veden / Rampant

Factorio Mod - Basic AI augmentation using potential fields
GNU General Public License v3.0
58 stars 22 forks source link

Attempt to perform arithmetic on local 'playerCount' (a nil value) #66

Closed alex60015 closed 2 years ago

alex60015 commented 2 years ago

Hello dear Rampant authors and contributors :),

While playing a (heavy?) mod-loaded multiplayer world (co-op world) with the two biggest mods being Krastorio 2 and Space Exploration, we get the very annoying non-recoverable error from the title.

The full error message:

The mod Rampant (2.0.3) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Rampant::on_tick (ID 0)
__Rampant__/libs/ChunkPropertyUtils.lua:468: attempt to perform arithmetic on local 'playerCount' (a nil value)
stack traceback:
    __Rampant__/libs/ChunkPropertyUtils.lua:468: in function 'addPlayerToChunk'
    __Rampant__/libs/MapProcessor.lua:258: in function 'processPlayers'
    __Rampant__/control.lua:918: in function <__Rampant__/control.lua:896>

After a lot of trail and error (even switching versions all the way back to 1.1.4 - where we started the world on) we found out that the error occurs starting at version 2.0.0. The first time we got the error was after a batch update of 3 libs (RitnWaterfill 1.2.0 -> 1.2.1, RitnLib 0.5.3 -> 0.5.4 & aai-industry 0.5.8 -> 0.5.9). So what we did is undo the update process and load an old save from before the update. But the error keeps annoying us. We then removed Ritn* mods and we had no problems for around... I guess 15 hours while playing and then it came back. I played a bit with the debug settings and figured out that whatever I do - the moment I move on the current save from an active chunk to an inactive one, the errors keeps happening.

I don't know if this is useless information but the last things we did was expanding to a new mine and combined with a +400 arty shot bombardment on the biters we expanded and removed a very huge amount of biter's land.

Here some more details to the error who are hopefully useful to you guys:

I tried the savegame above on my laptop and on my desktop in single & multiplayer and both are raising the same error. If you need more details I'll gladly answer them :)

Mod setting changes:

Currently we're still only on the starter planet with only some satellites in orbit, no other planets are visited so far

/rampantSetAiState: nauvis is in AI_STATE_RAIDING

With kind regards Alex

Merry Christmas and sorry for opening this issue right on the 24th 😅

veden commented 2 years ago

Thanks for the report. This should be fixed in the next version.

Peckerhacker10203 commented 2 years ago

Hi there, i think i got a similar error with the new update of Rampant. I got the same seed and Information from the user above, we play together on the same map. I hope you can help us! <3

The mod Rampant (2.1.2) caused a non-recoverable error. Please report this error to the mod author.

Error while running event Rampant::on_tick (ID 0) Rampant/libs/MapProcessor.lua:455: attempt to index local 'chunkPack' (a nil value) stack traceback: Rampant/libs/MapProcessor.lua:455: in function 'processNests' Rampant/control.lua:935: in function <Rampant/control.lua:888>