Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Akow, TipmyPip, tomaslolo), 788 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
too many entities = sudden unexpected slowdown #32972
09/09/04 17:43
09/09/04 17:43
Joined: Jan 2003
Posts: 710
T
Templar Offline OP
Developer
Templar  Offline OP
Developer
T

Joined: Jan 2003
Posts: 710
Hi,

I have noticed some interesting engine behavior and I would like to know if anyone else experienced this too.

I'm using quite a lot entities (models) in my level - over 1300. The level actually uses almost no level geometry at all. I have found out that once entity count gets over a certain number, the fps starts to drop and jerks appear. The first strange thing is that the jerks appear even at fps where the game should run still smoothly (over 60 ), the second strange thing is that this behavior seems to be caused just by the fact that these entities exist - not by their behavior. It doesn't matter if their action is complicated or if there's none. It actually does not matter even if they're currently in the camera view! To put ir straight - if I put 1300 models in my level, without any action and they're out of camera view, fps goes down no matter what actions run or how many polygons are currently visible.

Does anyone know why is this happening?

T.

Re: too many entities = sudden unexpected slowdown [Re: Templar] #32973
09/09/04 19:37
09/09/04 19:37
Joined: Jul 2000
Posts: 11,321
Virginia, USA
Dan Silverman Offline
Senior Expert
Dan Silverman  Offline
Senior Expert

Joined: Jul 2000
Posts: 11,321
Virginia, USA
I can only guess here (since I don't typically build levels this way), but entities are not considered by the BSP build. As a result, they will all appear to the camera UNLESS you set camera clipping so that any entity outside the clipping range is ignored. Therefore, I am going to suggest that you adjust your clipping range so that less geometry is taken into account by the camera.


Professional 2D, 3D and Real-Time 3D Content Creation:
HyperGraph Studios
Re: too many entities = sudden unexpected slowdown [Re: Dan Silverman] #32974
09/09/04 19:47
09/09/04 19:47
Joined: Jan 2003
Posts: 710
T
Templar Offline OP
Developer
Templar  Offline OP
Developer
T

Joined: Jan 2003
Posts: 710
Thanks Dan! That might actually explain it. But if it was so, wouldn't there also be a very high number in debug panel where visible polygons are shown?

Re: too many entities = sudden unexpected slowdown [Re: Templar] #32975
09/09/04 22:47
09/09/04 22:47
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Entities are culled by the BSP process.

But there's a bug in the 6.30 version that causes a heavy slowdown when the entities are ent_created, or have an action. This is caused by a physics bug (even it the entities don't use physics), and will be fixed in the next release.

But if you experience the problem also with older versions, like 6.22, there must be a different reason. The next version will have a more complete statistics panel that shows by which part of the frame cycle the slowdown happens.

Re: too many entities = sudden unexpected slowdown [Re: jcl] #32976
09/09/04 23:25
09/09/04 23:25
Joined: Jan 2003
Posts: 710
T
Templar Offline OP
Developer
Templar  Offline OP
Developer
T

Joined: Jan 2003
Posts: 710
Thanks for your reply!

Unfortunately this happens with version 6.22.
I managed to get smooth gameplay by having only about half of the entities in the level ( about 500 ) and ent_creating the rest and removing them at runtime when needed so that the count never gets over 500. This way (along with avoiding ent_create peaks) I achieved completely smooth gameplay, that was not at all possible when having all the entities in the level from the start.
How many entities there can be before the visible slowdown appears seems to be related ( though I might be wrong ) to CPU performance.

It's great to hear that the slowdown problem in 6.30 was located.
I'm looking forward to trying the improved statistics panel! What do you exactly mean by "next version"? The next public beta or 6.4?


Re: too many entities = sudden unexpected slowdown [Re: Templar] #32977
09/09/04 23:41
09/09/04 23:41
Joined: Jan 2003
Posts: 710
T
Templar Offline OP
Developer
Templar  Offline OP
Developer
T

Joined: Jan 2003
Posts: 710
I have one more question. Would entites be culled even if I turn visibility calculation to off? I'm using isometric camera pointing at ground and not using level geometry to "hide" anything so I guess that I don't need that? The entities that are outside camera frustum should be culled anyway, right?
I'm asking because I'm considering using level geometry as a sort of bounding boxes for models (and using old colission system to save some performance) and that would generate too many unnecessary portals and make visibility calculation impossible.

Re: too many entities = sudden unexpected slowdown [Re: Templar] #32978
09/10/04 00:28
09/10/04 00:28
Joined: Oct 2003
Posts: 1,258
Virginia, USA
qwerty823 Offline
Senior Developer
qwerty823  Offline
Senior Developer

