RTS Vertice Count + Animations

Hello, I am working on an RTS and so far each unit has 1200 vertice. Is this to high? When I move a group of 100 around WITH animations my FPS dips to around 40~50. If I move the group WITHOUT animations, my FPS holds 60. Are there to many verts per unit? the logic percentage on the Animations debug go to 30%. Is this to high? Is there something I need to change in my animation? It is just a walk cycle.


Edit: I don’t think hardware is the issue either. I thinks its something in the bge.
i5 6600k
GTX 1070
16gb of ddr4

You should definitely bring down the number of vertices. When the models are so small, you really don’t need so much quality.

Hpw many bones for each character?

Are they using ik or FK solvers?

I think 500 tris is fine for an RTS, based on distance. Also dont use IK. I guess you use this tip: https://www.garagegames.com/community/forums/viewthread/23078

lordloki76

How many bones for each character?
69 bones per unit.
I realized when you asked that I was probably using too many bones. I will reduce dramatically.

BluePrintRandom

Are they using ik or FK solvers?
They are using FK

Thanks Akira_San good tip!

69 :slight_smile:
They say for mobile use 30 bones, for pc 60, but since this is an rts game, then use 17 bones pic-> http://pasteall.org/pic/show.php?id=112257 Also maybe even less frames per animation.

At that scale you could also use sprites.

So I reduced the verts to 457 and bones to 13. It runs great with 100 units now! But 200 units it runs at about 30fps. I guess I’ll have to cut the verts in half again :(. Oh well. I’ll just have to make sure the game play is that much better!

How do you suppose Empire Total War allows for such high detail models and animations. I was messing with the demo and packed all of my units in a very small space forcing it to load the high res models for well over 200 units and it never slowed up once. I feel like mine should run flawless with 200 units since there’s nothing else going on in the bge.

There was talk of implementing hardware armature skinning or something like that for UPBGE

I wonder if you can pass uniforms to a shader in upbge and animate on the gpu side?
(‘animation number’, frame value?)

Try UPBGE, it have optimizations. But yes in the end youll need some GPU skinning. :slight_smile: Chars with armature will take more %. so yes, we are waiting for lordloki76. :smiley:
You cant compare both game engines. They use different arhitecsture. Empire Total War is deferred render the way i see it, bge is still a forward render.
Or maybe this is interesting: http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter03.html
Is vsinc off?

You will have to decide whether you want the flexibility of models or the performance of sprites.
At the scale you’re working at I personally think sprites look better, and you could easily go to 300 sprites without lag, if the other elements of your game (pathfinding, unit selection, combat etc…) can cope. As your game develops further you’ll find that small things add up and there will be additional drain on resources. This can maks even moderate drain from animations unacceptable.


My own RTS is running quite well with sprites, but there are a few down sides.
First there is a limit to how many actions you can include. Each one you add needs a new texture strip. Add enough and it starts to take a toll on rendering.
Second you are limited to a fixed camera angle and zoom. Finally they dont play well with dynamic lighting and shadows.

Models can be more flexible but aren’t really suitable to the BGE if you’re going to have more than a hundred.
RTS games put an especially high drain on any game engine, but there are established methods to avoid the worst problems.

Akira_San

Is vsinc off?

uh OK I feel stupid I didn’t think of that my self. That did the trick I am now moving 200 units around with only 1fps drop when I give command to move! Thank you!

[Smoking_mirror

You will have to decide whether you want the flexibility of models or the performance of sprites.
](https://blenderartists.org/forum/member.php?27607-Smoking_mirror)

I never thought of doing it with sprites.
I am considering this since I plan to make each game very long playing time and hopefully very large map size.
Question. Will a unit need multiple walking animations for each directing he can walk. I was thinking it would need 8. Or am I thinking about this wrong. I have never messed with sprites before.

Also, right now I have my units logic tick set to 2. Is there a way to make the animation ticks 4 within my script?
Setting the logic ticks to 4 is a little to choppy so I was thinking since the animations are whats causing the slow down, I would have the movement run at 2 ticks and the animations run at 4. Is this doable?

Edit: Testing 400 units now I tried lowering the walk animation to 5 frames and then in my script set the playback speed to 0.2 but it doesn’t change anything. Probably since its still triggering the action every tick.

I believe there is a reason why AAA game lock the entire game at 30fps instead of skipping/desync a few updates, 30fps may not be smooth but it is also less jarring and choppy than when you decouple your logic and animation updates

A sprite needs at least 4 directions, better 6 and best 8.
Mine have 7, I have 4 base and more are created by flipping the image from left to right. I couldn’t get both north and south by flipping so mine have no north animation, but ne and nw are closer to north than east or west and used instead.

With blender you don’t have to do the logic on animations every tic.
Only activate it when you start a new animation.
Walk>idle>shoot>idle>walk
Should only require 4 activations and the last should cycle forever, or until you start a new animation.
If you want to reduce processing time go to the properties tab, and set restrict animation updates. Set frame rate to be something like 24fps. Animation will be a bit jerky (like stop motion animation) but will use a fraction of the resources.


animations.blend (689 KB)

See the following file, try turning restrict animation updates on and off.
Check out the logic for each object. It is just a single key-press to make the animation run, no always sensor.

Also, if you’re doing the animations in Python you don’t have to update them every frame, just once like with logic bricks.

So Smoking_mirror have a look at this

I decided to go with sprites and I must say I LOVE the way it looks! Runs much faster with shadows too! I have one problem though. the distant units are blurred and I can’t figure out why. I have anisotropic set to 16. Any ideas?
you can see what I’m talking about in the pic


^It’s the mipmaps I guarantee it!

Those sprites look great! I’ve always been a fan of sprites in RTS games, I don’t like the ultra low poly infantry, it just doesn’t look good to me.

On the subject of blurring:

bge.render.setMipmapping(2)   
bge.render.setAnisotropicFiltering(2)

I usually do this ^

Though you can turn off mipmapping completely:

bge.render.setMipmapping(0)

If you want really crisp textures, though then you can’t have small textures o large objects without tiling or you can see the pixels.

Yep fixed it! Awesome thanks!

Also, at the moment I’m using Billboard for my Face Orientation. What are you using?