Purpelia wrote:Lunas Legion wrote:
So...
You managed to recruit 10,000 Japanese people to fight for you from their army? Is that how that works?
He triggered a number overflow bug.
TLDR computers store negative numbers and positive numbers both in the same way. To them it's just a positive number in binary. As in, if the PC had a 3 digit number option you could use the same field to store numbers [0-999] or [-499,500]. And if you saved one of each type and picked say -499 and 0 and you took a microscope and looked at the physical imprint of both on your hard drive you'd see that they are exactly the same. No difference. The only thing that changes is that the PC knows to read 0 or -499 based on an additional flag added separately.
Additionally, a quirk of this notation means that if you took the number 500 (unsigned) and added 1 you'd get 501 because the unsigned numbers go up to 999. But if you took 999 and added 1 you'd get 0. It loops back. With signed numbers that means adding 1 to the highest possible number (500 in our example) actually flips back and makes it -499.
You don't see this happen often in video games because a) PC numbers go up to +/-2'147'483'647 and b) programmers are generally smart enough to handle stupid overflows like that. But apparently HOI4 is optimized badly enough that #a can happen because #b failed to.
See I thought it might have been this because I've done that a few times in HoI4 with things like equipment production but I only took 20K casualties which seems like such an odd number for it to break at.
Also I'd like to tell you all that if you aren't using 40 width divisions you're not living life probably. They're amazing.