Hey everyone.
I am not sure of any of you are familiar with the term MUD (which is Multi User Dungeon, a text-based game). If not feel free to go over to www.mudconnect.com to check it out.
Anyway, back to my post. What I am currently planning on doing is changing the way the world works from a room-based world to a location based world, which uses x, y and z coordinations.
The current room-based world would load up each room into a certain number (called vnum) and within each room there the posibility of having 6 exits, which takes the player to another room with the number specified on the exit. In practice this works great. Also a collection of rooms is called an area.
Now my idea is to remove the whole concept of an area existing out of rooms, so instead of a town being an area with a x amount of rooms it is a location, consisting of a x amount of spaces and y amount of spaces (x,y grid system). The z axis would be used for height as to how high a certain place on the location is or how high a player is above the ground (seeing that certain players can fly).
So basically I have taken up thought of this alot more recently and was wondering what would be the best way to go about.
What I thought of was using a file (let's call it locations) and within that file it has names (or numbers) of the locations which needs to be loaded. Each location which is loaded would be loaded from another file (x.loc). Now in each file for each location there would have to be a x, y and z to know the size of the grid, seeing that the inside of a house would be a location just as a whole town would be a location, and they both do differ in size. Also each location would have a main description, but each x, y and z position should have sub-description, seeing that the location could be "The town of Belgaard" and if you are in the northern parts of the town infornt of a store it would be "The bakery".
So basically I would need a structure to load the list of all the locations, and also a structure to load each of the locations specified in the locations file, as well as keep in mind that certain positions in a location may have obsticles etc.
Now what would be the best way to go about, also would the better way be to load a location into the players structure as the player enters a location, or load all the locations into memory. I know loading it into memory once of consumes more memory, but loading it everytime needed would cause alot of lag seeing that your average mud has about 10-25 players on at the same time.
Any advice on this would be appreciated.
Thank you.
P.S If this is very confusing but you do feel that you would like to help I will be more than happy to explain things in much more detail, as well as show the code of how it currently works, etc.