What are Subscenes in Unity? (Massive Worlds!)

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ส.ค. 2024
  • ✅ Get the Project files and Utilities at unitycodemonke...
    Let's check out Subscenes in Unity, what they are and how we can use them to make Massive Worlds!
    Subscenes use Unity DOTS / ECS in order to be insanely performant with nearly instant loading.
    When closed they represent their contents as Entities and when you need to modify something you can open the Subscene which will convert all objects into Game Objects that you can edit as usual.
    If you have any questions post them in the comments and I'll do my best to answer them.
    🔔 Subscribe for more Unity Tutorials / @codemonkeyunity
    See you next time!
    📍 Support on Patreon / unitycodemonkey
    🤖 Join the Community Discord / discord
    📦 Grab the Game Bundle at unitycodemonke...
    📝 Get the Code Monkey Utilities at unitycodemonke...
    #unitytutorial #unity3d #unity2d
    --------------------------------------------------------------------
    Hello and welcome, I am your Code Monkey and here you will learn everything about Game Development in Unity 2D using C#.
    I've been developing games for several years with 7 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.
    You can see my games at www.endlessloopstudios.com
    --------------------------------------------------------------------
    - Website: unitycodemonke...
    - Twitter: / unitycodemonkey
    - Facebook: / unitycodemonkey

ความคิดเห็น • 256

  • @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 2 ปีที่แล้ว

      @@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 ปีที่แล้ว +31

    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.

    • @Sim2322
      @Sim2322 ปีที่แล้ว +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 ปีที่แล้ว +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  ปีที่แล้ว +1

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

  • @-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.

  • @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!

  • @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.

  • @superbhack2034
    @superbhack2034 ปีที่แล้ว +2

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

  • @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!

  • @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 5 หลายเดือนก่อน

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

  • @DeadWayfes
    @DeadWayfes 4 ปีที่แล้ว +3

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

  • @GakuCMDR
    @GakuCMDR 4 ปีที่แล้ว +3

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

  • @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

  • @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!

  • @misterquantum9840
    @misterquantum9840 4 ปีที่แล้ว +2

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

  • @speedrob
    @speedrob 4 ปีที่แล้ว +1

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

  • @seithcg
    @seithcg 4 ปีที่แล้ว +1

    That's a great tutorial, thank you!

  • @blobfish5713
    @blobfish5713 4 ปีที่แล้ว +1

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

  • @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!

  • @cgh353
    @cgh353 4 ปีที่แล้ว

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

  • @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

  • @dclxviclan
    @dclxviclan 2 ปีที่แล้ว

    Amazing perfomance

  • @falsecalamity
    @falsecalamity 4 ปีที่แล้ว

    Once again Code Monkey proves they are the best!!

  • @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

  • @zombiehacker1941
    @zombiehacker1941 3 ปีที่แล้ว

    This Is Very Helpful
    Thanks For The Tutorial

  • @F3L0
    @F3L0 4 ปีที่แล้ว

    Yep , there we go !

  • @MrDeivis666
    @MrDeivis666 4 ปีที่แล้ว +1

    I like this tutorial. Thank you

  • @eddyrc7
    @eddyrc7 2 ปีที่แล้ว

    OMG YOU ARE PURE GOLD.

  • @make-a-game-com
    @make-a-game-com 4 ปีที่แล้ว

    Cool. Always. Keep it up!

  • @shuashuashua1
    @shuashuashua1 4 ปีที่แล้ว

    As allways great vid !

  • @Kenbomp
    @Kenbomp ปีที่แล้ว

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

  • @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.

  • @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 ปีที่แล้ว +1

      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

  • @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.

  • @erikm9768
    @erikm9768 5 หลายเดือนก่อน

    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

  • @souhailla10
    @souhailla10 3 ปีที่แล้ว +1

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

  • @lucaGameDev
    @lucaGameDev ปีที่แล้ว +1

    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.

  • @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?

  • @sumppi95
    @sumppi95 4 หลายเดือนก่อน

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

  • @euming
    @euming 3 ปีที่แล้ว +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  3 ปีที่แล้ว

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

  • @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?

  • @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.

  • @kken8766
    @kken8766 4 ปีที่แล้ว

    This is awesome!!!! Thank you very much ~

  • @sekker2k446
    @sekker2k446 4 ปีที่แล้ว

    Awesome!! Thanks

  • @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 th-cam.com/video/B3SFWm9gkL8/w-d-xo.html

  • @MilkyGamesOfficial
    @MilkyGamesOfficial 8 หลายเดือนก่อน

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

  • @mikoaj7956
    @mikoaj7956 4 ปีที่แล้ว +3

    Whenever i enter playmode all my objects in sub scene disappear from game view, but they are still around in scene view?

    • @toadd
      @toadd 4 ปีที่แล้ว

      I have the same problem

    • @mikoaj7956
      @mikoaj7956 4 ปีที่แล้ว +1

      @@toadd Hey guys, turns out you got to download hybrid renderer if I remember correctly

    • @toadd
      @toadd 4 ปีที่แล้ว

      @@mikoaj7956 Dziekuję, man, but it is still not appearing if the game is in play mode :(

  • @ChrisTharpArt
    @ChrisTharpArt 4 ปีที่แล้ว

    Very interesting stuff.

  • @nickdev
    @nickdev 2 ปีที่แล้ว

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

  • @JimboS1ice999
    @JimboS1ice999 ปีที่แล้ว

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

  • @STARmod
    @STARmod 9 หลายเดือนก่อน

    How the reserved memory gets with this implementation?

  • @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.

  • @Quaternionuur
    @Quaternionuur ปีที่แล้ว

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

    • @neilfosteronly
      @neilfosteronly 9 หลายเดือนก่อน

      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.

  • @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

  • @DanyloSyrotynskyy
    @DanyloSyrotynskyy 4 ปีที่แล้ว

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

  • @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.

  • @erikm9768
    @erikm9768 5 หลายเดือนก่อน

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

  • @f11bot
    @f11bot 2 ปีที่แล้ว

    Okay so basically this is like loading scenes additively but better!?

  • @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...

  • @laserbean00001
    @laserbean00001 10 หลายเดือนก่อน

    So this is only for a static environment right?

  • @aster5031
    @aster5031 2 ปีที่แล้ว

    10/10

  • @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!

  • @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

  • @yourgadget3577
    @yourgadget3577 ปีที่แล้ว

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

  • @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...

  • @newenrx5618
    @newenrx5618 2 ปีที่แล้ว

    Why do we need to convert player to entity?

  • @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

  • @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

  • @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. :/

  • @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.

  • @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.

  • @BarioIDL
    @BarioIDL ปีที่แล้ว

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

  • @No_Ghosts
    @No_Ghosts ปีที่แล้ว +1

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

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว +2

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

    • @No_Ghosts
      @No_Ghosts ปีที่แล้ว

      @@CodeMonkeyUnity great, looking forward to it

  • @sanzjulio
    @sanzjulio 3 ปีที่แล้ว

    how can be changed from distance to trigger with colliders?

  • @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.

  • @DeadFrontierPinoyRambulan
    @DeadFrontierPinoyRambulan 2 ปีที่แล้ว

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

  • @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?

  • @bodyclockgames9272
    @bodyclockgames9272 4 ปีที่แล้ว

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

  • @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?

  • @ItsYourBoPhase
    @ItsYourBoPhase 4 ปีที่แล้ว

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

  • @Adamthegeek70
    @Adamthegeek70 2 ปีที่แล้ว

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

  • @gdb5549
    @gdb5549 2 ปีที่แล้ว +1

    does this work for 3d too?

  • @austinwhiteted8231
    @austinwhiteted8231 ปีที่แล้ว

    Could the scenes be infinitly generated?

  • @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.

  • @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.

  • @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.

  • @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

  • @jittojoseph9195
    @jittojoseph9195 2 ปีที่แล้ว

    how do you prefer to use subscenes in multiplayer?

  • @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?

  • @serjserj7850
    @serjserj7850 2 ปีที่แล้ว

    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

  • @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

  • @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?

  • @trexarain794
    @trexarain794 3 ปีที่แล้ว

    Do this work on mobile and for 3d worlds?

  • @jobinjeeji3502
    @jobinjeeji3502 3 ปีที่แล้ว

    Its working fine on pc but when i build on android its not rendering objects inside subscene. I have intsalled hybrid renderer. Please suggest a solution. Im using unity 2019.4 so im also using hybrid renderer v1 do you think that could be the issue? Do i have to upgrade to unity 2020

  • @user-dd4dw2zf5b
    @user-dd4dw2zf5b 4 ปีที่แล้ว

    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.

    • @user-dd4dw2zf5b
      @user-dd4dw2zf5b 4 ปีที่แล้ว

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

  • @mmx.official
    @mmx.official 4 ปีที่แล้ว

    Can you upgrade the package dependencies to 2019.4 LTS please?

  • @tonymax7503
    @tonymax7503 3 ปีที่แล้ว

    Is there a way to await subscene completely loaded?