I was talking to someone who used to make games professionally, and he suggested reserving disk space for save files, to minimize the probability that the player runs into a "Can't save because I'm out of disk space" problem later on.
I'm planning to write the Javascript code myself, but I'm looking for feedback on this idea. The most straightforward ways I can think of are either (1) including premade, not-playable saved games in the game download or (2) automatically creating save games upon first launch (e.g., when the Data Manager shows that no save file exists).
I'm modifying the save and load screens, so the player won't be able to load these premade saved games and they can be overwritten later on.
Any comments as to what might be best? Other suggestions are welcome too.
Background info: I know the save files aren't very big in the grand scheme of things and I am going to limit the number of save files to about 20 or so but the target audience for my game may include people who don't usually play games. The plan is that this game will be played over several months (different parts of it will be unlocked over time), which is why there is the small concern that people may fill up their hard drives over time.
OK. In all honesty, you're the first person that I've ever seen to worry about something as little as 40 KB of space.
I'm not sure who you plan your gaming audience to be, but even Windows require at least 2% of HDD for smooth running. So I would say, as long as your gaming audience can use computer at least on user level, I wouldn't worry about that... Because while it is very easy to fill even a 1 TB HDD, it's still very improbable to fill it so much that you won't find 40 KB of free space.
Going on with what Poryg said, if the hard drive is unable to find something with that little space, then the user will have gotten several other messages from other programs saying that something is wrong. Web browsers, which are probably some of the most common tools used on a computer, make extensive use of temporary files, many of which will be over that limit either by themselves, or combined with others.
Windows itself will also definitely not have a good time. It needs temporary files as well. To a degree it will probably try to scale back it's use of temporary files, maybe delete some that are older, but ultimately, if the user doesn't have much storage, then there are so many things that will be failing before they're able to run your game.
Preallocating disk space makes sense for very large files, like when you download a game on Steam, they're often multiple gigabytes. Even a game like terraria, which is under 200MB, will preallocate space because that's just what steam does. But terraria is, as I recall, 183MB. That's 191,889,408 bytes (I'm using the standard Windows measurement of 1024 bytes in a KB, etc). Assuming your save file is 50KB, that's 51,200 bytes. That makes terraria 3,747.84 times the size of your save file. If you want the 20 save files, it's still 187 times bigger than that, and that's just the game and install files which may be compressed, it doesn't account for any save or otherwise generated files.
Realistically, with a game like this where save files are megabytes or gigabytes long, there's really not a benefit to preallocating the space. If you needed a few gigabytes for your save files, I could see this being an argument because that has potential to be a problem. But with 20 save files at 50KB each, you haven't even technically reached a MB yet (again, assuming we're using steps of 1024).
tl;dr Preallocating save files for a game this small really doesn't make much sense. They'd need to be about a thousand times larger before it starts becoming more plausibly an issue.
Frankly, even in past I had to keep some free space. Sure, win 98 didn't need too much and neither did win 2000, but I had to keep free space. At least 700 MB for correct work. Once I managed to destabilize my system just by not having enough space and two times my ram got crazy from overfilling, so crazy that I lost all my rights, including the right to turn off my computer 😀 I literally could not turn off my computer, because I was lacking the rights according to the system. The only thing that worked was signing off 😀
But yeah, I was always able to find a gig or two of free space when I needed it. With 30 and 20 GB hdds. Let alone a free MB.
Btw. Windows 7 and newer have plenty of functions that constantly use HDD, among my least favorite ones being Superfetch.
Ok thanks for the feedback! I'm just nervous about when I release the game and people have problems that I would never have thought of, but it seems like it's more trouble than it's worth. My friend is an old school developer who tends to prepare for stuff like this, which is why he suggested it.
Let's pretend you are making a game for Windows 3.1 DOS and your game is going to have 1MB total worth of saves (very inefficient for that time period, but theoretical). Google showed me an example computer with 3.1 DOS on it to have a storage capacity of 48MB total on the hard drive. That is about 2% of the drive space on top of whatever the actual game's install size is so pre allocating space made sense then. Now we have hundreds of gigs in storage capacity so perhaps a cheap laptop someone has today maybe has 128GB of storage space total. Now we are only talking not even a 10,000th of a single % of the total hard drive capacity. Sure you have the game install size ontop of that, but something this incredibly small we can just ignore it as it just has no real effect in the grand scheme of things. Others have said before that many other things would stop working first before this became an issue.
If we were designing mission critical software where failure to properly write data to the hard drive would cost billions of dollars in loss or maybe someone's life even if that failure rate was 10,000th of a single %, then handling such a fringe case would be worthwhile. For a game however where the worst possible consequence is they just can't fit a save file and this is such an extremely low probability of even happening, it is generally not worth it.
This isn't to say to not think about fringe cases with your game and player base, but prioritize where you spend time, effort, and perhaps dollars on issues that have big impacts or serious consequences.