Game Development Community

Performance question. low FPS at a distance..

by Flybynight Studios · in Constructor · 08/30/2008 (6:58 pm) · 10 replies

Still pretty new to constructor but I was doing a lot of DIF modelling a couple years back and dont recall this issue. I have currently made 3 buildings in constructor and dropped them into Torque and they look great. I have correctly (I think) designated structural and detail brushes.

The models are configured in a little village where I have placed 1 instance of each model (for a total of 3 buildings) within a 100 foot circle area.

When I am within the model area and running from 1 building to another performance is not bad.. However when I run away from town for a bit and turn back to face the village the frame rate craters to 1 FPS. As I get closer to the village again it picks up substantially.

Now I have not done any LoD on my buildings but I cant see as that should make for a negative performance hit as I move away from the buildings should it? I woudl assume that LoD would simply increase performance as I move away ...

Any suggestions?

Thanks in advance.

PS: Constructor is "The bomb" btw :) thank you.

#1
08/30/2008 (7:49 pm)
LOD, will definitly help that situation. Also, if you have other objects such as DTS tables/npcs that populate the village, I suggest looking into Portaling the buildings. A word of caution, and its been my experience Constructors doesnt like the export of LOD with portals.

As for the distance issue. Since you can see the entire village at once from the road, i am assuming the village is 1 single DIF. there is 2 options. Break up the 1 large Dif into several and use terrain occlusion and LOD to take the load off. Such as let the player see only a part of the town from the distance via a hill or have features to bend the town around a terrain feature. This can be hidden even within a building or mixed in with land features. like terraced farm land or its such as that.

Just remember when your in the middle of the models, you are only rendering whats in front of your, ie looking at. When you are looking at the whole of the scene, its everything at once.

Though I am not sure exactly what you are modeling, with 3 buildings taking up so much FPS.

i144.photobucket.com/albums/r183/racs333/commonersdistrict.jpg
This is 11 (500+ Brushes) buildings, including NPCs and DTS furnishings, They do not have LOD but are portalled, and i have a regular 40-60 fps. All the buildings were created in Constructor as well. This is inside of a large open city area.

If you have 3 buildings creating that kind of lag. Check your textures, are you using 1024x 1024 textures when you could be using 512x512, reduced the amount of brushs and faces. I have found in several models i have reviewed from others that simple brush reduction can reduce brushes by 30% without reducing any of the exterior appearance. Also constructor has a tendancy to create bad faces. This isnt something you and i can control however, but i have had several models I have had to reexport to fix bad faces or faces with no collision. Any of these things, could be the issue. Hope this helps
#2
08/30/2008 (9:34 pm)
Hey Edward, thanks for the feedback but maybe I didnt explain it right..

My "village" is 2 DTS models, a gate and a wall section. The gate is repeated twice and the wall section is repeated 15 or so times. There is no issue with performance when I leave the village and look back with just the DTS shapes..

The buildings are individual DIFs as I said above, not a single DIF. I am aware of how LoD works in relation to a players position but I have never seen this effect before. As I said, standing beside any of the three buildings seems to be fine and runnign around inside them or around them is fine.. Leave town and turn to look back from a few hundred feet away and the frame rate craters. My textures are all 128 or 256 not using anything 512 or greater yet. My brush count per building is approx 20 structural brushes and 10-20 detail brushes per building.

I will have to do some more testing tonight. My first building I would consider structurally "iffy" as far as tight seems go so I'll try and isolate the problem to that. I do not understand portals but maybe that is something to consider as well.

BTW, just to be clear ther eis NOTHING else in the village aside from the gate and walls and 3 DIF buildings. No NPCs no mobs no other DTS/DIF objects. My zone operates flawlessly aside from when I started tossing those DIFs in. I was wondering if there was a step I was missing with Constructor or something.

Here is the building that is perhaps not "tight" on the structural brushes:
www.aakrana.com/images/donotupload/SShvbuilding4.jpg
And here is my last building which is very well done and tightly constructed.
www.aakrana.com/images/donotupload/SShvhovel2.jpg
Thanks for your suggestions. I guess I'll keep pounding away at it. I probably need to understand portals to figrue out if they are part of the issue.
#3
08/30/2008 (10:44 pm)
Did some more testing. The problem is with my large structure feature din the first SS. I was playing around with snap to grid and grid sizes and I know I definitely forked up some of the connections between structural brushes. I assume I have a significant ammount of leakage in that building and thats whats causing my frame rate issues.

