updating positions of many entites slows down fps

Posted By: gameplan

updating positions of many entites slows down fps - 10/04/12 17:05

Hi,

i have some trouble with a very fps dropping code. Usually, there are round about 100 entites at the same time in front of the players view. There are severel "masterentities" and they move around. All other entites have to stay in the same relative position and angle to theire masterentites.
I get this working by saving all relative vectors for positioning the entites in one array. At each frame, the relative position of every entity gets updateted with the position vectors from the array, depending on the new position and angle of the masterentites.

So this slows down fps.
I have noticed that there isthe posibility to merge entity meshes (like it is shown in another diskussion here), but is there any other possibility to get all entites moved without doing all this vector and array stuff on each frame for each entity?

Thanks
Posted By: Uhrwerk

Re: updating positions of many entites slows down fps - 10/04/12 20:13

You can put together several entities into a wmb entity. This will do the same as manually updaing the entities. However, I doubt that this is really the reason for the slowdown. Updating 100 entities and some vector calculations are not much of a task. Have you examined the debug panel?
Posted By: sivan

Re: updating positions of many entites slows down fps - 10/05/12 07:45

I also had a slow down when tested a few hundred vertex animated soldiers with runtime attached randomized heads, weapons and shields. it really does depend on how you calculate relative positions. cloning also can result in slow down.
if use only vec_for_vertex and get the same pan, it is relatively fast. if more complex vector calculations are applied it can be felt...
if you have bone animations, you can use vec_for_bone and ang_for_bone (but I have little experience with it).
if entities are animated you can merge them in MED and use vmask runtime to show only what you need, or use wmb if they are non-animated (but merging them in MED also fine).
but it really depends on your particular application, which is the best way...
© 2024 lite-C Forums