Saving players state in co-op
Saving players state in co-op
Hi everybody !
I'm quite new on this forum. I just re-discovered Doom and all its engine, and I am trying to set up a co-op server.
I would like to know if it is possible to save the players state when they leave, to restore it when they come back ?
It would be better to remember their weapons, instead of let them restart only with the pistol, at the late levels wich are quite hard.
Or, if the above is not possible, is it possible to set a default package (weapons, ammo and armor) that each player receive as they connect ?
Thank you by advance.
Please apologies for english mistakes, as this is not my native language.
I'm quite new on this forum. I just re-discovered Doom and all its engine, and I am trying to set up a co-op server.
I would like to know if it is possible to save the players state when they leave, to restore it when they come back ?
It would be better to remember their weapons, instead of let them restart only with the pistol, at the late levels wich are quite hard.
Or, if the above is not possible, is it possible to set a default package (weapons, ammo and armor) that each player receive as they connect ?
Thank you by advance.
Please apologies for english mistakes, as this is not my native language.
RE: Saving players state in co-op
You could set a once only spawn room with weapons ammo and armor. There are ways of remembering a player on a server, usually quite complicated but you could maybe take their name string and have a condition that gives them weapons etc.. when that name comes on again. There are ways to enforce a specific player getting their things, you could do a pw system in acs. Hopefully when/if an account system gets created this will be a lot easier. Still I could probably help you if you have a specific idea.
RE: Saving players state in co-op
Thank you for the response.
But I have to admit that I am quite a newbie in doom world, so I don't understand a lot of terms you used : acs, pw system, account system, and so on.
I tried to read the wiki about all these, but I don't think I understand everything.
Identifying players by their name string seems a good idea, as there will be 8 players max on the server, always the same players (the server is private).
Is there a way to save their stuff when they disconnect, and give it to them when they reconnect ?
Thank you again for your help.
But I have to admit that I am quite a newbie in doom world, so I don't understand a lot of terms you used : acs, pw system, account system, and so on.
I tried to read the wiki about all these, but I don't think I understand everything.
Identifying players by their name string seems a good idea, as there will be 8 players max on the server, always the same players (the server is private).
Is there a way to save their stuff when they disconnect, and give it to them when they reconnect ?
Thank you again for your help.
RE: Saving players state in co-op
I did a bit of reading and it turns out you can have multiplayer save games in Zdoom - http://zdoom.org/wiki/Multiplayer#Savegames though it looks pretty complicated. I suppose a lot of the problems with saving player positions would be preventing people from messing about with it, but if you know and trust who your playing with it might be easier. Although I get the feeling your not intending to make your own maps, so any kind of save functionality would have to be in acs script (acs is a modern doom language, used in zdoom and zandronum and a few others, it's pretty easy and is documented on the zdoom wiki). If you tell me exactly what you want I'll try and make it for you.
RE: Saving players state in co-op
Thank you for your proposition, i completely accept it !
I will play on official wads (doom, doom2, tnt, plutonia) for now, so i won't make my own maps, as you guessed.
What i want is :
- a player connect to the server, play some levels and disconnect.
- the weapons the player had, and munitions (and optionnaly the armor), are saved, preferentially server side, but it is not a big problem if it is not.
- others players connect and play. Possibly, the map change as they complete it.
- the first player connect again, and the server give him the same stuff (weapon, ammo and maybe armor) that he had when he left.
Obviously, i need this to be done for each player, not only one. And if needed, i remember this is for coop only.
Is it ok for you, or do you need more informations ?
Thank you anyway.
I will play on official wads (doom, doom2, tnt, plutonia) for now, so i won't make my own maps, as you guessed.
What i want is :
- a player connect to the server, play some levels and disconnect.
- the weapons the player had, and munitions (and optionnaly the armor), are saved, preferentially server side, but it is not a big problem if it is not.
- others players connect and play. Possibly, the map change as they complete it.
- the first player connect again, and the server give him the same stuff (weapon, ammo and maybe armor) that he had when he left.
Obviously, i need this to be done for each player, not only one. And if needed, i remember this is for coop only.
Is it ok for you, or do you need more informations ?
Thank you anyway.
RE: Saving players state in co-op
While possible with scripting (called ACS) it's highly doubtful that someone will make it for you right away.R.Alex wrote: Thank you for your proposition, i completely accept it !
I will play on official wads (doom, doom2, tnt, plutonia) for now, so i won't make my own maps, as you guessed.
What i want is :
- a player connect to the server, play some levels and disconnect.
- the weapons the player had, and munitions (and optionnaly the armor), are saved, preferentially server side, but it is not a big problem if it is not.
- others players connect and play. Possibly, the map change as they complete it.
- the first player connect again, and the server give him the same stuff (weapon, ammo and maybe armor) that he had when he left.
Obviously, i need this to be done for each player, not only one. And if needed, i remember this is for coop only.
Is it ok for you, or do you need more informations ?
Thank you anyway.
RE: Saving players state in co-op
I can try it by myself, but I have absolutely no idea how to do it. That's why I really appreciate the proposition of one_Two. But if he can't or does not have the time to do it it, I won't be angry.
Is there any exemple of ACS that I can found, which could help me understand this ?
Is there any exemple of ACS that I can found, which could help me understand this ?
-
Watermelon
- Zandrone
- Posts: 1244
- Joined: Thu Jun 28, 2012 9:07 pm
- Location: Rwanda
RE: Saving players state in co-op
Basically you need to decide:
1) Save if server stays up
or
2) Save if server is restarted
Then we can go from there.
1) Save if server stays up
or
2) Save if server is restarted
Then we can go from there.
RE: Saving players state in co-op
I would also love the ability for the server to save the player states! I would prefer allowing the server to restart so that on really love maps, a friend and i could save our game midway!
-
Blachinowhy
- New User
- Posts: 2
- Joined: Tue May 21, 2013 10:31 pm
RE: Saving players state in co-op
Sorry to necro an old thread but I'm also interested in this subject, I'm running a RGA2 server and it's very irritating to play for 2 - 3 hours, get up to rank 20 and then have to go and come back to be level 1 again with no weapons. Since this is a 24/7 server the saves could be stored in ram and dumped when the server resets, no need to create say a text file with player inventories. I was hoping there might be a way to link to the menu open event that way the server stores a players inventory, rank, and weapons upon opening the menu to say, close the game. What is the most likely way to accomplish this? Wad or server side script? Suggestions and script help would be nice, I'm still just learning to program myself so I need as much information as I can get.
-
Watermelon
- Zandrone
- Posts: 1244
- Joined: Thu Jun 28, 2012 9:07 pm
- Location: Rwanda
RE: Saving players state in co-op
There is 3 ways of saving
1) Write ACS to save your x/y/z position and your inventory, then write it with your name to the server .ini file and have it restore when you join (prone to bugs/exploit with someone using the same name)
2) Get a server mod to record by IP, but if your IP changes you'r screwed
3) Write an intricate ACS login system (I had one working at one time but its thousands of lines of code)
or the secret option
4) Make a custom binary build with the above
For my third option, the danger is that whatever password you enter on the server can be probably read by any rcon users, so it's not great.
1) Write ACS to save your x/y/z position and your inventory, then write it with your name to the server .ini file and have it restore when you join (prone to bugs/exploit with someone using the same name)
2) Get a server mod to record by IP, but if your IP changes you'r screwed
3) Write an intricate ACS login system (I had one working at one time but its thousands of lines of code)
or the secret option
4) Make a custom binary build with the above
For my third option, the danger is that whatever password you enter on the server can be probably read by any rcon users, so it's not great.
Last edited by Watermelon on Sat May 25, 2013 3:52 pm, edited 1 time in total.
-
katZune
- Forum Regular
- Posts: 470
- Joined: Mon Jun 04, 2012 9:41 pm
- Location: Mexico! aka the hell gate
RE: Saving players state in co-op
I dont know but, dont would be great to add an acount system? I mean something basic like, save ammo, hp, armir, weapons and inventory, and let mods to add their custom things, tbh that would be hard (?) but would make zandronum unique
Whitout a good PC ATM, i will back when 2.0 come out, :)
Spoiler: The True (Open)
RE: Saving players state in co-op
http://zandronum.com/tracker/view.php?id=1176katZune wrote: I dont know but, dont would be great to add an acount system? I mean something basic like, save ammo, hp, armir, weapons and inventory, and let mods to add their custom things, tbh that would be hard (?) but would make zandronum unique
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)

Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)

