• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Can you give us an estimate of how much you have to break it? I think I've had close to 2 millions in my alliance without it breaking.
http://en.cppreference.com/w/c/types/limits
game must have an integer that counts thousandths of a 1k stack (in other words units) hence it rollsback close to that value

can that cause an exploit though? (either game exploit or of the virus kind) or is the overflow checked?
 
Last edited:
~ (2^31) / 1000 is the limit
May seem stupid, but why use signed numbers for things like troops ? It's not like if we're supposed to go in the negative
 
May seem stupid, but why use signed numbers for things like troops ? It's not like if we're supposed to go in the negative

  • Signed numbers make overflows more visible in a lot of code that assumes variables are >= 0, if you see a negative number in such a variable you immediately know it's an overflow.
  • Having 32 unsigned bits of precision is great until you suddenly need to apply them in a signed equation because you misjudged, or had changed requirements...
  • Programmers are generally more familiar with signed arithmetic and not familiar with unsigned/signed mismatch casting.
  • Despite the 50% difference, the gain of 1 bit never makes a practical difference in the vast majority of code. If you had an overflow at 31 bits chances are you would also get it at 32 bits.
  • Having to think about what type of integer to use when coding higher level problems is vast of effort/time.
  • In case of 64 bit signed arithmetic which is getting more common since x64, you're probably not going to overflow anyway.

I don't recommend ever using unsigned except in bit manipulation code or where you otherwise explicitly need unsigned semantics. Aside from that, the fixed point arithmetic in Clausewitz is 32/64 bit signed only for above reasons. Many programming languages also lack support for unsigned because the designers know it's a noob trap.
 
Last edited:
  • Signed numbers make overflows more visible in a lot of code that assumes variables are >= 0, if you see a negative number in such a variable you immediately know it's an overflow.
  • Having 32 unsigned bits of precision is great until you suddenly need to apply them in a signed equation because you misjudged, or had changed requirements...
  • Programmers are generally more familiar with signed arithmetic and not familiar with unsigned/signed mismatch casting.
  • Despite the 50% difference, the gain of 1 bit never makes a practical difference in the vast majority of code. If you had an overflow at 31 bits chances are you would also get it at 32 bits.
  • Having to think about what type of integer to use when coding higher level problems is vast of effort/time.
  • In case of 64 bit signed arithmetic which is getting more common since x64, you're probably not going to overflow anyway.
I don't recommend ever using unsigned except in bit manipulation code or where you otherwise explicitly need unsigned semantics. Aside from that, the fixed point arithmetic in Clausewitz is 32/64 bit only for above reasons. Many programming languages also lack support for unsigned because the designers know it's a noob trap.
Thanks a lot !
 
That's more questionable, I believe someone thought it appropriate. :p

Edit: Pretty sure it's because of manpower being represented with fixed point such that 1 manpower = 1000 men, and the data type remaining after multiplication. Still, converting this to an integer before summing would solve the issue unless you have wars above 2 billion losses.
 
Last edited:
Can someone explain to me why my army weight in the province is higher than the actual army size?
The army's general has one maneuver pip ..

20180309174503_1.jpg
 
Province modifiers that increase attrition act by increasing the supply weight of each army in addition to increasing attrition.

Maybe Malacca has defensive ideas or similar.
 
Incidentally, another similar thing I've noticed: With at least a 4 maneuver general and defensive ideas, the weight of a 1k man army is displayed as negative.
 
Who did you start as?
 
Hey guys, just here to show you a super successful reformation (sans reformed, not a single reformed CoR yet) and the HRE being dismantled during the league war by a member of the HRE (Bohemia). Been a while since I've seen the HRE dismantled and probably my first dismantle that I didn't cause (I'm not even in the league war).
20180309182814_1.jpg
20180309182821_1.jpg
 
Bohemia trolling, they could get the Emperorship at the end of the War but they rather dismantle.
 
Talking about a succesful reformation, I show you this:
099767F2DDA6E7AC4EDEF8C4D945426AD0A67EA9

-Protestant CoRs are in Scotland, England & Ireland
-Reformed CoR is in theodoro (I force converted them to catholic)