Re: Access specific objects from a binary file
- From: Jeff Lait <torespondisfutile@xxxxxxxxxxx>
- Date: Wed, 30 Apr 2008 05:00:12 -0700 (PDT)
On Apr 30, 8:33 pm, "Jürgen Lerch" <jyn...@xxxxxx> wrote:
Saluton!
On Tue, 29 Apr 2008 22:52:06 -0700 (PDT), Jeff Lait wrote:
Saving maps to disk during play just seems like such an unnecessary
complication. You introduce tons of painful edge conditions: what if
you run out of hard disk space while saving? What if someone plays
from a read-only hard drive mount? Or has their home directory marked
read only? Or deletes one of the files while playing?
What do you do if you run out of RAM? (HD space is nowadays
at least as plenty as RAM.)
As mentioned, modern OSes have virtual memory so running out of RAM is
not an option. Admittedly, 32bit OSes tend to have annoying 1.6gb,
2gb, or 3gb limits. But, in all honesty, if you don't have hard upper
cap of 1gb of memory free you do have problems.
Diskspace is actually more troublesome than ram. For example, you may
be running from a USB stick, or other system. I also rather
frequently run out of diskspace, but that's due to my tendency to
create gigabytes-per-hour data sets. Roguelikes shouldn't be doing
that.
A failure to memory allocation will cause damage at random parts of
your program, likely entailing a crash. A failure due to disk space
during your save method is a constrained problem you can deal with. A
failure due to diskspace in your scattered map loading/saving is much
more troublesome. There is no "ignore and continue" option - you have
to successfully save the map or the game is corrupt. Failing to save
a game to a single file doesn't have to corrupt the active game, so
all you have to do is report the failure and let the user try again at
their leisure.
How does such someone save on exit?
How do you save on exit when maps are stored to disk? The problem is
the same - on exit you want your *current* level saved as well. If
your desire is to have checkpointing so you can recover from a crash,
I'd much sooner advocate checkpointing with an actual saved game
rather than trying to rebuild from the map data. This is conceptually
simpler to create, has only one code path, and removes any need to
make some special "recover" program.
And if a file gets deleted, well, you just create it anew.
Either you have it in ram, so recreating it straightforward, but,
likewise, there's no good reason to have it on disk. Or you recreate
it by regenerating it. In which case this becomes a trivial cheat to
destroy troublesome encounters.
--
Jeff Lait
(POWDER: http://www.zincland.com/powder)
.
- References:
- Access specific objects from a binary file
- From: Aaron J. M.
- Re: Access specific objects from a binary file
- From: Jeff Lait
- Re: Access specific objects from a binary file
- From: Pfhoenix
- Re: Access specific objects from a binary file
- From: Jeff Lait
- Re: Access specific objects from a binary file
- From: Jürgen Lerch
- Access specific objects from a binary file
- Prev by Date: Re: Access specific objects from a binary file
- Next by Date: Re: The '08 refactoring of Kaduria
- Previous by thread: Re: Access specific objects from a binary file
- Next by thread: New RL Development Blog
- Index(es):
Relevant Pages
|
Loading