[1.1.34] "Play for limited times" in editor, wraps around after 65536 ticks

This subforum contains all the issues which we already resolved.
Post Reply
movax20h
Fast Inserter
Fast Inserter
Posts: 160
Joined: Fri Mar 08, 2019 7:07 pm
Contact:

[1.1.34] "Play for limited times" in editor, wraps around after 65536 ticks

Post by movax20h »

I was trying to run a simulation in editor for 600000 ticks (10000 seconds). I want to calculate pretty precisely the average thoughput of various features of my build design, so I need to run it long, to get decent accuracy (i.e. to smooth out fluctuations, initial delays, etc).

However, it stopped after about 10000 ticks.

I narrowed it down, to be use of 16-bit unsigned integer somewhere probably.

Entering 65537 then clicking "Tick custom" will advance the game by 1 tick.

This also explains why 600000 ticks resulted in about 10000 ticks, because 600000 mod 65536
= 10176.

The issue happens with normal speed, and with other speeds (for example 64x).

Additionally, despite ticks_to_run being uint (so I expect 32 or 64 bit), in the API spec ( https://lua-api.factorio.com/latest/Lua ... cks_to_run ) , doing `/c game.ticks_to_run = 65537` results in an error.

I also noticed that entering 65535 then clicking "Tick custom" will in fact run forever and never pause.

Linux, steam version of factorio.

Rseding91
Factorio Staff
Factorio Staff
Posts: 11882
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.34] "Play for limited times" in editor, wraps around after 65536 ticks

Post by Rseding91 »

Thanks for the report. It's now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”