|
|
Re: Lots of entities = low frame rate
[Re: ulillillia]
#45081
08/23/05 14:46
08/23/05 14:46
|
Joined: Nov 2003
Posts: 1,659 San Francisco
JetpackMonkey
Serious User
|
Serious User
Joined: Nov 2003
Posts: 1,659
San Francisco
|
Ulillila
YOU ARE KING!!!!!!!!!!!!!!!!!!!! I would give you 10 stars if I could..
Two questions:
1. Can my.dynamic = off be applied to sprites? It just says non-moving "entities" in the manual! This begs the question then-- if yes, does it also apply to non-rotated sprites, which rotate automatically.
2. My.dynamic can be used when the object is static. Is this only for transformations like rotation and translation and scale? Or does it also apply to things moving by mesh deformation, specifically a terrain-based water mesh.
3. What about non-moving entities (eg scriptless, not being moved by a script) which are just cycling through their animation?
Your findings are really useful!
Last edited by Bonanza_Jellybean; 08/23/05 15:03.
|
|
|
Re: Lots of entities = low frame rate
[Re: JetpackMonkey]
#45082
08/23/05 15:08
08/23/05 15:08
|
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
|
Quote:
Ulillila
YOU ARE KING!!!!!!!!!!!!!!!!!!!! I would give you 10 stars if I could..
It was just an experiment that I wanted to rerun due to more knowledge I had and that my last run didn't really have much to go on.
Quote:
Two questions:
1. Can my.dynamic = off be applied to sprites? It just says non-moving "entities" in the manual! This begs the question then-- if yes, does it also apply to non-rotated sprites, which rotate automatically.
It likely can, but since sprites are two polygons, it'd have practically no noticeable effect thus not all that worth it.
Quote:
2. My.dynamic can be used when the object is static. Is this only for transformations like rotation and translation and scale? Or does it also apply to things moving by mesh deformation, specifically a terrain-based water mesh.
Your findings are really useful!
That I'm not too sure on. Mesh deformation I've never done (and don't know how either). Dynamic means "changing". If you make it not dynamic (or not changing), you couldn't change anything. If you have a one-time case of, for example, making something transparent, add a wait(1) instruction before turning the my.dynamic flag off. I don't know, however, if the my.dynamic can be turned back on again (such as through a function) to make a small change. For things like water, because it changes constantly, you'll need the my.dynamic set to on or the animation simply won't work.
"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]
#45083
08/23/05 15:20
08/23/05 15:20
|
Joined: Nov 2003
Posts: 1,659 San Francisco
JetpackMonkey
Serious User
|
Serious User
Joined: Nov 2003
Posts: 1,659
San Francisco
|
Hey
Thnx U--
Hmm I just did a test on a water mesh HMP, and you know what? Even with my.dynamic=off, it still animates/deforms properly. Whether or not this improved my speed, I can't say.
This is excellent. BTW i've got a jillion sprites in my game, fortunately I scripted them all way in advance. I noticed a significant improvement when I inserted that my.dynamic=off in there.
Last edited by Bonanza_Jellybean; 08/23/05 15:33.
|
|
|
Re: Lots of entities = low frame rate
[Re: JetpackMonkey]
#45084
08/23/05 15:49
08/23/05 15:49
|
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
|
A "jillion" sprites? That's not good, however many a "jillion" is. I strongly suggest that you rethink your level and replace sprites with models if you can, unless, of course, you've got a good reason for having that many.... To test if the speed was changed, all you have to do is delete the "my.dymanic = off" line, test run the engine, and note the fps. Then add the line back in and test again. Normally, there would be a detectable change if this was the case.
"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]
#45085
08/23/05 22:46
08/23/05 22:46
|
Joined: Nov 2003
Posts: 1,659 San Francisco
JetpackMonkey
Serious User
|
Serious User
Joined: Nov 2003
Posts: 1,659
San Francisco
|
Yeah, I'd do that, but I'm too lazy. I'll just take the benefit of the doubt. And yeah, I'm all about these sprites  gotta keep em. But really-- a mess of MDL's is faster than a lot of sprites?
|
|
|
Re: Lots of entities = low frame rate
[Re: JetpackMonkey]
#45086
08/24/05 10:34
08/24/05 10:34
|
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
|
A mess of single MDLs duplicated in WED (having a lot of objects) has about the same impact as a mess of sprites in the same way. The exception is when the mess of MDLs is in one single MDL file where you can get 15 times the speed or more.
"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: JetpackMonkey]
#45088
08/25/05 07:47
08/25/05 07:47
|
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
|
If the models have actions on them, use separate models. If they're static (not moving), then combine them into one.
What I mean by several models existing in one massive MDL file is to have all the points, vertices, etc. in a single MDL file and that it is all visible in MED. This is best when you have objects of the same thing or using the same texture. The only disadvantage to this is that the textures cannot go above 1024 pixels on a side and that the models cannot go above 32,768 (or maybe 65,535) faces/vertices. Other than that, the advantages are tremendous. And using a map entity with several MDL's inside doesn't work either - my platforms in my game, for example, are of a map entity and, with only 80-some objects (which can be reduced to 50-something), I notice a lag in the frame rate when all visible. If I remove it, there's an increase on the frame rate, about 6 fps, so even if you had a map entity with 1024 objects in it, even if very simple, then it could have a huge impact on the frame rate. If you've seen the screenshots from my experiment, when I mass-combined 2048 objects into one single MDL file, the frame rate is higher, a lot higher. You can download the models I used in the experiment and see for yourself. It's double-zipped as zipping up the first ZIP file compressed it a strong 50%. It's the one ending in "all.mdl" with some stuff before that. See how that one is designed? That's combining all into one.
"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]
#45090
08/26/05 03:06
08/26/05 03:06
|
Joined: Sep 2004
Posts: 260 UB,Mongolia
Olzii
Member
|
Member
Joined: Sep 2004
Posts: 260
UB,Mongolia
|
Hi ulillillia,
I wrote good script for lots of entities. It will reduce entity count and will increase frame rate.
Before in my level i have placed a lot of similar entities like trees /3600trees/.
Now i am creating only 100 trees. These trees are DYNAMIC trees. In my script maximum 100 trees will be visible. if one tree is going invisible to camera, i will place it to another tree location.
Perhaps, my idea will help a lot of people from placing so many trees.
The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
|
|
|
|