View Full Version : Some concerns over a future project - saving games
legacy-Matt Webster
03-31-2003, 07:17 PM
I've been outlining the key features to a single-player mod and researching the limits and existing features of the Ut2003 engine. The goal is to produce a hybrid turn-based single player game.
The turn-based part will be tricky, but still do able. The AI will also
require a good deal of work, but again... do able without godly knowledge of programming or the inner workings of the engine. Pretty much everything I've thought of that I'd like to include should not be too difficult to implement, except saving and loading games. As most everyone knows, single-player games
require the ability to save more often then at the start or end of every level. Turn-based games, even moreso.
I was hoping that I could be given the honest opinion on where to
start in relation to getting a save/load system in place as seen in many other Unreal games, like Splinter Cell. I want to allow the player to be able to save games at any point in time, and that will save data such as inventory status (items in possesion, ammo, etc), progress flags (missions, quests, etc), as well as details of the environment (you broke down the door, destroyed the window, etc) and status of the enemy (enemy doesn't respawn,
corpses stay, etc).
The more I look at it, and what minimal information I can find it seems that there is almost no "irregular" file access built into the scripting side of UT2003.
I would appreciate any, and all information that you could provide me in determining the viability of such a system and if you know of anyone who has had progress in this area and might be able to offer some advice.
I know there's always the option of using Unreal 2, as it has features such as state saving and single-player AI... but I would prefer to be using UT2003 since I'm already familiar with the tools, file formats, and existing scripts. I don't own that game, so buying it (no offense to those who made it) would be
a last resort to produce this project using the newest Unreal engine.
legacy-Xeonicus
03-31-2003, 09:34 PM
If I were going to do it, I'd take a good look at how the 'GameProfile' class works and try extending your own single player game profile class from that. UT2003 uses it for its limited single player campaign, you can see how they use it if you look at the 'UT2SinglePlayerMain' interface class. It has built in functionality to store off the data for the gameinfo. The hard part you will run into, is, if you want to store the game status, mid-game, you will need to provide a ton of information in your custom gameprofile class, depending on what you really need to keep tabs on of course. You might need to save info for the current status of the game, the current map you are on, perhaps an actor list of some kind that will contain all of their current properties when you saved it. Lots of work :D
legacy-Matt Webster
03-31-2003, 10:44 PM
I've known about the way data is stored in the ini or user profile classes, and that it could be used to provide functional save and loading support between levels but the type of game I have in mind would require a more flexible system that would allow the user to save at any time.
Per-level saves can work with games that have short levels, or linear flow with checkpoints but I need something that stores most information from the state of the level.
In the few threads I've found on this topic, I've seen people state how Deus Ex did it (earlier build of Unreal engine, modified) was to save a copy of the level and related information. That explains why each save game was over 20 megabytes. I've checked out a more recent game, with support similar to what I'm looking for, Splinter Cell. Uses a more recent version of the engine, again being heavily modified. Each save is only about a meg and a half.
I also posted this on the Mod developer's mailing list, and got a quick response from Tim Sweeney of Epic:
"The old Unreal 1 savegame support is still there, but we haven't tested it in over a year, so it might be broken. See http://gosewehrryan.home.mindspring.com/projects/unreal/ for the console commands.
Note that the upcoming mod contest will be focused on UT2003, so it's certainly the place to be for these mods.
-Tim"
The console commands mentioned in that link were QuickSave and QuickLoad. I tested them, and Quicksave tries to save the game but runs into these errors:
Warning: Error deleting file '../Save\Save.tmp' (0x32)
Warning: Can't save ../Save\Save9.usa: Graph is linked to external private
object Package Package
Seems like the functions are still there, but I don't believe they process the files correctly to save them. Since I Can't get a game saved, I'm unsure if QuickLoad works.
I'll keep at it, and I hope that anyone who has some suggestions or information on possible avenues to implement saving/loading will post it here.
legacy-Xeonicus
03-31-2003, 11:42 PM
Yea, I saw the post from Tim Sweeney on the mailing list about this. It seems that quicksave is little more than a cover for sending the savegame 9 console command. It also seems that the savegame console command exists, but the loadgame <slot> console command from unreal 1 is no longer in existance, perhaps someone pulled this because it didn't work? I see they are using ClientTravel for quickload, but the saved URL doesn't work. Did you say the save file that is created is empty? Hmmm, all that stuff is done natively so I doubt there is a uscript work around.
legacy-Matt Webster
04-01-2003, 12:15 AM
When saved, it seems to create a temporary file (UT2003/Save/Save.tmp) that has no data in it. What's strange is, the log says that it can't delete that file which I Can't understand. Since the temp file is empty, it can't save to the .usa file (save game file) and thus it cannot load the saved game file.
I realize it's native, and it's really turning out to be a pain.
I simply cannot come up with a reasonable way to save the state of all data related to actors in the level. Inis are meant to save information relating to things with only one instance (like your performance in single-player) or things that have the same settings throughout (like changing a default value for a class).
It would not allow, at least as far I as understand it, to initialize the state of multiple objects of similar class (i.e, doors, enemies, items) to different values.
Since we don't have access to native code, I might have to abandon the idea of offering saves at different points in the level. Would definately limit the scope of the game, but I'd rather not cancel the project due to a rather serious shortcoming of the engine.
Hopefully I'm wrong, and there's a way around it.
legacy-Xeonicus
04-01-2003, 12:31 AM
Originally posted by Matt Webster
Hopefully I'm wrong, and there's a way around it.
Or Epic realizes the problem and does something to fix it in the next patch. Doubtful I know, but possible.
It would not allow, at least as far I as understand it, to initialize the state of multiple objects of similar class (i.e, doors, enemies, items) to different values.
If you did it right, you could do this with custom profiles. When the game initializes you could just run through an actor list you created in the profile, spawn each of those actors, set its properties to what you had saved in your profile whatnot.. We had a discussion about this in a thread a long time ago and it still seems pretty reasonable to me... I don't understand why it wouldn't work exactly like Unreal 1 saving with some time put into designing the gameprofile right. I am saying you could do this mid-game too, you wouldn't have to wait until the level is completed. Yea it would be a hack, but it would work.
legacy-Matt Webster
04-01-2003, 12:44 AM
I thought of that, but how could you get it to differentiate between one actor of the same class? From what I can see from the ini-writing abilities, it just sorts the variables by what package and class it goes to not by what instance of the class it is.
The only way I could think of around this is as hackish as could be. Create a subclass so that all instances of "saveable" objects are unique. The problem with this, is that you'd end up having to create a sub-class for every instance instead of being able to make use of the obvious benefit of a class-based system which is reusability.
Each level won't have a lot of enemies, as death will come quick. So while it won't be completely implausible to have a sub-class for each NPC character, it's definately very clunky and something I'll hold off on until I'm certain there is no alternative.
This also makes me wonder, is there a limit to how many classes can be loaded at once? In order for this to work, I'd need to have one sub-class for every non-player object which could add up to a lot.
legacy-Mychaeel
04-01-2003, 02:53 AM
You can use the PerObjectConfig class attribute to have it store information in .ini files on a per-object basis, not a per-class basis. See also Unreal Wiki: Class Syntax (http://wiki.beyondunreal.com/wiki/Class_Syntax) and Undocumented UnrealScript (http://mb.link-m.de/mirror/UndocumentedUC.htm).
You can use the optional "Name" parameter in the "new" function to give new spawned objects unique, descriptive names that are used for their respective .ini sections. See Unreal Wiki: Creating Actors and Objects (http://wiki.beyondunreal.com/wiki/Creating_Actors_And_Objects).
As mentioned before, there are also several functions related to loading and saving individual "data objects" from and to packages in the GameInfo class (CreateDataObject, LoadDataObject, SavePackage and more).
legacy-Matt Webster
04-01-2003, 04:50 AM
Great stuff. I took a look (as best I could) at the Splinter Cell save game files, and it seems they've done something similar. Dumping key values of objects that must persist between save states.
So I'll look into the stuff suggested tomarrow.
legacy-Jaxtrasi
06-09-2003, 09:09 PM
Did you get this working? I'm also trying to avoid working with Unreal 2 if possible...
Does the UT2003 compo imply that Epic will be trying to pull together more support for single player mods?
Mysterial
06-09-2003, 09:40 PM
Steve Polge did say on the mailing list at some point that they'd try to get the native save functions working at some future time but no word if that's the next patch, UT2004, or neither.
legacy-Jaxtrasi
06-09-2003, 09:42 PM
What is this mailing list? I've been trying to track it down all over the place, with no luck.
elmuerte
06-10-2003, 04:03 AM
Originally posted by Jaxtrasi
What is this mailing list? I've been trying to track it down all over the place, with no luck.
:eek:
I think you've been looking in the wrong location
legacy-Jaxtrasi
06-10-2003, 09:51 AM
I searched the Epic site, the UT2003 site, the UDN site, BeyondUnreal, PlanetUnreal, these forums, (the BU forums are down) and searched on Google. Nothing.
legacy-Angelus
06-10-2003, 01:28 PM
http://www.ataricommunity.com/forums/showthread.php?threadid=271978
elmuerte
06-10-2003, 02:05 PM
now that's a dead give away
legacy-Jaxtrasi
06-11-2003, 10:04 AM
Thank you ta.
legacy-luciano.bargman
06-11-2003, 05:54 PM
I searched the Epic site, the UT2003 site, the UDN site, BeyondUnreal, PlanetUnreal, these forums, (the BU forums are down) and searched on Google. Nothing.
doh!
legacy-Evil-Devil
10-16-2003, 04:01 AM
Well, i tried this damn quicksave/quickload also. In UT2K3 v2225 it doesn´t works. But in the U2Runtime it really works fine. I mention that it have something to be with the gametype or so. Unlike the U2Runtime Level isn´t multiplayer. Maybe thats all about it
Evil
legacy-Vito
10-17-2003, 08:17 AM
Save games are broken in UT2003 2225. They're actually broken in the stock engine, and we fixed them for the runtime; multiplayer or gametypes have nothing to do with it.
Epic has mentioned looking into fixing them in the future, but I don't know if that means they'll work in UT2004 or what. Sorry.
legacy-Spam Saviour
04-02-2004, 08:20 AM
Any more info about the save game functions in the UT2004 build?
legacy-Mr Evil
04-02-2004, 10:07 AM
I would like to know this too. Not that I need to use it myself, but so many people want to create single-player games and I want to be able to tell them that it is possible.
legacy-munky402
08-04-2004, 12:58 AM
ok first of all, i am in no way a techie. i'm an artist. now when i read this forum a while ago, i freaked, because my final project for my degree is a single player mod, and not having save games would seriously screw us over. so when i saw this on the lastest patch description, i rejoyced, but then i wanted to be sure that the whole thing works before i throw myself a party.
so my question: does this really mean the save games work now? and what's this about animations and ragdolls aren't serialized? does that mean that on loading the level ragdolls will no longer be active?
excerpt from fileplanet's description of the fixes in the patch:
- Save Games fixed, with the following limitations:
- ragdolls aren't serialized
- animations aren't serialized (but uses simanim to save channel 0)
- must run UT2004 with -makenames option, or set bSupportSaveGames true in LevelInfo
- added Actor events PreSaveGame() and PostLoadSavedGame()
- Render hud overlays[] on DM_Low clients also
legacy-Spam Saviour
08-04-2004, 03:56 AM
It may say it's fixed but only to a degree and I'm not even sure if it works with -mod.
Ragdolls are not saved. Any animations playing while saving and not saved mid-animation and upon loading anim0 is loaded.
One other aspect that I've noticed which doesn't save is emitters. There may be others but I gave up with it after that. :confused:
You can of course use other methods to save data out to a file.
AFAIK this is still the case, although I could be wrong.
legacy-JohnClay
09-21-2004, 05:43 AM
So.... has anyone gotten saving/loading to work (particularly in a mod)? A recent UT2004 patch mentioned two posts ago says that saving is fixed...
(It's just that I'm working on a single player game...)
legacy-Psyk
09-21-2004, 10:56 AM
Yep works fine. Needs a little ini tweaking for it to work. But apart from that you can even do it in plain old UT2k4 in an instant action game.
legacy-JohnClay
09-21-2004, 10:35 PM
Originally posted by Psyk
Yep works fine. Needs a little ini tweaking for it to work. But apart from that you can even do it in plain old UT2k4 in an instant action game.
Could you go into further detail about the ini tweaking? And I'm assuming this works with -mod where all of the mod's files are in their own directory. Thanks.
legacy-Psyk
09-22-2004, 03:25 AM
In the ini there is a line that reads savepath=../save or something like that. Basically it's the wrong slash:D Put in a backslash and it works nicely. Make sure you also run the game with the -makenames option.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.