Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualJossos

Posted 13 January 2013 - 06:51 AM

There are a number of ways of doing a minimap like this .. there are pros and cons to different approaches and which you choose will depend on things like:

 

How big is your overall map?

If your overall map isn't too huge you can just create a big texture to hold the whole 'giant mini map', then render a quad for a part of it by varying the tex coords. This would be the simplest approach.

 

If you've got a huge map, you might either periodically recreate your local 'giant mini map' or use a tiled scrolling approach for the mini-map texture.

 

How dynamic does the minimap have to be?

If you are showing mainly non-dynamic stuff on the mini map, you can precreate the texture, and reuse each frame. If it's very dynamic, you could  say overlay the dynamic elements each frame, or just redraw the whole thing each frame. This depends on the requirements of your game.

 

If you are using a texture, you'll probably want to use 'render to texture' approaches (google this), there are a number of ways of achieving it. And you may end up modifying your general rendering routines so that they can be also used for drawing the minimap, to save you writing your rendering code twice.

 

You could also simply create the mini-map texture in software and upload it just like any other texture, if render to texture didn't appeal. You also might save the giant mini-map with the game level as a premade texture, depending on the game.

 

Well to how dynamic, The minimap size (and thus the map size) will be 32x32 pixels up to 256x256 pixels (/tiles), and will change 30 times per second. each pixel will show the color of the dominant player over the corresponding tile, or otherwise light green for grass, light brown for dirt, dark green for trees etc.

 

If i can bind the texture to a opengl quad, that will fix any screen resizing issues.

 

I just have no idea how to draw a texture pixel by pixel, and then apply it to a quad. I can do so with existing images, but this image needs to change 30 times per second (my apps frame rate).


#1Jossos

Posted 13 January 2013 - 06:49 AM

There are a number of ways of doing a minimap like this .. there are pros and cons to different approaches and which you choose will depend on things like:

 

How big is your overall map?

If your overall map isn't too huge you can just create a big texture to hold the whole 'giant mini map', then render a quad for a part of it by varying the tex coords. This would be the simplest approach.

 

If you've got a huge map, you might either periodically recreate your local 'giant mini map' or use a tiled scrolling approach for the mini-map texture.

 

How dynamic does the minimap have to be?

If you are showing mainly non-dynamic stuff on the mini map, you can precreate the texture, and reuse each frame. If it's very dynamic, you could  say overlay the dynamic elements each frame, or just redraw the whole thing each frame. This depends on the requirements of your game.

 

If you are using a texture, you'll probably want to use 'render to texture' approaches (google this), there are a number of ways of achieving it. And you may end up modifying your general rendering routines so that they can be also used for drawing the minimap, to save you writing your rendering code twice.

 

You could also simply create the mini-map texture in software and upload it just like any other texture, if render to texture didn't appeal. You also might save the giant mini-map with the game level as a premade texture, depending on the game.

 

Well to how dynamic, The minimap size (thus the map size) will be 32x32 pixels up to 256x256 pixels (/tiles).

 

If i can bind the texture to a opengl quad, that will fix any screen resizing issues.

 

I just have no idea how to draw a texture pixel by pixel, and then apply it to a quad. I can do so with existing images, but this image needs to change 30 times per second (my apps frame rate).


PARTNERS