G
Guest
Guest
Archived from groups: rec.games.roguelike.development (More info?)
Hello.
I am slowly making something that might become a roguelike / rpg at some
point in time. I'm using an OO structure. I've got the map, movement and
FOV ...ok.
Handeling the Monsters (and player) in the dungeon is done by setting a
flag (IS_OCCUPIED) on the Tile at it's position, then storing the
Monsters hashed on position. Any interaction on the Tile checks the
flag, and if it is set, the game gets it from the table. Quick and easy.
Features, on the other hand... They are usually immoveable (door,
stairs, traps) and often blocking movement and/or LOS. It would be
easier for the Tile to check if it allows entering by a Monster if it
(the Tile) had a pointer to the feature. Will it be too expensive
(memory-wise) in this day and age to keep a pointer instead of a flag?
Probably yes, for larger maps.
Items. These would be nice not to keep a position on (I mean, if they
are carried or within a container - a position would be redundant), but
that would mean that each Tile needed an Item container. Which even I
would see was a waste of space. Dang. Position for Items, and flags on
the Tile, here I come. Probably flag for Features also.
Incredible how much I realize as I type it out. I'll post this anyway.
And also: If I make a *big* boulder, - that can be pushed by magic or a
great feat of strenght (or strenght of feet), but not picked up. Should
it then be a moveable Feature, or an unliftable Item. Think Indiana
Jones size boulder.
Thanks for the insight I've gained by reading rgrd and by writing this.
tormodh.
Hello.
I am slowly making something that might become a roguelike / rpg at some
point in time. I'm using an OO structure. I've got the map, movement and
FOV ...ok.
Handeling the Monsters (and player) in the dungeon is done by setting a
flag (IS_OCCUPIED) on the Tile at it's position, then storing the
Monsters hashed on position. Any interaction on the Tile checks the
flag, and if it is set, the game gets it from the table. Quick and easy.
Features, on the other hand... They are usually immoveable (door,
stairs, traps) and often blocking movement and/or LOS. It would be
easier for the Tile to check if it allows entering by a Monster if it
(the Tile) had a pointer to the feature. Will it be too expensive
(memory-wise) in this day and age to keep a pointer instead of a flag?
Probably yes, for larger maps.
Items. These would be nice not to keep a position on (I mean, if they
are carried or within a container - a position would be redundant), but
that would mean that each Tile needed an Item container. Which even I
would see was a waste of space. Dang. Position for Items, and flags on
the Tile, here I come. Probably flag for Features also.
Incredible how much I realize as I type it out. I'll post this anyway.
And also: If I make a *big* boulder, - that can be pushed by magic or a
great feat of strenght (or strenght of feet), but not picked up. Should
it then be a moveable Feature, or an unliftable Item. Think Indiana
Jones size boulder.
Thanks for the insight I've gained by reading rgrd and by writing this.
tormodh.