Log in

View Full Version : Blank savegames



foxtacles
06-21-2012, 07:55 PM
The goal is to remove savegames from vaultmp; that is, vaultmp will invisibly provide "blank" savegames, which should contain as little as possible (no?) change records.

Story need to be skipped, so a "new game" savegame is not an option.

Volumed
06-21-2012, 09:20 PM
Can it not become server sided what the original idea is.

foxtacles
06-21-2012, 09:59 PM
It is completely server-sided. I just need empty savegames, because the game needs to load one.

Queue
06-22-2012, 03:00 AM
Ok, in theory I could strip it down maybe 2 more bytes, but it's pretty darn minimal now. I've only tested it in New Vegas, but it's based on a Fallout 3 save file, so I'm hoping it will work for Fallout 3 as well. There was a small section of the file that I couldn't figure out what it did, and just trial-and-errored a 32-bit value in until the game successfully loaded; since this was done in New Vegas, there's the chance the value that worked won't work for Fallout 3. If this save doesn't work for Fallout 3, let me know and I'll see about installing Fallout 3 again to test (I own Fallout 3, I just don't have it installed and didn't intend to ever play it again).

https://lh.rs/wXgCU0eum8kv

Also, since the save is brutally stripped down (it's only 196 bytes), I can't promise no side effects, but the testing I did in New Vegas had it working without problems.

Edit - Might also be a good idea to set the file's modified date to back in time to like 1 AM Jan 1 2008 so it sorts to the bottom of a player's load order. Or alternatively, if you can give the file an extension besides .fos so that it won't be in the load menu in-game but where VaultMP could still force the game to use it. Having a dummy save file in our load menu looks kinda tacky.

Edit 2 - I updated the wikia at https://falloutmods.wikia.com/wiki/FOS_file_format with some of the format specs I worked out, at least up through the stats structure (which the minimal save I linked above doesn't even have). The data after the stats structure I didn't describe at that wikia because I'm not clear on the specifics well enough for it to be worthwhile, but it's related to the player's orientation (get/setangle x y z) and maybe position as well.

Queue

foxtacles
06-22-2012, 06:06 PM
196 bytes...great (tested with New Vegas, works)! The engine function I use takes the filename without extension, so I won't be able to hide the savegame from the list. A practical solution would be to pack that bunch of bytes with the main executable, and unpack / delete it on demand :)

Thanks a lot!

EDIT:

I tried without Fallout 3, loads without problems; but some stats are messed up. They are set pseudo-randomly, like here:
114
Do you know how to fix? The stats are listed on the wiki page, I'll try a couple of things myself.

(in New Vegas, all stats are properly set to 0)

Queue
06-22-2012, 08:29 PM
I guess Fallout 3 doesn't handle the missing stats structure as well as New Vegas. The garbage values are probably from a buffer overflow. Here are 2 more save files with the stats structure added back in; one only has 1 stat, while the other has the full 26 that Fallout 3 uses. The one with all 26 is obviously a little bigger, so ideally if the one with 1 works for Fallout 3, use it instead, but if Fallout 3 can't cope without the full 26, then so be it.

https://lh.rs/mG8HAslRBjf1

Queue

foxtacles
06-22-2012, 08:43 PM
Thanks. I tried both savegames, but Fallout 3 still reads garbage from somewhere ;)

I'll try to track down the problem. Is there any offset which might cause the problem?

Queue
06-22-2012, 09:04 PM
Oh, weird.

In the 3 saves I've uploaded, offset 0xB2 defines the size of the stats structure. This isn't always at 0xB2 since the preceding data can vary in size.

Everything from 0x40 to 0x60 I didn't understand well, and might have been formIDs of some sort (which I mostly zeroed out). Of note, 0x40 (4 bytes) was the result of trial-and-error; 0x0000000E might be a bad value for Fallout 3 but worked ok for New Vegas.

Everything from 0x60 to 0xB0 was all zeroed out to begin with so it shouldn't be anything there.

I didn't analyze the save file beyond the entry that holds player location / orientation so don't know if it's a missing chunk of data that would be later in the save file (that I'd omitted).

Queue

Queue
06-22-2012, 10:56 PM
Try this:
https://lh.rs/SntM2psq0H5m

