Jump to content

Zones and portals


tjheldna
 Share

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

  • Upvote 5
trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0
Link to comment
Share on other sites

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 )

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

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.

trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

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.

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

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.

  • Upvote 1
Link to comment
Share on other sites

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.

  • Upvote 1
Link to comment
Share on other sites

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 ?

Stop toying and make games

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

 Share

×
×
  • Create New...