Shadowrun: in defense of save points (a technical view)

October 17th, 2013, 02:27

The talk about the save games in Shadowrun makes me pause now that I see what is involved technically in developing save games thanks to my own game. the techniques you can break down in three systems, two of them are related.

When I first began my development on Android I was hoping there was something in the system that just took a snapshot of its states and every value in memory and could save the "image". It would be a pig but it would make save games simple and automatic. There isn't.

What Shadowrun does is create save states and this is how I think it (and a lot of other console RPG's) do it:

with each are object having a 3 or four dimensional area variable to indicate where they are in the rooms (x, y, d or x, y, z, d)

Player Object
—-
Attributes
Inventory stack
State Variable

Using the state variable, you can indicate where the Player should be at any time and simply load the player into it. It should be obvious to anyone, you only have to save the values of the player in the save file. The state variable will take care of where it should be (ie - the Starting Point in each area) and you simply load the predefined room into it.

In order to have a "save anywhere" system there's two ways I can think of doing it

first is save everything

Player Object
—-
Attributes
Inventory stack

Area 1
Objects Stack

Area 2
Objects Stack

Area 3
Objects Stack

in order to do that you have to loop through everything and every object in each area. An NPC object for example would have a variable concerning their current opinion of the player. I mean, what if the player shot some random player in the room? You have to account for that in the save if you want to make it continue like you left off.

Each and every object and variable needs to be recorded in each and every object in the game (that the player can return to, assuming the game is not linear) and then be reversed back out from storage to make it seem like its continuing from where the player left off.

As you can see this can get pretty large. You can reduce some of it by only saving the areas Player has been to, make the game linear so you only have to save one area at a time, or make it hybrid-linear by dividing the game into chapters and closing certains areas to Player behind the,.

the upper end would be the same size but it does have the advantage of only saving the changes and therefore being smaller. Basically you would load the Predefined Areas everytime then load the changes behind them.

That sounds ideal but its more complicated algorithmically as, first, everything would need a state variable to say if they've changed or not and on each object that could add up as drilling down further and further. Doing it this way also makes it more susceptible to breaking. So what you make up for in cost of size you lose in cost of performance, and more importantly, complexity.

—

So you can see why its tempting to do it the first way. On a game as complex as Shadowrun with only a budget of two million, how much simpler was it to do it this way, compared to the constant need for QA the other ways.

Really it's pretty easy to save object states using serialisation or some other such technique. And if you don't have the time/skills to write the code yourself there are plenty of libraries available to do it for you. There many games costing far less than $2m that perform this simple task without difficulty.

I don't see it as a cost effective measure at all, having periodic saves vs saves whenever the player wishes. To me, it's simply plain laziness. I'm not going to load and reload 20 times to achieve a perfect result, but if my phone rings, or if my wife needs me, I want to be able to save right then, and lose no progress. If you take that from me, you most likely won't get my money.

Originally Posted by Roq
Really it's pretty easy to save object states using serialisation or some other such technique. And if you don't have the time/skills to write the code yourself there are plenty of libraries available to do it for you. There many games costing far less than $2m that perform this simple task without difficulty.

Do you have a link for something in C++, Java or Python? If its "pretty easy", why do ou think they didn't do this?

Originally Posted by joxer
AKA phonegame.
AKA I'm not paying for that.

actually, my game plays better on tablets (although playing with your thumb on a smaller screen is quite enjoyable).

Originally Posted by Carnifex
I don't see it as a cost effective measure at all, having periodic saves vs saves whenever the player wishes. To me, it's simply plain laziness. I'm not going to load and reload 20 times to achieve a perfect result, but if my phone rings, or if my wife needs me, I want to be able to save right then, and lose no progress. If you take that from me, you most likely won't get my money.

"cost" in development terms doesn't mean money, it refers to the costs on the process itself. For example, the costs in running a for loop means repetitive work over and over until its finished. On a recursion the process is done once, but you have to load it all in memory first. What it makes up in processing cost, it loses in memory cost.

but you're talking about a user perspective, I'm just pointing out the other side.

I mentioned that among endless crap I've tried and couldn't believe ppl are actually enjoying, in the end I've found two real games:
1. Sacred Odyssey
2. Chaos Rings 2

Those two are not cheap like other phonegames. Then again, you won't feel conned after buying and playing them.
Should I stop spitting on phonegames then? No. Two jewels among a huge pile of junk means only one thing. Phonegames and phonegaming, currently, is a pure and genuine fraud. It's worse than horse armor. It's even worse than Cryptic/PerfectWorld STO boxes scandal.

Lucky, just please make a PC game with a quality save system as most of us have a huge HDD so your saves can hold just about anything, even player's DNA if you want.

I agree with the points made and I found Shadowrun's system annoying but not in a showstopping way. As a developer I probably have too much sympathy for the devs. But from a user's perspective we expect you do it right and give us all of it.

While serialization/deserialization is a solved problem, it can be very tricky to deal with and early decisions impact things greatly later especially after release. The more tricks involved; the more room for error and therefore the more room for bugs. I would say versioning is among the first problems from a development standpoint that should be solved and can be a huge tax on the developers (and by extension the users) when done poorly. If you release a patch which makes different assumptions in anyway from the base app then the number of issues that can arise grows.

When you serialize the object graph, you need to make sure it was done in a way that can handle references to other objects and when deserializing do so in the "correct" order and that you have appropriate hooks for when you need to hack it later to fix versioning issues. If the games supports mods like Skyrim or Shadowrun what happens when mods are added and removed and things in the save are no longer valid. The more of these references that exist the more likely a bug will creep in.

If you can just save the minimum state to recreate what is needed then many of these concerns just go away though usually never completely. I'm not really worried about the object enumeration effect at runtime as Lucky is but there is no doubt saves will be slower for it. That can be solved in overly cleaver ways.

One company I worked for had a binary save format that loaded straight into memory and had minimum fixup required and was blazing fast but god forbid anything change or it would break in a heartbeat. As a result we had 2 save file formats, one for day-to-day work and one for compatibility between patchs/upgrades which usually meant double the work or more for the developers in ensuring both worked reliably.

Anyway, main point is that it is usually not an issue if the system is well designed but I don't think most I've seen are all that well designed. If it was easy then everyone would use the same system but my experience is no 2 developers do it the same way. Anyway I thought the Infinity Engine was well done and Bethesda's was ok. Jagged Alliance 2 (source publically available) was scary and what I find to be more typical. Anyone remember Fallout 2 where the saves were not compatible across the first patch (or at least that was what I remember).

Well, if it was from a technical point of view they did it, they're not that good developers.

I thought it was to add some challenge to the game. If you can save anywhere, almost any game becomes very easy, and IMHO often boring. There is no risk in any decision, as you can just load back, losing a battle is no issue as you can just load back before it, save anywhere sucks.

I guess PC people have a hard time to understand this. However there are better ways to achieve this as dark souls have proved….

That's supposed to be welcoming to inexperienced developers, and you can't assume they're very good at what they do.

Personally, I found the design simplistic and unsatisfying. The ultra-linear approach with savepoints was extremely off-putting. But it seems the nice visuals and text-based story delivery was enough for most people to consider it a good to great game.

DArtagnan

Originally Posted by Lucky Day
Do you have a link for something in C++, Java or Python? If its "pretty easy", why do ou think they didn't do this?

Haven't done much C++ coding recently, the last serialisation library I actually used was that in MFC (Microsoft Foundation classes). I think there are more complete libraries available now such as Boost, which you should be able to find with a simple Google search.

As to why they didn't do it. Obviously it's a feature that does require some implementation effort and it requires strict version control and coordination between developers - you can't just hack the code together and expect it to keep working. In any case it shouldn't be that hard to make an ad hoc saving system for a game as simplistic as SR, by just recording the variables that need to be saved somewhere. That's what a lot of Indie games likely do, I would have thought.

That's supposed to be welcoming to inexperienced developers, and you can't assume they're very good at what they do.

Personally, I found the design simplistic and unsatisfying. The ultra-linear approach with savepoints was extremely off-putting. But it seems the nice visuals and text-based story delivery was enough for most people to consider it a good to great game.

I don't really get that - but to each his own.

to me, "open world" is actually a turn off. I like linearity in my RPGs, I prefer to follow a story instead of "you're there, do what you want", though both are perfectly valid RPG designs.

Originally Posted by wolfing
to me, "open world" is actually a turn off. I like linearity in my RPGs, I prefer to follow a story instead of "you're there, do what you want", though both are perfectly valid RPG designs.

Sure, and I can appreciate linearity as well.

But I think there's a balance to find in most games, and there's one thing I really don't like in RPGs and that's not being able to backtrack at all.

DArtagnan

ok, it looks like I'm already doing serialization, but I just didn't know the name of it. It looks like it can be made fairly robust too - mine looks like top down design compared to Object Oriented for what it could be. Still researching, but is it just me or does it remind anyone else of Ant where you write test procedures. Methinks it could be done by adding hooks and a procedure or a class and collect the changes for later use. (serialization my guess is engineering speak for converting all your data into streams).

So some of you folks think this was a deliberate Harebrained design decision? The code is more hackable on the fly without the fear of breaking. I can't argue with that but I still don't think serializing it is easy - its just way easier to do it terms of save points. Is that lazy?

Oh, and Joxer, I would have loved to do a game for PC but I'm just one guy. Where could I sell it, who is going to buy it and does it help me learn something I could get a job with? It was job interviews that pushed me to do Android - Intel came out of the blue and asked what I knew about it even that it had nothing to do with the job description.

But I agree that most of the stuff out there is ripoff garbage - especially the free ones as Jay pointed out. Its why I'm writing it the way I'm writing it - no tracking, no ads, and no microtransactions.