Saving players state in co-op

General discussion of the port and Doom-related chat.
R.Alex
New User
Posts: 6
Joined: Fri Dec 14, 2012 2:29 pm

Saving players state in co-op

#1

Post by R.Alex » Fri Dec 14, 2012 2:35 pm

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.

one_Two
Addicted to Zandronum
Posts: 1753
Joined: Thu Jun 07, 2012 4:47 pm

RE: Saving players state in co-op

#2

Post by one_Two » Fri Dec 14, 2012 3:10 pm

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.

R.Alex
New User
Posts: 6
Joined: Fri Dec 14, 2012 2:29 pm

RE: Saving players state in co-op

#3

Post by R.Alex » Fri Dec 14, 2012 3:16 pm

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.

one_Two
Addicted to Zandronum
Posts: 1753
Joined: Thu Jun 07, 2012 4:47 pm

RE: Saving players state in co-op

#4

Post by one_Two » Fri Dec 14, 2012 4:45 pm

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.

R.Alex
New User
Posts: 6
Joined: Fri Dec 14, 2012 2:29 pm

RE: Saving players state in co-op

#5

Post by R.Alex » Fri Dec 14, 2012 5:52 pm

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.

Llewellyn
Forum Regular
Posts: 578
Joined: Mon Jul 02, 2012 7:12 am

RE: Saving players state in co-op

#6

Post by Llewellyn » Fri Dec 14, 2012 8:18 pm

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.
While possible with scripting (called ACS) it's highly doubtful that someone will make it for you right away.

R.Alex
New User
Posts: 6
Joined: Fri Dec 14, 2012 2:29 pm

RE: Saving players state in co-op

#7

Post by R.Alex » Mon Dec 17, 2012 9:39 am

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 ?

Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

RE: Saving players state in co-op

#8

Post by Watermelon » Mon Dec 17, 2012 6:26 pm

Basically you need to decide:

1) Save if server stays up
or
2) Save if server is restarted

Then we can go from there.

Skrell
 
Posts: 20
Joined: Sat Feb 02, 2013 1:52 am

RE: Saving players state in co-op

#9

Post by Skrell » Sat Feb 02, 2013 1:53 am

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

#10

Post by Blachinowhy » Tue May 21, 2013 10:41 pm

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

#11

Post by Watermelon » Sat May 25, 2013 3:51 pm

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.
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

#12

Post by katZune » Sat May 25, 2013 10:06 pm

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)
Ijon Tichy wrote:
Catastrophe wrote: Banned on grandvoid for trolling Zombie Horde and all out war (blocking, destroying my own base, etc)
Kicked from El Zoido's all out war for nuking our teams base
Kicked again from el Zoido's server for fucking up the warfactory so bad that mechs couldn't spawn anymore
I see no offenses here

only justice

User avatar
Ænima
Addicted to Zandronum
Posts: 3579
Joined: Tue Jun 05, 2012 6:12 pm

RE: Saving players state in co-op

#13

Post by Ænima » Sat May 25, 2013 10:11 pm

katZune 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
http://zandronum.com/tracker/view.php?id=1176
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)
Image

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

#14

Post by katZune » Sat May 25, 2013 10:29 pm

Nice, hope it will be added
Whitout a good PC ATM, i will back when 2.0 come out, :)
Spoiler: The True (Open)
Ijon Tichy wrote:
Catastrophe wrote: Banned on grandvoid for trolling Zombie Horde and all out war (blocking, destroying my own base, etc)
Kicked from El Zoido's all out war for nuking our teams base
Kicked again from el Zoido's server for fucking up the warfactory so bad that mechs couldn't spawn anymore
I see no offenses here

only justice

Blachinowhy
New User
Posts: 2
Joined: Tue May 21, 2013 10:31 pm

RE: Saving players state in co-op

#15

Post by Blachinowhy » Sun May 26, 2013 1:26 am

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

#16

Post by Watermelon » Sun May 26, 2013 3:32 pm

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?
This is how I'd do it:

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
}
Probably missing a lot of key concepts and such but this should be a good start. Of course people can easily name steal though.

Tomslucky7
New User
Posts: 6
Joined: Mon Aug 11, 2014 6:36 pm

RE: Saving players state in co-op

#17

Post by Tomslucky7 » Sat Aug 16, 2014 3:42 am

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.

Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

RE: Saving players state in co-op

#18

Post by Watermelon » Sat Aug 16, 2014 3:49 am

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.

Tomslucky7
New User
Posts: 6
Joined: Mon Aug 11, 2014 6:36 pm

RE: Saving players state in co-op

#19

Post by Tomslucky7 » Sat Aug 16, 2014 4:08 am

Any suggestions on who I could talk to?

Lollipop
Zandrone
Posts: 1124
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

RE: Saving players state in co-op

#20

Post by Lollipop » Sat Aug 16, 2014 3:04 pm

#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

Post Reply