> 1000 x 1000 x 30
30Mbytes of storage (at least).
But that's just the tip of the iceberg, you've got to initialise all those locations with meaningful data, unless you have a lot of
N
There is ocean here
N
There is ocean here
N
There is ocean here
N
There is ocean here
N
There is ocean here
Not only that, no user will ever visit every location in your RPG, it would simply take too long (1 room per second for almost a year, non-stop)
Your RPG will have at most a few hundred locations (that are interesting in some way). I suggest you store the connectivity of the locations within the data, then you only need to store the locations which interest you
Perhaps something like this
Code:
enum { NONE, KITCHEN, HALL, STAIRS };
enum { NORTH, SOUTH, WEST, EAST };
struct room {
char *name;
int next[4]; // N,S,W,E from this location
} rooms[] = {
{ "None" },
{ "Kitchen", { NONE, HALL, NONE, NONE } },
{ "Hall", { KITCHEN, STAIRS, NONE, NONE } },
{ "Stairs", { HALL, NONE, NONE, NONE } },
};
If you have
int room_num = KITCHEN;
Moving south is just
room_num = rooms[room_num].next[SOUTH];