Sign in to follow this  

Basic Map System for a Text Game

This topic is 4162 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

I'm wondering how I would go about designing a map system for a text-based game? I would like to be able to randomly generate a new map every time someone loads up a new game... The map won't be shown physically (text-based game :p), but I'm pretty sure there still needs to be some sort of restrictions of where you can and can't go. Something like a vector of bool(s) (The language of choice here is C++), and just make it true if the path is clear or something? I'm really not sure of how to go about this. Please, don't worry about giving me code, just some simple design ideas, or even better a tutorial on this subject, and any help is greatly appreciated :)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Depends if your map topography is a regular 2D (or 3D??) grid of 'rooms' (with standard NWSE directions and maybe the NE NW SE SW...) OR
a more flexible 'network' of nodes.


You could use the fixed array of connection flags (for every room) with a regular grid -- if you also use an array of the rooms (wasteful if you dont use all the array slots). Or use a 1D array of rooms and an array of index info for the room's connection links (with some flag value like MAX_INT to mark NO-CONNECTION cases).


If you want the more flexible network topography you would have a set of rooms (possibly in a static array) and each room would have a linklist of connection nodes (so that you could have an unlimited number of connections or only 1 without wastage). Each connection node will contain the address of its destination 'room' node and probably a descriptive phrase ('Trapdoor', 'ladder up', 'east door', 'Hole in the Corner' etc...) of that connection.

Of course you can add the usual additional attributes like 'secret door' or locked for each .......


Share this post


Link to post
Share on other sites
Hey, try cruising around google with terms like, random dungeon generation fractals etc. I found one good site which seems to have a bunch of links on it: http://roguelikedevelopment.org/php/article/showArticle.php?path=development/MAP/articles/&article=Creating%20a%20dungeon%20-%20Brian%20Bucklew%20[bbucklew@inteletek.com].txt

Hope it helps,
J

Share this post


Link to post
Share on other sites

This topic is 4162 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this