Jump to content

Unnecessary high precision math and rounding errors


Recommended Posts

I do not think someone at Klei Studio will write a thesis on full-fledged 3-D real-time thermodynamics simulation, but i believe simulating thermal flows of 30 micrograms of gas is a bit excessive. You could make the game flow better, and optimize memory resources if you truncate the calculations up to 1 gram, or 10 grams.

Also, I believe that all this numerical precision is leading to a lot of rounding errors while i load my game saves. I frequently got stuck at my electric grill queue because i got a 2,399 kcal mushroom, and the grill do not start the queue until i got 2,400 kcal of mushroom. And, yes, i kept my dupes from eating 1 kcal of mushroom by configuring the Consumables menu properly.

Any of you guys have hints for workarounds to solve this problem, until a new update fixes this rounding error problem? Thanks! =]

in the consumables tab i would uncheck the mushrooms. with things that require eatable ingredients like mush fry, gristle berry, fried mushrooms there is a chance that the dupe will eat some of it. turning off the ingredients in the consumables will prevent them from eating them critters on the other hand will still eat them if applicable as well

4 hours ago, Gmax said:

I do not think someone at Klei Studio will write a thesis on full-fledged 3-D real-time thermodynamics simulation, but i believe simulating thermal flows of 30 micrograms of gas is a bit excessive. You could make the game flow better, and optimize memory resources if you truncate the calculations up to 1 gram, or 10 grams.

If you look deeper into how/when thermal energy is exchanged you will find something a lot better than rounding or truncation:

Thermal energy will just be transferred if a minimum energy to transfer is reached

 

But I saw some strange things like fractional seeds and that´s an other issue

I saw the fractional seeds(seen them even on streams), saw also fractional reed fiber that dupes just don't want to use for clothing ...
And now that you mentioned the Mushroom issue, I think I had that too.

Here is an idea:
if you click on any food item there is a "compost" button. Try it(might require an actual compost faciiity though(Refinement menu(7)=> pyramid of dirt)! It might throw away the food item, but solve your delivery issue(and I hope a few lost grams of a mushroom isn't much for you).

For most things, rounding to grams would be entirely fine. But this is an eventual tuning issue.

Looks to me they are using short-floats and these pretty much suck except for approximate calculations (23 bits of precision only).

is there any chance that masses aren't floating point at all? What's the maximum mass you can put in a tile before mass starts getting deleted? How many micrograms are in a kilogram - 10^9. How large an int can a 64-bit word store? 2^18

 

I bet you mass is a single-word int? Any way to check?

 

 

 

1 hour ago, avc15 said:

is there any chance that masses aren't floating point at all? What's the maximum mass you can put in a tile before mass starts getting deleted? How many micrograms are in a kilogram - 10^9. How large an int can a 64-bit word store? 2^18

 

I bet you mass is a single-word int? Any way to check?

 

 

Why would they need to do anything like this? Thats silly and unwieldy. They simply work with variables.

 

1000.00 mcg = 1.00G

1000.00 G =1.00KG

1000.00 KG =1.00MG

 

etc

There is no 1211211.67456 mcgrams , or whatever youre thinking they round to 100ths per measurement group.

Why would you all think they measure everything in micrograms? The game would not run and the rounding errors would be WAY worse then we're seeing.

Now if they arnt clamping and rounding to avoid CPU/language errors then thats just amazing that it lasted this log without way more problems than 2.9 seed issues

15 hours ago, Megouski said:

The game would not run and the rounding errors would be WAY worse then we're seeing.

That's not necessarily true. Plenty of optimizations (in various applications) replace floating point math with a combination of integer math and lookups. You might give up precision or you might not.

 

Kind of like what this game does. "How much heat transferred?" - how many times per tic does this problem run? 4 times + number of active layers *per visible cell*. That's a lot of logarithms, since there are two logarithms for each of the 4-8 computations done per cell. "How much mass transferred?" This one is a clear candidate. 

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...