| View previous topic :: View next topic |
| Author |
Message |
mibiz Cheater
Reputation: 0
Joined: 14 Jun 2009 Posts: 31
|
Posted: Wed Sep 14, 2011 1:33 am Post subject: data type usage |
|
|
Hi,
I've noticed that in some of the games, some data types are used over other. For example, in one instance, money is stored as float when all calculations with it are whole numbers or integers. Is there any benefit to using float over int in terms of code base size and/or program execution speed? Is it developer's preference? Or is it the game engine's design which the game is based upon? I can understand it's float usage if the calculations were done in fractions as is the perks points system in the game Star Wolves 3: Civil War. IIRC, majority of that game's calculations are done in fractions and percentages and I see why the float is used.
Thanks,
mibiz
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25830 Location: The netherlands
|
Posted: Wed Sep 14, 2011 1:36 am Post subject: |
|
|
lazyness. Float can be used for full numbers and fractions, so if you use float for everything you don't have to think about that you are doing, and as long as the values do not get too big it's not a problem either
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
mibiz Cheater
Reputation: 0
Joined: 14 Jun 2009 Posts: 31
|
Posted: Wed Sep 14, 2011 3:26 am Post subject: |
|
|
| Thanks. I didn't think about it.
|
|
| Back to top |
|
 |
|