# Stats Through Kills: How XP works?

**URL:** <https://discourse.cataclysmdda.org/t/stats-through-kills-how-xp-works/25929>\
**Category:** The Bunker\
**Tags:** mod\
**Created:** [February 16, 2021, 2:53pm UTC](https://discourse.cataclysmdda.org/t/stats-through-kills-how-xp-works/25929 "2021-02-16T14:53:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarArt](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/marart/32/7812_2.png) [@MarArt](https://discourse.cataclysmdda.org/u/MarArt)\
**Post date:** [February 16, 2021, 2:53pm UTC](https://discourse.cataclysmdda.org/t/stats-through-kills-how-xp-works/25929/1 "2021-02-16T14:53:42Z")

</div>

First – how much XP do you need for your first point and how does it increase? just “+n Xp” or is it multiplied?  
And second – how does game calculate the amount of xp you get for each kill?  
Is there any way to modify these parameters?

---

<div class="post-metadata">

**Author:** ![Valase](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/valase/32/6972_2.png) [@Valase](https://discourse.cataclysmdda.org/u/Valase)\
**Post date:** [February 16, 2021, 3:44pm UTC](https://discourse.cataclysmdda.org/t/stats-through-kills-how-xp-works/25929/2 "2021-02-16T15:44:59Z")

</div>

> [@MarArt](#):
>
> First – how much XP do you need for your first point and how does it increase?

300 and yes, it increases, based on the [code at the time](https://github.com/CleverRaven/Cataclysm-DDA/blob/5cc608ccea74ba783c2f1569fafdbc2b9caf0021/src/avatar.cpp#L1408-L1415), like this (full list):

> **All Levels**
>
> ```auto
> // based on D&D 5e level progression
> static const std::array<int, 20> xp_cutoffs = { {
> 300, 900, 2700, 6500, 14000,
> 23000, 34000, 48000, 64000, 85000,
> 100000, 120000, 140000, 165000, 195000,
> 225000, 265000, 305000, 355000, 405000
> }
> };
> 
> ```

This also means that there’s a max Level (which is 20), and you won’t be able to get more stat points after that this way.

> [@MarArt](#):
>
> Is there any way to modify these parameters?

Well, yes and no. There is no “easy” way to edit them as in just changing it in a JSON file, as these are hardcoded.  
You can however either download the full game’s source code from GitHub, change the values in the file and compile it yourself or use a runtime editor to find and change these values around for your current game session.

> [@MarArt](#):
>
> And second – how does game calculate the amount of xp you get for each kill?

It uses each monster’s difficulty level, or - in case of NPCs - their size value.  
Since the monster’s difficulty value is set in JSON, you can change this around if you want, in- or decreasing the speed at which you gain XP.  
Please note that - from what I see [in the code](https://github.com/CleverRaven/Cataclysm-DDA/blob/5cc608ccea74ba783c2f1569fafdbc2b9caf0021/src/kill_tracker.cpp#L59-L67) - changes also apply to already killed monsters.

---

<div class="post-metadata">

**Author:** ![MarArt](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/marart/32/7812_2.png) [@MarArt](https://discourse.cataclysmdda.org/u/MarArt)\
**Post date:** [February 16, 2021, 4:29pm UTC](https://discourse.cataclysmdda.org/t/stats-through-kills-how-xp-works/25929/3 "2021-02-16T16:29:39Z")

</div>

Hmm, i see. So, i can change max level, right? Can you explain a bit more how to do this?

---

<div class="post-metadata">

**Author:** ![Valase](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/valase/32/6972_2.png) [@Valase](https://discourse.cataclysmdda.org/u/Valase)\
**Post date:** [February 16, 2021, 4:48pm UTC](https://discourse.cataclysmdda.org/t/stats-through-kills-how-xp-works/25929/4 "2021-02-16T16:48:42Z")

</div>

> [@MarArt](#):
>
> Can you explain a bit more how to do this?

By which method? I’ve listed two ways…  
I assume you want to compile the game yourself? In that case, you might want to take a look at how [you can compile it](https://github.com/CleverRaven/Cataclysm-DDA/blob/0707f460a35ddaa2c39e55ac16887008a7a06f45/doc/COMPILING/COMPILING.md) on your system.  
After you could compile it successfully (basically before that, but I’d suggest to compile it first, as this is usually the most complicated step to get running), you can start to make changes to the source code locally on your computer.

As for changing the max level, there are different ways again, depending on what you want to do.  
I’m not good at explaining stuff simple, but I’ll give it my best…

If you just want to increase the limit of levels, edit the `std::array<int, 20>` (from the xp\_cutoffs varibale linked above) and change the `20` to the highest level you want to be able to reach. After that, you’ll have to add numbers to the list, so that the count of the numbers match the new limit (for example, if you set your new limit to 40, you’ll have to add 20 more numbers to the list). You can choose whatever values you want and changes existing ones too.

If you want to get “no level limit”, you could rewrite everything where xp\_cutoffs variable is used and replace it with a function of your own that returns a multiplied value, so there will be no max level.

---

<div class="post-metadata">

**Author:** ![MarArt](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/marart/32/7812_2.png) [@MarArt](https://discourse.cataclysmdda.org/u/MarArt)\
**Post date:** [February 16, 2021, 5:14pm UTC](https://discourse.cataclysmdda.org/t/stats-through-kills-how-xp-works/25929/5 "2021-02-16T17:14:22Z")

</div>

Okay, big thanks for the help. I’ll try to compile it and report how it goes!
