Advice on Actors

Is there any advice/knowledge one can share with me about Actors and how Actors can influence the fps?

Right now my pre-build actors are a little over 1k in vertice count.

I use multi-texturing (texture stages) to give them their basic unclothed look they have now.

Geometry and collisons have little to no effect on my fps, so I feel I’ve did a good job with optimizing there.

However, the more Actors I start to pile up (I did this in a test run), the more my fps starts to suffer.

I can defeat that high Actor count fps drop by simply not using P3D’s armature and animation handling system, but that would put a hell of a lot of work on my hands.

So I was wondering if there is anything I can do, or maybe I “slipped” up somewhere; relating to Actors…

Enlighten me.

Almost forgot, I did do a geometry test for Actors. It turned out the vertice count for the Actors had no bearing on the fps at all.

Can’t believe I missed a very important piece of the Actor optimization.

I gained a significant amount of fps after the correction (with the same number of actors on screen as before); not as much as I hoped for, but enough the make this project possible again.

P3D is a “tight budget” engine, but nails are not in my coffin just yet.


so…what did you eventually do to solve your issue?
It’s nice to share problems and solutions! :wink:

I noticed in your other threads that you’re making some kind of strategy/simulation game. In my opinion 1000 vertices is way too much for one actor in that kind of game.

That’s what I thought too. So I did a test where I made quick 32 vertice Actors and replaced the originals. My fps did not improve at all, so the geometry of the scene (or animated vertices) is not an issue (which is no suprise since most GCs will handle that well now).

There was only one issue remaining and that was the fact I would need to have at least 30 characters moving and animating on screen without killing the fps. Why? Because the player will command an army of 10 against the enemy, which can also be an army of 10 (when grouped that is).

What I did was abandon P3D’s built-in collision detection using spheres as from objects. I wrote my own collision detection to take its place; and that solved my final problem. The only things I use from P3D’s collison detection is the Ray (picking ray) and one collision barrier. The rest is my handy work.

Right now, I’m a little hurt with the Cartoon Ink Filter. Based on my tests, a finished version of my game would run round 90 to 125 fps.

However, with the Cartoon Ink Filter added, that fps would most likely be “50ish” or 60 if I’m lucky.

This screenshot is of a test run with Cartoon Ink. Around 25 to 30 Actors (40 in total) are moving around on screen (most out of view). Notice the fps in the top right.

By markjacksonguy at 2012-02-24

That fps would normally be over 100 fps (around 125) without the Cartoon Ink Filter. So what I will most likely do is leave the Cartoon Ink up to the gamer. That is, make it an option to turn on or off.

I love the Ink look; the screenshot does not do it justice. It’s much sweeter looking during the actual running game. The Cartoon Ink really fits this game nicely. :smiley:

I’m not doing too bad, giving the fact, when I had an empty screen (no collisions) way earlier in the project (where I was testing actor count and fps drop), I was able to get 100 actors on screen before my fps hit 60. So right there, I knew this game would be a challenge using P3D.

ATI Radeon HD 2600 XT
Quad Core 2.4, Intel p4 (32bit Vistal, 6gb Ram (3 active))

Nice screenshot, though palms don’t fit very well in cartoon-inked game. Did you somehow optimize building, tree rendering? What graphics card do you have? 100 animated objects can get fps pretty low with any engine I believe. There should be some possible optimizations, but I don’t have experience in that.

My Specs are at the bottom of my post before yours. That graphic card is old, but I want to use older tech to develop with. So many people still use older PCs for game play.

True, I’ve been optimizing like crazy and it has paid off well. :smiley:

I believe I’m pushing P3D to it’s limits for the type of game I’m creating. I’m not doing bad given the fact other RTS games drop as low as “30ish” to “40ish” on my PC.

By markjacksonguy at 2012-02-25

In this shot, you get a close up of my female character actor type. Yes she is naked and bald. :laughing: I’m not currently working on characters.

By markjacksonguy at 2012-02-25

