Jump to content
  • Advertisement
Sign in to follow this  
Iftah

OpenGL tile engine

This topic is 4843 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi :) im a complete openGL newbie but very exicted to finally attempt it. im trying to make a platform style game (tile based) i followed the article tiling in opengl (http://www.gamedev.net/reference/articles/article1256.asp) which basically loops x,y and draws quads but i have a feeling it is quite basic. my question: is there a smarter way to draw the tiles? display list? quad strip? unroll a loop? also, should i split all the tile bitmaps into many 32x32 textures or have one big texture and display part of the texture for each tile? i switched to orthogonal view and it improved some the performance. not that i have performance problems so far (the "game" is nothing but render 15x15 tiles) but profiling it at 60 fps shows the drawing takes a large percent of the time (full-screen is better but still lots of time rendering). something like 60-70% rendering 40-30% sleeping. i know games can settle for less than 60 fps but i think a simple platform game should be able to handle it. (i must admit i have an old pc, 1800mhz p4, 64mb weak graphics card). thanks in advance Iftah.

Share this post


Link to post
Share on other sites
Advertisement
in my opinion,you can use VertexArray and DisplyList to speed up your program,
i am a beginner too.

Share this post


Link to post
Share on other sites
thanks,
Ill look into the subject of vertex array

and let you know if there is an improvment
will take me a while though, exams season here :(

Iftah.

Share this post


Link to post
Share on other sites
I'm currently developing a tile based game engine myself. I use a VBO (vertex buffer object) to store in the layers, ready for rendering. In the rendering loop I detect which tiles are visible and only send the indices for those tiles to the GPU.

But I would recommend you to use a basic version first, so you can learn the concepts (I did that too). Later you can optimise the engine. You can take a look at my engine: JEngine SSE

Share this post


Link to post
Share on other sites
thank you jeroenb, your engine looks very cool!
exactly what i had in mind when i started my project :)

ill check VBO

Iftah.

Share this post


Link to post
Share on other sites
I'll try to upload a clean project ready for development of a game in the upcomming days. For that I have to create some templates of the Lua scripts and directory structure. I will also add the editor with it, in which you can build the worlds and write your lua scripts.

Share this post


Link to post
Share on other sites
About the texture part I think its faster to store as much as you can in one big texture and display the parts you want for each tile.
Heard that too many glBindTexture can slow your app down

Share this post


Link to post
Share on other sites
That is true. Texture swaps take some considerable time. That's why I have put all tiles in one texture for every layer. It is even possible to use one tile bitmap on multiple layers. You just have to use other tiles :P.

I posted a template project on my website from which it should be fairly easy to create your own game. Please feel free to try it out and post bugs or idea's on my forums.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!