Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 946 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
updating positions of many entites slows down fps #408617
10/04/12 17:05
10/04/12 17:05
Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
G
gameplan Offline OP
Member
gameplan  Offline OP
Member
G

Joined: Aug 2011
Posts: 133
Germany, Supergeheimes Hinter-...
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


Version: A8 free
OS: Windows 10
Re: updating positions of many entites slows down fps [Re: gameplan] #408624
10/04/12 20:13
10/04/12 20:13
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
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?


Always learn from history, to be sure you make the same mistakes again...
Re: updating positions of many entites slows down fps [Re: Uhrwerk] #408647
10/05/12 07:45
10/05/12 07:45
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
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...


Free world editor for 3D Gamestudio: MapBuilder Editor

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1