[16.25] Express belt animation stops at a specific time

This subforum contains all the issues which we already resolved.
metriy
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sun Feb 25, 2018 10:38 am
Contact:

[16.25] Express belt animation stops at a specific time

Post by metriy »

After a certain time of the game, the animation of Express belt just stops. But it does not stop working. Animation T1-T2 belts continues to work fine.
This does not depend on the graphics settings or mods.
I played a very long time in this save, with the release of 0.15. Maybe at the specified second there is some overflow of the animation counter?
P.S. i'm using google translate, sorry for that.
situation 1.webm
(848.26 KiB) Downloaded 383 times
situation 2.webm
(1004.24 KiB) Downloaded 259 times
Attachments
factorio-current.log
(13.73 KiB) Downloaded 172 times
mods.zip
(3.55 MiB) Downloaded 149 times
save_1_minute_left.zip
(68.26 MiB) Downloaded 220 times
posila
Factorio Staff
Factorio Staff
Posts: 5341
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [16.25] Express belt animation stops at a specific time

Post by posila »

Thanks for the report.
Fixed for 0.16.26
I think this makes you record holder of the longest played map with belts :)
orzelek
Smart Inserter
Smart Inserter
Posts: 3922
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [16.25] Express belt animation stops at a specific time

Post by orzelek »

Did it really overflow some counter? ;)
posila
Factorio Staff
Factorio Staff
Posts: 5341
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [16.25] Express belt animation stops at a specific time

Post by posila »

You could say that. There was

frame = (int32_t)(tick * animation_speed)

where result of (tick * animation_speed) is double, so when it got larger than max int, casting it to int clamped it to max int (because that's how float -> int cast behaves, it doesn't wrap around as normal integer arithmetic)
Rseding91
Factorio Staff
Factorio Staff
Posts: 14250
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [16.25] Express belt animation stops at a specific time

Post by Rseding91 »

posila wrote:You could say that. There was

frame = (int32_t)(tick * animation_speed)

where result of (tick * animation_speed) is double, so when it got larger than max int, casting it to int clamped it to max int (because that's how float -> int cast behaves, it doesn't wrap around as normal integer arithmetic)
People using signed types when they never needed or wanted the negative variant -.-
If you want to get ahold of me I'm almost always on Discord.
SQLek
Inserter
Inserter
Posts: 45
Joined: Tue Jun 28, 2016 10:23 am
Contact:

Re: [16.25] Express belt animation stops at a specific time

Post by SQLek »

Dude! Do You really gamed over 9942 hours on this save? Without speeding up ts's like 3.4 years gaming 8 hours a day O.o
Supercheese
Filter Inserter
Filter Inserter
Posts: 841
Joined: Mon Sep 14, 2015 7:40 am
Contact:

Re: [16.25] Express belt animation stops at a specific time

Post by Supercheese »

SQLek wrote:Dude! Do You really gamed over 9942 hours on this save? Without speeding up ts's like 3.4 years gaming 8 hours a day O.o
He could have been playing on a higher game.speed setting.
metriy
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sun Feb 25, 2018 10:38 am
Contact:

Re: [16.25] Express belt animation stops at a specific time

Post by metriy »

132 days = 3200 hours, and all at normal speed, just 24/7. And I know, I'm a little crazy :shock: - but someone mining bitcoins, well, I'm the mining ores in Factorio. So meditative... :D
Thanks for answer.
metriy
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sun Feb 25, 2018 10:38 am
Contact:

Re: [16.25] Express belt animation stops at a specific time

Post by metriy »

Yes, 16.26 fixed belts. However, the same problem still remained for express splitters and underground belts. :roll:
User avatar
retep998
Burner Inserter
Burner Inserter
Posts: 7
Joined: Mon Mar 21, 2016 1:32 am
Contact:

Re: [16.25] Express belt animation stops at a specific time

Post by retep998 »

posila wrote:You could say that. There was

frame = (int32_t)(tick * animation_speed)

where result of (tick * animation_speed) is double, so when it got larger than max int, casting it to int clamped it to max int (because that's how float -> int cast behaves, it doesn't wrap around as normal integer arithmetic)
If you're doing this in C++, it's much worse than merely "clamping". Casts from floating point types to integer types that result in overflow cause full blown nasal demon undefined behavior!
Image
Rseding91
Factorio Staff
Factorio Staff
Posts: 14250
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [16.25] Express belt animation stops at a specific time

Post by Rseding91 »

retep998 wrote:
posila wrote:You could say that. There was

frame = (int32_t)(tick * animation_speed)

where result of (tick * animation_speed) is double, so when it got larger than max int, casting it to int clamped it to max int (because that's how float -> int cast behaves, it doesn't wrap around as normal integer arithmetic)
If you're doing this in C++, it's much worse than merely "clamping". Casts from floating point types to integer types that result in overflow cause full blown nasal demon undefined behavior!
That's fine. It does the same thing on all of the platforms we support or multiplayer wouldn't work (and it does). We also rely on signed integer overflow/underflow which works as you'd expect it to on all of the platforms we support with tests and everything.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”