Archived

This topic is now archived and is closed to further replies.

hkgeorge

how to build and store an unlimited map

Recommended Posts

You can''t store something that is unlimited as you''d need unlimited storage space. Perhaps you want to look into procedurally-generated terrain.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]

Share this post


Link to post
Share on other sites

void LoadMap()
{
int i;

for(i=0;i<(INFINITE+1);i++)
{
//Post on gamedev and find out why
//this function hangs. Personally I think
//it''s a bug in W1nD0z3. Bill Gates is teh SUXX0RZ!
}
return;
}


Seriously though, you would have to generate the map randomly wouldn''t you?

Share this post


Link to post
Share on other sites
Even something the size of a large planet is not "unlimited".

Kylotan had it right, I would think. The closest you''re going to get to unlimited is procedural.

But if I were you, I would just go for a system that would dynamically load in nodes or sections, blocks at a time. And make the world wrap-around.

One of my future goals is to make an RTS that uses a 3D globe for the terrain. Better try and make a simple 2D map first though, huh?

Take care.

Florida, USA
RTS Engine in Development
http://www.knology.net/~heaven/rts.htm
Jesus is LORD!

Share this post


Link to post
Share on other sites
poke around flipcode, there''s an article there on algorithms for infinite spaces

George D. Filiotis

I am a signature virus. Please add me to your signature so that I may multiply.

Share this post


Link to post
Share on other sites
You''re going to have to cut the map into sections and load/unload the sections as your player moves (or your mouse scrolls) around. I would suggest...

0 0 0
0 1 0
0 0 0

break up the sections and always load up 9 sections around your character (noted as 1 above)

Of course....Size limit = harddrive size

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
There''s a way to generate un unlimited map.

Just generate it on the fly with a random seed, as long as you keep the same random seed you will be able to re-generate the same map again and again. Use that with the X.Y position added to the random seed and you can generate multiple map that can be linked easily ...

The bad part about that is the erratic map you will probably have..


Feel free to tell me if i''m wrong about, and WHY !
And please forget my bad english

Share this post


Link to post
Share on other sites