edward850 wrote:I feel as though doing a back in forth is going to get stupidly offtopic, especially since I think our responses are based off a miss-understanding
Thank you. I agree.
edward850 wrote:Issue 1: SetCvar disobeys the basic rule that saved games are a persistent state.
My stance here is categorisation of CVars. CVars are the handiest form of persistent data that exists in ZDoom. They can be created outside of a game instance and modified outside of a game instance. These range from mostly harmless like
audio settings to gameplay altering like
monster infighting functionality. These in-built variables can be categorised in a method that indicates how destructive they are on the gameplay and whether they should save with the gamestate or not. For simplicity's sake, client and server are the terms I've used as they immediately communicate to anyone what their functionality is. Client side variables and effects are things that have zero affect on the game state. Audio volume is the prime example there. Server side variables and effects are things that have a tangible impact on the game state. Monster infighting, for example, would radically affect a cooperative match. Server side varaibles would be expected to sync at the start of a multiplayer session. Preferably they would be immutable for the entire session too, however someone with admin priveleges could alter them and have them propagate across the session quite easily. Saving the game state would simply be a case of taking a copy of the relevant server CVars and restoring them on load.
As these variables originate from ZDoom, a further distinction of "Pure" can be placed on them. These variables are guaranteed to exist across all instances of ZDoom. Pure client variables can live in the INI file as they currently do. Pure server variables should have a bit of extra care added to them - upon starting a new session, they are reset to a set of values provided to them my the server creator. For a single player game, these values are hardcoded profiles. For a configurable multiplayer game, that's up to the session creator to alter. Having a set of defaults to work from is nice though, so for human usability it can steal them from the single player profile.
Mods (or "simulations" to use the term I used earlier) are a different story. It's not like the Quake days where you could load up some QuakeC or a DLL in Quake 2 and have things just work. Quake puts a lot more power in the modder's hands than ZDoom does. Persistent data can be tied up in CVars fairly simply, but straight away they won't be Pure. They're originated from a mod, and it should not be ZDoom's responsibility to maintain them all the time. The issue of synchronisation will pop up though. This can be quite simply solved by applying the same distinctions to Simulation CVars as Pure CVars. Simulation Client CVars would generally be harmless things like text speed, or client side effects that don't impact the game state. These can get saved in the appropriate section of the ZDoom INI (or a Simulation INI). Simulation Server CVars, likewise, would be stuff that gets synced upon session create/join and get saved to the game state. Things like (for a bare bones example) how often a custom item respawns would be Simulation Server settings and would require synchronisation across all game states, be they multiplayer, previously-saved, or demos.
This only leaves the question of what SetCVar can alter. Pure variables are out of the question. These are the responsibility of ZDoom, not the modder. Simulation Server variables should follow the same immutable rules as Pure Server variables. Simulation Client variables are the obvious choice. Suddenly, you can save the high score you always wanted so that it would persist across sessions. Or keep a track of character progress, either through levelling up or via mod progression.
It is true that this can be open to abuse - things you'd want to be persistent across a save state like the character's abilities at that point in time wouldn't work with Simulation Client variables. These, however, I think would benefit most from virtualisation. Simulation Client variables would vary for each connected player, but they also want to be saved in the gamestate. The server in this case would want to keep a copy of each client's variables and save/synchronise them as necessary. This requires the modder to program things correctly ACS side. But at some point, trust has to be given to the modder. Yes, it will result in questions on the forums and bugs that modders don't understand. Over time though, a collective knowledge base of best practices will emerge.
edward850 wrote:Issue 2: SetCvar also goes against how netgames are supposed to function (presently).
I got down here and was ready to detail more of what I mean, but then I realised it was completely covered with the above.
[quote="edward850"]I feel as though doing a back in forth is going to get stupidly offtopic, especially since I think our responses are based off a miss-understanding[/quote]
Thank you. I agree.
[quote="edward850"]Issue 1: SetCvar disobeys the basic rule that saved games are a persistent state.[/quote]
My stance here is categorisation of CVars. CVars are the handiest form of persistent data that exists in ZDoom. They can be created outside of a game instance and modified outside of a game instance. These range from mostly harmless like [url=http://zdoom.org/wiki/CVARs:Audio]audio settings[/url] to gameplay altering like [url=http://zdoom.org/wiki/CVARs:Configuration]monster infighting functionality[/url]. These in-built variables can be categorised in a method that indicates how destructive they are on the gameplay and whether they should save with the gamestate or not. For simplicity's sake, client and server are the terms I've used as they immediately communicate to anyone what their functionality is. Client side variables and effects are things that have zero affect on the game state. Audio volume is the prime example there. Server side variables and effects are things that have a tangible impact on the game state. Monster infighting, for example, would radically affect a cooperative match. Server side varaibles would be expected to sync at the start of a multiplayer session. Preferably they would be immutable for the entire session too, however someone with admin priveleges could alter them and have them propagate across the session quite easily. Saving the game state would simply be a case of taking a copy of the relevant server CVars and restoring them on load.
As these variables originate from ZDoom, a further distinction of "Pure" can be placed on them. These variables are guaranteed to exist across all instances of ZDoom. Pure client variables can live in the INI file as they currently do. Pure server variables should have a bit of extra care added to them - upon starting a new session, they are reset to a set of values provided to them my the server creator. For a single player game, these values are hardcoded profiles. For a configurable multiplayer game, that's up to the session creator to alter. Having a set of defaults to work from is nice though, so for human usability it can steal them from the single player profile.
Mods (or "simulations" to use the term I used earlier) are a different story. It's not like the Quake days where you could load up some QuakeC or a DLL in Quake 2 and have things just work. Quake puts a lot more power in the modder's hands than ZDoom does. Persistent data can be tied up in CVars fairly simply, but straight away they won't be Pure. They're originated from a mod, and it should not be ZDoom's responsibility to maintain them all the time. The issue of synchronisation will pop up though. This can be quite simply solved by applying the same distinctions to Simulation CVars as Pure CVars. Simulation Client CVars would generally be harmless things like text speed, or client side effects that don't impact the game state. These can get saved in the appropriate section of the ZDoom INI (or a Simulation INI). Simulation Server CVars, likewise, would be stuff that gets synced upon session create/join and get saved to the game state. Things like (for a bare bones example) how often a custom item respawns would be Simulation Server settings and would require synchronisation across all game states, be they multiplayer, previously-saved, or demos.
This only leaves the question of what SetCVar can alter. Pure variables are out of the question. These are the responsibility of ZDoom, not the modder. Simulation Server variables should follow the same immutable rules as Pure Server variables. Simulation Client variables are the obvious choice. Suddenly, you can save the high score you always wanted so that it would persist across sessions. Or keep a track of character progress, either through levelling up or via mod progression.
It is true that this can be open to abuse - things you'd want to be persistent across a save state like the character's abilities at that point in time wouldn't work with Simulation Client variables. These, however, I think would benefit most from virtualisation. Simulation Client variables would vary for each connected player, but they also want to be saved in the gamestate. The server in this case would want to keep a copy of each client's variables and save/synchronise them as necessary. This requires the modder to program things correctly ACS side. But at some point, trust has to be given to the modder. Yes, it will result in questions on the forums and bugs that modders don't understand. Over time though, a collective knowledge base of best practices will emerge.
[quote="edward850"]Issue 2: SetCvar also goes against how netgames are supposed to function (presently).[/quote]
I got down here and was ready to detail more of what I mean, but then I realised it was completely covered with the above.