I was just wondering if anyone has any ideas on the best way to achieve this in a game.
Basically,
I want the player to be able to save their game, so they can come back and continue it later. However, if they die, I don't want them to be able to just load up the saved game again like nothing happened - death should be permanent.
The obvious solution would be to just delete the saved game file when the player dies, but then what's to stop the player looking in the game folder and creating copies of the saved game before they die?
OldManClayton: Sorry, could you elaborate on those please - I don't really understand. How could you store the info "in the game" without losing it when the player quits?
Simon Kubisch: It won't be an online game, so the server idea isn't really an option. I think a lot of people don't like games leaving random files all over their harddrives without their consent.
I've played games that do it very effectively, so they can tell if the file you're loading is a copy and not the original. "Critical Mass" for example - I was devestated after working my way up to Admiral, only to be killed by a fluke hit to my ejector pod...
Is there some way to read the "time & date modified" or "time & date created" of a file in mmf2? Maybe then I could store the date in the file somewhere and check they match? Or can you edit the "date modified" easily from windows? That would make it useless.
I've played with the concept of permadeath, but then I realized its a pain in the ass for the player. What if there's a bug in your game that causes the player to die instantly for no reason? You're basically saying, "Screw you, restart your game from scratch," for something that's entirely YOUR fault. Punishing the player for something they didn't do is bad game design.
Don't want people to save/load to "cheat" your game? Don't cheat them out of your game with permadeath. Instead, consider options like designated save points that are few in number, like at the beginning of a level in a platformer or only in the hotels of large cities in RPGs.
How about having a setting in the save game file that when set at, for example 0, nothing happens. However, when a player dies the setting is changed to 1 automatically saves progress. From then on whenever that save game file is opened the setting switched to 1 will automatically send the player to a game-over screen?
Let's assume you have a .INI file with all the saved data.
For example :
[Save01]
Level=3
Lives=5
Points=1200
Then if you want permadeath, you can do something like this :
+ Number of lives of "player1" reach 0
° Set ("File.INI", "Save01", "Level") to 0
° Set ("File.INI", "Save01", "Lives") to 0
° Set ("File.INI", "Save01", "Points") to 0
This way you have erased all the data in your INI file.
If you need more specific help for your situation, just ask
All that I see is the years...
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
15th October, 2008 at 12:01:54 -
If you want to get really pedantic about it you could use the binary extension to slap the MD5 of the savefile onto the end of your exe. Then when you start the game check the MD5 of the save file against the one stored at the end of your exe. Most people wouldn't guess to copy and backup both the exe and the save file.
But I don't really like the idea of permadeath in the first place
ok, thanks a lot everybody - I should be able to come up with something using one or more of those ideas.
I agree that permadeath isn't good in most cases, but sometimes it is appropriate. Generally, if the game doesn't have a specific long-term goal (and especially if there are a never-ending supply of randomly generated levels), or if the goal is deliberately so hard to achieve that most players won't be able to, then permadeath is a good idea. Imagine if you could keep loading saved games in Tetris - it would go on forever; however, it would still be nice to be able to save your game, because let's face it - tetris does get quite tedious after a while. Permadeath is also one of the defining features of a "rogue-like".
Adam Phant: I'm certainly hoping that there won't be any bugs resulting in "unfair" death, so I'm not concerned about that. I don't think it's cheating the player.
Permadeath in the old Apple II game Deathlord was really brutal but maybe you could do the same type of thing. As soon as one of your guys (or THE guy) dies, make the game save instantly. You could also alter one or two variables to that same save file so that if the person tried to re-load the thing it'd detect the guy had already died and refuse to load the information. You could also do funny things like make the player's max HP equal to 0 when the die.
I don't know, but it shouldn't be too hard.
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!
I think you might be missing the point a bit. The player could still just open up the game folder in the windows explorer, find the saved game file, and make a copy of it every now and then before they die. Then, if they do die, they just overwrite the existing file with their copy.
What I need, is a way to check the save game file is an original and not a copy.
It wouldn't be cheating the player to accidentally screw them out of their savefile? That would be like Blizzard saying, "Sorry, but due to an unforeseen bug where all of your characters randomly get deleted. Rest assured, we didn't plan for this to occur so we won't be able to restore your account."
I hope there is a bug in your game resulting in unfair death, just so I can say, "I told you so." I'd even say I hope it occurs someplace where it'd be most problematic, such as right after you start the game or load a previous (legitimate) save.
I love permadeath games. The important point is to make sure that either the world is randomly generated or that players are competing with other players (so permadeath keeps them from becoming too strong).
I don't think you should bother with checking that there is a copy. Just let them cheat by copying the save file. You know that you've gone wrong if over half the players are cheating. Most games do that.
Just save into a file, and when the character dies, delete the file. Don't delete it after loading, just when dying. If the player expects to die, he will crash/quit the game, and that will be annoying enough to be an anti-cheating deterrent.
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
I say if somebody goes through all the trouble to cheat on your game, then let them. If they can't play it fairly they will either try to cheat or not play it at all... I rather them have fun cheating then not playing at all...but like you said, you have a few good ideas that should let you make something.
Hello guys! I'm New! -- I've been new for a year now...haha
Well, a cheater will always find his way to cheat, regardless of how much effort you put on your anti-cheat devices
I agree with these guys : If someone tries to find a way to avoid permadeath just because they want to go on with your game, then be happy 'cause it means that you created an interesting game.
Hmmm. Maybe.
I'm still going to try because it's frustrating me that I can't.
Anyway, I've come across a strange "feature" in windows (xp). Here's an example;
I create a file called "save.ini" at 3pm.
An hour later, I create a copy of it called "copy of save.ini".
At this point everything is fine - if I look in the properties tabs, it says "save.ini" was created at 3pm, and "copy of save.ini" was created at 4pm.
I delete "save.ini". It still says "copy of save.ini" was created at 4pm.
I rename "copy of save.ini" to "save.ini". Now all of a sudden it thinks this file was created at 3pm! How (and why) is it doing this?
I think it has to do with the way file deletion is handled. Redo your test, only after deleting the original save.ini, download some random image using Google Image Search. Rename the copy afterwards and see the result. If I'm right, then the renamed copy should stay at 4PM.
You're right - doing other stuff in between keeps the right dates. It suggests you can't prevent cheating if you use external save files though. The only difference between a copy and the original is the date they were created, and it's easy to get around that, so I guess I need a new method
I though of that, but isn't it meant to be quite dangerous? I don't really want to mess up my own computer, let alone any one else's. It's probably the most sensible option, but I'm not trying it til I'm confident I know what I'm doing first.
I don't see how a password-protected zip would help. You could still copy it, even if you can't open it.
Originally Posted by Sketchy I though of that, but isn't it meant to be quite dangerous? I don't really want to mess up my own computer, let alone any one else's. It's probably the most sensible option, but I'm not trying it til I'm confident I know what I'm doing first.
I don't see how a password-protected zip would help. You could still copy it, even if you can't open it.
Yeah, don't mess with the registry because that will for sure deter lots of people from even trying your game out. Don't worry too much about cheaters I guess. They're always going to find a way around your blocks. I think most people who cheat at video and computer games end up finding out that all it eventually does is ruin the fun anyhow. More people will likely play your game legitimately for that reason alone.
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!