EarendelDevelopers / factorio-mods

This is a public repository for tracking issues with Earendel's factorio mods.
18 stars 3 forks source link

Non-recoverable error - zonelist.lua attempt to compare nil with number #255

Open NickMcGettigan opened 2 years ago

NickMcGettigan commented 2 years ago

Just finished several sciences to unlock more zones / planets. Attempted to bring up universe explorer but it crashed instead.

Screenshot of error: image

Link to save: https://drive.google.com/file/d/1mRsIJ_lnbf0Mxnw_RryopjEReN3psaaN/view?usp=share_link

Console: [2022-11-24 15:58:58]: space-exploration/scripts/zonelist.lua:1476: in function <space-exploration/scripts/zonelist.lua:1474>[2022-11-24 15:58:58] [C]: : in function 'sort'[2022-11-24 15:58:58]: space-exploration/scripts/zonelist.lua:1485: in function 'update_list'[2022-11-24 15:58:58]: space-exploration/scripts/zonelist.lua:2273: in function 'update'[2022-11-24 15:58:58]: space-exploration/scripts/zonelist.lua:1210: in function 'open'[2022-11-24 15:58:58]: space-exploration/scripts/zonelist.lua:884: in function 'toggle'[2022-11-24 15:58:58]: space-exploration/scripts/zonelist.lua:2732: in function 'callback'[2022-11-24 15:58:58]: space-exploration/scripts/event.lua:15: in function <space-exploration/scripts/event.lua:13>"[2022-11-24 15:58:58] [46727.538]: Info ServerMultiplayerManager.cpp:795: updateTick(197996472) changing state from(InGame) to(Failed)[2022-11-24 15:58:58] [46727.551]: Quitting: multiplayer error.[2022-11-24 15:59:01] [46729.847]: Info ServerMultiplayerManager.cpp:141: Quitting multiplayer connection.

NickMcGettigan commented 2 years ago

Link to log: https://drive.google.com/file/d/1uqIC85pr69V46r-lIfB4DtQ9idGR_mGo/view?usp=sharing

InappropriatePenguin commented 2 years ago

@NickMcGettigan, did you build a spaceship console on a non-SE surface (such as inside the Editor extensions lab or on a Factorissimo surface)? If so, mine the console from that surface and you should no longer encounter this crash.

The next version of SE will no longer allow spaceship consoles to be built on non-SE surfaces in order to address this and other crashes.

NickMcGettigan commented 2 years ago

There are two of us but we don't think we placed a spaceship console anywhere we shouldn't have, neither of us have unlocked that either.

InappropriatePenguin commented 2 years ago

It seems like something got messed up with some zones in your Universe as they appear to be missing hierarchy index values. You can fix the problem by resetting the hierarchy indices using the following command. You'll be able to use the Universe Explorer after that.

/c __space-exploration__ Universe.set_hierarchy_values()

I'm noticing some of those same zones are also missing bot_attrition values, which should have been calculated upon universe creation. This might spam your console with warning messages without crashing.

This too can be addressed, but I'd like to understand how both of these issues came about. I see you have at least three extra (player?) forces in your game—can you detail all the commands you used throughout your game?

NickMcGettigan commented 2 years ago

I will load the bad save and try that, thank you.

There were a few of us playing at some point, we knew we wouldn't play together much and wanted a "separate" start.

I believe I used the first command below originally to spawn a few of us but I think I found it was setting all players to the new force, and tried the second when another person joined. It did seem to cause an issue. We also never got biter creep.

Team Creation /c remote.call("space-exploration", "setup_multiplayer_test", { force_name = "", players = {game.player}, match_nauvis_seed = true}) /c game.players[''].force = game.forces[''] /c game.player.character.die()

Team Creation replace with your ingame name /c remote.call("space-exploration", "setup_multiplayer_test", { force_name = "", players = {game.players['']}, match_nauvis_seed = true}) /c game.players[''].force = game.forces['']

We unlocked the research queue after the start and set the evolution to not overwhelm the new players but I believe those are the only commands we used.

NickMcGettigan commented 2 years ago

Confirming the command for hierarchy values did allow the universe explorer to open and got a warning about a zone not having a bot attrition value. The name doesn't look familiar, and it isn't the Nauvis seed which was the starting point for each player.

InappropriatePenguin commented 2 years ago

Yeah, this will have to get looked at. Since the vast majority of SE games are either single player or multiplayer-with-a-single-force games, the multiplayer pvp setup command that you were using is not as well tested.

In the mean time, you can fix the missing bot attrition values using the following command:

/c __space-exploration__ for _, zone in pairs(global.zone_index) do
  if not zone.bot_attrition then
    zone.bot_attrition = Zone.calculate_bot_attrition(zone)
  end
end
NickMcGettigan commented 2 years ago

We knew it was a bit of a risk but didn't want to schedule a specific day to play so we'd be in sync. Thanks for your help.