SaveGame v. 0.6
Moderator: Moderators
SaveGame v. 0.6
What does this do? It allows people to save and load their game states.
Alpha Code. Definitely a "work in progress", but it works well enough to test.
Include in your projects to test via include (it's a "mod"), or manually add the code to your project (not recommended until we're all reasonably certain it's bug-free, and it still will want the SAVEGAME.sdd folder to write to, unless we all decide we'd like something else).
Must have Spring 0.81+ installed to test this.
Records Unit, Feature, Resource, Map states. Now records all Unit Command states, including such things as Guard.
Will record GG in its entirety to record gamestate data for Lua game designs and Lua AIs. Has a fairly pretty UI; supports 10 savegame states, will tell you details about savegames you've saved.
Oh, and.... HIT the "~ / `" key to activate, for now (sorry for not posting that right away, and yeah that's all open to discussion).
- Attachments
-
- SAVEGAMES.sdd.zip
- (464.65 KiB) Downloaded 73 times
-
- screen00001.jpg
- (376.16 KiB) Downloaded 3 times
Last edited by Argh on 28 Jan 2010, 15:18, edited 8 times in total.
Re: SaveGame v. 0.1
You need to start a game to load other games?
Is this applicable to multiplayer sessions?
Is this applicable to multiplayer sessions?
- very_bad_soldier
- Posts: 1397
- Joined: 20 Feb 2007, 01:10
Re: SaveGame v. 0.1
You did that window really well, sir. Looks AAA no doubt.
Re: SaveGame v. 0.1
Meh, it's just something so that it's not ugly. Anybody could reskin it very easily, btw, it's fairly flexible.
So, maybe include the module with a special build of SA, test it out. Mainly I think that, once we're sure it's as un-buggy as it's going to get, I'll try and convince Lobby folks to support the format. But we'll see about all of that when it's all working as well as it can.
Well, kinda. For P.U.R.E., I intend to ship it with all 10 savegames filled, let people use this feature directly from AppLauncher and from the Linux frontend (another project).You need to start a game to load other games?
That's a really interesting question. If multiplayer games use a host IP, etc., and everybody uses the EXACT SAME savegame... IDK, it might be possible that that startscript will result in everybody being back in the same game state. That's not a question I can answer though, IDK how that part of sync works. In theory, everybody'd log back in to the host, the script would roll, and everybody would have the same game-state...Is this applicable to multiplayer sessions?
So, maybe include the module with a special build of SA, test it out. Mainly I think that, once we're sure it's as un-buggy as it's going to get, I'll try and convince Lobby folks to support the format. But we'll see about all of that when it's all working as well as it can.
Last edited by Argh on 22 Jan 2010, 21:23, edited 1 time in total.
Re: SaveGame v. 0.1
Suggestion:restart.
As i was thinking about making some single player missions i quickly realized restart would be very important.
As i was thinking about making some single player missions i quickly realized restart would be very important.
Re: SaveGame v. 0.1
It uses restart, lol.
Download it, install it, try it out.
Download it, install it, try it out.
Re: SaveGame v. 0.1
I have a restart button in my system!Gota wrote:Suggestion:restart.
As i was thinking about making some single player missions i quickly realized restart would be very important.
Argh: Gota does not mean "Use Spring.Restart to load a game"
He means "make a button that start over a game with the same initial conditions"
Or so I understood.
Re: SaveGame v. 0.1
omg your fighting against posting screenshots of worldbuilder yet you took one anyway to show off the savegame gadgets and then continued to fight?!
Re: SaveGame v. 0.1
Hit "save" at whatever point you want... hit "load" to restart. Just like any commercial product.He means "make a button that start over a game with the same initial conditions"
Re: SaveGame v. 0.1
commercial products have a dedicated restart button per mission.
Re: SaveGame v. 0.1
Yeah, but it usually reloads the entire game state, which is what this does.
I could make a generic "restart" that would auto-save with just the start-script and a blank savegame, I suppose, to take the place of slot 10, use a special button, etc.
But it would still have to restart the engine; I don't want to have poor end-users waiting to restore the map, when it's faster to just reload, and that wouldn't be kosher with GameFrame() dependent states in missions, etc.
I'm not going to build you a generic mission frontend- if you want one, zwswg's is pretty good and very easy to install.
Anyhow, doing a restart feature's straightforward; I'll get that done and post a new version... after you've downloaded and tested it.
Here's a little incentive; it took longer to make the bitmap than to make the code.
I could make a generic "restart" that would auto-save with just the start-script and a blank savegame, I suppose, to take the place of slot 10, use a special button, etc.
But it would still have to restart the engine; I don't want to have poor end-users waiting to restore the map, when it's faster to just reload, and that wouldn't be kosher with GameFrame() dependent states in missions, etc.
I'm not going to build you a generic mission frontend- if you want one, zwswg's is pretty good and very easy to install.
Anyhow, doing a restart feature's straightforward; I'll get that done and post a new version... after you've downloaded and tested it.
Here's a little incentive; it took longer to make the bitmap than to make the code.
- Attachments
-
- screen00001.jpg
- (376.16 KiB) Downloaded 3 times
Re: SaveGame v. 0.1
What's with the arbitrary 3 levels of GG? If you don't restore it in its entirety I don't see how the data can do anything but crash gadgets.
Re: SaveGame v. 0.1
Absolutely, if they go deeper than the following example:
GG.foo = {bar = {foobar = 'barfoo'}}
I haven't seen much of anything designed to go further down than that, so I figured it was reasonably safe.
GG.foo = {bar = {foobar = 'barfoo'}}
I haven't seen much of anything designed to go further down than that, so I figured it was reasonably safe.
Re: SaveGame v. 0.1
arbitrary three levels because it's hardcoded nested loops?
Re: SaveGame v. 0.1
...and?
I tried a few things, but because of the way that the data has to get written back... honestly, I figured I'd just add another recursion by hand or two, if there was a real need.
I tried a few things, but because of the way that the data has to get written back... honestly, I figured I'd just add another recursion by hand or two, if there was a real need.
Re: SaveGame v. 0.1
I'm thinking. sample code in a sec.
Re: SaveGame v. 0.1
NP, I appreciate the help- I thought it would be super-trivial, but got stumped when faced with output
Re: SaveGame v. 0.1
Code: Select all
local function dumpTable(tab)
if type(tab) == 'table' then
local tmp = {}
for a, b in pairs(tab) do
table.insert(tmp, a .. '=' .. dumpTable(b))
end
return '{' .. table.concat(tmp, ',') .. '}'
else
return tab
end
end
Spring.Echo(dumpTable(GG))