Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by AndrewAMD. 12/05/23 10:56
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip, Quad), 622 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 6 1 2 3 4 5 6
Lots of entities = low frame rate #45051
05/02/05 09:00
05/02/05 09:00
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline OP
Senior Expert
ulillillia  Offline OP
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
Experimentation results.

For some reason, having a bunch of entities causes the engine's frame rate to drop quite drastically, even with 16x16 skins, 4 polygons and a small overall size (physical dimensions). I feel as if this is a bug so that's why I posted it here. With 2048x1024 skins, low poly, and small or large physical size, there is little difference in the frame rate. High poly, as expected, would drop the frame rate and the skin size has little effect on it.

The reason for my video card being seemingly as bad as my old one is because of this high entity count problem. I'm going to need like 1500 entities per world (likely more especially with the indoor worlds) plus likely another 500 for the main levels and this could mean running at 6 fps....


"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] #45052
05/02/05 23:00
05/02/05 23:00
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
What scripts are you running ? Are these entities running any actions ?

Re: Lots of entities = low frame rate [Re: Marco_Grubert] #45053
05/02/05 23:30
05/02/05 23:30
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline OP
Senior Expert
ulillillia  Offline OP
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
Almost all of the entities have no actions attached to them. There are but five moving platforms, but I ran an experiment in which nothing had any actions running. I can send you the experimental files I used (as a ZIP file) and you can test it yourself if you want. I'll give my conditions of my experiment and how they were as well, maybe as a TXT file.


"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] #45054
05/03/05 14:51
05/03/05 14:51
Joined: Mar 2002
Posts: 1,835
Minneapolis, Minnesota, USA
Nardulus Offline
Serious User
Nardulus  Offline
Serious User

Joined: Mar 2002
Posts: 1,835
Minneapolis, Minnesota, USA
Hi Nick,

First check and see what you are doing with the actions associated with the entities, as Marco correctly suggested.

Next do you have collision turned on for all the objects?
Are the all the entities casting shadows?

There are things done by your computers CPU, that can effect frame rates. Collision testing, culling, just traversing the draw list.

Each entity needs to be looked at by the render to determine if it should be drawn or not. Just travesing a 500 to 1500 item list will slow things down. Level geometry uses a BSP system which allows the render to skip large groups of items that may not need to be rendered in the scene. Entites do not have this advantage. Marco can correct me if I am wrong, Octree culling is in development.

Figure, for each Frame, the CPU is going to hit each entitie and if it has an action hit that also, if collisions are turned on, then collision testing takes place each frame, if you are casting a shadow, then a shadow map needs to be created and rendered, each frame, etc.

You may want to combine entities, or create some logic that activates only the needed entities and disables the ones not needed in a scene.

GPU's are really great for pushing polys, and other graphics stuff, but if the CPU can not get the data to the GPU fast enough then, its just wasted GPU bandwidth.

I would seriously consider lowering your number of entities, in some clever way.

Ken

Re: Lots of entities = low frame rate [Re: Nardulus] #45055
05/03/05 21:23
05/03/05 21:23
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline OP
Senior Expert
ulillillia  Offline OP
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
All I did was just create the entity with the default settings and positioned it where I'd like it to be. Nothing more, nothing less. If you create a model, skin it, and save it then load the entity into WED, position it where it needs to be and duplicate the entity dozens of times, the frame rate drops to almost nothing. None of the flags are set, the ambient and the related are left at the default and no actions are attached to them. I did this in a test level with no actions and stuff, but I was still getting the horrible frame rates. 500 entities doesn't seem like much. But with that many visible at once, the frame rate is very low (like 12 fps (check my experimentation results for details on the precise values)).


"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] #45056
05/03/05 23:08
05/03/05 23:08
Joined: Mar 2002
Posts: 1,835
Minneapolis, Minnesota, USA
Nardulus Offline
Serious User
Nardulus  Offline
Serious User

Joined: Mar 2002
Posts: 1,835
Minneapolis, Minnesota, USA
Actually 500 entities is a lot.

As I stated before, traversing the draw list is a function of the CPU, so a faster GPU will not help you much in your test. A faster CPU will help you.

You need to reduce the number entities in the draw list. Can you combine models, can you substitute some entities with level geometery.

Good Luck,

Ken

Re: Lots of entities = low frame rate [Re: Nardulus] #45057
05/03/05 23:45
05/03/05 23:45
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline OP
Senior Expert
ulillillia  Offline OP
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
Level geometry runs even slower than models, especially for the size of the objects I have. For example, the restaurant world's floor is like 32,768 by 24,576 quants total. I once made a wall in my old project and it took nearly an hour to build and compile, 99.9% of the time spent just tessellating textures. Yet, level geometry appears much darker than regular models without shaded mode and the surfaces are likely to be very large and could cause trouble.

