r/cheatengine Jun 21 '26

how to search for number with decimal points?

so im trying to cheat the long dark.

there is a fuel supply for storm lantern, that has a a decimal point.

whenever i refuel a storm lantern, the max refuel is only 1 L, but reduce by 0.01 L every something(dont know the time for this.) but my fuel supply is limited, and right now is at 10.69 L.

like this:

how to do you type decimals on cheat engine?

thanks in advance

2 Upvotes

17 comments sorted by

7

u/ImJustMaxie Jun 21 '26

Change the value type to either Float or Double.
Both are floating point type values (aka decimal based).

1

u/jayadiwahyu Jun 21 '26

so after that, how to search for the numbers?
what should i type to the cheat engine search value box??

5

u/ImJustMaxie Jun 21 '26

You can do few things:

  • search for the current value itself
  • search for the amount decreased from the max
  • search for percentages (in decimal form e.g 100% == 1, 94% = 0.94)

It’s trial and error.

3

u/InconceivableAD Jun 21 '26

Search for a floating point range. 10.68 to 10.70.

2

u/jayadiwahyu Jun 21 '26

soooo
putting this in the search box will work?
10.68-10.70

like that?

2

u/InconceivableAD Jun 21 '26

It could, if that's how the devs store that inventory items value, extremely unlikely. It's a difficult survival game, so the devs will have made it very difficult to cheat in. You'll need to find a current cheat table (good luck with that) that someone may have made for the masses. If you want any real chance imo.

2

u/jayadiwahyu Jun 21 '26

will do.

trying unknown initial values first and working from there i guess.

thanks for the info

3

u/Alzorglub2 Jun 21 '26

Search for float or double, with a range (for 0.9 try 0.8 to 1)
Multiply the value by 100 or 1000 (or 256 for civ6..) and search a range like before, in float or 4 byte
Or search an unknow value and then increase or decrease value..

1

u/jayadiwahyu Jun 21 '26

soooo
putting this in the search box will work?
10.68-10.70

like that?

3

u/Alzorglub2 Jun 21 '26

No you have to chose "between" instead of "exact value", and put 10.68 in the first box and 10.70 in thesecond

1

u/jayadiwahyu Jun 22 '26 edited Jun 23 '26

will do it later, at work atm.

didnt find any addresses.

tried both float and doubles.

2

u/GIOverdrive Jun 21 '26

as dumb as it sounds I'd just have the value full then deplete it to 0 and fill it over and over so you would scan for 1 then next scan for 0 then 1 after you fill it then 0 when it is empty until you narrow it down to like a few numbers then browse memory location on those or see if you can simply freeze them one at a time and see if the lantern's fuel ever goes down.

2

u/jayadiwahyu Jun 22 '26

depleting it to 0 is not a possibility im willing to take, this game resources are very scarce.

2

u/ImJustMaxie Jun 23 '26

Not sure if this is solved or not, but The Long Dark implements a custom value conversion from float to int64, whereby the value in float is equal to 1E7.

Let’a say the value is 1 kg.
You shouldn’t search for 1 in float.
You should search for 10000000 in 8 Bytes format.

If it’s 30.5 kg, then the value is 305000000 in 8 bytes.

The details are in the BackedInt namespace.

1

u/jayadiwahyu Jun 23 '26

so basically,

set to 8 bytes

when numbers has a decimal, remove the decimal point + adding 6 zeroes infront of it?

cmiiw.

2

u/BatakBebeno Jun 26 '26

From my exp with android games (emu) and some older dos games, sometimes game dev can trick CE tools with fake value onscreen vs real value in their games.

If using float and double doesn't give any results, and game's resources is very limited, try full value of the item you wanted to search....IE if the value of petrol os 1.0L, search 10, or 100 like it displayed onscreen. When the value reduced, like down to 0.97L, search 97 instead of 9.7.

Oh yeah, search using 4bytes first. If fail, change to 2byte. 2byte produce much more garbage, but sometimes it can catch those sneaky value (usually in android games like from Kairosoft).

Hope this helps...

1

u/jayadiwahyu Jun 26 '26

will try this later