Page 1 of 2

Single Player Save Game Needed

Posted: 20 Apr 2008, 05:07
by jonjonz
I played alot of TA single player and have played just about every other RTS out there and always came back to TA because the AI was superior to any other. I loved how you could get a scenario to a balance point, where it you could leave the computer and game running unattended for days and only look in occasionally to see the changes.

I have played multiplayer, but find it not to my taste. I like single player because I like to take my time and study what is going on, look at it from many different angles, and replay certain battle over and over with minor subtle changes.

I was very excited to come accross Spring and was blown away by the one thing TA always lacked, a decent un-fixed camera.

It was with great dismay that I slowly discovered there is not functioning equivalent to saving and resuming a single player game in Spring.

Because of that, I fear Spring has lost a potential player and supported, as multiplayer is just not my cup of joe.

I hope some developer will see this and realize that by implementing this feature, many single players would flock to Spring.

Re: Single Player Save Game Needed

Posted: 20 Apr 2008, 06:15
by Argh
Um, there's a save-game feature.

And, last time I checked anyhow, it works.

Re: Single Player Save Game Needed

Posted: 20 Apr 2008, 22:40
by Guessmyname
Doesn't loading save games really mess up the AIs though? Because all their calculations and stuff (threat matrix etc) haven't been saved as well, so they effectively have to start from scratch each time...

Re: Single Player Save Game Needed

Posted: 20 Apr 2008, 23:28
by BrainDamage
since 2 releases spring have the necessary methods to load & store AI data on save, some AIs uses them, can't recall which one did and and which one didn't implement them

Re: Single Player Save Game Needed

Posted: 21 Apr 2008, 01:03
by Satirik
viewtopic.php?f=12&t=14628

Re: Single Player Save Game Needed

Posted: 21 Apr 2008, 20:35
by Nerambit
Yeah, I've been wondering about the "save game" for single player feature also. So, there actually is one? Because I've been trying to figure out how to do it.

How do you use it? Also, how do you load a game that has been saved? It sort of seems like this is what the original poster was trying to figure out and no one seems to have explained how to actually do it.

Thanks for any help you could offer.

Re: Single Player Save Game Needed

Posted: 21 Apr 2008, 22:04
by BrainDamage
to save type in the chat
.save nameofsavegame
to load load "test spring" from the menu, and use allow keys to go to mid-bottom part of the list, there you'll find your savegame listed

EDIT: the function is sorta experimental tho, if you get errors/problems, please report in the help section and or bug tracker so devs have a chance to fix them

Re: Single Player Save Game Needed

Posted: 21 Apr 2008, 22:22
by Nerambit
thank you very much

Re: Single Player Save Game Needed

Posted: 30 Apr 2008, 20:07
by Prootwadl
Brain Damage wrote:to save type in the chat
.save nameofsavegame
Is that the same thing as hitting Ctrl+Shift+F8?

Re: Single Player Save Game Needed

Posted: 25 Aug 2009, 21:10
by Achilla
Bump

I thought it would be nice to be able to save and load game from in-game menu, not by awkward 'experimental' way. Too bad I found that out after I had to give up on a cool fight due to limited time. If there was a clearly visible save/load menu just above 'quit' I wouldn't have lost that game :cry:

On the other hand, it would be cool too to be able to save a multiplayer game. Perhaps an option in map settings or something like that, with a limit to prevent freezing the game for everyone. Or perhaps a /vote system for saving the game or not? Not sure how it would play out though, if there weren't all of the players to continue the game at later time.

Perhaps time for some brainstorming.

PS. I have bumped this thread for a purpose, which is discussion of what I propose

Re: Single Player Save Game Needed

Posted: 25 Aug 2009, 21:23
by zwzsg
Independantly from the hard coded save system, Kernel Panic 3.6 feature some lua-based pseudo-savegame. When /cheat is on, it autosave every minute.

Re: Single Player Save Game Needed

Posted: 25 Aug 2009, 21:28
by hoijui
it makes no sence to make saving/loading easier for users as long as it does not yet work.
and as singleplayer usually means playing agasint an AI, which does not work for savegames yet, save/load can be considered unusable.
..except that Kernel panic thing maybe :-)

Re: Single Player Save Game Needed