I could combine some models, but that would mean gigantic skin sizes (like 2048x1024 (using 4 MB of memory)). Though, from my experimenting, skin size has practically no impact on the frame rate. The table areas, for example, in my restaurant world consist of two chairs, a table top, a table bottom, a salt shaker, a pepper shaker, and a napkin dispenser (7 models). These four entities can be combined into one without too much trouble. They're relatively simple in their shape with quite few polygons (mostly because of those straight edges). Another part of my restaurant world consists of booths instead of chairs and basically the same basic stuff from other areas. This, too, can be done as one single model, but again with a very large skin size. They don't animate and there's no need to animate them, add shadows, etc.. However, using a regular bounding box may pose problems, so I'd have to turn polygon collision on for each object. The bounding box is okay for the platform levels themselves as, well, they're already rectangles. It's the scenery of each world that has the odd shapes.

I'm looking into getting a 2 GHz processor, though I don't know what my motherboard supports. My motherboard is K7VTA3 version 6.0. I have a Duron 1.05 GHz processor right now. Anything much above 2 GHz is too expensive at this point. I've seen 2.5 GHz for $100 is is more than my budget can handle, let alone trying to get a more dependable graphics program that isn't so outdated as well as getting XP if that would help, but before I can get XP, one specific problem needs to be solved (and it's not monetary related).


"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] #45058
05/08/05 18:52
05/08/05 18:52
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
I've been running into the same problems with my current project, which is an over-head, freeform shooter. My level is all terrain and model based, but when i have for instance a bunch of trees placed in the level, I start to see noticeable lag even when they aren't visible.. even if I make them all invisible, there is a big slowdown at about 500+ entities. The tree ents have an action attached, but this is not a looping action, and at the end of the action i set my.dynamic=off; I also have enable_polycollsion=0;

Now through lots of optimizations i have managed to get my game running very smoothly. For one thing i made my tree model a group of trees, and placed far fewer.. but this is still annoying.. if an entity isn't visible, and has no action, is passable, and has dynamic off, it shouldn't take any CPU cycles at all should it? And if it has to sort through this big entity list, couldn't there be some way to have multiple draw lists, that update differently? In fact, if all these tree models were one big model, it would only be like 6000 polys, which wouldnt be hard to render at once.. why should multiple objects be any slower (if they have no actions)? I dont' think this is a bug, but perhaps the way the engine handle entities could be improved? Would the octree system fix this?

Re: Lots of entities = low frame rate [Re: Matt_Aufderheide] #45059
05/08/05 19:36
05/08/05 19:36
Joined: Mar 2002
Posts: 1,835
Minneapolis, Minnesota, USA
Nardulus Offline
Serious User
Nardulus  Offline
Serious User

Joined: Mar 2002
Posts: 1,835
Minneapolis, Minnesota, USA
Hi Matt,

In computer science we have a theorem called "The Big O Theorem", basically its about finding problems inside of an execution loop, it helps a developer find where time is being spent in an execution loop.

http://64.233.167.104/search?q=cache:ieC...eorem&hl=en



Level geometery has the advantage of haviong a BSP tree being created, this means that you do not have to traverse the whole geometery element list, you can follow a tree that has only the geometery you need to display, thus speeding up time progressing throught the draw list.


Model entites do not have the advantage of BSP, these entities are not fixed and are considered moveable by the engine. So they have to be calcuated each frame. Possibly Octree would allow a tree structure to be applied to the draw list, not sure.

Bottom line the less that needs to be done inside of start render and draw render loop the better. Travesing the draw list, is a CPU issue, the less times throught the list the better the performance....

I hope this helps. I am not Octree savy, but I have coded my share of draw list code, 2d and 3d.

Theoretically this is how things are done, 3DGS may have many tricks to speed this process-up, that would be their secret....

Ken

Last edited by Nardulus; 05/08/05 19:46.
Re: Lots of entities = low frame rate [Re: Nardulus] #45060
05/09/05 02:24
05/09/05 02:24
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline OP
Senior Expert
ulillillia  Offline OP
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
In my city world, as big as it is (34,000 quants diameter), the frame rate is extremely high, even with the whole level in view, because I mass-combined a ton of entities into one huge entity. Sprites are bad when it comes to the entity count, so avoid those and stick with models. Having one entity is about the same as having a model of about 120 polys or something. I ran an experiment a little while ago, I had 18 models on the screen at once with 4096 polys each and I was getting 18 fps. I also had a case of 624 models on the screen at once with only four polys and got basically the same frame rate. So, when making models, combine them so that you get at least 120 polys.


"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
Page 1 of 6 1 2 3 4 5 6

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