How traits modify max_experience in BFW1.16?

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
demario
Posts: 130
Joined: July 3rd, 2019, 1:05 pm

How traits modify max_experience in BFW1.16?

Post by demario »

The effect of intelligent trait on the max experience in version 1.16 is a bit confusing.
BFW-1.16
BFW-1.16.spearman.23.png
BFW-1.16.spearman.23.png (247.54 KiB) Viewed 883 times
BFW-1.16.clasher.26.png
An intelligent Spearman has 23xp (for unit type experience at 42) and the intelligent clasher has 26xp (unit type: 45).

It has clearly changed since BFW1.14 as the following screenshots show.
BFW-1.14
BFW-1.14.spearman.24.png
BFW-1.14.spearman.24.png (191.82 KiB) Viewed 883 times
BFW-1.14.clasher.25.png
BFW-1.14.clasher.25.png (364.25 KiB) Viewed 883 times
In BFW1.14 for the same stats and trait, the spearman had 24xp while the clasher had 25xp.
In the dialog that shows the unit description, it shows as 32xp for Clasher (31.5 rounded up) and 29xp for Spearman (29.4 rounded down) for both BFW1.14 and 1.16 (taking in account the 70% XP modifier defined in the default map settings).

So the gap has moved from 1xp to 3xp between these 2 units.
Last edited by demario on October 28th, 2021, 8:34 am, edited 1 time in total.
"simply put, it's an old game"T — Cackfiend
User avatar
Pentarctagon
Project Manager
Posts: 5496
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: How traits modify max_experience in BFW1.16?

Post by Pentarctagon »

Hejnewar made a lot of changes to the default era (and also just a lot of changes in general), so he'd be the one to ask about mainline unit balancing changes.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
demario
Posts: 130
Joined: July 3rd, 2019, 1:05 pm

Re: How traits modify max_experience in BFW1.16?

Post by demario »

I hope it was clear that this is not coming from a stat change but from a change in the engine.

Looking further this is a consequence of change on how the different modifiers are taken into account.
  • BFW1.14 is using modification from trait first (-20%) and modification from map setting after (70%) with rounding done in between.
  • BFW1.16 is applying from map setting (70%) to the unit type first and modification from trait after (-20%) with rounding done in between.
Of course this introduces rounding errors that explain the differences in resulting max experience.

From a spreadsheet comparing the 2 calculations, I suspect the problem will extend to:
MORE +1xp to intelligent units in BFW1.16 vs 1.14
experience=24 - from 13 to 14
data/core/units/dunefolk/Falcon.cfg
data/core/units/undead/Corpse_Walking.cfg (never intelligent)
experience=28 - from 15 to 16
data/core/units/humans/Outlaw_Thief.cfg
data/core/units/saurians/Augur.cfg
experience=38 - from 21 to 22
data/core/units/gryphons/Gryphon_Rider.cfg
experience=45 - from 25 to 26
data/core/units/drakes/Clasher.cfg
experience=65 - from 36 to 37
data/core/units/dunefolk/Skirmisher.cfg
data/core/units/goblins/Knight.cfg
data/core/units/humans/Loyalist_Pikeman.cfg
data/core/units/humans/Woodsman_Trapper.cfg
data/core/units/monsters/Wolf_Dire.cfg
experience=74 - from 41 to 42
data/core/units/dwarves/Steelclad.cfg
experience=95 - from 53 to 54
data/core/units/drakes/Thrasher.cfg
data/core/units/dwarves/Thunderguard.cfg
data/core/units/humans/Loyalist_Dragoon.cfg
LESS -1xp to intelligent units in BFW1.16 vs 1.14
experience=22 - from 13 to 12
data/core/units/bats/Bat_Vampire.cfg
experience=42 - from 24 to 23
data/core/units/drakes/Fighter.cfg
data/core/units/dunefolk/Piercer.cfg
data/core/units/dunefolk/Rider.cfg
data/core/units/dwarves/Ulfserker.cfg
data/core/units/humans/Loyalist_Fencer.cfg
data/core/units/humans/Loyalist_Spearman.cfg
data/core/units/humans/Outlaw_Thug.cfg
data/core/units/orcs/Grunt.cfg
experience=47 - from 27 to 26
data/core/units/dunefolk/Soldier.cfg
data/core/units/dwarves/Guardsman.cfg
"simply put, it's an old game"T — Cackfiend
User avatar
Pentarctagon
Project Manager
Posts: 5496
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: How traits modify max_experience in BFW1.16?

Post by Pentarctagon »

Alright. It looks like that change was made unintentionally in fact, but it made it into 1.16 so we're stuck with it for now.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
demario
Posts: 130
Joined: July 3rd, 2019, 1:05 pm

Re: How traits modify max_experience in BFW1.16?

Post by demario »

Pentarctagon wrote: October 28th, 2021, 4:06 pm Alright. It looks like that change was made unintentionally in fact, but it made it into 1.16 so we're stuck with it for now.
OK.
The thing is that involves pretty common units that level in 1v1 (grunt, thief, augur, clasher, spearman, fencer). Beyond change in balance, it also breaks replay.
If you have a chance, consider applying the patch in attachment that would solve the problem according to my early testing.
Pentarctagon wrote: October 29th, 2021, 12:19 am posting patch files to the forums is not a good [...] way to do this.
Sorry about that. Fixed.
Last edited by demario on October 30th, 2021, 9:59 am, edited 2 times in total.
User avatar
Pentarctagon
Project Manager
Posts: 5496
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: How traits modify max_experience in BFW1.16?

Post by Pentarctagon »

It can't be applied to 1.16 at this point since it would break compatibility with 1.16.0, so this could be fixed in 1.17 but not 1.16.

Also please use git+github to submit patches. If you need some help getting things setup then we can help you with that, but posting patch files to the forums is not a good or convenient way to do this.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
octalot
General Code Maintainer
Posts: 777
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: How traits modify max_experience in BFW1.16?

Post by octalot »

Pentarctagon wrote: October 28th, 2021, 4:06 pm Alright. It looks like that change was made unintentionally in fact, but it made it into 1.16 so we're stuck with it for now.
It seems this is the fix for #1796, as in the old behavior was considered a bug which was fixed; sadly no-one jumped in and pointed out that multiplayer was balanced for the old behavior.
demario wrote: October 28th, 2021, 11:28 pm it also breaks replay.
Do you mean "breaks replays from 1.14"? Sadly, now that 1.16.0 is out it's more important to keep compatibility with 1.16.0 rather than compatibility with 1.14.
Post Reply