Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


data type usage

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
mibiz
Cheater
Reputation: 0

Joined: 14 Jun 2009
Posts: 31

PostPosted: Wed Sep 14, 2011 1:33 am    Post subject: data type usage Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25830
Location: The netherlands

PostPosted: Wed Sep 14, 2011 1:36 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
mibiz
Cheater
Reputation: 0

Joined: 14 Jun 2009
Posts: 31

PostPosted: Wed Sep 14, 2011 3:26 am    Post subject: Reply with quote

Thanks. I didn't think about it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites