What are Subscenes in Unity? (Massive Worlds!)

Поділитися
Вставка
  • Опубліковано 21 лис 2024

КОМЕНТАРІ • 255

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  4 роки тому +19

    Here's a really great Unity feature you might now know about, build massive worlds!
    🌐 Have you found the video Helpful and Valuable?
    ❤️ Support on Patreon www.patreon.com/unitycodemonkey or get the Game Bundle unitycodemonkey.com/gamebundle.php

    • @Gmania999
      @Gmania999 4 роки тому

      Hi, I have all the characters in the RTS game controlled by one script (for optimization), please tell me is it possible to use hybrid render for their rendering and physics? Without ECS

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      @@Gmania999 The Hybrid Renderer is a renderer that works with ECS components so you can't really use it without ECS.
      You can manually draw a Mesh with Graphics.DrawMesh();

    • @joepeters8746
      @joepeters8746 4 роки тому

      I can not make a subscene, the option is greyed out, can anyone help please?

    • @christofstanits
      @christofstanits 3 роки тому

      @@joepeters8746 you need to save your currently open scene first.

  • @toppefall
    @toppefall 4 роки тому +58

    As always, delivering cutting edge DOTS insight. Very helpful and never stops amazing me how well you break these complex topics down into biteable chunks!

  • @N1ghtR1der666
    @N1ghtR1der666 2 роки тому +32

    I would love to see how you break up a 3d continuous world with subscenes and also once your world gets bigenough how the editor window performance is effected and can be improved. Another aspect with 3d worlds would be how do you deal with distant but visable objects that are visible from multiple subscenes away (consider a tower in or mountain in the distance)

    • @00xenobil00
      @00xenobil00 2 роки тому +3

      Its the same thing, but you render everything in in a line in front of the character and dont render anything in the back and sides of the character.

    • @S_Tadz
      @S_Tadz Рік тому +3

      @@00xenobil00 culling and dynamically loading map chunks are not the same thing. You definitely can use both

    • @therealpeter2267
      @therealpeter2267 Рік тому

      You could use multiple LOD levels of subscenes, so like layer bigger subscenes, holding towers and big things, and smaller subscenes, holding trees, then grass, etc...

    • @JiraMelaj
      @JiraMelaj Рік тому

      Also helpful would be how to build a full size spherical (or geodesic polyhedra) planet without crashing the editor. There is a bit of a catch 22 with needing it cut up before making it. Looks like it would need to be done in stages with math & not just plopped in...

    • @JiraMelaj
      @JiraMelaj Рік тому +1

      Basically, some in editor dots terrain generation. Probably need to start as base shape before transformed into stuff & it's LODs.

  • @Anthrocarbon
    @Anthrocarbon 2 роки тому +7

    First of all your typing speed and accuracy sounds like a stampede of little keyboard construction workers and I love it!
    Secondly, thanks for another great source of information about Unity features that are somewhat buried behind a competence barrier. I refer constantly to the official unity script API page and would never have found this info considering the way I browse it. I've been looking for a mechanism to increase performance on a single-scene game I'm building with a huge number of unique one-off meshes and materials, and I think this will be key to the solution.
    Thirdly, I continue to find it amazing how your videos make me feel smart and also stupid at the same time! This is great for helping me get an objective sense of my capabilities as a game dev, and I appreciate the opportunity to see how pro-level development is approached. Once again, the Unity community has shown that it follows an unspoken credo of helpfulness, unlike many other programming niches where the professionals and wizards treat the newcomers like worthless scum. CM, you make me feel included and respected.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 роки тому +1

      That's great to hear! I'm glad the video helped you! Thanks!

  • @onerimeuse
    @onerimeuse 2 роки тому

    You're basically my dictionary for when I'm watching more advanced dots concept videos and someone says something I don't understand (like subscene, for example). Fantastic channel, man.

  • @-pcmr-108
    @-pcmr-108 4 роки тому +4

    This is exactly what I thought of doing when I heard of subscenes when they were originally announced. Just got back into messing with unity and was going to toy with this. Great that you have something up on it.

  • @superbhack2034
    @superbhack2034 2 роки тому +2

    bro you deserve at least 1 million subscribers. Your videos are amazing man

  • @born2kiss
    @born2kiss 4 роки тому +11

    Great video. Please do a video about Animations using DOTS. Either with new Unity.Animations or some other way. Keep up the great work!

  • @yarikar
    @yarikar 3 роки тому +1

    WOW this is so helpful! Thank you!
    I can't wait finishing my bachelor thesis. I'll totally get either into your patreon or get the bundle this summer and start making small game projects. Your tutorials are such great entry points into larger systems. This is gold!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 роки тому +1

      That's awesome! Best of luck with your thesis!

  • @iCeDrAgOn2025
    @iCeDrAgOn2025 4 роки тому +3

    There is so many possibilities that this can be useful for besides extremely Thing of a game that has a very complex UI with multiple windows or sections, those could all be saved in to a Subscene and loaded and unloaded as needed

    • @magnusm4
      @magnusm4 4 роки тому

      Subscenes, LOD, repeating texture render on multiple objects and Occlusion Culling. Ah there's so many built in easy performance improving features it's sad how few use this to make huge games

    • @iCeDrAgOn2025
      @iCeDrAgOn2025 4 роки тому

      @@magnusm4 The reason why not many are using it yet is because the DOTS packages are still in preview and aren't ready yet for production, but yes I do agree there is a lot of things in there than can help with 2D and 3D to greatly increase performance

  • @misterquantum9840
    @misterquantum9840 4 роки тому +2

    You are the fastest typist I have ever seen on UA-cam.

  • @lucaGameDev
    @lucaGameDev Рік тому +2

    Thanks always for your great work and ispiration.
    I reimplemented your example using Unity 2022.3 with Entity 1.0 and compare with MonoBehavior SceneManager.LoadSceneAsync.
    I create a demo Scene with 10000 SpriteRenderers.
    ECS -> SceneSystem.LoadSceneAsync has a very huge peak (FPS drop) at the really begin and it takes 37 frames to load the Subscene
    Mono -> SceneManager.LoadSceneAsync does not have any huge peak at the start and it takes 21 frames to load the scene (LoadSceneMode.Additive)
    During scene async loading they both have a similar fps
    It would be interesting if you create similar tests, to compare these two worlds (Mono and ECS). I guess with your experience you can create more reliable test results than mine.

  • @petarstoyanov9024
    @petarstoyanov9024 4 роки тому +2

    This is amazing! Thank you from the bottom of my soul, we need such in-depth tutorials on various systems!

  • @erikm9768
    @erikm9768 8 місяців тому

    Thank you for this tutorial. I had no idea it was this simple

  • @Kenbomp
    @Kenbomp 2 роки тому

    Only thing is you need to do your own format to track what's the next scene without hard coding it. But still useful

  • @DeadWayfes
    @DeadWayfes 4 роки тому +3

    This really helped me! I look forward to apply this to my project! Thanks a lot!!

  • @marcelocosta9620
    @marcelocosta9620 3 роки тому

    Wow! Great video! This is like Minecraft chunk loading system.

  • @AyItsKevin
    @AyItsKevin 3 роки тому

    You just saved me so many overlap triggers lol

  • @josueccama303
    @josueccama303 4 роки тому +6

    wonderful, video, as always, details that make a difference, but I doubt, how would join sub scenes with path finding?. It would be a great video, that you could show how to make that union. Very good video, thanks for your time and dedication.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +4

      Pathfinding for massive worlds is definitely a topic I'd like to cover

  • @GakuCMDR
    @GakuCMDR 4 роки тому +3

    Thank you, I was looking for this kind of solution to my game

  • @erikm9768
    @erikm9768 8 місяців тому +1

    You didnt mention much about the LOD system with subscenes, but are these essentially just a substitute subscene if a subscene is very far away? Sounds like it could be faster than just relying on LOD gameobjects in a single subscene , but not a huge difference unless you have thousands of objects in your subscene

    • @tufanaydin6340
      @tufanaydin6340 2 місяці тому

      If you unload subscene, load fake LOD model in there

  • @foomaster6353
    @foomaster6353 2 роки тому

    New to Unity, have been watching you videos and they have really helped me out a lot, thank you! Quick but possibly stupid question, would using prefabs in subscenes still propagate changes like they do if they weren't in a subscene? For example, if you wanted to change the color of the grass would you just change the prefab or would you have to "unpack" all the subscenes, change the prefab, then "repack" them?

  • @souhailla10
    @souhailla10 3 роки тому +1

    looks great sir ! do you also have an example in 3d scenes ?

  • @emoneydatruth1
    @emoneydatruth1 2 роки тому +1

    Can we do this with bolt? I want to try and make a big world and this seems like the best way.

  • @MasterofFire-sc3yn
    @MasterofFire-sc3yn 4 роки тому +9

    I would like to ask you if you can actually do an in-depth tutorial on animations in ECS.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +4

      I haven't yet looked at DOTS animations but it's on my list

    • @MasterofFire-sc3yn
      @MasterofFire-sc3yn 4 роки тому

      @@CodeMonkeyUnity Thanks, be sure to check your videos out!

  • @eddyrc7
    @eddyrc7 3 роки тому

    OMG YOU ARE PURE GOLD.

  • @andrewshandle
    @andrewshandle 4 роки тому +2

    This is a great video and I can't wait to give it a try.
    One thing I've noticed on this and the Prefab video is you are making Systems instead of Jobs for some of these systems. While I haven't tried this particular one out yet, shouldn't a "SceneJob" work fine to handle all of this or would it not worth with the Burst Compiler?
    Similarly I've found that spawning a prefab in a Job with DOTS also doesn't work with the Burst Compiler which is frustrating, if I want a Player to fire a Projectile Entity (something that would be incredibly common in a game), not being able to do that in a worker thread seems to be a problem.
    That, or am I missing something? (I really hope I am).

    • @iCeDrAgOn2025
      @iCeDrAgOn2025 4 роки тому +1

      Not every system has to contain a job. Systems such as movement or turning on or off a single entity would run so quickly that it's actually better not to set such up as a job because it would just lead to you as the developer needing to write more code.

    • @andrewshandle
      @andrewshandle 4 роки тому +3

      @@iCeDrAgOn2025 The new JobComponentSystem in the latest preview is the same amount of code as a ComponentSystem and it'll use Burst Compile by default. You'd think for consistency you'd just use the same one all the time if possible. I do think Systems are a bit easier by default since it doesn't require using Buffers, but it'd be nice for the future of DOTS if there'd be a consistent way to do it.

    • @MechabitGames
      @MechabitGames 4 роки тому +1

      @@andrewshandle I think creating a job has an overhead so for player interactions for a single character you're probably better off not using jobs?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +2

      Normally I use the ComponentSystem when its something very simple like here just moving a single Player but yes ideally in a proper game you would make Jobs for everything. I believe the plan is to merge ComponentSystem and JobComponentSystem into one so in the future it'll be very easy to convert them. There is a small overhead when creating the job and their goal is to bring that down as much as possible.
      In terms of spawning prefabs you can do it with Burst but you don't do it with EntityManager.Instantiate(); You do it with a EntityCommandBuffer.Concurrent

    • @andrewshandle
      @andrewshandle 4 роки тому

      @@CodeMonkeyUnity I definitely understand that for input, since Job or otherwise, it'll pretty tiny, it's not like movement, rotation or pathfinding which might influence 10s of thousands of entities (depending on your game of course).
      I should probably stop worrying around a tenth of a millisecond here or there with small Systems and Jobs. ;)
      Keep up the good work, I find these videos incredibly helpful.

  • @F3L0
    @F3L0 4 роки тому

    Yep , there we go !

  • @estebansustacha1911
    @estebansustacha1911 4 роки тому +1

    I don't know what I would do without your videos man! Thanks for the hard work, hope one day be able to support you on Patreon!

  • @ODCrab
    @ODCrab 4 роки тому

    Cool concept. It seems a lot cleaner than having scenes that are only whole if you remember to load in it's sibling scenes. And I never even thought of doing LOD's for entire scenes.
    I feel like you should have left a disclaimer when you just cycled through the whole sub-scene array to find the closest ones. That is bound to get slow when you have hundreds of these things. Its a weird problem to solve in code. So I think I would add a collider to each sub-scene and put them on a "sub-scene" physics layer. Then do a sphere cast with a layer mask for the sub-scene layer, from the player's position to find which ones are close. Sort of like a radar.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      Sure if performance becomes an issue you could build some colliders or just simply test the distance only once per 5 seconds instead of every frame.

  • @Dimencia
    @Dimencia 4 роки тому

    tbh the thing that I'm amazed about in this video ... I didn't think unity's DOTS worked with its physics. But if you can convert a subscene to Entities, then I imagine all the colliders, meshes, etc all still function. And I thought the problem with DOTS right now was that we didn't have access to physics with it?
    Guess I'm gonna have to do some research

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      DOTS Physics has been in development for quite a while and is already very advanced, check it out ua-cam.com/video/B3SFWm9gkL8/v-deo.html

  • @dclxviclan
    @dclxviclan 2 роки тому

    Amazing perfomance

  • @sumppi95
    @sumppi95 7 місяців тому +1

    for some reason the componentsystem namespace doesn't exist for me? What have I Done wrong?

    • @tufanaydin6340
      @tufanaydin6340 2 місяці тому

      Did you find any solution? Ecs updated so much times. So i have same errors.

  • @falsecalamity
    @falsecalamity 4 роки тому

    Once again Code Monkey proves they are the best!!

  • @MilkyGamesOfficial
    @MilkyGamesOfficial 11 місяців тому

    Is this better performance for 3d or would unity addressables be better for 3d?

  • @No_Ghosts
    @No_Ghosts Рік тому +2

    Would you consider doing an updated video now that 1.0 is out? The code in this video no longer works. Cheers.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +3

      Yup I definitely want to cover DOTS as soon as I have the time

    • @No_Ghosts
      @No_Ghosts Рік тому

      @@CodeMonkeyUnity great, looking forward to it

  • @speedrob
    @speedrob 4 роки тому +1

    Thank you so much for this particular tutorial, very useful indeed.

  • @STARmod
    @STARmod Рік тому

    How the reserved memory gets with this implementation?

  • @JimboS1ice999
    @JimboS1ice999 Рік тому

    So you create the large world then split highlighted poritons into subscenes?

  • @blobfish5713
    @blobfish5713 4 роки тому +1

    Thanks for the juicy upload once again! can't wait to learn more !!

  • @armoredgreatbear
    @armoredgreatbear 4 роки тому

    Very useful and very cool, thank you so much for the tutorial, but I have a question, can this system be used with the grid based map unity system? If so, a tutorial on that will be awesome.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      Hmm used with the Grid System how? I guess you could make a subscene and store it in each grid position but that's what's already being done here so no need for the Grid System in this case.

  • @cgh353
    @cgh353 4 роки тому

    Im really thankful for all your video's. Thank You.

  • @MrDeivis666
    @MrDeivis666 4 роки тому +1

    I like this tutorial. Thank you

  • @nickdev
    @nickdev 2 роки тому

    iknow this video is little ...old.. but... this can solve Float Origin Problems too? if yes... how?

  • @yaarrghmematey
    @yaarrghmematey 4 роки тому

    This is awesome! I haven't looked into SubScenes and your video is the first time I heard of SubScenes, I have been waiting for DOTS to mature before I rewrite the game engine for YAARRGH! Correct me if I am wrong and what I can tell after watching your video, I could replace my cached queue LIFO Chunk Manager with SubScenes? With your experience using SubScenes and its seems plausible, to have multiple SubScenes of about 10x10x10 size for a 3D procedural world? This is why I am loving DOTS, been working with DOTS for about a year, it is awesome and now with SubScenes, if it can do chunk management, procedural worlds will be amazing!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      The one thing that I'm still not entirely sure about is if you can create or modify subscenes in runtime so I don't know how they would work for a procedural world.
      I'm guessing it should be possible since it does seem perfect for that use case but still need to research that.

    • @yaarrghmematey
      @yaarrghmematey 4 роки тому

      @@CodeMonkeyUnity Thanks mate, I will check it out later, hope it works out

  • @seithcg
    @seithcg 4 роки тому +1

    That's a great tutorial, thank you!

  • @flashpointstudios7910
    @flashpointstudios7910 4 роки тому +2

    Aren't infinite worlds still plagued by floating point precision issues? Or do subscenes fix this by default?

    • @alcofribasnasier1838
      @alcofribasnasier1838 3 роки тому

      floating points can easily be fixed with a simple return to origin, and it doesn't take more than 50 lines of code to do it.

    • @flashpointstudios7910
      @flashpointstudios7910 3 роки тому

      @@alcofribasnasier1838 I know and I've done that myself. The question was do subscenes fix the floating origin problem. Also congrats on 50 lines of code, but I doubt that works for larger projects.

  • @christofstanits
    @christofstanits 4 роки тому

    another great video! thank you very much!
    Going on from this.
    How would you add components to the entities in your subscene? What would be a proper way to identify entities in the subscene so you can add components correctly?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      Usually you can identify a certain entity by adding a empty tag component

    • @christofstanits
      @christofstanits 4 роки тому

      ​@@CodeMonkeyUnity
      thank you!
      My Problem was that I hadnt known I can just add IConvertGameObjectToEntity to the subscene gameObjects.
      there I can add all the tags and whatever I need.

  • @GunslingerP
    @GunslingerP 4 роки тому +1

    How would you create subscenes to make procedurally generated content? it seems you have to have a subscene created before you start a game, but there is no way to duplicate scenes. So there's really not a way to use this to make infinite worlds...

  • @brockormond4131
    @brockormond4131 4 роки тому +6

    As a theoretical, can you still have interactions in unloaded subscenes? Say you have a NPC chopping a tree down in an unloaded scene, can it make a sound? ;P
    But seriously, if there is a dynamic system in an unloaded subscence, can you still have its effects spill into loaded scenes? (Ex. A dam is set to blow on a timer and flood a region, but no one is around to see it, can other regions down river get flooded anyway?)

    • @washynator
      @washynator 4 роки тому

      I'm an idiot, so you should probably wait for a comment from someone who knows anything. But I would imagine that it wouldn't be possible to have stuff happen in unloaded scenes (they are unloaded, after all). My (stupid) solution would be to use some kind of a trigger to make the thing happen anyway (you can use whatever system to load the scene to make the flood happen). For example game time? As in "after the game has been going for 50minutes, load the scene with the dam and destroy the town, then unload the scene until the player comes near".

    • @brockormond4131
      @brockormond4131 4 роки тому +3

      @@washynator That's certainly one way for that sort of thing; but I'm thinking about dealing with massive dynamic environments where things can happen even without player involvement.
      Maybe something like another 'subscene layer' like how there can be a 'low render' and 'high render' scene depending on distance; there could be a 'data layer' which needs what's in the environment, but not any of the visual components (meshs/partical effects).
      Really just thoughts that came to me while watching the video.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +5

      Unloaded Subscenes don't really exist, if you look in the Entity Debugger the entities don't exist.
      I'm not sure if you can modify SubScenes after they've been converted, I believe they are meant more for the static parts of your game, so in your case you could use it for the terrain and whatever trees and rocks that never move but the dam and the water would be in normal entities on in a subcene that is never unloaded.

    • @zaingill9527
      @zaingill9527 4 роки тому +1

      @@CodeMonkeyUnity So anything that is unloaded as a part of the subscene can't hold any state or persist and do it's own thing due to it not existing makes sense

    • @martimking1craft
      @martimking1craft 4 роки тому +2

      You should do what terraria does to subscenesyou have a timer always running and when a subscene is loaded it grabs your timer and do some time checks to decide what is the current state of the sub scene

  • @zy-blade
    @zy-blade 4 роки тому

    Just as I needed it, great! One question though; How to handle dynamic objects like enemies? They can't be loaded/unloaded based on the subscene, because they could follow the player for example. And what, if I want to save the state of an object, before it gets unloaded, so when I go back later, the object remains like the player left it? I will surely implement this, but this could be content for some of your next videos =) Keep up those awesome videos! (yea, that were 2 questions ^-^)

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      SubScenes are only meant for either static entities or entities where the state doesn't matter (like a flock of birds) so if you want some sort of state to persist then don't unload it through a SubScene. As soon as you load it loads from the data on the binary file regardless of what changes you made while the SubScene was loaded.

    • @zy-blade
      @zy-blade 4 роки тому

      @@CodeMonkeyUnity Yup, that makes sense. Thanks.

  • @magnusm4
    @magnusm4 4 роки тому

    I've thought of using this for large open world games. Like GTA.
    Though I wonder, what stops you from making an entire game like this instead of using actual scenes, like making Half Life entirely into subscenes to remove the loading in between?
    Imagine making the entire summer camp in Psychonauts into one single map using this method.
    Thing go on in the background far away but the objects's functions are inactive and are basically in a passive mode that simply makes them move.
    Or having a massive building surrounded by a smaller base with a circle of water to a whole city.
    And you can see everything moving and being alive and go there. As I said, passively active to give the illusion of everything being one scene.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      There's nothing stopping you, that's exactly how massive games like Skyrim are made.
      The world gets loaded in and out as the player moves around.
      It can become very complex though which is why a lot of games use the typical level structure.

    • @magnusm4
      @magnusm4 4 роки тому

      @@CodeMonkeyUnity That and open worlds means typical optimization methods don't work like disabling objects obstructed by view. Even if they're far away, it's still a whole open plane of objects you'l have to low poly render and the sheer number alone can cause trouble even with less than 300 polygons.
      Then the engine itself can be limited. Like with Cursed Halo he explains there's a vertice limit of about 20 000 or more. This means regardless of your optimization you're automatically constricted by the engine unless you do like some developers and either modify the engine, or make a third party software to allow more to be rendered without lag or crashing.

  • @witek_smitek
    @witek_smitek 4 роки тому

    Hi Code Monkey,
    Thanks for great (as usual) tutorial! I have one question for you - how do you handle obstacle collisions and movement constraints with ECS? Let's say we have one character controlled with WASD movement. What is the best way to constrain it so player wouldn't be able to move through objects?
    In legacy unity we have CharacterController script, but how we can achieve it in ECS? Is using DOTS Physics lib is good for it?
    Let me know what you think...

  • @pietromaggi9259
    @pietromaggi9259 4 роки тому

    It would be possibile to create subscenes from sprites and tilemaps ? Maybe you should implement some sort of conversion to meshes, I guess

  • @МаксимМарченко-н8ы

    As always great video.
    Could you answer is it possible to save subscene like prefab and use it for instantiating in further?
    And how could we process some managed object inside subscene, like npc? Will they unload with the subscene and won't being processing? or maybe is there some work around?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      When the Subscene is unloaded the objects are destroyed.
      But you could keep the logic of the NPC in another Entity that is outside the subscene and only have the visual inside the subscene and when that is loaded you look up the current state of the logic Entity to display the visual.

    • @МаксимМарченко-н8ы
      @МаксимМарченко-н8ы 4 роки тому

      @@CodeMonkeyUnity thank you for answering. but what about subscene like prefab? is there not some tricky with it?

  • @thibaudgayraud6400
    @thibaudgayraud6400 4 роки тому

    Hi, Awesome stuff as always, I really like your tutorials on DOTS with unity. I was wondering, in this vidéo you create a variable of class :"SceneSystem" and I can't seem to access it, am I missing a package or something? Take care and I can't wait for your next video.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      It's inside Unity.Scenes

    • @thibaudgayraud6400
      @thibaudgayraud6400 4 роки тому

      @@CodeMonkeyUnity Thanks for your answer :D, I'm implementing Unity.Scenes, but it seams like there is no system called SceneSystem. I have access to something called SubSceneStreamingSystem but then there is no function called loadSceneAsync or anything alike.

  • @gdb5549
    @gdb5549 2 роки тому +1

    does this work for 3d too?

  • @MsDakota7
    @MsDakota7 3 роки тому

    Maybe a stupid question, but say an enemey is supposed to patrol 3 different subscenes, how can we ensure the patrol actually happens when we unload one or multiple of the subscenes?

  • @BarioIDL
    @BarioIDL Рік тому

    can i use subscenes for each characters like the layers of subscenes you mentioned?

  • @DeadFrontierCamouflage
    @DeadFrontierCamouflage 3 роки тому

    Hey CodeMoney Can I use triggers for this too? trigger enter and exit?

  • @ItsYourBoPhase
    @ItsYourBoPhase 4 роки тому

    Do you still have to worry about the issues when you get far away from the origin using this method?

  • @DanyloSyrotynskyy
    @DanyloSyrotynskyy 4 роки тому

    They should have implemented open/close subscene on right click context menu or with shortcut

  • @yourgadget3577
    @yourgadget3577 Рік тому

    I'm using Unity version 2019.4.25f1 and don't have that option. Why?

  • @Quaternionuur
    @Quaternionuur Рік тому

    What is the difference between this and occlusing culling? The other seems more appealing and practical

    • @neilfosteronly
      @neilfosteronly Рік тому

      This will unload the asset so they are not in the ram. With occlusion you don't render objects but they are still loaded and take up memory.

  • @daniilparokonnyy7980
    @daniilparokonnyy7980 4 роки тому +1

    Do you think, is it a good idea to load a subscene with common game manager and canvas to similar scenes, such as levels?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +2

      Yup, from what I know the goal is to eventually have everything inside SubScenes so you won't even need to use the ConvertToEntity Script
      However there are still a handful of things that don't work as Entities like the Camera and the UI so for now those have to stay in normal game objects and everything else can be inside a SubScene

  • @Un4GivNX
    @Un4GivNX Рік тому

    How does lightmaps work with subscene? Let's say you have one big world with 100 subscenes, I intended to bake the lighting. It is something that just works or will I be facing many bumps along the road? Also, same question but regarding baking occlusion.

  • @bodyclockgames9272
    @bodyclockgames9272 4 роки тому

    Been playing around with this. All works fine in the editor - but doesn't seem to work in a build :(

  • @Kondensatorr
    @Kondensatorr 4 роки тому +2

    Is it possible to add entities to Subscene in runtime or generate new Subscene with some entities? For example for procedurally generated terrain in ECS?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      I'm not sure, that's something I still have to research. I imagine it should be possible since that would be a perfect application of this system.

    • @vildauget
      @vildauget 4 роки тому

      @@CodeMonkeyUnity Looking for the same, it'd be great for procedural work. I don't see any methods for it in Unity.Scenes, but I might miss something with my limited understanding of it all, docs.unity3d.com/Packages/com.unity.entities@0.5/api/Unity.Scenes.html

  • @LINK1V4N
    @LINK1V4N 3 роки тому

    Unity demo looks better than Cyberpunk.

  • @erikm9768
    @erikm9768 8 місяців тому

    If changes are made to a subscene in run-time, are these changes persisted if you unload and load again?

  • @sanzjulio
    @sanzjulio 4 роки тому

    how can be changed from distance to trigger with colliders?

  • @laserbean00001
    @laserbean00001 Рік тому

    So this is only for a static environment right?

  • @adrim.m.7149
    @adrim.m.7149 2 роки тому

    how did you use the subscene
    I entered Unity and if I drag a Scene inside my actual Scene it is not child of the first

  • @jittojoseph9195
    @jittojoseph9195 3 роки тому

    how do you prefer to use subscenes in multiplayer?

  • @euming
    @euming 4 роки тому +1

    3:49 when I right-click in Unity v2020.1.6f1, I don't have the option to "create subscene" at the bottom of the dropdown menu. I just have 'properties' as the last menu item.
    Is there some setting I need to check or some package I need to install first? Do I need to buy Unity Pro version? Is there another component I need to add somewhere? What's the missing information here?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      Do you have the Entities package installed? Haven't touched DOTS in quite a while so it's possible the menu changed.

  • @austinwhiteted8231
    @austinwhiteted8231 Рік тому

    Could the scenes be infinitly generated?

  • @calebvaccaro
    @calebvaccaro 4 роки тому

    Would this work with Multiplayer? I have some ideas on how to use it but just wanted to make sure it's feasible.

  • @Gonzakoable
    @Gonzakoable 4 роки тому

    know any way to dynamically create subscenes at runtime?

  • @tonymax7503
    @tonymax7503 3 роки тому

    Is there a way to await subscene completely loaded?

  • @Lythowastaken
    @Lythowastaken 4 роки тому

    So if I understand right. I could use SubScene to put a level into it? So I can load unload levels with it?

  • @Adamthegeek70
    @Adamthegeek70 2 роки тому

    How would this work with basic multiplayer (lan or intenet via photon etc) with players far and near. each other.

  • @make-a-game-com
    @make-a-game-com 4 роки тому

    Cool. Always. Keep it up!

  • @abdelrahmanmohammed9405
    @abdelrahmanmohammed9405 4 роки тому +1

    Is it possible to interact with the subscene objects in the game? Like destructing objects, etc...

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      You can, but if you unload and then reload the subscene I believe they will all go back to their starting state.

    • @L0upyb0y
      @L0upyb0y 4 роки тому

      You could use an external map save file to store booleans for each destructible object to mimic this? IDK how efficient it'd be, but it could be a great start I guess

  • @mmx.official
    @mmx.official 4 роки тому

    Can you upgrade the package dependencies to 2019.4 LTS please?

  • @shuashuashua1
    @shuashuashua1 4 роки тому

    As allways great vid !

  • @trexarain794
    @trexarain794 3 роки тому

    Do this work on mobile and for 3d worlds?

  • @shiv-iwnl8188
    @shiv-iwnl8188 3 роки тому

    how do I add a LOD system, my meshes are created at runtime but I don't know how to have the chunks change their mesh to a lower detail mesh if the camera is further. I know how to actually load the entire chunk but not the lower detail one is the problem!

  • @mehcaqueen
    @mehcaqueen 3 роки тому

    Can subscenes be different sizes or must they remain in a grid of all the same size? Say there is a very large scene where the camera zooms out and you want to contain it all in one scene, but there are other surrounding ones that are much smaller. Would this have any long term problems? Assuming all of the subscenes along side the edge of the largest one still have the same length and there arent any gaps within the map.

  • @JC-jz6rx
    @JC-jz6rx 4 роки тому

    can i implement the same on a unity terrain?

  • @johnnydoe6696
    @johnnydoe6696 3 роки тому

    Is it possible to create a new subscene from selection, and then close for editing at runtime? For example if you wanted to split a large existing scene into subscenes at the start of the game.

  • @ColtPtrHun
    @ColtPtrHun 3 роки тому +2

    What does it mean that GameObjects are converted to entities? What are the pros and cons?
    What do entities have to do with subscenes?

  • @serjserj7850
    @serjserj7850 3 роки тому

    Hi, I have problem with sub scenes, in my game when I am activating subscene the models are loading but, colliders does not work, So I can go through with my character or any other physical object

  • @youtubechannel548
    @youtubechannel548 4 роки тому +1

    Would it be possible to see a video on the day and night cycle for 3D games? Like some procedural skybox that uses a custom shader. I'm terrible when it comes to shaders..

    • @youtubechannel548
      @youtubechannel548 4 роки тому

      @@bezoro-personal Yeah but it's way to basic looking. Wish there would be a way to add more details to the skybox. Like the moon and stars. Also if you want to have different settings, like completely couldy sky.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      Not sure about 3D games but the Lost Crypt demo has a gorgeous Day Night transition

    • @youtubechannel548
      @youtubechannel548 4 роки тому

      @@CodeMonkeyUnity Yeah I have looked at the Lost Crypt demo project, but unfortunately for 3D this method for the day and night cycle would not really work. :/

  • @newenrx5618
    @newenrx5618 3 роки тому

    Why do we need to convert player to entity?

  • @Ahmed-ic9ft
    @Ahmed-ic9ft 4 роки тому

    hi, how would this work if i had objects that the player would interact with such as trees that fade when player is behind or effects like particles which is not static. also dose the vector3.distance work if my player is normal object and compare to entity pos?

  • @aster5031
    @aster5031 2 роки тому

    10/10

  • @Gahast
    @Gahast 2 роки тому

    Is it already possible (and save) to use that in production?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 роки тому

      DOTS involves 3 things, Entities, Job System and Burst Compiler
      The Job System and Burst compiler are already production ready
      Entities is still in preview

    • @Gahast
      @Gahast 2 роки тому

      @@CodeMonkeyUnity And sub scenes are part of entities, right? That would mean the sub scene workflow isn't production ready or am I wrong? Thanks for the answer btw

  • @omerfarukbykl6097
    @omerfarukbykl6097 4 роки тому +1

    I heard things like " by using dots you can use 1m object with almost no performance loss" is that true? how is that happening?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +3

      The entire Megacity demo has more than a million objects in total and several hundred thousand at the same time.
      DOTS is super fast because the memory is all set up in a very efficient way that makes it so the CPU can just sequentially process each Entity and doesnt have to jump around
      ua-cam.com/video/Z9-WkwdDoNY/v-deo.html

    • @omerfarukbykl6097
      @omerfarukbykl6097 4 роки тому +2

      @@CodeMonkeyUnity do other game engines have that? for example game engines that AAA game companies use. It might open a lot of door for them

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      @@omerfarukbykl6097 I'm not sure about using ECS but yes AAA engines are massively optimized to the point that you can just look at COD:MW or BFV and see how gorgeous they look with all those effects. That is the power of a custom engine that is handcrafted to suit a specific game.

  • @SCOTTINPYOHONG
    @SCOTTINPYOHONG 4 роки тому

    After adding another gameobject into subscene, all gameobjects are drawn in wrong place, but their colliders are on correct position. Do you know how to fix it?

  • @ChrisTharpArt
    @ChrisTharpArt 4 роки тому

    Very interesting stuff.