Page 1 of 1

Multiplayer crash - FactorioMMO game

Posted: Wed Mar 29, 2017 6:56 pm
by psihius
Hello,

we started to experience quite a few crashes after 36 hours in game. We have some admin tools implemented, but no mods. Tools were there since the start of the game and we had no issues with them over numerous events, so probably this is some edge case.

Logs and save are attached. I have no idea what triggers it as we have 15-20 people playing usually.

Re: Multiplayer crash - FactorioMMO game

Posted: Wed Mar 29, 2017 6:58 pm
by psihius
Annd another crash, this time stack trace looks way more useful.

Re: Multiplayer crash - FactorioMMO game

Posted: Wed Mar 29, 2017 7:43 pm
by Rseding91
Are you using a custom scenario script?

If so, can you upload that here? I suspect you have something like "on an entity being mined: create an entity ghost of that entity on some other force"?

It's crashing because a script is trying to create an entity ghost of something that is not valid as an entity ghost (a train, projectile, something that takes special data in create-entity to work). I'll fix the crash for 0.15 but I'm wondering what you're doing in script that's causing it :)

Re: Multiplayer crash - FactorioMMO game

Posted: Wed Mar 29, 2017 9:40 pm
by psihius
Scripts are part of the save - see control.lua - there are all the includes. Your interest is in

Code: Select all

require "locale/utils/admin"
and specifically admin.lua file function

Code: Select all

function entity_mined(event)
And yes, you are absolutely right - we create ghosts when someone deconstructs/destroys something on a separate force - this is our anti-griefing tool. Load the save and give yourself admin rights and you will see a GUI. When you switch to spectate - you will see ghosts of deconstructed/destroyed stuff :)

By the way, a related bug report - you see that we check for underground-belt in that function and place a chest ghost instead of an underground belt? Well, underground belts on different forces cause problems - if there is a underground belt ghost - you cannot place an underground belt at all, or they don't go the full length. If you need more info on that - we can make a video.

Re: Multiplayer crash - FactorioMMO game

Posted: Wed Mar 29, 2017 9:52 pm
by psihius
If you could give us a list of entities that we need to exclude from creating ghosts - we would be very greatfull and will fix script from our side too so we can play the map further (people just started to do something a lot and we crashed every 5-7 mins)

Re: Multiplayer crash - FactorioMMO game

Posted: Wed Mar 29, 2017 9:56 pm
by I_IBlackI_I

Code: Select all

--Originally written by 3RA, modified by I_IBlackI_I for FactorioMMO
function entity_mined(event)
	local entity = event.entity
-- All the things to exclude
	if entity.force.name == "neutral" 
	or entity.name == "entity-ghost" 
	or entity.type == "locomotive" 
	or entity.type == "cargo-wagon" 
	or entity.type == "car" 
	or entity.type:find("robot") 
	or game.players[event.player_index].force == game.forces.Admins 
	or entity.name == "tile-ghost"
	then return end
--Change underground-belt to chest so we can still see that it was destroyed, but prevents the bug of unable to place underground belts inside a underground-belt ghost.
	if entity.type == "underground-belt" then
		local ghost = entity.surface.create_entity
		{name="entity-ghost",	force=game.forces.Admins, inner_name="iron-chest", position=entity.position, direction = entity.direction}
		ghost.last_user = game.players[event.player_index]
--If it shouldn't be excluded and isn't an underground-belt, make a ghost entity on the admin-force
	else
		local ghost = entity.surface.create_entity
		{name="entity-ghost",	force=game.forces.Admins, inner_name=entity.name, position=entity.position, direction = entity.direction}
		ghost.last_user = game.players[event.player_index]
	end
end
So yeah we are probably missing something.



Edit:

Alright here is the code from 3RA it looks like they have updated their list:
https://github.com/3RaGaming/utils/blob ... in.lua#L45

I guess this topic can be closed unless there are still entities missing.

Re: Multiplayer crash - FactorioMMO game

Posted: Wed Mar 29, 2017 10:13 pm
by Rseding91
psihius wrote:By the way, a related bug report - you see that we check for underground-belt in that function and place a chest ghost instead of an underground belt? Well, underground belts on different forces cause problems - if there is a underground belt ghost - you cannot place an underground belt at all, or they don't go the full length. If you need more info on that - we can make a video.
That was fixed for 0.15 a few months ago - I believe now other forces ghosts are ignored.