It is very clear to me that the models are functioning very well considering no LoD aside from that first abomination heh. I wanted to redo it anyways. Not bad for my first constructor model though. :) I consider it a learnign experience. I hadnt caught on to deplicating brushes etc for that one and it was all meshed by hand. very nasty.

I will still try and sort out portalling because I am sure it is somethign importatn I should know and the basic concept shoudl be simple. (Isnt it something about rendering whats inside the interior of the "portal" Like a window or doorway into the dif?

I'll let you know how my revamp of building one goes :)

Peace
#4
08/31/2008 (1:45 am)
Got it sorted now. Doing even more brushes and not getting the framerate impact at all. Still need to add in a ton of detail brushes but so far Im real happy with the new model.

One problem though is I am getting a ton of light leaking.. I'll have to read up on that. Not sure what kind of strategies can be used to fix that.

www.aakrana.com/images/donotupload/SShvbuilding2a.jpg
#5
08/31/2008 (6:06 am)
Looks good, im glad that you found that issue. Yah, lightleaking is a issue, i havent found a issue to stop lights inside from shining through either,Id loved to figure that one out even in portalled building. But for portalling, you have to make sure the model is sealed up tight. You have to cover ever window with a portalled brush, and have all brushes sealed up tight. or it wont work. Its a pain. but for your first model. Very awesome. Constructor can be touchy, but it works.

So as for the wall modeles... Are they arranged in a predetermined fashion? You can reduced the wall model even further by connecting them and exporting them 2-3 wall segments wide, such as the entrance and the 2-4 side piece on each side. Simply replicating the brushes adds up fast. I realize its minor, but its much easier to place ,and 1 item to Modify vs 5 is always good. That may help some. create a prefab wall or setup if you have a certain wall style, you can use it to create walls against buildings or even features to split areas of the village up.

Looks great. Constructor does rock, when you compare its free and not too bad vs some of the more expensive and complex alternative.
#6
08/31/2008 (7:52 am)
There's an interesting note on light leaks on the TDN which to be honest I haven't fully understood yet, but seems relevant if you're seeing leakage on what you believe is a well sealed DIF.

Quote:The so-called light leaks you see in your DIFs are not light leaking through cracks in between brushes or anything of the sort. They are light bleeding across the edges of the light maps. We saw above that the number of texels is bound to binary divisions of the Meter. The problems with lightmaps occur when you have an oddly sized brush face.

More here.
#7
08/31/2008 (10:17 am)
Im fairly sure the structural model is very well sealed because I was very careful with the structural brushes and used snap to grid on almost the entire model. Every single structural brush is lined up vertex to vertex which I assume means a good fit?

Last time I did DIF modelling I seem to recall that having your brushes "collide" or penetrate each other is a bad thing for performance. Is that true or just old wives tales? As an example, 95% of the model is vertex to vertex but on some of the angle work for the roof structure The angles wouldnt line up "just so" so I had the wall vertex penetrate into the roof brush just slightly to ensure a tight fit. Is that the correct method for "Sealing up" a structure?

Thanks very much for the input guys.
#8
08/31/2008 (10:34 am)
From what I understand having brushes intersect cause them to be split which increases the poly count, potentially by a lot, which obviously reflects in a performance hit.

Haven't used it yet, but I'm fairly sure there's some way to change the render mode in the engine while in debug mode that shows DIF's as polys rather than textured. Can't remember where I read how to do it though.

EDIT: SetInteriorRenderMode TorqueScript console function is the puppy.
#9
08/31/2008 (10:23 pm)
One way to fix "light leaks" is to decrease the light_geometry_scale under Scene->Manage Entities... (must be a power of 2). This will increase the resolution of the lightmap, which will result in sharper shadows and reduced "light leaking" but will result in a larger DIF file. Also, it can be a pain to work in debug mode, especially if you're going to be doing relight stuff (setInteriorRenderMode requires a relight). So I suggest compiling a release version with the preprocessor definition INTERNAL_RELEASE to enable setInteriorRenderMode in your release EXE.
#10
08/31/2008 (10:57 pm)
Quote:Last time I did DIF modelling I seem to recall that having your brushes "collide" or penetrate each other is a bad thing for performance.
No this is not correct.

It is bad to have .dif structure to collide or penetrate each other. It's causing performance issues and even hard crash on older TGE versions (pre 1.4.2).