Jump to content

  • Log In with Google      Sign In   
  • Create Account

World Map Render And Storage


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 Barrett   Members   -  Reputation: 151

Like
0Likes
Like

Posted 17 June 2013 - 01:53 PM

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



Sponsor:

#2 Rld_   Members   -  Reputation: 1463

Like
0Likes
Like

Posted 17 June 2013 - 02:27 PM

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.



#3 Barrett   Members   -  Reputation: 151

Like
0Likes
Like

Posted 17 June 2013 - 02:29 PM

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...



#4 frob   Moderators   -  Reputation: 21241

Like
4Likes
Like

Posted 17 June 2013 - 03:11 PM


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.


Check out my personal indie blog at bryanwagstaff.com.

#5 Krohm   Crossbones+   -  Reputation: 3117

Like
0Likes
Like

Posted 17 June 2013 - 10:44 PM


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.

#6 Barrett   Members   -  Reputation: 151

Like
0Likes
Like

Posted 17 June 2013 - 10:57 PM

Thanks a lot!

 

I will try to do it)



#7 Barrett   Members   -  Reputation: 151

Like
1Likes
Like

Posted 20 June 2013 - 11:59 AM

yep, it was really fast.

Now I will optimize it)

 

Thanks a lot!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS