How decimals work when refiting units (Full Version)

All Forums >> [New Releases from Matrix Games] >> WarPlan



Message


malkarma -> How decimals work when refiting units (12/11/2020 4:47:31 AM)

Some technical question to Alvaro. When refiting units, how the decimal works?
In order to elaborate, lets say that an unit have a repair cost of 4.3 per strength point. So...
1)If I repair 1 str point, I will pay:
1a) 4.3*1=4.3(rounded to 4)PP
1b) 4.3(rounded to 4)*1= 4 PP
2)If I repair 2 str points, I will pay:
2a) 4.3(rounded to 4)*2 = 8 PP
2b) 4.3*2= 8.6(rounded to 8) PP
2c) 4.3*2= 8.6(rounded to 9) PP
3) If I repair 3 points, I will pay:
But if the cost of repair a strength point of an unit isn 4.6 PP, then...
4) If I repair 1 str point I will pay:
4a) 4.6*1 =4.6 (rounded to 5) PP
4b) 4.6*1=4.6 (rounded to 4) PP
4c) 4.6 (rounded to 4)*1 = 4 PP
5) If I repair 2 str points I will pay:
5a) 4.6 (rounded to 4)*2= 8 PP
5b) 4.6*2 = 9.2 (rounded to 9) PP
5c) 4.6 (rounded to 5)*2=10 PP
6) If I repair 3 str points I will pay:
6a) 4.6(rounded to 4)*3= 12 PP
6b) 4.6(rounded to 5)*3= 15 PP
6c) 4.6*3= 13.8 (rounded to 13) PP
6d) 4.6*3= 13.8 (rounded to 14) PP


ps: I'm aware that this can be one of the nerdiest questions that you have received, but I noticed an oddity when repairing the starting Italian depleted corps. So I need to be sure about how the engine calculate the costs before I make the other post (can be a bug or can work as intended)





AlvaroSousa -> RE: How decimals work when refiting units (12/11/2020 12:49:22 PM)

If I remember it rounds down.




malkarma -> RE: How decimals work when refiting units (12/11/2020 1:44:57 PM)

But the round down is done to value of refit of 1 strength point or to the value after adding all the points that will be refitted?




AlvaroSousa -> RE: How decimals work when refiting units (12/11/2020 1:55:15 PM)

The refit is rounded down.
Then the cost is based on this which is again rounded down.

If I remember




malkarma -> RE: How decimals work when refiting units (12/11/2020 2:12:17 PM)

So if 1 strength point of an unit have a cost pf 4.6 PP to refit this should work like this:
Refit 1 str point: 4 PP
Refit 2 str points: 8 pp
Refit 3 str points: 12 PP

Or would work like this:
Refit 1 str point: 4 PP
Refit 2 str points 9 PP
Refit 3 str points: 13 PP




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.7382813