You can see how things look different on close up versus zoomed out. I will most likely change graphics at the end of the game depending on what my fps looks like. Everything is being modeled so cheaply at the moment.

By markjacksonguy at 2012-02-25

The combat system for this game should be money! The concept for it is nice. If you’re wondering what those empty panels in the GUI are for, they are unfinished.


Running an empty window of P3D runs at 1000 fps on my machine. That’s half the speed of some of the commercial games’ (I have) empty windows.

So you’re observing a tiny 0.5 millisecond overhead in Panda compared to the other engines. That seems completely insignificant to me, and I can assure you that 500 microseconds is far too little to have any effect on observable gameplay.
While a 1000 FPS difference may seem like a lot, if you translate it to the frame time in milliseconds (which is the unit to use when making performance measurements), it is virtually nothing at that range.

For example, if your game runs at 50 FPS average, then adding a 500 microsecond overhead as you’ve observed would reduce the FPS to ~48.8. That’s just 1.2 FPS difference, compared to the 1000 FPS you observed! This is a good example of how deceptive it is to use FPS for performance measurement.

For the record, the difference may also be that Panda uses OpenGL by default whereas many Windows-specific engines use DirectX by default. While using OpenGL doesn’t imply any kind of lower performance, there are some graphics drivers out there that have the OpenGL support as a hacky layer on top of the DirectX support, with a slight performance overhead. That may be what you’re seeing here- to verify this, simply switch Panda3D to the DirectX renderer. Still, we’re talking about numbers so low that they could be coming from anywhere.

Yeah, I agree with rdb. People explained me this a few times on the chat. You should be worried more about FPS drops, they break the illusion of motion. May I ask you how are you planning to implement AI?

The empty window speed isn’t where the “ice breaks” (even though 3K fps compared to 1k throws a hint at engine design),

it’s the fact those commercial games I’m talking about can easily handle 500+ characters and a large environment.

It’s like I’ve already stated (as well as developers working for large corps), every engine has it’s limitations. You can opitmize until you drop dead, you will never go pass the limiations of a graphic engine (or graphic card for that matter).

P3D’s engine power can allow for some nice games, but I wouldn’t go and try to build the next World of Warcraft with it.

I already wrote my own collision detection and path finding, which is much faster. Given the optimizations I’ve made for my version of P3D, I would be able to create some hardcore games with the engine, but I have to be realistic about what I want to make with it, because it’s not going to push 500 quality actors on screen and still keep a 60 fps (with a reasonable PC).

You have to throw in other things like shader effects, particles, shadow casting, reflections (which uses an off screen buffer), etc… All those things will drink down fps.

If you ever get a chance to play the game Divinity II -DKS, do it. The games has some of the most realistic shader effects you’ll ever see. As a result of such beautiful graphics, the game only runs at 30 fps (at best). Most of the time it runs at 20 fps or lower, and I played it on my most powerful system.

Can one produce Divinity II graphics with P3D as the engine and beat DKS’s frame rate? I think so. With the optimizations I’ve made, I know I can go crazy with shaders (not with my current game though), but I do question real-time shadows. I feel shadow casting will be too much if one is using shader based texture effects on everything (with P3D); you can throw off screen buffers in with that.

All in all, I’m not saying P3D isn’t a good engine. If it wasn’t I wouldn’t be using it. I just feel one must be smart about what kind of game they choose to make with P3D because some games will prove to be too much for the engine to handle; regardless of Dx versus openGL, drivers, ect…


By markjacksonguy at 2012-02-27

Most GPUs start slowing down at a few hundred geoms in the scene. That is not a Panda limitation, that’s a limitation of the bus that’s used to transfer data to the graphics card. You can do tricks to combine batches, which is presumably what those other engines are doing, but Panda cannot magically make existing GPU limits disappear.

Panda provides a relatively thin wrapper around the OpenGL and DirectX interfaces. You can’t expect Panda (or any engine for that sake) to magically make your app faster. Panda will help you, but it’s still you who has to find the bottlenecks and apply methods to eliminate them.