New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Very large company values are not graphed correctly #8253
Comments
You are an absolute madman to make a savegame for this and clear steps to reproduce :D Awesome, tnx :) |
The first part's quite fun - the graphing code uses INT64_MAX as "INVALID_DATAPOINT" . Of course, if it actually gets that value, it just ignores all the data. Line 39 in 1e529e1
A hacky fix might be to use INT64_MIN as a sentinel value, but I'd say that in real world conditions one is no less likely to appear than the other, so probably wouldn't actually fix anything I'm not quite sure about the second issue. The Lines 437 to 457 in 1e529e1
|
I really do not know why I just spend 2 hours fixing this bug. It is so unlikely for anyone to ever hit it in any real (or sane) game .. but there we go :P It was a collection of problems starting when you were Please stop abusing OpenTTD :P (nah, it is okay; it was a fun little bug, that escalated into the madness of how compilers and computers actually work. I learnt things today :D) |
Version of OpenTTD
master (2020-07-01)
Expected result
Actual result
Company value of 2^63-1 is not recorded on the company value graph at all (scale still runs from -5 to 4).
Company value of e.g. 2^63-10000 is still recorded on the company value graph, but the points do not appear.
The scale runs from 0 to (2^63-1)/10 (~922 billion million) instead of from 0 to 2^63-1 (~9.22 trillion million).
(see above images)
Steps to reproduce
Savegame
Gronnway Transport, 363576-09-15.zip
(The savegame contains a single company with maxed-out (2^63-1) company value and cash, and has been optimized to run at up to several in-game years per second on high-end modern hardware.)
The text was updated successfully, but these errors were encountered: