Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

How decimals work when refiting units

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> WarPlan >> How decimals work when refiting units Page: [1]
Login
Message << Older Topic   Newer Topic >>
How decimals work when refiting units - 12/11/2020 4:47:31 AM   
malkarma

 

Posts: 310
Joined: 7/5/2020
Status: offline
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)

Post #: 1
RE: How decimals work when refiting units - 12/11/2020 12:49:22 PM   
AlvaroSousa


Posts: 9927
Joined: 7/29/2013
Status: offline
If I remember it rounds down.

_____________________________

Creator Kraken Studios
- WarPlan
- WarPlan Pacific

Designer Strategic Command
- Brute Force (mod) SC2
- Assault on Communism SC2
- Assault on Democracy SC2
- Map Image Importer SC3

(in reply to malkarma)
Post #: 2
RE: How decimals work when refiting units - 12/11/2020 1:44:57 PM   
malkarma

 

Posts: 310
Joined: 7/5/2020
Status: offline
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?

(in reply to AlvaroSousa)
Post #: 3
RE: How decimals work when refiting units - 12/11/2020 1:55:15 PM   
AlvaroSousa


Posts: 9927
Joined: 7/29/2013
Status: offline
The refit is rounded down.
Then the cost is based on this which is again rounded down.

If I remember

_____________________________

Creator Kraken Studios
- WarPlan
- WarPlan Pacific

Designer Strategic Command
- Brute Force (mod) SC2
- Assault on Communism SC2
- Assault on Democracy SC2
- Map Image Importer SC3

(in reply to malkarma)
Post #: 4
RE: How decimals work when refiting units - 12/11/2020 2:12:17 PM   
malkarma

 

Posts: 310
Joined: 7/5/2020
Status: offline
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

(in reply to AlvaroSousa)
Post #: 5
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> WarPlan >> How decimals work when refiting units Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.953