[14.22] Spawning particles, smoke or fire entities can cause desyncs

This subforum contains all the issues which we already resolved.
User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 716
Joined: Sun Nov 23, 2014 11:57 am
Contact:

[14.22] Spawning particles, smoke or fire entities can cause desyncs

Post by Earendel »

I made some mods (AAI) that allow combinators to move vehicles autonomously and they are becoming very popular. With the increased popularity has come many many more desync reports. Quite a few people have checked the code for script issues that could cause desyncs but after after much testing it seems to be narrowed down to particle and/or fire entities and not a scripting problem.

The vehicles spawn smoke particles, mining particles when they mine, shell particles when they shoot. These particles are spawned with surface.create_entity and are not tracked afterward.

Reference Level

Code: Select all

<targeter name=smoke position={-199.4492187500, -54.2109375000}></targeter><targeter name=smoke position={-221.4335937500, -54.2187500000}></targeter>
Desynced Level

Code: Select all

<targeter name=smoke position={-199.4648437500, -54.2812500000}></targeter><targeter name=smoke position={-221.4257812500, -54.2617187500}></targeter>
In a small testing setup with just my mods things can be stable in multiplayer for hours, but in complicated bases and other mods the problem is much more likely to occur quickly.

Vehicles also have a 'fire' type entity attached in order to provide some light and vehicles sounds even when a player is not driving, these entities are tracked to update their position. I have a hunch that these entities might expire in an inconsistent way that may be partly responsible.

Desync from Arumba
Desync Report: https://www.youtube.com/playlist?list=P ... Naih_-Qoi-
Modpack: https://www.dropbox.com/s/uk3802lvkuunw ... mo.7z?dl=0

Desync Report: Desync from Nilaus
Desync Report: https://drive.google.com/file/d/0B8uzPm ... sp=sharing
Modpack: https://drive.google.com/drive/folders/ ... sp=sharing

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5246
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [14.22] Spawning particles, smoke or fire entities can cause desyncs

Post by Klonan »

Thanks for the report

This is most likely an issue on the mod behalf, where whatever script you are using to spawn the entities with create_entity is mistaken, rather than a direct issue with the API call

If you can reproduce it with some simple Lua command, it would prove that it is an issue with the in game create_entity, until then i will move this to desync with mods

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5246
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [14.22] Spawning particles, smoke or fire entities can cause desyncs

Post by Klonan »

It may the the math.random() call you're making, can you try replacing it with (math.random(100)/100) and seeing if the desyncs persist?

It may be some built in Lua random issue

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 716
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: [14.22] Spawning particles, smoke or fire entities can cause desyncs

Post by Earendel »

Ok I'll give that a go. Thanks for taking a look.

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 716
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: [14.22] Spawning particles, smoke or fire entities can cause desyncs

Post by Earendel »

So it seems that the smoke particle positions were different in the desync reports not because of a desync problem with the smoke particles directly, but because of the moving fire entities described in this report: viewtopic.php?f=30&t=44344

The other issue is marked as resolved for the next release so this can be too, or moved to not a bug.

Thanks.

Post Reply

Return to “Resolved Problems and Bugs”