Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

Single-Scene Vs Multi-Scene?

DoomPriestK

Active Coder
Ok, I would like to have the main outside world in my game (it's a massive city) to be within a single scene, with all indoor environments being in different scenes. I would like to know peoples opinions on this

I imagine people will advise using multiple scenes for the city, but given the new hardware in the upcoming XBox and Playstation consoles I was wondering if there would be a significant reduction in load times now, so I could literally load the city on the splash screen on both consoles and PC. I am trying to use Depth of Field and ill be also trying Occlusion Culling to reduce the load on the systems resources, coupled with the Volumetric Fog im using it should hopefully be quite optimized?

I wanted to ask this question now before I start developing massive chunks of the city so I know what method i'll be using to build the world.

So would keeping the outside environment in one massive scene be do-able or should I always break up the city into loadable "chunks" for optimizations sake?

probably worth mentioning that theres a lot of neon signs (emissive materials) and volumetric lights in places also.

Thanks all!
 
I'm not a game designer but even I'd say it mainly depends on the size of the outside world/city. If we're talking like the size of Grand Theft Auto V then yeah, it's advisable to break everything up into scenes and load them in. If the city/world is generally small then there is no need. Just make sure that only the objects in the player's line-of-sight is only being rendered.

Although, since you're using Unity, you'll need to write a script that carries over data to the next scene(Which loads a part of the city/world). If you don't then everything just gets reset and none of the data that was in the previous scene, gets carried over.

Another thing that I'd like to mention is the level-of-detail(LOD). If things like trees and buildings have complex details on them then it can impact performance heavily(Especially when there's many of them). If the buildings and trees aren't too detailed then it won't impact performance as heavily. One thing that Unity(And essentially all modern game engines) can do is decrease the detail the further the player is away from an object. So, say I'm close to an overly-detailed building. If I walk away from that, the less details being rendered. The further I go, it will become just a simple block and then eventually, it won't be visible in my line-of-sight because I've gone too far away from it(Or fog is obstructing it from being viewed).

Just because modern systems nowadays have generally good hardware, poorly optimized and/or extremely realistic games that are rendering in complex details and calculating complex physics, can even bring down the best of hardware. Including the upcoming PS5 and XBox Series X. So, just remember that. Also, PC is one that you're gonna struggle with as every PC has different hardware-specifications. Which is when something is optimized on one PC, runs like crap on another PC.
 
If we're talking like the size of Grand Theft Auto V then yeah, it's advisable to break everything up into scenes and load them in.

Hmm I may have misunderstood how scenes work then, I thought each scene was it's own seperate environment? Can you load other scenes INTO a current scene?

If the city/world is generally small then there is no need. Just make sure that only the objects in the player's line-of-sight is only being rendered.

Thats cool, im using Occlusion Culling to make sure it renders only whats in view, and Depth of Field to blur anything past a certain distance

Although, since you're using Unity, you'll need to write a script that carries over data to the next scene(Which loads a part of the city/world). If you don't then everything just gets reset and none of the data that was in the previous scene, gets carried over.

Yeah I believe theres a "DontDestroyOnLoad" function that stops things unloading when the scene is changed.

Another thing that I'd like to mention is the level-of-detail(LOD). If things like trees and buildings have complex details on them then it can impact performance heavily(Especially when there's many of them). If the buildings and trees aren't too detailed then it won't impact performance as heavily. One thing that Unity(And essentially all modern game engines) can do is decrease the detail the further the player is away from an object. So, say I'm close to an overly-detailed building. If I walk away from that, the less details being rendered. The further I go, it will become just a simple block and then eventually, it won't be visible in my line-of-sight because I've gone too far away from it(Or fog is obstructing it from being viewed).

I just looked into this and am right now re-importing my mesh with 3 LOD levels, thanks for the tip!

Also, PC is one that you're gonna struggle with as every PC has different hardware-specifications. Which is when something is optimized on one PC, runs like crap on another PC.

I have this in mind all the time, my computer is basically trash by todays standards (ill post specs below to give you an idea) so im hoping if it's smooth on mine then anything better should have no trouble. It's hard to get much lower spec than this unless your running a laptop that isnt specifically for gaming I would think.



----------
Operating System: Windows 10 Home 64-bit
Processor: AMD A8-6600K APU with Radeon(tm) HD Graphics (4 CPUs), ~3.9GHz
Memory: 12288MB RAM
Available OS Memory: 12228MB RAM
Page File: 13300MB used, 106951MB available
DirectX Version: DirectX 12
-----------
Card Name: NVIDIA GeForce GTX 960
Manufacturer: NVIDIA
Chip Type: GeForce GTX 960
Display Memory: 10167 MB
Dedicated Memory: 4053 MB
Shared Memory: 6114 MB
Current Mode: 1842 x 1036 (32 bit) (60Hz)
Native Mode: 1920 x 1080(p) (60.000Hz)
------------
Drive: B:
Free Space: 295.2 GB
Total Space: 305.2 GB
File System: NTFS

Drive: C:
Free Space: 58.6 GB
Total Space: 228.9 GB
File System: NTFS

Drive: D:
Free Space: 2594.4 GB
Total Space: 2861.5 GB
File System: NTFS
------------
 
DoomPriestK said:
Hmm I may have misunderstood how scenes work then, I thought each scene was it's own seperate environment? Can you load other scenes INTO a current scene?
Well, technically, yes. A scene is it's own environment but with a completely different design and world. One scene is loaded with tons of flora and fauna and then when you get to a certain point, a new scene is loaded with a bustling city. That's generally how it works. Unity has extensive documentation on scenes so be sure to read up on them.

As for loading two scenes at once, you can. But as far as I'm aware, you can only load multiple scenes in the editor. I cannot tell you if it's possible to render multiple scenes at once while playing the game itself but you'll have to see. I haven't touched Unity in a while.

DoomPriestK said:
Yeah I believe theres a "DontDestroyOnLoad" function that stops things unloading when the scene is changed.
Well, if there is, then that sounds like it's more for objects rather than data such as how much ammo you've currently got, are you riding a vehicle or not, etc. You're gonna be handling a lot of data when transferring between scenes, especially if it's the same scene. You might wanna read up on how to do something like this as transferring data between one part of the game to another and back is extremely difficult.

DoomPriestK said:
I just looked into this and am right now re-importing my mesh with 3 LOD levels, thanks for the tip!
You're welcome for the tip. It's best to take advantage of LOD levels as it can help save performance on a system that's running the game. If you didn't do this then performance all related to details will have been an issue once you release the game and then after you release it, you have to release patches that fix this sort of LOD issue.

As for performance, not only do you to have to optimize models, highly detailed textures being rendered also impact performance. Effects such as fire and water affect performance as they're constantly running until they're deleted or paused by a script. As for scripts, you also want to make sure that your code is clean, readable and easily modifiable in the case that you modify it in a future update. You'll also want to make sure that there are no bugs in these scripts as that can also heavily impact your game on both reviews and performance.

Good luck.
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom