Multiplayer: Need a mod that creates corpse on player leave

Looking for a mod? Have a review on a mod you'd like to share?
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Multiplayer: Need a mod that creates corpse on player leave

Post by Impatient »

In mp players often make their mk2 first then run a round a bit, then leave. mk2 and all stuff they have on them goes with them. I am looking for a mod that creates a corpse if a player leaves the game. I know such feature exists in redmew scenarios. But does a mod also exist? I could not find anything. Thanks!
Pi-C
Smart Inserter
Smart Inserter
Posts: 1728
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Multiplayer: Need a mod that creates corpse on player leave

Post by Pi-C »

Impatient wrote: Fri Mar 01, 2024 3:45 pm I am looking for a mod that creates a corpse if a player leaves the game.
In miniMAXIme, I already preserve player corpses when a player logs out of a multiplayer game. (Actually, I only set it to not expire until the player logs in again, when it will return to its remaining time_to_live, so other players still could loot the corpse.) I think it would be quite simple to add the feature you need, and as I already handle player corpses it also wouldn't be out of line with the mod's theme.

One question: What should happen when the player returns? Suppose the corpse still exists, should the player automatically get back everything in the corpse's inventory? (The corpse would be destroyed in the process.) Or perhaps, should the next player who joins (could be another player than the one who left the corpse) get the loot of the first corpse found on any surface?
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: Multiplayer: Need a mod that creates corpse on player leave

Post by Impatient »

Thanks for your interest Pi-C!

The direct answer to your question is: No there should be no special action on player return or other player join.



The main goal behind my question is item preservation. There are two cases where items do get lost through inconsiderate player actions:

1) If items stay on a corpse until it expires
2) If players leave the game and never return

ad1) There is a mod that sets corpse expiration to infinity. ( https://mods.factorio.com/mod/infinitycorpeslive )

ad2) In this case I wish that the items are put back into the game world. Creating a corpse is one way (and with the mod for case 1 it would not expire). Another way would be eg to create some chests with the items. Depending on researched tech maybe passive or active provider chests. And I am sure there are some other good ideas how to do it. But a corpse thematically fits best IMO.

Non-expiring corpses have the advantage of staying in the same location and they are also indestructable. They can be looted by everyone who has need for the items in it. Of course also by the same player. On return that player will spawn in the same location they were when they left the game. If the items are still there is another question. If the body got looted, then they are out of luck. Maybe someone else put that mk2 or spidertron or whatever expensive item to good use.

I see though that players might in a way try to dodge this by going to some distant part of the map before leaving. And not knowing that a corpse with valuable items is there is almost as bad as them being lost forever. Maybe that is the thought behind your question.

The people from redmew write a message with a map location in the chat and also set a map tag in that location, whenever a player leaves and a corpse with items is created. That is how they try to preserve items for the remaining team. As you might know, their scenarios are made for massive multiplayer games and items being lost due to players leaving, is an issue in these games.

A final side thought on the topic of implementing this: I had a look at the miniMAXIme mod of yours. Btw I think its very good. The character, when made smaller, looks better in scale to the game world, most notably when comparing it to vehicles. Nice! The topic though is a different one from item preservation. So I would implement it as a separate mod. Just my 2 cents.
Pi-C
Smart Inserter
Smart Inserter
Posts: 1728
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Multiplayer: Need a mod that creates corpse on player leave

Post by Pi-C »

Impatient wrote: Sat Mar 02, 2024 12:24 pm The direct answer to your question is: No there should be no special action on player return or other player join.
OK, that makes things so much easier! :-)
The main goal behind my question is item preservation. There are two cases where items do get lost through inconsiderate player actions:

1) If items stay on a corpse until it expires
2) If players leave the game and never return

ad1) There is a mod that sets corpse expiration to infinity. ( https://mods.factorio.com/mod/infinitycorpeslive )
An external mod isn't even necessary! I could define a new character-corpse prototype that never expires.
ad2) In this case I wish that the items are put back into the game world. Creating a corpse is one way (and with the mod for case 1 it would not expire). Another way would be eg to create some chests with the items. Depending on researched tech maybe passive or active provider chests. And I am sure there are some other good ideas how to do it. But a corpse thematically fits best IMO.
If you'd come up with some graphics, we could make it a burial-site. Technically, it could be either a character-corpse or a container in disguise.
I see though that players might in a way try to dodge this by going to some distant part of the map before leaving. And not knowing that a corpse with valuable items is there is almost as bad as them being lost forever. Maybe that is the thought behind your question.

The people from redmew write a message with a map location in the chat and also set a map tag in that location, whenever a player leaves and a corpse with items is created. That is how they try to preserve items for the remaining team. As you might know, their scenarios are made for massive multiplayer games and items being lost due to players leaving, is an issue in these games.
Adding a tag on the map and raising an alert shouldn't be too hard.
A final side thought on the topic of implementing this: I had a look at the miniMAXIme mod of yours. Btw I think its very good. The character, when made smaller, looks better in scale to the game world, most notably when comparing it to vehicles. Nice! The topic though is a different one from item preservation. So I would implement it as a separate mod. Just my 2 cents.
I think you missed the other aspect of miniMAXIme: It's not just about scaling character size, but can also be used to change your appearance on the fly. There are a number of mods that provide alternative characters (e.g. GearGirl, Shrek, different anime characters -- see the optional dependencies for the complete list) -- which should be interesting for multiplayer games because players can present themselves in a way they like. Some character prototypes may differ regarding inventory size, so item preservation already is something I'm dealing with.

But I also have another mod where I could integrate creating character corpses: Maps. Killing trees, spawners, or worms may get you a map of the area, which will chart a certain area around the map. I could add a kind of secret treasure map that would chart a chunk with a player corpse and tag the location in map view. This would make it easier to find hidden corpses, and it would give a further incentive to hunt for maps. :-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: Multiplayer: Need a mod that creates corpse on player leave

Post by Impatient »

Pi-C wrote: Sat Mar 02, 2024 2:27 pm I could add a kind of secret treasure map that would chart a chunk with a player corpse and tag the location in map view. This would make it easier to find hidden corpses, and it would give a further incentive to hunt for maps. :-)
Putting all corpses in the 0,0 chunk would definitely prevent player-leave-corpses being cluttered all over the map.
Pi-C
Smart Inserter
Smart Inserter
Posts: 1728
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Multiplayer: Need a mod that creates corpse on player leave

Post by Pi-C »

Impatient wrote: Sat Mar 02, 2024 2:56 pm
Pi-C wrote: Sat Mar 02, 2024 2:27 pm I could add a kind of secret treasure map that would chart a chunk with a player corpse and tag the location in map view. This would make it easier to find hidden corpses, and it would give a further incentive to hunt for maps. :-)
Putting all corpses in the 0,0 chunk would definitely prevent player-leave-corpses being cluttered all over the map.
That would only work in games where all players are on the same force. If there are competing player forces, dropping all corpses in the same chunk would be unfair if one force had complete control over that chunk. Also, there are games with multiple surfaces (with mods like SE where surfaces represent different planets, or mods like Factorissimo where you can have multiple nested mini-surfaces representing the interior of buildings), so it may be impractical to drop corpses only on Nauvis.

Perhaps the following would work:
  • Mod creates a marker that designates the chunk where it is located as burial-ground.
  • Each force may place only one marker per surface. The main burial ground of a force will be on the surface where they put their first marker.
  • Players who leave the game temporarily will drop a corpse on either the burial ground located on their current surface, or on the main burial ground if their force has no marker on their current surface.
  • Players who are permanently removed from the game will drop a corpse on the main burial ground.
  • If players are leaving or permanently removed from the game, and if their force hasn't placed a marker yet, the players will drop a corpse at their current position on their current surface.
  • Chart tags will be placed at the position where a player dropped a corpse. The tags are visible in mapview to all other players on the force who are on the tagged surface.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Multiplayer: Need a mod that creates corpse on player leave

Post by FuryoftheStars »

I am curious: while do I understand the intent behind this, wouldn't this be rather inconvenient for those who don't just leave themselves logged in 24/7? I mean, me, if I were to join a multiplayer server where every time I logged out after playing for a few hours all my gear and stuff was left on the ground somewhere, that would actually make me not want to play on that server anymore and just leave for good. :/

I feel like this would be unnecessarily punishing towards anyone that can't just stay logged in all the time.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
Pi-C
Smart Inserter
Smart Inserter
Posts: 1728
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Multiplayer: Need a mod that creates corpse on player leave

Post by Pi-C »

FuryoftheStars wrote: Tue Mar 05, 2024 11:48 am … if I were to join a multiplayer server where every time I logged out after playing for a few hours all my gear and stuff was left on the ground somewhere, that would actually make me not want to play on that server anymore and just leave for good. :/

I feel like this would be unnecessarily punishing towards anyone that can't just stay logged in all the time.
Perhaps it would be better to leave a corpse when a player is leaving, and to automatically return to the player whatever is left of the corpse inventory on reconnecting. This would entail the possibility that a returning player would get back none of the dropped items if somebody else has looted the corpse, but returning players wouldn't have to go looking for their corpse and manually pick up their stuff on returning. On the other hand, the items still wouldn't be lost in case a player is leaving permanently. What's your opinion on that?
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: Multiplayer: Need a mod that creates corpse on player leave

Post by Impatient »

My opinion is, that wishes on a game are different and I absolutely respect that. My view is that the stuff I carry is not mine but borrowed from the team. I always put the stuff I carry in chests befor I leave, no matter if I plan to return or not.
Usually, when there is not enough of something in a base, then one would just pipe in more resources, widen production capacity and soon there will be enough of it. Yet, I again point to the redmew server situation. They have 10+ players playing and a constant stream of visitors who leave without intention to return. And at stages base growth and tech progression is absolutely hampered, by everyone crafting their mk2 + level 2 roboports and shields and lasers. But there are other scenarios where some items are absolutely vital for survival. Either the game settings could have been set in that way deliberately or, by chance the team ended in a bad situation unintentionally. I vividly remember a game where exactly that happened. We were surrounded by biters, we could not kill, in desperate need for more power, with a very small amount of uranium ore and we only had so many pieces u-235 to start kovarex. everyone was freaked out and praying for the needed few remaining pieces of u-235 to appear from the uranium processor. If in that situation a player who had some of the existing pieces of u-235 on them would have left, it would have been game over. No nuclear power, no way to break out and get to the next patch of uranium ore. Picture your own scenario where item preservation would be vital to you. Maybe you don't like games where that could even be possible. Maybe you only want to play in bases where everything is available abundantly. And I absolutely respect that. Tastes differ and not every game is vor everyone.

To me its not important if a returning player gets back the items automatically, which are still on their corpse. To me its only important that they are preserved for the team, which means, that they are taken from them, when they leave and are put back into the game world and that the team somehow is notified that they are there. That is what I am looking for, for a game I want to host.
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Multiplayer: Need a mod that creates corpse on player leave

Post by Bilka »

Are you aware of the vanilla /open PlayerName command? It allows admins to open the inventory of any player, including offline players. It's what I use whenever someone leaves my multiplayer game with something important in their inventory.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: Multiplayer: Need a mod that creates corpse on player leave

Post by Impatient »

Bilka wrote: Fri Mar 08, 2024 2:21 pm Are you aware of the vanilla /open PlayerName command? It allows admins to open the inventory of any player, including offline players. It's what I use whenever someone leaves my multiplayer game with something important in their inventory.
I have not been aware of that. That is good to know. Anyways, haveing this as a basic and automated mechanic in a hosted game is still my wish. You probably are with me when I say, that I don't want to check every players inventory who left for vital items.

How do you do that? Do you check everyone who left?
Pi-C
Smart Inserter
Smart Inserter
Posts: 1728
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Multiplayer: Need a mod that creates corpse on player leave

Post by Pi-C »

Bilka wrote: Fri Mar 08, 2024 2:21 pm Are you aware of the vanilla /open PlayerName command? It allows admins to open the inventory of any player, including offline players. It's what I use whenever someone leaves my multiplayer game with something important in their inventory.
I wasn't aware that this command would also work for offline players. As the command doesn't disable achievements, I wonder if there really is a justification for making such a mod. I can see one argument for it: '/open PlayerName' can only be used by admins, and moving the items of leaving players to a temporary corpse would keep their items for the team even if no admin was paying attention.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Pi-C
Smart Inserter
Smart Inserter
Posts: 1728
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Multiplayer: Need a mod that creates corpse on player leave

Post by Pi-C »

Impatient wrote: Fri Mar 08, 2024 2:01 pm To me its not important if a returning player gets back the items automatically, which are still on their corpse. To me its only important that they are preserved for the team, which means, that they are taken from them, when they leave and are put back into the game world and that the team somehow is notified that they are there. That is what I am looking for, for a game I want to host.
So moving items to a temporary corpse at a location that is known to the other players would preserve the items for the team, and restoring whatever is left to returning players would accommodate players like FuryoftheStars who don't want to start with zero items whenever they connect to a server. Seems like a good compromise to me. :-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Multiplayer: Need a mod that creates corpse on player leave

Post by FuryoftheStars »

Edit: Whoop, some other posts were put in while I was writing. Adding the post I was reply to:
Impatient wrote: Fri Mar 08, 2024 2:01 pm My opinion is, that wishes on a game are different and I absolutely respect that. My view is that the stuff I carry is not mine but borrowed from the team. I always put the stuff I carry in chests befor I leave, no matter if I plan to return or not.
Usually, when there is not enough of something in a base, then one would just pipe in more resources, widen production capacity and soon there will be enough of it. Yet, I again point to the redmew server situation. They have 10+ players playing and a constant stream of visitors who leave without intention to return. And at stages base growth and tech progression is absolutely hampered, by everyone crafting their mk2 + level 2 roboports and shields and lasers. But there are other scenarios where some items are absolutely vital for survival. Either the game settings could have been set in that way deliberately or, by chance the team ended in a bad situation unintentionally. I vividly remember a game where exactly that happened. We were surrounded by biters, we could not kill, in desperate need for more power, with a very small amount of uranium ore and we only had so many pieces u-235 to start kovarex. everyone was freaked out and praying for the needed few remaining pieces of u-235 to appear from the uranium processor. If in that situation a player who had some of the existing pieces of u-235 on them would have left, it would have been game over. No nuclear power, no way to break out and get to the next patch of uranium ore. Picture your own scenario where item preservation would be vital to you. Maybe you don't like games where that could even be possible. Maybe you only want to play in bases where everything is available abundantly. And I absolutely respect that. Tastes differ and not every game is vor everyone.

To me its not important if a returning player gets back the items automatically, which are still on their corpse. To me its only important that they are preserved for the team, which means, that they are taken from them, when they leave and are put back into the game world and that the team somehow is notified that they are there. That is what I am looking for, for a game I want to host.
As I said, I get the intent. I really do. But this would make it to where some people just wouldn't want to play on the map at all. We all have schedules and need sleep. We can't play or even leave our computers logged in 24/7. Others probably don't have more than an hour or 2 in which they can play per week (though I suppose we're starting on the extreme, there). (I'm also unclear on MP permissions and how any of that may help, if at all, with "visitors". I don't necessarily need it all explained to me, but rather just something to throw out there for thought.)

