Non-Instanced Housing and Lag

Discussion in 'Housing & Lots' started by NirAntae, Oct 23, 2013.

Thread Status:
Not open for further replies.
  1. NirAntae

    NirAntae Avatar

    Messages:
    1,367
    Likes Received:
    2,686
    Trophy Points:
    125
    Gender:
    Female
    Location:
    Mississippi
    One of the big arguments for instanced housing, is the lag non-instanced housing can cause for people just running through the town.

    During a convo in chat on the subject, I came up with the following idea:

    What about the possibility of making some sort of "mini instance" for the inside of houses? That is, the yards and exterior of the houses would load as you run by, but the contents of the house wouldn't load until you entered the lot or got within a certain proximity of the house itself.
     
  2. Sir Seir

    Sir Seir Avatar

    Messages:
    1,055
    Likes Received:
    1,526
    Trophy Points:
    125
    Gender:
    Male
    Location:
    Bailey, CO
    You could test this out in Unity today, just build out a complex house prefab and drop a few hundred of them in a scene and see what it does. I'm pretty sure it only loads what is within range and visible...

    I would imagine and hope the devs will optimize this anyway.
     
  3. NirAntae

    NirAntae Avatar

    Messages:
    1,367
    Likes Received:
    2,686
    Trophy Points:
    125
    Gender:
    Female
    Location:
    Mississippi
    That presupposes I know the first thing about Unity ;) I can't even play the web browser version of the scene jam scenes reliably on this computer, I certainly couldn't build them.
     
    Seir likes this.
  4. Sir Seir

    Sir Seir Avatar

    Messages:
    1,055
    Likes Received:
    1,526
    Trophy Points:
    125
    Gender:
    Male
    Location:
    Bailey, CO
    ;)

    You've sparked my curiosity so I'll try it and see maybe tonight if I finish reading the SOW...

    OK, tried it out and guess I am just naive...build a small village of 60 SotA small shops each with 70 or so of the SotA Skeleton Sets (10 or so skeletons in each) and I could barely walk through the town. I did notice that I could see the skeletons through the windows so maybe that would explain why so many were instantiated. Maybe see-through windows are bad?

    I'm not smart enough about Unity to figure out how to reduce the number of things it instantiates like that so maybe someone smarter than me can help but my initial impression was way off :) So, now I share your original concern :)
     
  5. LoneStranger

    LoneStranger Avatar

    Messages:
    3,023
    Likes Received:
    4,761
    Trophy Points:
    165
    Gender:
    Male
    Location:
    Petaluma, CA
    There is something called 'Level of Detail' that is often used with models. It's where you take one highly detailed model and make one or more copies of it at lower quality. If the first one LOD0 is, say, 1000 polygons, then LOD1 might be 500 polys, and LOD2 might be 200 polys. When you are far away from the model, you'll see the lowest quality model and as you get closer you'll move up to the better models. This helps the machine show you many more objects on screen at the same time.

    Another trick is to have objects not even get displayed until you are close enough to them. As you speculated, this would be great for items inside the houses, and any other objects that are way out of visual range. You can also split the town into sectors and only display the major objects until the person enters into an adjacent sector.

    I'm sure there are other tricks you can play to speed things up. One optimization related to AI is to give the nearby NPCs full AI processing, but skip frames if they are far away. NPCs far away might only get a quarter of the CPU time they regularly get, and maybe even none if they are all the way on the other side of the map.
     
    vjek and Seir like this.
  6. vjek

    vjek Avatar

    Messages:
    1,162
    Likes Received:
    1,639
    Trophy Points:
    113
    Location:
    ̣New Britannia
    One way to handle this is by not loading any internal (inside/beneath the house) objects until the player crosses the entrance threshold, after opening the door.

    In other words, the only thing that's loaded by default is the exterior shell. Everything else is loaded on demand. Voila! Less lag.
    Edit -- Ninja'd by the LoneStranger! :D
     
    LoneStranger and Seir like this.
  7. Sir Seir

    Sir Seir Avatar

    Messages:
    1,055
    Likes Received:
    1,526
    Trophy Points:
    125
    Gender:
    Male
    Location:
    Bailey, CO
    So looking into the window would show an empty house then?

    *edit*

    Thanks guys for the explanation...still curious about the windows.
     
  8. LoneStranger

    LoneStranger Avatar

    Messages:
    3,023
    Likes Received:
    4,761
    Trophy Points:
    165
    Gender:
    Male
    Location:
    Petaluma, CA
    Depends on how everything else runs. If they have it down to a managable level, then maybe things close to the windows can be displayed earlier than the rest of the objects inside. I know what you're getting at; showing off stuff like award winning lamps in the shape of a leg.
     
Thread Status:
Not open for further replies.