Are effects rendered using rendering.draw_animation() and rendering.draw_light() expected to be synchronised?
If not, how do I synchronise the state of a random number generator? As far as I can see, Lua's math.random() only lets you seed it, but there's no facility for synchronising state.
Effects, random numbers, and desyncs
-
- Long Handed Inserter
- Posts: 93
- Joined: Thu May 18, 2017 2:22 pm
- Contact:
Re: Effects, random numbers, and desyncs
Take a look here:
https://lua-api.factorio.com/latest/Lua ... rator.html
Also if I recall correctly you don't need to sync math.random(). It is modified for game use and uses map random generator.
https://lua-api.factorio.com/latest/Lua ... rator.html
Also if I recall correctly you don't need to sync math.random(). It is modified for game use and uses map random generator.
Re: Effects, random numbers, and desyncs
Render objects are part of the game state, just like entities. If they weren't, they'd be disappearing on save load
Math random is deterministic and math randomseed it does nothing.
Math random is deterministic and math randomseed it does nothing.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
-
- Long Handed Inserter
- Posts: 93
- Joined: Thu May 18, 2017 2:22 pm
- Contact:
Re: Effects, random numbers, and desyncs
Ok that makes sense, and makes things really easy. Thanks!