Jump to content
tjheldna

Zones and portals

Recommended Posts

Some sort of zoning and portal system to occlude unnecessary entities is well needed in this engine, something like in C4 and I think Unreal use it to for memory.

 

I've created an almost identical scene in the C4 engine which makes very good use of these techniques and I can fit a comfortable 250 (300 but frame rate suffers) house models on screen at once. Even still if house models start to be occluded by zones etc frame rate is fine. I still have the option for LOD and did no texture compression.

 

The same house model and interior in C4 I only get 80 - 90 house models on screen at once, which then crashes Leadwerks. I know we experimented with some dodgy house setups in the past as seen in some other threads, but this has been rectified now.

 

I'm just thinking ahead and all about performance to handle the load as our scene gets bigger. I just don't think onscreen occlusion (whatever it's called) and distance culling is enough. I want to see optimisations that make this engine purr.

 

Don't take this the wrong way as I know mentioning other engines is never popular, but I felt this needed to be said as it's a close to straight comparison as I can get and the vast difference been playing on my mind ever since.

 

Cheers

Share this post


Link to post
only get 80 - 90 house models on screen at once

It's already good in LE3. Unity has same problem and they are just making possible bigger worlds with UT5. It's not a simple , easy task.

Share this post


Link to post

Are the house models instanced or are they unique? I'm just curious if it's related to a performance problem I've been having.

Share this post


Link to post

Sound like your asking for streaming terrain/maps - which wont really work with the current leadwerks map format I think ( you'd have to chunk up the map + model loading )

Share this post


Link to post

I believe the main issue is via the editor itself. We already do our own optimizations during run-time. It seems that view range does help the editor (and should our game a little but it's a top down view so you don't see much anyway) but you are then limited in your overall view of your map and can't get a really good overview of it.

Share this post


Link to post

The built-in occlusion culling system makes old-school portal systems redundant and does away with the need for this. The house stuff you guys were doing was ridiculously inefficient, from what I saw...you had hundreds or thousands of entities making up each little patch of floor. You practically had a separate entity for each individual polygon.

Share this post


Link to post
The house stuff you guys were doing was ridiculously inefficient, from what I saw

 

I know we experimented with some dodgy house setups in the past as seen in some other threads, but this has been rectified now.

Share this post


Link to post
The house stuff you guys were doing was ridiculously inefficient, from what I saw...you had hundreds or thousands of entities making up each little patch of floor. You practically had a separate entity for each individual polygon.

 

I totally agree, like I said the ways of the past have been rectified and each house now is split into 3 entities only now: external walls, internal walls and roof and only have the internal walls + props appearing on a house when the player is within a certain distance from it.

 

I literally tried every possible way of creating the house models to find out what was the most effective way of doing it and what we can get away with for the size of our project so we are not coming to grief when we are too committed and it's too late.

 

I get this probably wont happen, but it's the suggestion box so what the hell.

Share this post


Link to post

So here is a question. Our interior (1 solid interior model NOT made up of smaller models) of the house is a separate model from the exterior (again this is changed now to be 1 solid model), and a separate roof model. If I'm looking directly down on the house so the camera can't "see" the interior (roof and exterior are in the way) I assume in LE the interior is still drawn because it's bounding box is visible to the camera? In other words, if a bounding box is inside another bounding box, that interior bounding box will be drawn?

Share this post


Link to post

It doesn't evaluate each individual entity, unless that entity has individual occlusion mode enabled (in which case the AABB is evaluated, not the model itself, because that would be just as slow as just rendering it). Instead the routine discards chunks of the scene. This means it isn't pixel-perfect for each object, but it's much faster this way and eliminates big pieces of occluded scenery.

Share this post


Link to post

..this sort of things are usually much easier to control and get proper results with scene graph oriented (exposed to a programmer), rather then entity oriented system..

Share this post


Link to post

Is this edit time or runtime?

A simple grid system for occlusion usually works great if the default octree ranges aren't good enough.

Share this post


Link to post

ViewRange Far or Medium doesn't help either?

Could you post your prefab/model so we can try it?

Share this post


Link to post

What I have done is to use different viewrange settings, like all entities with a small aabb uses Near or Medium, works nice for most interiors, chairs, and tables or lamps, weapons doesnt have to render when your not even close. While big items walls etc uses Far or Max.

A house from 200m away doesn't really have to show the windows/doors or anything inside it. Mainly just walls and big stuff.

Share this post


Link to post

Our interiors are prefabs that we load and unload at runtime to save memory and processor time since most things on the inside have scrips on them and we plan on having hundreds of houses in the scene. We precache one of everything at startup so loading unloading is instant and happens when we are in a specific range of a house. We are trying to be efficient with our memory and processor usage since we want large outdoor scene but very detail. Having a top down rts like view helps aid in doing that by dynamically loading and unloading entities as the player walks around.

Share this post


Link to post
We precache one of everything at startup so loading unloading is instant

What do you mean by precache ? a table of unique prefabs and you create new copy of prefab at runtime ?

Share this post


Link to post

We preload 1 of every model/texture so during runtime when we load them only instances are created and that's instant.

Share this post


Link to post

How do you manage when you need instancing ? Some level grid and looking where is the player on that grid ?

Or simply is your level linear and you just check distance change ?

Share this post


Link to post

Currently I do a bounding box check (ForEachEntityInAABBDo()) around the player once every 2 seconds or so. I cycle through the entities that exist and if it's a house exterior I load it's interior which is defined as a variable in the house exterior script. I track what we have loaded so when the character moves away from the house (their bounding box no longer includes the exterior house entity) we unload the interior (which is a prefab that has all the furniture and stuff).

 

The trick with doing this is that we need AI to still exist and walk around inside houses so each house has it's own interior collision csg that is always visible in the map so the navmesh can be created and AI can move inside the house even though there may not be any interior model. We want our AI to be doing things in the world so even though we may not be near them (and so the interior models won't be loaded) they may still be moving around inside the house as if there were visual models. We are still sort of playing with this aspect though. Things can change with this.

Share this post


Link to post

If LE3 has plugin system and you would transform your zone load/unload system into a plugin, i think many of us would have baught it.

 

We want our AI to be doing things in the world so even though we may not be near them (and so the interior models won't be loaded) they may still be moving around inside the house as if there were visual models.

I don't think it's important to manage AI when you are far enought from a house, if it's indoor only AI ?

How do you manage AI ? Do you activate and manage only nearest AI or do you manage far away ones ?

Share this post


Link to post

AI can wonder around. They can go from inside to outside and outside to inside. The AI is the part I'm working on now so it's being shaped currently.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...