Frame rate test for tile-based games 测试结果.[小糊涂的灵感]

 

http://discussion.forum.nokia.com/forum/showthread.php?s=db67f2a788859f04447a0e9bfd9f05e9&threadid=33852&perpage=15&pagenumber=2

Frame rate test for tile-based games

Hi, all.

Recently there were pretty much discussions on which method is faster and more efficient for using in tile-based games.
I was also interested in the issue, of course :)

I spent some free time and created small test that rather reallistically models typical situation:

It fills screen with 16x16 pixel tiles and then draws 3 "actor" images. For each drawing method I move actors pixel by pixel from left to right.

After the test you have the following info:
1. FPS: frames per second for each method tested
2. Total time and total frames for each method
3. Amount of tiles per frame = width_in_tiles*height_in_tiles + number_of actors
4. Amount of milliseconds per single tile painting - this parameter might be useful if you try to optimize your game by repainting only needed areas
5. Textual method description. On very small screens might not fit to the screen

Here are the methods tested:
1. Graphics & immutable: Paints images using Graphics.DrawImage() and preserving transparency
2. Graphics & mutable: Same, but with mutable images. Hence, no
transparency
3. Graphics & mutable by DirectUtils: Same, but mutable image is created by DirectUtils. No transparency
4. DirectGraphics & immutable: Paints images using DirectGraphics.DrawImage. With transparency.
5. DirectGraphics & mutable: Paints mutable images using DirectGraphics.DrawImage. No transparency.
6. DirectGraphics & converted arrays: Paints images using DrawPixels in native phone format. No transparency.
7. DirectPixels & prepared arrays: Paints images using DrawPixels and arrays read from files in TYPE_USHORT_4444_ARGB format. With transparency

dwarf in nokia forum

Anyway, we can already make some conclusions. For Series 40 and Series 60 straight MIDP 1.0. graphics is the fastest or almost the fastest option.

For some Series 40 devices standard graphics is too slow, while drawPixels in native format is the best.

...
There is one issue...
DrawPixels & converted arrays goes in native format without transparency and
DrawPixels and prepared array goes in ARGB_4444 format with transparency.

I suppose it would be nice to add testing converted arrays with transparency or at least to show what the native format is.

Does anybody want to make these additions to the open source code? :)
Then Ican publish it on the same place in the web.
As I'm doing it in my free time, myself I'll probably find some time for modifications not earlier than in a week :(

 

6610 v4.18

113 frames, 67 tiles per frame

Graphics & immutable
11.2304 fps, 1.3093 ms per tile

Graphics & mutable
12.2070 fps, 1.2050 ms per tile

Graphics & mutable by DirectUtils
11.4746 fps, 1.2954 ms per tile

DirectGraphics & immutable
6.5917 fps, 2.2580 ms per tile

DirectGtaphics & mutable
6.5917 fps, 2.2500 ms per tile

DrawPixels & converted arrays
15.1367 fps, 0.9721 ms per tile

DrawPixels & prepared arrays
8.0566 fps, 1.8281 ms per tile

posted @ 2004-10-25 08:45  小糊涂的超级blog  阅读(592)  评论(0编辑  收藏  举报