I booted up one of my old computers that still had Fallout 3 installed (whew, saved me having to reinstall and patch) and toyed around a little. A small change to the stats structure got it working with all 0 stats. There's a small anomaly if you load the save via the game's load menu where it shows your current level progress incorrectly during the loading screen, but this seems to have no impact once the save is loaded and since we don't see a loading screen using VaultMP, I don't think it's actually a problem.

For me at least, this save works for both Fallout 3 and New Vegas, all stats are 0, player is level 1 with 0 of 200 experience, all SPECIAL are at 5, all skills are at 15.

Edit - It's worth noting that I only tried loading it via the two games' load menus, not via VaultMP. Since the first stripped save file I uploaded I did test via VaultMP for New Vegas did work, I expect this one will as well since nothing substantial changed.

Queue

foxtacles
06-23-2012, 12:43 PM
Awesome - works! :)

Queue
06-23-2012, 10:55 PM
A thought crossed my mind; if you can use the CenterOnCell command (it's a console command, not sure if it's accessible via script), you likely wouldn't need a save at all. In New Vegas, at the title screen if you open the console and type:
CenterOnCell Goodsprings
(or COC Goodsprings)
it drops you off at basically the same spot that a blank save does and doesn't require a save file.

Queue

foxtacles
06-24-2012, 08:36 PM
Nice idea! I'm able to run console commands (with a small hack I developed), I have to try that.

foxtacles
06-26-2012, 04:24 PM
Implemented the function for loading a cell, works nicely:

https://github.com/Foxtacles/vaultmp/commit/d8e76461661f40a8d661cefb1c78743f698c89ce

foxtacles
07-17-2012, 03:07 PM
The switch from savegames to cells is done. In future versions of vaultmp (>= gary 2) you won't have to mess with savegames anymore. Instead, specify a spawn cell (further customizable per player via scripts):

https://github.com/Foxtacles/vaultmp/blob/cell_load/source/vaultserver/vaultserver.ini#L10
(this works for exteriors as well as interiors)

Queue: sadly we still have to use a savegame :( When the player dies, you can't resurrect the player without loading a savegame (the resurrect script command is the most buggy function I've ever seen). This will be your blank savegame. Maybe we can find some better way (instead of loading savegame, then loading spawn cell)

Queue
07-17-2012, 07:15 PM
I made a mod for New Vegas some time ago that disables player death; upon death the player would respawn without having to load. The simple explanation is the player was set as ''essential'' which meant he couldn't be dismembered and he went unconscious upon death. It wasn't actually that simple though; certain types of death would put the game into a slow-motion death camera that you could never get out of (such as falling to your death or burning to death). The work-around was to disable any types of damage that would cause the slow-motion death camera and emulate that damage via script; it was very hacky.

My mod, for New Vegas:
https://localhostr.com/download/TdS9kIz/Surrogate%20Save%20System%20-%20Beta%207.zip

My point is, it's possible.

As I see it:
The current system of ''load then teleport'' would also require we re-synchronize the player's stats, items and game world after each respawn. The code to sync the player will need to be developed for when a player first connects to a server anyway, so although this is clunky, it should probably be acceptable as the short-term solution.

Later, if we can figure out how to disable the slow-motion death camera and some death loops that also occur when trying to disable player death, we could switch to an essential-flagged player so that a load won't be necessary. This would probably require patches to the game memory in multiple locations, so would likely take a lot of work. We probably shouldn't just use the work-arounds from my mod as they're not fool-proof nor elegant (things like changing all ''spell damage'' such as from fire attacks into a tracked number that's then applied as damage by a script is very messy).

Queue

foxtacles
07-17-2012, 07:32 PM
That's interesting, however I'd prefer a solution which actually keeps the death (possibly without the slowmotion camera). Currently, respawn is disabled (the game won't reload until the server tells so, see SetPlayerRespawn). I actually like that a player's body can be looted for a period of time.

The problem I see is that the game is totally not designed for re-entering the game after the death sequence has been initialized, so it's probably very difficult (?) to reset state.

Code to reload settings and game environment is there and works to some extent:
https://github.com/Foxtacles/vaultmp/blob/master/source/Game.cpp#L1243

Still, a solution without reload would be superb.