GAME INFORMATION
- GAME BUILD #: 101.102.28520.0
- GAME PLATFORM: Steam
- OPERATING SYSTEM: Windows 10
ISSUE EXPERIENCED
When using the trigger “Modify Attribute” to edit the unit’s Population attribute, when the result is a non-integer number, the game will treat it as zero.
Edit: Every time using Trigger effect Modify Attribute to edit the unit’s Population attribute, the game seems like will reset the value to 0 first, then execute the trigger. (can also see my comment #4)
(Note for those who don’t know: A unit needs a negative value of Population cost to require population space. a normal unit should be -1, Karambit Warrior is -0.5. While a building having positive value = gives population space, the house is 5. And we can’t put negative numbers or non-integers into the trigger so we need to do it mathematically.)
Example 1:
- Set Longbowman’s population to 0
- Subtract 1
- Divide 2
- Expected result: Longbowman occupies 0.5 pop space (just like Karambit Warrior)
- Actual result: Longbowman occupies 0 pop space
Example 1.1:
- Subtract Longbowman’s population by 1
- Expected result: (-1) - 1 = -2 = Longbowman occupies 2 pop space
- Actual result: Longbowman occupies 1 pop space
Example 1.2:
- Subtract Longbowman’s population by 2
- Subtract 2 again
- Expected result: (-1) - 2 - 2 = -5 = Longbowman occupies 5 pop space
- Actual result: Longbowman occupies 2 pop space
The only explanation I can come up with is that every time using Trigger effect Modify Attribute to edit the population, the game somehow resets the value to 0 first, then executes the effect.
So,
Example 1 is actually (0) / 2 = 0,
Example 1.1 actually (0) - 1 = -1,
Example 1.2 actually (0) - 2 = -2,
That explains all the results.
When using the trigger “Modify Attribute” to edit the building’s Population attribute, It’s a mess. Allow me to explain with examples:
Example 2:
- Set Pavilion A population to 0
- Add (x = any random positive integer number)
- Expected result: Pavilion A now provide x pop space.
- Actual result: Pavilion A now provide (x + 10) pop space, and when it is destroyed, the pop space drops by only x, extra 10 pop space is still available, even though I have zero buildings.
Example 3:
- Set Pavilion A population to 0
- Add 11
- Divide 2
- Expected result: 1 Pavilion A provide 5.5 pop space, 2 Pavilions provide 11 pop space
- Actual result: 2 Pavilions provide 64 pop space, and when either one/ both of them are destroyed, the pop space never drop.
I can’t figure out the logic behind it.
I guess it’s a form of software protection so it won’t have to handle non-integer numbers and prevent bugs, but still, I just want to make it similar to Karambit Warrior.
I heard that the “Population” attribute is not a real attribute, so if it’s a manufactured tool, I hope it gets fixed. It will be useful for custom scenario creators if done correctly.
FREQUENCY OF ISSUE
- 100% of the time / matches I play (ALWAYS)
REPRODUCTION STEPS
- Get into the Scenario Editor
- Using the trigger effect “Modify Attribute” to edit population attribute, try different numbers, or recreate the examples above. Can also download my scenario below.
- Test the scenario
EXPECTED RESULT
- The game should handle the Population attribute properly, negative value to require population space. positive value to give population space.
- Should not reset Population value to 0 without permission.
- Should be able to produce the correct result of math.
- When the building is destroyed, all of the population space it provided should be gone.
IMAGE
Screenshot of Example 1 & Example 3:
- Expected Longbowman take 0.5 pop space, but take 0 instead
- Expected 2 Pavilions provide 11 pop space, but end up providing 64 pop space and never drop.
GAME FILES (SAVE / RECORDING)
Pop test.aoe2scenario (1.6 KB)