Page 1 of 1
Putting gamedir into save game files?
Posted: Wed Jul 30, 2014 7:10 am
by Baker
I want to put the gamedir into save game files *AND* have it degrade gracefully in non-supporting clients back to standard Quake.
Not stuff that breaks other engines, needs regular Quake just to ignore it.
Any thoughts on the least EVIL way to do this? I don't want it to print warnings to the console of non-supporting clients either.
[I don't like the idea of save games not knowing what they are. I can think of 2 ways to pull this off, but at the moment I'm not liking either of them (repeat fields multiple times with different information for the engine to scrub out is one --- a non-supporting engine would set the field multiple times, but last value would be the real on --- the other idea involves the save game comment. -- first one seems really hacky, second one is kind of "okayish" but want to collect thoughts and see if there is a "best way"]
Re: Putting gamedir into save game files?
Posted: Wed Jul 30, 2014 8:27 am
by mankrip
Any extra information in the savegames should be encoded as an entity comment in the world entity. Entity comments are ignored by the engine, but the engine can be programmed to use data from some of those comments.
That's how the serverflags fix was implemented in the latest versions of Makaqu.
Re: Putting gamedir into save game files?
Posted: Wed Jul 30, 2014 9:44 am
by Baker
This is the worldspawn segment of the save game file, I'm not sure what you are suggesting?
But it sounds promising.
Code: Select all
{
"modelindex" "1.000000"
"movetype" "7.000000"
"solid" "4.000000"
"classname" "worldspawn"
"model" "maps/start.bsp"
"message" "Introduction"
"sounds" "4.000000"
"wad" "gfx/start.wad"
}
Re: Putting gamedir into save game files?
Posted: Wed Jul 30, 2014 1:01 pm
by Spike
is it not safe to assume that the gamedir the saved game is stored in is the gamedir that should be used to reload the saved game? I'm not sure why you'd need to add anything at all.
Re: Putting gamedir into save game files?
Posted: Wed Jul 30, 2014 9:08 pm
by leileilol
if i did this in my uneccessarily anal way i'd just stick the progs.dat crc appended to the save file name and get the engine to load that automatically appended.
but if I do that, someone will bitch on the debian mailing list that it's not secure enough and should be a progs.dat sha-1 hash save file name
Re: Putting gamedir into save game files?
Posted: Wed Jul 30, 2014 10:04 pm
by Spike
stick the entire progs.dat in there, that way it'll not bug out between versions.
Re: Putting gamedir into save game files?
Posted: Wed Jul 30, 2014 11:13 pm
by r00k
could it not be simple enough to save games to the gamedir and then load saved games from the gamedir?
original saved files for quake in id1 mods have their saved games in their dirs?
i havent looked at the code i just assumed it wasnt hard coded for saved games to always be in id1
wait just reread the thread i think spike said the same thing i just did
since for example each player might have a different name for one mod as apposed to
another player. so saving a foldername in the saved file might later not work if they reinstalled the mod
and used a different foldername. but just tossing a saved game know to be from
intheshadows would work for 'its' if thats the -gamedir name to load from
blah typing on my phone hope this
makes sense
Re: Putting gamedir into save game files?
Posted: Thu Jul 31, 2014 6:50 am
by mankrip
I do agree that it seems unnecessary, but Baker didn't exactly say what he wants to use this for. And anyway, it's something fun to code...
Baker wrote:This is the worldspawn segment of the save game file, I'm not sure what you are suggesting?
Search for "serverflags" in the Makaqu source code.
Re: Putting gamedir into save game files?
Posted: Thu Jul 31, 2014 2:15 pm
by frag.machine
Save a dummy entity in the end of the savegame (let's say, "classname" = "_progsinfo") containing all info you want to store, like the progs.dat CRC or the gamedir name.
Vanilla engines will just parse and spawn a harmless entity with virtually no consequences to gameplay, yours will use the mentioned fields and silently discard the entity.
If you're really paranoid about an inoffensive errant entity wandering in the engine guts, add a "nextthink"="SUB_Remove" so it is almost immediately reclaimed in vanilla engines.