Jump to content
  • Advertisement
Sign in to follow this  
schragnasher

Roguelike dungeon

This topic is 3169 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If i were making a roguelike, i would need some form of structure for the dungeon. Would this "dungeon object" be considered an entity which i add to the world, or is the dungeon the actual world container like a scene graph might be. Im thinking about how to use component entity objects and in the past iv had a world/entity manager which keeps track of entities and tells them to update. A simple list of entities. When thinking about how i would make a roguelike iv been unable to figure out how to represent the dungeon with components (since i would think the dungeon might keep track of all other entities anyhow, player monsters, items etc.) and think i might be coming at it from the wrong direction.

Share this post


Link to post
Share on other sites
Advertisement
I'd probably consider the dungeon to be the world itself. Would there ever be anything in the world that isn't in the dungeon?

What data do you actually need to store about the dungeon, and how do you need to query that data? I'm guessing you need to do things like find out which rooms are in a given floor of the dungeon, and then which entities are inside those rooms. Your data structures will generally want to reflect the way in which you want to use them.

One thing you can always do is have your entities appear in multiple lists. Your dungeon can have a global 'all entities' list that you scan through to update everything, and *also* per-floor or per-room lists that you just use for rendering what the player can currently see, and so on. It requires a little bit more tracking as entities move around, but it's not too hard.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!