Game Development Community

Flipper Performance

by Simon OCallaghan · 01/15/2008 (9:07 pm) · 0 comments

One thing which has been bothering me for sometime is the performance of my game. This was further highlighted by a couple of people during feedback that said the start-up of the game had extremely low FPS and was unplayable.

Initially when I looked at the problem I thought the FPS issue was due to something not finishing on time at the start of the game and causing the slow down with FPS.

The start-up scripts were split between a common / mod directory and there was not much documentation to help with what everything did. Eventually I got the scripts down to their bare essentials, but this did not fix the FPS problem.

When I first started playing with the engine I found out very early on that it could cope with 3D assets. Which was very good news because I can create 3D assets much easier than I can create 2D assets. What I did not know at the time was, the engine was very good at pushing large amounts of 2D assets but not good with the same amount of 3D assets.

My initial tests of the engine were just a couple of models to see if I could get the 3D importer working correctly and the FPS was just fine. As the game started to grow so did the amount of 3D assets I was using which included coloured tiles, shadow models, special tiles and highlights. All these 3D assets were really hurting the FPS and I needed to find a way to convert some of them back to 2D assets.

The first logical choice for asset replacement was the main tile grid as it was drawn all the time and made up of two 3D assets, tile & shadow. I took a couple of screenshots of what the performance was like beforehand so I could tell if anything had changed.

In order to convert the 3D assets into 2D assets I used the engine to do the hard work for me. I setup a grid of grey tile in various rotation angles and took a screenshot which I used to create a 32 cell animation stripe.

Once the 2D asset data blocks were setup I replaced the front menu 3D tiles with a complete grid full of looped animated tiles and checked the FPS speeds. I was amazed and relieved that I had found a way to speed up the game without any difference in appearance.

Test Results: Top part of screen 1024x768, Bottom part of screen 800x600

Left: before any changes - Right: no 3d assets
www.simonoc.com/images/design/game_flipper/2dtest_base.gif www.simonoc.com/images/design/game_flipper/2dtest_blank.gif
Left: Static 2D asset replacements - Right: Animated 2D assets as a 32 cell stripe
www.simonoc.com/images/design/game_flipper/2dtest_sprstatic.gif www.simonoc.com/images/design/game_flipper/2dtest_spranim.gif
Sims