Little bug in entrenchment function when negative value is set(editor and game)
Posted: Sat Sep 19, 2026 12:02 pm
Working in my mod, I noticed that : When you set a negative value in the "defense bonus data" parameters (-1) for a hex (example : village), editor does accept this value.
But in game and in editor, if you place a unit on the concerned hex, you see that this unit has the benefit of a super-gigantic entrenchment value : 255
Due to this ultra high entrenchement value, the concerned unit is almost invulnerable in combat when attacked
If you set the parameter = 0 or > 0, no any problem, the entrenchment value of units is correct
So, to set -1 as value for entrenchment in a hex (malus) gives to units a gigantic entrenchement capacity of 255 (the exact contrary of what it is wanted)
Capture image here :
(don't take in mind the little blank point that is displayed on some hex, it's "invisible supply" (tip) I place on roads to adapt the supply system to tactical scale)
I report this concerning a value = -1 for entrenchement, but in my opinion, it would be necessary to verify if a similar problem does occur when we set a -1 value for all other bonus/malus in the defense bonus data windows => example : what will happends if I set a malus of -1 for village in defense vs tanks ?, etc (entrenchment bug is easy to verify in game, because all is displayed on screen, but it's not so evident for other bonus/malus of the list because nothing can be displayed in details => By example, if I set a -1 value for units in villages for defense vs tanks, perhaps it does cause a invisible bug that gives more wrong resistance to the attacked unit in village (same like entrenchment bonus), etc
But in game and in editor, if you place a unit on the concerned hex, you see that this unit has the benefit of a super-gigantic entrenchment value : 255
Due to this ultra high entrenchement value, the concerned unit is almost invulnerable in combat when attacked
If you set the parameter = 0 or > 0, no any problem, the entrenchment value of units is correct
So, to set -1 as value for entrenchment in a hex (malus) gives to units a gigantic entrenchement capacity of 255 (the exact contrary of what it is wanted)
Capture image here :
(don't take in mind the little blank point that is displayed on some hex, it's "invisible supply" (tip) I place on roads to adapt the supply system to tactical scale)
I report this concerning a value = -1 for entrenchement, but in my opinion, it would be necessary to verify if a similar problem does occur when we set a -1 value for all other bonus/malus in the defense bonus data windows => example : what will happends if I set a malus of -1 for village in defense vs tanks ?, etc (entrenchment bug is easy to verify in game, because all is displayed on screen, but it's not so evident for other bonus/malus of the list because nothing can be displayed in details => By example, if I set a -1 value for units in villages for defense vs tanks, perhaps it does cause a invisible bug that gives more wrong resistance to the attacked unit in village (same like entrenchment bonus), etc