• Advertisement

Archived

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

performance of tile transitions

This topic is 5833 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

i want to try tile transitions in my game. however, i think tile transitions may occupy too much time. most tiles need to use transitions(to make the map looks pretty). if i use this method on layer 0(the base layer): 1.draw tiles without transparency 2.draw transition tiles with transparency that is to say, i need to draw much more tiles ,and even the worse, the addition tiles need to use alpha blending ,which will be slower. i wonder whether i can make it with good performance...

Share this post


Link to post
Share on other sites
Advertisement
The way i know to speed up it, most things with blend you could
optimize. Watch my sample - blended blue light could be prerendered and drawn in future as single texture.

But with particles you will lose many FPS I don''t know how to solve it.

Share this post


Link to post
Share on other sites
Why are you alpha blending? For a 2D game you should be able to blit several screens worth of tiles and still maintain a very high frame rate. We aren''t on 386''s using Mode13h anymore... um, right?

Share this post


Link to post
Share on other sites
i am programming with directx 8.0, and using tga files thus i can get it''s alpha information and use it for alpha blending.
it''s a direct, and easy way, right? but may cause performance problems...

Share this post


Link to post
Share on other sites
I''m using the alpha-blended tiles, but slightly differently. What I have is a series of solid tiles, then a single set of alpha tiles (no texture applied). Then I put one texture on the base tile and blend the top tile with an alpha map before rendering it.

I was originally using seperate texture files with all the different transition shapes and then rendering only the base and the overlay tile (not run-time blending an alpha with a base).

I have lost an average of 8 frames per second doing this, which isn''t significant at this time. And if I turn off the transition drawing, it all goes up by 12 frames (so... pre-blended alpha tiles only cost me 4 fps).

At the moment I am able to render the terrain (base tileset only, no buildings/monsters) at around 50 fps. Loading a random (but typical) spread of additional objects (buildings and monsters) drops this to around 28. A typical load of particle effects (15,000 particles) drops this to 23. Not exactly lightning fast, but still more than adequate. And my machine is really pretty slow by today''s standards.

Anyway, the point is... the 8-frames lost by using blended alpha textures is insignificant compared to the losses through other details.

Share this post


Link to post
Share on other sites

  • Advertisement