In level saving?

Request patches for Keens 1-3.
Post Reply
Stealthy71088
Posts: 583
Joined: Thu Mar 17, 2005 11:54 pm
Location: NY

In level saving?

Post by Stealthy71088 »

I know there has been a great deal of discussion of in level saving for keen 1-3. Did anyone ever figure out a way to do it?
Stealthy71088
Posts: 583
Joined: Thu Mar 17, 2005 11:54 pm
Location: NY

Post by Stealthy71088 »

Unless the save doesn't store the level number (which is possible), I would have thought that the game could simply be patched to skip the check for being on the map level, thus creating in level saving. If the level number wasn't stored, obviously this would be a little more complicated, as you would have to add a hex value to the save file. Maybe at some null address, or at the end?
User avatar
Malvineous
Posts: 113
Joined: Sat Mar 13, 2004 12:54 am
Location: Brisbane, Australia
Contact:

Post by Malvineous »

I think there would be a lot more involved than that. The world map only has a tiny amount of 'state' to remember - apart from the score, ammo and number of lives, only the player location and which levels have been completed are necessary.

If you were to extend this into in-level saving, you'd have a whole bunch more state that needs to be saved - where enemies are in the level and which ones have been killed, which items have been collected, if switches are on or off, whether that chain that squashes the Vorticon Commander in that one level in Keen 1 has been shot or not, etc. Storing the current state of the Mangling Machine would be a big headache too.

Then you also have to restore all that correctly at the other end. It'd be doable if the in-game memory layout is well known, but nonetheless quite complex.
Stealthy71088
Posts: 583
Joined: Thu Mar 17, 2005 11:54 pm
Location: NY

Post by Stealthy71088 »

So I was thinking about it for awhile, and I came up with a possibility. It's far too late for any of my mods, but I'll post it in case someone wants to use it some day. If you would like to use checkpoints, all you really have to do is apply the in level teleportation patch and the hold onto keycards after death patch. Finally, you need a tile that takes away keycards.

If you have all of this, then all you have to do is:

1. Set up teleporters at the very beginning of the level that go to different parts.

2. hide these teleporters behind 4 differently colored doors.

3. put the keys on the other end of the teleporters. Make sure the teleports are one way.

4. put a tile that removes all of the keycards right before the end of the level.

5. make sure that the levels are played linearly. Players can't choose to play a different level instead of the one you want them to play.

Ta da, you now have working in level teleporters. You can have one for every key card you use. So if you want to use 4 teleporters, you have to use 4 keycards. If you want to use just one teleporter, then you only need to use one keycard, leaving the other three free.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

What Keen does when saving is a memory dump, a large section of memory is simply copied to an external file. In theory, though I'd need to check with Lemm, it would be possible to save a larger chunk of memory to file and load it, allowing saving of the level state.
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

Post by lemm »

This is way too complicated.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Really? Why is that?
User avatar
Fleexy
Site Admin
Posts: 490
Joined: Fri Dec 12, 2008 1:33 am
Location: Bloogton Tower

Post by Fleexy »

Where is the saving/loading code in the dump? If I can find a few important addresses I might be able to make a crude in-level saving function.
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

Post by lemm »

As Malv said, there's a whole lot of memory in the game state that must be saved, including all of the map, the sprites, keen's stats, and probably a bunch of other variables that are scattered all over the place.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Right, so what you're saying is the variables that need to be saved aren't in one big chunk, you'd have to get data from various places, save it and then to load, split the saved game file up again. This makes more sense.
EricMushroomWilson
Posts: 78
Joined: Mon Dec 18, 2006 9:52 pm
Location: Limbo

Post by EricMushroomWilson »

This is one of those patches that has been saught after for a long time, and may be possible, but not that feasible or practical. Then again, there are plenty of patches now that I wouldn't have dreamed possible, so who knows? It'd definitely take some doing.

Edit: I do know that in Jill of the Jungle, which has in-level saving, a save file essentially IS a level file. You can do things like go into a level file and edit Jill's inventory to fill it with extra jumping powers and the like if I remember correctly. Or use a hex editor to make an entire level in a save file and load it...

I'm not sure if that's how the in-level saves in Keen: Galaxy/Aliens work. Making the save file a level file would presumably work for Vorticons, if it could be implemented properly by someone with the required Assembly knowledge and if there could be space found or made for the code in the EXE file. Saving the every single tile in the level including the ones that cannot change would waste an amount of disk space that might have been somewhat considerable back then, but would be negligible now. Keen: Vorticons was released at a time when in-level saving was uncommon, I think, and disk space (possibly also RAM usage?) was probably part of the reason for that.
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

Post by lemm »

As far as I know, a Galaxy save file incorporates a carmack compressed level, the list of sprites, and some other variables. But even the Keen Galaxy save mechanism isn't perfect, as is evidenced by all the savegame hacks.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

What save game hacks are these?
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

Post by lemm »

Dying, then saving, reloading and beating the level.

Or saving offscreen, reloading and gaining vision of invisible areas.
Post Reply