-
katZune
- Forum Regular
- Posts: 470
- Joined: Mon Jun 04, 2012 9:41 pm
- Location: Mexico! aka the hell gate
RE: Saving players state in co-op
Nice, hope it will be added
Whitout a good PC ATM, i will back when 2.0 come out, :)
Spoiler: The True (Open)
-
Blachinowhy
- New User
- Posts: 2
- Joined: Tue May 21, 2013 10:31 pm
RE: Saving players state in co-op
Option 1 sounds the easiest to do, not to concerned with people copying names or exploiting, also location isn't so important to the save either. Just want people to spawn on the default spawn for that level upon rejoining with their inventory intact, keys excluded. So what do I do with this ACS, is it going in a pwad or do I just plug the code directly into the server .ini?
-
Watermelon
- Zandrone
- Posts: 1244
- Joined: Thu Jun 28, 2012 9:07 pm
- Location: Rwanda
RE: Saving players state in co-op
This is how I'd do it:Blachinowhy wrote: Option 1 sounds the easiest to do, not to concerned with people copying names or exploiting, also location isn't so important to the save either. Just want people to spawn on the default spawn for that level upon rejoining with their inventory intact, keys excluded. So what do I do with this ACS, is it going in a pwad or do I just plug the code directly into the server .ini?
Code: Select all
#define MAXPLAYERS 64
global int 0:weapondata[MAXPLAYERS];
script 100 ENTER
{
// Restore based on .ini here
while (true)
{
// Record inventory bitmask for weapondata[playernumber];
// This would be like dmflags, where the first bit is the shotgun, 2nd is ssg... however you want
delay(1);
}
}
script 101 (int playernumber) DISCONNECT
{
// Construct player name to a string with StrParam();
// Use ConsoleCommand to store the name in the .ini
// Store with corresponding weapondata[playernumber] into the .ini
}
-
Tomslucky7
- New User
- Posts: 6
- Joined: Mon Aug 11, 2014 6:36 pm
RE: Saving players state in co-op
Necroing an old thread again. I would like to know how to implement this into a Doom 2 Tower Defense server that I am hosting. Is there any way I could save the file like I normally would in singleplayer on a multiplayer server? Not sure if this mod would support an ACS system due to when someone dies that would end up crashing the server. I found this out because a buddy of mine and I played for a couple hours and when he died then I died the map reset and both the game and server crashed. I had it set to survival co-op mode as attempting to set it to skulltag (which is required by the mod) was not staying when the server was created via doomseeker (would set skulltag in options then it would just reset to cooperative).
I would just like to know how I could go about getting a saving system into this mod for multiplayer so we don't end up constantly losing our progress.
I would just like to know how I could go about getting a saving system into this mod for multiplayer so we don't end up constantly losing our progress.
-
Watermelon
- Zandrone
- Posts: 1244
- Joined: Thu Jun 28, 2012 9:07 pm
- Location: Rwanda
RE: Saving players state in co-op
If your server crashed it might be a bug.
You will need ACS to save stuff. Most likely you will need to code it yourself or with the help of someone who knows what they're doing.
You will need ACS to save stuff. Most likely you will need to code it yourself or with the help of someone who knows what they're doing.
-
Tomslucky7
- New User
- Posts: 6
- Joined: Mon Aug 11, 2014 6:36 pm
RE: Saving players state in co-op
Any suggestions on who I could talk to?
RE: Saving players state in co-op
#zamapping on IRC is filled with geniouses, who know practically anything with their combined knowledge.
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there