Jump to content

controller collision killing fps


Rick
 Share

Recommended Posts

I have 16 zombies and a player in my scene. Each have a controller to them. If the zombies have an entity type that collides with the player but not other zombies I get 60+ fps and all is good, minus the stacking up on each other they do. If I have all controllers collide with each other, and all these zombies are always moving towards the player, as soon as they are all around the player always trying to move closer but colliding with each other I get about 1 fps.

 

1) I assume this is just how controllers work? Many collisions with controllers each frame just kills the fps or am I missing some magic command to reduce this?

 

2) Any suggestions on how to handle this differently while still using controllers? I'm thinking about stopping the zombie movement if it collides with the player or another zombie and if not moving try moving again every 1 second or so to reduce the physics. This could of course lead to some strange looking behavior as the zombies are closing in on the player and happen to just bump into each other so curious what others would try.

 

Thanks!

Link to comment
Share on other sites

I just have a flat terrain with 16 zombie models and a player model I placed in the scene. The models themselves aren't doing any sort of collision as I don't set any entity type for them. When I load the scene I loop through and give each zombie and the player a controller. I have an update method called each frame for the zombies and it points the zombie at the player, and sets a move variable via: _move = Curve(1 * _speed, _move, _moveSmoothing / AppSpeed()); It them updates the controller and positions the model to the controller location. As you can see from the screenshot once the zombies have surrounded me I get .78 FPS.

 

 

http://dl.dropbox.co...842/zombie1.png

Link to comment
Share on other sites

Your character models have a physics body made out of a high-poly mesh. If collision is being tested against those it will be very slow.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Those model physics bodies aren't being considered in the collisions. Only the controllers have an entity type assigned to them. If I set the zombie controllers to an entity type of 2 and the player to 1 and given the default collisions the engine uses when a scene is loaded it does collision between player and zombie but not zombie and zombie in terms of the controller and I get 25 fps. This would lead me to believe that having this many controllers on screen with them colliding each frame is something LE doesn't handle very well. :(

 

I'll play around with replacing those models in the scene with a LoadMesh() so no physics file is loaded and see how that works just to be sure to rule anything happening with those models behind the scene.

Link to comment
Share on other sites

I don't think so, the controller-controller test is very simple. It's possible maybe the collisions are being discarded after the test? I don't think so, but that sounds like a possibility. Let me know the results when you use LoadMesh.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Strange results.

 

In my scene parsing logic I use LoadMesh() and delete the model loaded. I also tried CreatePivot() instead of LoadMesh(). With CreatePivot() everything is fine. All the "zombies" go around me and sometimes it might drop to 30 but it goes right back to 60 and is fairly consistent at 60. With LoadMesh() for the models if I run around in circles and don't let the zombies get me I get 60 fps. This tells me it's not the poly count of the models themselves. Once I let the zombies all gather up on me, over about 10 seconds it'll slowly degrade the fps until it reaches 0 and it stays there..

 

So why would it be that if my player model is moving around not letting the zombie controllers touch me but they are touching each other the fps stays at 60, but if the zombie controllers/meshes touch me and gather on the player the fps starts dropping then and only then to 0 and doesn't recover. The meshes shouldn't have anything to do with the collisions right?

 

Here is the update function that gets called each frame. It's pretty basic so I wouldn't think this would matter.

void Actor::Update(Camera& camera)
{
UpdateController(_controller, _rotate, _move, _strafe, _jump, 50000);
PositionEntity(_model, EntityPosition(_controller));
}

Link to comment
Share on other sites

With CreatePivot() everything is fine.

Ah, I think I know what is happening. Unnecessary ray casts or collision tests are slowing it down, I bet. Let me look into it further...

  • Upvote 2

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • 2 weeks later...

solution is very simple..make controllers to collide with, just and only world geometry, not other controllers...then, create cylinder bounding space, with same size as controller, and position it on same position as controller is, and final, check cylinder bounding spaces intrusion, instead of controllers..similar technique im using for my system and it can run hundreds of characters with no slowdown at all..

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...