Skip to main content
GameDev.net gamedev.net
🔒 Locked

World Map Render And Storage

Started by Barrett Jun 17, 2013 at 7:53 PM 5 replies 2.6k views
Original Post
Barrett
Barrett

Hello to everyone!

I've got a problem. In my game I have the skeleton of world map (map is random) with description for every cell - water, seaside, forest and etc.

The map is not small - about 50 000 cells. And I need to draw, for example, the large region of map. For example 5 000 cells.

Can you help me to solve this problem?

Is there any way to do it good?

Here some of my solutions:

  1. Pre-render the region of map and render additional regions, when player visit new location on map
  2. Render each cell every frame smile.png
  3. ????

Thanks in advance,

Denis

Barrett
Barrett

What exactly is the problem?

I'm assuming you don't want to go over all 50.000 cells and draw them, but only draw those that are actually visible. If that is the case, a Quadtree (http://en.wikipedia.org/wiki/Quadtree) might be a solution.

Should I Draw 5 000 cells of one region every frame? It will be slow...

frob
frob




Should I Draw 5 000 cells of one region every frame? It will be slow...

Are you sure? Have you actually tried it?

For beginners usually the best thing is to actually DO SOMETHING. Do it first, then see what happens. If you do it and the results are too slow, find a way to do less. You might also be pleasantly surprised at how much a modern processor is capable of doing. Nobody knows if your method is good enough until you actually try it.

Krohm
Krohm




Should I Draw 5 000 cells of one region every frame? It will be slow...
If doing 5k draw calls sure it will be (but it might still be viable for fast processors). If drawing them in a single blow, it'll get you 100+ fps with ease. Just make sure drawcalls are kept to a low count. Replicating cell geometry and pre-transformation will be key. You might eventually look in instancing but I personally wouldn't use it for that specific usage.
Previously "Krohm"
Barrett
Barrett

Thanks a lot!

I will try to do it)

Barrett
Barrett

yep, it was really fast.

Now I will optimize it)

Thanks a lot!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.