Hello Guest

Author Topic: Performance for an RTS game  (Read 4426 times)

eric

  • Newbie
  • *
  • Posts: 2
    • View Profile
Performance for an RTS game
« on: January 17, 2013, 09:04:39 pm »
Hi all,

I'm planing to buy the kit but I've some performance concerns.

I've an RTS game published for Android but I want to (re)develop it with 2D Toolkit. In a typical level, I have several infantries (say 50). The animation sprite sheet of the infantry has 250 images on it (infantry moving 8 directions, attacking, dying etc). I do also have several other units (tanks, helicopters etc) in a typical mission.

Now, how would 2d Toolkit perform if I had developed the game with it? Let's say there will be 100 units in the level at a time. Let's again say there are 10 different units and each unit's sprite sheet has 250 images.

At the moment game works at 35-40 fps for the numbers given (it's developed by Java in Eclipse, no opengl).

Any idea?

Your help is much appreciated.

Many thanks.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Performance for an RTS game
« Reply #1 on: January 18, 2013, 05:15:37 am »
It all depends on how many things are visible at a time.

You'd probably have to do some optimizations to disable the animated sprites as they go off screen, but apart from that, performance wise, the number of images in a sprite collection (spritesheet) doesn't really matter at all. 10 different units from 10 different sprite collections = 10 draw calls roughly.

A couple of things to keep in mind.

Make sure your sprites of different spritesheets are in different z values. Group sprites from the same spritesheets with the same z, so they all sort at the same point. Ultimately this means 1 draw call per "layer". If you mix everything up, you'll end up with an uncertain number of draw calls which is something you really want to avoid when you have that many active sprites.
Try your best to group all assets for one unit in one spritesheet - again you want to try to minimise draw calls, as otherwise you'll find it increases massively.

Depending on the amount of overdraw, you should be able to hit 60 (obviously this depends very much on your script code too), but in terms of GPU overhead it isn't massive.


eric

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Performance for an RTS game
« Reply #2 on: January 18, 2013, 09:58:30 am »
Great advices. Thanks. I've purchased already.

I shall share my experiences later here.

Thanks.