Joined: Oct 2003
Posts: 1,258
Virginia, USA
While I can't answer for JCL, i think he means next beta (which will eventually make it to the public), but from the 6.30.3 beta.txt section:

Code:

time_level
Time in ms/frame consumed by level rendering.

time_sky
Time in ms/frame consumed by sky rendering.

time_entities
Time in ms/frame consumed by entity rendering.

time_effects
Time in ms/frame consumed by particle rendering.

time_portals
Time in ms/frame consumed by portal/mirror rendering.

time_panels
Time in ms/frame consumed by panel rendering.

time_update
Time in ms/frame consumed by screen refresh.

time_actions
Time in ms/frame consumed by script execution.

time_pfuncs
Time in ms/frame consumed by particle functions.

See also:
time_physics.



For finding performance problems, the best thing to do is pull up the debug panel (F11, statistics section in the manual), and watch the ms column. When the framerate takes a nosedive, one of those values will go up. See which one it is, and start from there (or post a screenshot or the numbers from it).

As to your other question, it all depends. How many polies your entities have, whether they all use the same mesh, texture sizes, their actions, etc, all effect how many you can have.

1300 cubes (12 triangles) with a 64x64 texture, all the same mesh with no real action, would use almost no resources.

But 10 models, with 10K tris each, and 1024x1024 texture, all different meshes, and an action that computes PI to 100 digits will use substantial resources.


Never argue with an idiot. They drag you down to their level then beat you with experience
Re: too many entities = sudden unexpected slowdown [Re: qwerty823] #32979
09/10/04 01:26
09/10/04 01:26
Joined: Jan 2003
Posts: 710
T
Templar Offline OP
Developer
Templar  Offline OP
Developer
T

Joined: Jan 2003
Posts: 710
Thanks for clearing thsi statistics panel thing for me!
Quote:

As to your other question, it all depends. How many polies your entities have, whether they all use the same mesh, texture sizes, their actions, etc, all effect how many you can have.

1300 cubes (12 triangles) with a 64x64 texture, all the same mesh with no real action, would use almost no resources.

But 10 models, with 10K tris each, and 1024x1024 texture, all different meshes, and an action that computes PI to 100 digits will use substantial resources.




Yes, that is true but no matter how complex the models are and how many of them are there, there should be no slowdown as long as they're out of the view and their actions are simple or none, right? ( and as long as there's no texture swapping happening) Why should their existence affect fps in any way when they exist completely elsewhere in the level? Maybe I'm doing something terribly wrong and they are somehow visible to camera ( even when they're obviously out of camera frustum) ....

EDIT: I'll wait and see if I can find out more with the new statistics... Thanks everyone!


Re: too many entities = sudden unexpected slowdown [Re: Templar] #32980
09/10/04 02:36
09/10/04 02:36
Joined: Oct 2003
Posts: 1,258
Virginia, USA
qwerty823 Offline
Senior Developer
qwerty823  Offline
Senior Developer

Joined: Oct 2003
Posts: 1,258
Virginia, USA
Quote:

Yes, that is true but no matter how complex the models are and how many of them are there, there should be no slowdown as long as they're out of the view and their actions are simple or none, right? ( and as long as there's no texture swapping happening) Why should their existence affect fps in any way when they exist completely elsewhere in the level? Maybe I'm doing something terribly wrong and they are somehow visible to camera ( even when they're obviously out of camera frustum) ....




W/o knowing the engine internals, its hard for me to answer this. As I said before, looking at the debug panel to see which value increases is the first step to understanding where the drop occurs. As you've stated, if the objects are indeed being culled, and not sent to the rasterizer, there shouldnt be a drop in fps just from them being there. Post a screenshot of your debug panel if you can, or the ms numbers when your framerate drops.


Never argue with an idiot. They drag you down to their level then beat you with experience
Re: too many entities = sudden unexpected slowdown [Re: qwerty823] #32981
09/14/04 02:02
09/14/04 02:02
Joined: Sep 2002
Posts: 1,604
Deutschland
ChrisB Offline
Serious User
ChrisB  Offline
Serious User

Joined: Sep 2002
Posts: 1,604
Deutschland
I noticed an also strange fps drop. On my level all entitys are ent_created. I use a code which calculate every frame a new universal scale (nothing special, only one line). Every entity has an action which updates his own my.scale with the univeral scale every frame (the level looks much bigger with this trick ). But this process kills my fps!!!!
It runs nearly smooth without this code (setting the universall scale to 1), but with the calculation its unplayable. The calculation of the scale its not the problem, but the update of entity scales.

So my question: How fast is my.scale_x=value;????
Note: every frame for 500+ entitys

ChrisB


www.Swollen-Eyeballs.org
ICQ:169213431
#3dgs@quakenet
Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

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