playMaker

Author Topic: How to work with ADDITIVE LOAD LEVEL?  (Read 976 times)

PolyMad

  • Hero Member
  • *****
  • Posts: 545
How to work with ADDITIVE LOAD LEVEL?
« on: August 26, 2023, 09:46:41 AM »
Is it a good pipeline to use as main scene the player, GUI and general variables, and load the game levels as additive to the scene?
In this case, how do you deal with the end of the level, to destroy all the components before loading the new level?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How to work with ADDITIVE LOAD LEVEL?
« Reply #1 on: August 29, 2023, 12:17:43 PM »
Hi.
Unload scene.
If you use pooling and spawn object in the loaded scene you need to despawn them first (or spawn in a persistent scene)
« Last Edit: August 29, 2023, 12:40:01 PM by djaydino »

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: How to work with ADDITIVE LOAD LEVEL?
« Reply #2 on: August 30, 2023, 05:41:33 AM »
Uhm... I can't understand... despawn... I guess I'll have to learn how to use this...

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How to work with ADDITIVE LOAD LEVEL?
« Reply #3 on: August 31, 2023, 05:42:27 AM »
Pooling is similar to Create/destroy.
But create / destroy is very 'Expensive'

Pooling is a list of the same object prefab (for example a bullet) which are created at the start of a scene and enables/disables (Spawn/Despawn) these object from a list (Usually grouped in a parent object) on demand

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: How to work with ADDITIVE LOAD LEVEL?
« Reply #4 on: August 31, 2023, 09:22:27 AM »
Pooling is similar to Create/destroy.
But create / destroy is very 'Expensive'

Pooling is a list of the same object prefab (for example a bullet) which are created at the start of a scene and enables/disables (Spawn/Despawn) these object from a list (Usually grouped in a parent object) on demand

Oh ok. I know the theory behind this, but I've never used it.
Luckily, my game does not require a lot of create/destroy.

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: How to work with ADDITIVE LOAD LEVEL?
« Reply #5 on: September 05, 2023, 09:43:54 AM »
Pooling is similar to Create/destroy.
But create / destroy is very 'Expensive'

Pooling is a list of the same object prefab (for example a bullet) which are created at the start of a scene and enables/disables (Spawn/Despawn) these object from a list (Usually grouped in a parent object) on demand

Dino, how do I unload/destroy the old map, when I load a new one?
I see there is a UNLOAD SCENE ASYNC, but I don't need it to be async, I need it to be immediate.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How to work with ADDITIVE LOAD LEVEL?
« Reply #6 on: September 05, 2023, 03:42:11 PM »
Hi.
I don't know, maybe there is a action on the ecosystem.
I use LOAD SCENE ASYNC and UNLOAD SCENE ASYNC in our project

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: How to work with ADDITIVE LOAD LEVEL?
« Reply #7 on: September 05, 2023, 04:08:09 PM »
Yes sorry, I tried now UNLOAD SCENE ASYNC and managed to make it work!