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 


+Inf, NaN, float and double.

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

Joined: 19 May 2014
Posts: 74

PostPosted: Tue Jan 12, 2016 2:16 pm    Post subject: +Inf, NaN, float and double. Reply with quote

Greetings

First and foremost, how can a game deal with high numbers including fractions other than basic types?
Example being one flash game (I know this isn't a flash side of forum, I'm just asking about the specific mechanic of it) where it's plain and simple 4 bytes with a certain 'value offset' and typical flash multiplication of 8.

But with amounst beyond certain point, such as positive over 2147483647 as well as fractions the thing get's weird, and it's neither float nor double.

But main question is what's the difference between float/double +Inf value and NaN? As in how does that work out in most games, at least the ones that you (potential reader) have had the pleasure of interacting with? The reason behind this is NaN is a very crash-happy thing, how different is +Inf?

I noticed for certain values in float, and I'm presuming double as well as I had been dealing with it a little less often, get stuck in a 'range', such as 2147483648 for float. And using up little amounts in game doesn't change, as if the value was inherently frozen.

How does that work out, too? Is it like the bigger non fraction float amount the bigger the range of the 'frozen' constant rounding up?

Best Regards, and thanks a lot for your time!
Back to top
View user's profile Send private message
ZacTheSin
I post too much
Reputation: 6

Joined: 09 May 2006
Posts: 2657

PostPosted: Tue Jan 12, 2016 6:39 pm    Post subject: Reply with quote

Hmm, probably a good example of this is Clicker Heroes, however it does use Double values.

In the end-game you're no longer using it's weird arbitrary value counters showing billions/trilliions etc and it moves to scientific notation.

E.g. 6.445e65

6.445e35 or 6.445×10^35 = 644500000000000000000000000000000000

It's something I was trying to work out with the mega values as well, with little luck due to me derping my save (numbers too big = insta crash on load).

Kind of past the initial block where it starts using scientific notation by default to store the value, I think it must use a secondary address to give the value up to another point.

like in the same way you have EAX/AX/AH/AL

_________________
If someone helps you, why not Rep them?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Jan 12, 2016 6:59 pm    Post subject: Reply with quote

Yea, just throw more bytes at it. Feel free to check out Java's implementation.

Also, for +Inf, any normal number "mathed" with +Inf equals +Inf. So you can subtract all you want from it.

NaN is... not a number. So when it is "mathed" an exception is thrown and you crash.
Back to top
View user's profile Send private message
Noobrzor
Advanced Cheater
Reputation: 0

Joined: 19 May 2014
Posts: 74

PostPosted: Wed Jan 13, 2016 9:18 am    Post subject: Reply with quote

Zanzer wrote:
Yea, just throw more bytes at it. Feel free to check out Java's implementation.

Also, for +Inf, any normal number "mathed" with +Inf equals +Inf. So you can subtract all you want from it.

NaN is... not a number. So when it is "mathed" an exception is thrown and you crash.



Oh, I see. I should've ust googled what NaN stood for Very Happy Thanks a lot for clearing that out.

On a side note, I noticed Float Truncated search does not wind up any results if I search for exact value 2147483648. Any reason why so? This kind of messes if I'll set some time/duration value as inf or high enough and then I can't find it again so I'm stuck with a permanent value that can carry over game restarts and savegames.
Back to top
View user's profile Send private message
Redouane
Master Cheater
Reputation: 3

Joined: 05 Sep 2013
Posts: 363
Location: Algeria

PostPosted: Wed Jan 13, 2016 9:55 am    Post subject: Reply with quote

Noobrzor wrote:

On a side note, I noticed Float Truncated search does not wind up any results if I search for exact value 2147483648. Any reason why so? This kind of messes if I'll set some time/duration value as inf or high enough and then I can't find it again so I'm stuck with a permanent value that can carry over game restarts and savegames.


You can always use the next scan options 'bigger than','less than','value between','decreased','increased','changed','unchanged' etc. to find the value.

Also,here are the bytes if you want to set a value to infinity,-infinity or NaN :
http://forum.cheatengine.org/viewtopic.php?t=582177.
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 Gamehacking 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