|
|
Re: Lots of entities = low frame rate
[Re: Jamie_Lynn]
#45092
08/26/05 05:44
08/26/05 05:44
|
Joined: Sep 2004
Posts: 260 UB,Mongolia
Olzii
Member
|
Member
Joined: Sep 2004
Posts: 260
UB,Mongolia
|
Ent_create is slow function. Creating many entities using this function is very slow.
I have prepared 100 trees at startup and after just changing it's position. It is faster.
The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
|
|
|
Re: Lots of entities = low frame rate
[Re: Olzii]
#45093
08/26/05 10:40
08/26/05 10:40
|
Joined: Oct 2004
Posts: 1,068
Jamie_Lynn
Senior Developer
|
Senior Developer
Joined: Oct 2004
Posts: 1,068
|
Well my scenario is a little different. I am only dealing with 20-40 entities at a time (when creating or removing). With the code I am running currently... I have approx 650 entities in the level at a time, only about 70 are visible (using camera clipping range and fog etc) and I have about 50 functions running. I have what I consider a mid-range card - but on this site it is probably considered a low-end card... and I am getting 70 fps. So i am pretty happy with things. I would like to see if I can optimise it up to 80 fps ... but it is getting increasingly hard to gain any ground as the system is performing so well. Edit: I couldn't resist adding this ... when performance testing it is important to understand the "knee of the curve". Otherwise you can not understand why you have gotton "dramatic improvements" when changing a variable. In the above diagram, it is important to note that the unit of "work" is the same for each delta drawn on the curve.
Last edited by Jamie_Lynn; 08/27/05 00:24.
|
|
|
Re: Lots of entities = low frame rate
[Re: Jamie_Lynn]
#45095
08/27/05 01:20
08/27/05 01:20
|
Joined: Sep 2004
Posts: 260 UB,Mongolia
Olzii
Member
|
Member
Joined: Sep 2004
Posts: 260
UB,Mongolia
|
In my scene, I have over 400 wmb buildings with their LOD and about 3000 trees, plus 3000 small objects. Without these trees and small objects my fps is good.
Now i am deleting all my trees, small objects and doing above my method.
The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
|
|
|
Re: Lots of entities = low frame rate
[Re: Olzii]
#45096
08/27/05 10:26
08/27/05 10:26
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
OP
Senior Expert
|
OP
Senior Expert
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
|
Even if you have 1000 entities, you could still get 70 fps, but, when all are visible at once (as in my experiment), then the frame rate drops like crazy! When they aren't visible, however, that's what's giving you the high frame rate. Try getting the whole level in the view and you'll see this very thing happen.
"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip
My 2D game - release on Jun 13th; My tutorials
|
|
|
Re: Lots of entities = low frame rate
[Re: ulillillia]
#45097
08/27/05 14:15
08/27/05 14:15
|
Joined: Jun 2005
Posts: 656
Grafton
User
|
User
Joined: Jun 2005
Posts: 656
|
Olzii your method sounds very interesting. The advantage of having less entities for the engine to cycle through sounds good. But with this method, isnt almost the same amount of engine time taken up cycling through all the possible locations anyway, checking if they are visible to the camera? Could you further explain your method or post some code?
What I am doing is combining lots of tree entities (as Ulillillia already advised) into one model. However this limits your ability to change LOD and creates collision issues, so I am looking for alternatives.
Related to this subject, I just finished running a experiment using 800 trees to find the fastest "double sided" polygon rendering method. The first was traditional trees using double polygons with normals facing opposite directions, and the second used trees with single polygons using the wiki material (cullmode = none).
To my suprise, the frame rate was significantly higher with the traditional trees than the materialed trees, even though they had over 30% more polygons per tree!
Not two, not one.
|
|
|
Re: Lots of entities = low frame rate
[Re: Grafton]
#45098
08/29/05 01:35
08/29/05 01:35
|
Joined: Sep 2004
Posts: 260 UB,Mongolia
Olzii
Member
|
Member
Joined: Sep 2004
Posts: 260
UB,Mongolia
|
Hi Josiah,
Now i am replacing all my small objects like trees, lights ... and doing scripts for them. I have a big real city. My city has many small objects. Trees 3000, lights 2500, advertisements 1000, so on. I placed all these object on my ground, and FPS was really bad 0-1FPS. Now it is increasing, after changing my trees it goes 10FPS. I decided to change it all.
My algorithm is very simple, if you want i can share it to contributions.
The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
|
|
|
Re: Lots of entities = low frame rate
[Re: Olzii]
#45099
08/29/05 03:16
08/29/05 03:16
|
Joined: Jun 2005
Posts: 656
Grafton
User
|
User
Joined: Jun 2005
Posts: 656
|
That would be great if you decide to share, please do. I think everyone could benefit from it and appreciate it also. Otherwise perhaps you could elaborate on it a little more?
Not two, not one.
|
|
|
|