TL/DR - Trying to build random but repeatable cave gen without saving world data, need help understanding what is necessary.
I was thinking about good old games like Interplay FOTR, Ultima, Diablo, and an almost forgotten game from my childhood: Cavequest. I know the dungeons in the mentioned games were hardcoded, but I was thinking about a combo between Dwarf Fortress and Minecraft, and lots of other ideas swirling around, and feeling like I could make those ideas reality, but I would need to build up my abilities bit by bit. (pardon the pun)
TBH I hadn't though about Angband until I ran into this thread . Then I felt like I had the dumb, not thinking of it sooner.
I decided I'd be happy to start with a basic ASCII map in a console, and I hacked together a program that plunks down randomly sized rooms into a map then displays the map. So far so good. I also have a basic grasp of SDL so I can easily plunk together a tiler if I want to.
But what I really want to be the basis for the implementation, I can't figure out how to do. Here is the general idea:
I want to be able to generate and destroy rooms as needed, based on a seed. The only permanent storage of room data would be if the player has explored the room or changed something associated with it, and that could be freed after some interval. I think, for a possibly unlimited map area, world-coordinates might best be avoided, instead linking one room to another in a tree.
I think the essence of what I'm struggling with here is that even though rand() numbers (from a given seed) have a structure that can be determined and repeated, I can't figure out how to 'grab' numbers from an arbitrary place in the sequence without knowing where that place is. I could store the ID of a room but that brings us back to avoiding the storage of room data.
I want to be able to save the character's position in some form, and have the dungeon capable of regenerating itself from that data, moving outwards from the character's location on load time. Not like Minecraft, where once-explored lands are forever saved as explored (unless removed from the save file and thus regenerated from seed.) Actually, that's almost a perfect example: If MC were unable to store its data of previously explored terrain, any and all (original) blocks in the world can be regenerated from an arbitrary point where the player exists, based on the seed and the player's location. Of course, MC uses world coordinates, which causes the glitches near the Far Lands when variables start to overflow.
Of course I'm not going for the voxelly goodness that is Minecraft, but that's the general idea. I don't need to generate all the stuff between the character and the world origin in order to build the world within the player's immediate reach, it's a function of where the player is and the generator code - a technique I'm struggling to wrap my head around and reproduce.
(AFAIK I think there are SOME things such as water and lava source blocks that may not be tied to seed? Can't recall exactly.)
So please help a noob out and offer any insight into this problem that you might have. I don't really need code examples, but I can't quite pin down a metaphor to understand how to do this.
I was thinking about good old games like Interplay FOTR, Ultima, Diablo, and an almost forgotten game from my childhood: Cavequest. I know the dungeons in the mentioned games were hardcoded, but I was thinking about a combo between Dwarf Fortress and Minecraft, and lots of other ideas swirling around, and feeling like I could make those ideas reality, but I would need to build up my abilities bit by bit. (pardon the pun)
TBH I hadn't though about Angband until I ran into this thread . Then I felt like I had the dumb, not thinking of it sooner.
I decided I'd be happy to start with a basic ASCII map in a console, and I hacked together a program that plunks down randomly sized rooms into a map then displays the map. So far so good. I also have a basic grasp of SDL so I can easily plunk together a tiler if I want to.
But what I really want to be the basis for the implementation, I can't figure out how to do. Here is the general idea:
I want to be able to generate and destroy rooms as needed, based on a seed. The only permanent storage of room data would be if the player has explored the room or changed something associated with it, and that could be freed after some interval. I think, for a possibly unlimited map area, world-coordinates might best be avoided, instead linking one room to another in a tree.
I think the essence of what I'm struggling with here is that even though rand() numbers (from a given seed) have a structure that can be determined and repeated, I can't figure out how to 'grab' numbers from an arbitrary place in the sequence without knowing where that place is. I could store the ID of a room but that brings us back to avoiding the storage of room data.
I want to be able to save the character's position in some form, and have the dungeon capable of regenerating itself from that data, moving outwards from the character's location on load time. Not like Minecraft, where once-explored lands are forever saved as explored (unless removed from the save file and thus regenerated from seed.) Actually, that's almost a perfect example: If MC were unable to store its data of previously explored terrain, any and all (original) blocks in the world can be regenerated from an arbitrary point where the player exists, based on the seed and the player's location. Of course, MC uses world coordinates, which causes the glitches near the Far Lands when variables start to overflow.
Of course I'm not going for the voxelly goodness that is Minecraft, but that's the general idea. I don't need to generate all the stuff between the character and the world origin in order to build the world within the player's immediate reach, it's a function of where the player is and the generator code - a technique I'm struggling to wrap my head around and reproduce.
(AFAIK I think there are SOME things such as water and lava source blocks that may not be tied to seed? Can't recall exactly.)
So please help a noob out and offer any insight into this problem that you might have. I don't really need code examples, but I can't quite pin down a metaphor to understand how to do this.
Comment