Code:
%%..........@@
%%............@@
%%%.............@@
%%%....~~~~~.....@@@ This is a 20x10 sector
%%%...~~~~~~~....@@@ ~ indicates water
%%%....~~~~~.....@@@ % indicates trees
%%%..............@@@ @ indicates rocks
%%%....*=*.....@@@ *, = indicates a house ( below )
%%....***.....@@
%%..........@@
Looking at the above although it is a 20x10 grid 0,0 & 0,1 & 0,2 etc. isn't used so it is displayed as a blank spaced ' '. Where as depending on the sector type it would display the character appointed in the appropriate colour.
Code:
/---==---\
|........| This is a 10x5 sector
|........| -, |, / & \ indicates walls
|........| = indicates a door
\--------/
Looking at the above it is a 10x5 grid where all the sectors are used.
So basically some of the locations would differ in size and certain sectors isn't used. Although those sectors isn't used it is still part of the location.
So taking the above information. I will need to load each location in a 2 dimensional array.
Code:
typedef struct sector_data {
...
information
...
} sector[X][Y];
Where X and Y would be define as the maximum any locations can go. (No locations would go above 100x100).
Now what I would like to do is load up a collection of locations into a new variable (let's call it world). So in the end i would use world[loc].sector[x][y].type, etc. (loc would be the current location in, x and y pointing to the current sector).
All the locations would be loaded into memory seeing that it would be pointless to load/unload the location whenever someone enters, due to the fact that it is a online multiplayer game, and also if it were to load/unload then all the objects/mobs would reset the whole time which I don't want.
Thank you.