Posted: 25 Aug 2009, 21:45
by zwzsg
Well, it doesn't record properly building under construction, has issue with some orders because I haven't debugged it completly, and requires an AI that handles being given units. But if you stick to the Kernel Panic Lua AI, and don't mind losing 90% built units, it works.

Re: Single Player Save Game Needed

Posted: 25 Aug 2009, 21:50
by imbaczek
saving will also need mod lua support, so even if the engine started to support it, games would have to plug in their support, too.

Re: Single Player Save Game Needed

Posted: 25 Aug 2009, 21:56
by Achilla
Ah, so it's indeed complicated!

Well, hopefully that's something you guys will be able to pull off at a later date. To my understanding first something needs to be fixed with game engine, and then on-each-AI-basis for it to work properly, right? Or is it more complicated?

Re: Single Player Save Game Needed

Posted: 25 Aug 2009, 21:57
by imbaczek
yeah, pretty much what you said, but add per-mod to the list, too.

Re: Single Player Save Game Needed

Posted: 25 Aug 2009, 22:09
by zwzsg
As I proved with KP, you can also ditch engine support and do a savegame system entirely inside the mod. It's released now and it works.

The problem with resuming unit under construction I mentionned earlier wouldn't be there I hadn't canAssist=0. The savegame you made are automatically listed in the single player menu I made, you click them, game reload. Maybe it needs some big SAVE button so you don't have to type /dump MySaveGameName, but about any widget coder could do that.

Then it's a matter of BA copying it, because anything not in BA does not exist.

Re: Single Player Save Game Needed

Posted: 26 Aug 2009, 08:51
by hoijui
KAIK, RAI and AAI should already support beeing given units (UnitCreated + UnitFinished), and i think this is the way to go with them anyway. Of course, supporting a save and load state would have some advantages, but this can still be done in addition.. as it actually always was, pratically it works like this:

Code: Select all

loadingSaveGame() {
   loadingEngine();
   for each AI {
      if (AI supports loading) {
         AI.load(savedAIState)
      } else {
         for each unit of AIs team {
            AI.UnitCreated(unit)
            AI.UnitFinished(unit)
         }
      }
   }
}
in practice this means the AI has to reinitialize, and wont be bale ot use game local statistical data, like estimates of how strong the enemies are, or where they have their buildings. plus it suffers from nearly the same thing KPs system does: the AI will forget about half built units/buildings.
in general it should work though. it works well in my tests, when killing and reinitializing an AI mid-game.

Re: Single Player Save Game Needed

Posted: 26 Aug 2009, 18:46
by AF
Hoijui, I think that the unit created unitfinished thing could be problematic depending on the AIs architecture.

For example, the AI would need to check what the unit si doing so that it can pick up where it elft off properly, but it cannot check for a complex AI based task or what it was supposed to be doing. This mechanism in the end results in the AI suffering a setback because any logical processes and things its tracked based on that current game have gone.

While this can be solved via save states, this si not what I object to the most.

But mostly, the AI sees no difference between the following circumstances.
  • The AI has just taken over a teams forces
  • The AI has just been loaded and been given control of its forces from a savegame
  • The AI has just finished building a unit
  • The mod has spawned a bunch of units
One could check if the unit has pre-existing commands however this pulls up the following failure scenarios:
  • A lua gadget that automatically gives units commands on construction, aka one to make it leave the factory correctly or by a certain route, or one that loads the unit on a transporter which then does an orbital drop
  • An AI task may issue a command upon unit created messing up any unit finished stuff
  • The unit may have already gotten commands from another player or a previous savegame
  • Engine sub unit AI behaviours
As such a definitive means of distinguishing between all of these rather than taking a new type of event and expressing it in terms of existing events, its misleading and can lead to unforeseen behaviours. Any AI developer who can safely use the current hack could easily put UnitCreated(); UnitFinished() in their AI.

One example of even the expected behaviour being borked, is that normally an OTA directed AI will assume the first unit its told of is a commander unit. This assumption does not hold in a savegame.

Re: Single Player Save Game Needed

Posted: 27 Aug 2009, 14:04
by hoijui
i cant see any.. description/plan.idea in your post, explaining how it should be.
it works well wiht current AIs (AAI, RAI, KAIK).

Also, in genreal it is better to have your AI more general, and work correctly no matter how it got to its units. All the current AIs seem ot do that well, which is good, and actually will make them sleeker... also this is a good concept in general, for software design.
short: there is no problem, an i wont fix anything.