I wonder if any of the below, in whole or piecemeal, would work? Some of it may be too complex for a mod, and ultimately, it is a mod for your own server, so what is most important is your own preference.

a couple of ideas

Anyway, just some thoughts. Take or leave as desired. :)
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
Pi-C
Smart Inserter
Smart Inserter
Posts: 1728
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Multiplayer: Need a mod that creates corpse on player leave

Post by Pi-C »

Update: I've been working on the basics of this mod. When a player logs off or is permanently removed, a corpse for all the player's characters (player.character and associated characters) with items will be created and all items from all inventories will be transferred to it. So far, just a chart tag will be created next to each corpse, though I will add a message with the corpse coordinates printed to all players on the same force as the player who left the corpse. When the player rejoins the game, the remaining contents of all corpses will be transferred back to the original character. This part is working already, but I still must test handling the case where forces are merged.

However, I have some more plans:
  • Unlike I suggested earlier, I won't use one marker per force and surface. Instead, players will be able to place as many entities per surface as they like. These entities will act as portals to their force's central burial site, which will be a special surface that is created once the first entity has been placed by this force. Any corpses created after the burial site has been created will be placed there.
  • A chart tag will be created next to each portal entity. They will be updated with the number of corpses present on the connected surface.
  • The portal idea has been inspired by Factorissimo, where you enter a surface by bumping into the door of a Factorissimo building. However, I think the way Factorissimo works is terribly inefficient for multiplayer games. (It checks in on_tick for each player who is not in a vehicle but is moving whether there is a door directly in front of the player; if the test succeeds, the player is teleported inside the building.) If I should decide to use that method, I'll probably start keeping track of the riding_state of all players on forces with a burial-site, and only listen to on_tick if at least one force has a portal and at least one player on one of such forces is not riding in a vehicle. A better idea is basing the portal entity on a constant-combinator with 0 slots. If the entity's GUI is opened, it would be closed again immediately, and the player would be teleported to the burial-site surface. An indestructible and unminable portal entity will be placed at {0, 0} of each burial-site surface. Players who open the GUI of that entity would be teleported back to the portal they've used to enter the burial-site. Not sure yet if this will/can work as I imagine…
  • There must be some safeguard against losing corpses when a burial-site surface is deleted (this happens regularly in a certain vanilla scenario, and other mods may mess with my surfaces as well). I intend to handle this by storing the inventories of all corpses in script-inventories before the surface is deleted, and recreating the surface with all corpses on it immediately after the surface has been deleted.
  • Something that I just thought of: If we have a central burial-site, all corpses left by players of a force should be placed there, not just corpses of players who have logged off or been removed, but also corpses of players who have properly died. This would probably mean to somehow distinguish between "natural" and "temporary" corpses -- still need to think about that.
I still need some graphics for the portal entities. If somebody could make something nice, please do! (My idea was something like a portal as in entry to a cave, roughly made of wood and stone, but I'm not fixed on that. However, as I intend to make the recipe for the portal entity available right from the start, without research, it shouldn't look too high-tech.) You'll be credited for your work, of course. If nobody steps forward, I guess I'll have to use some ugly place holder … :-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Pi-C
Smart Inserter
Smart Inserter
Posts: 1728
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Multiplayer: Need a mod that creates corpse on player leave

Post by Pi-C »

Impatient wrote: Fri Mar 01, 2024 3:45 pm
I've finally published the mod. May I present: Leave Corpse On Exit, or simply "LCOE", as I've come to refer to it.

Sorry for the long delay, but I had to restructure my data several times, and spent a good amount of time on making things more efficient and on testing. Hope you like it! :mrgreen:
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Pi-C
Smart Inserter
Smart Inserter
Posts: 1728
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Multiplayer: Need a mod that creates corpse on player leave

Post by Pi-C »

Updated to fix some bugs and make some improvements:
Changelog
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Post Reply

Return to “Questions, reviews and ratings”