How to use Addressables FASTER Loading FREE Memory SMALL Download

Поделиться
HTML-код
  • Опубликовано: 18 дек 2024

Комментарии • 244

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  2 года назад +5

    ✅ Get the FULL course here at 80% OFF!! 🌍 unitycodemonkey.com/courseultimateoverview.php
    👍 Learn how to make BETTER games FASTER by using all the Unity Tools and Features at your disposal!

    • @vicktoriashepard
      @vicktoriashepard 2 года назад

      hi, i have a 3d game, how can i load only those resources that the player sees through the camera? I could check their position, but they are not on stage. I could ray cast, but they are not on stage. And if they are loaded into memory, the meaning of dynamic loading is lost. There is an idea to record their bounding box, and check the visibility on them, but I don't really understand how. Thank you for the lesson!

    • @Nova04550
      @Nova04550 2 года назад

      Hi CodeMonkey, are you going to do a video on the Unity UI toolkit?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад

      @@Nova04550 It's on my list, I've already done a bunch of research but haven't written a video yet

    • @Nova04550
      @Nova04550 2 года назад

      @@CodeMonkeyUnity Sweet! Really looking forward to that.

    • @path1024
      @path1024 Год назад

      @@vicktoriashepard You don't want to unload and reload objects that should be in the scene. Frustum culling will prevent them from rendering when they're not being looked at, but completely unloading and reloading the objects while looking around would destroy the performance of your game. If you are talking about objects that are not nearby and wouldn't be visible even when looking around then you're talking more about world streaming. In that case you have to divide the world into sections and load or unload entire sections based on proximity.

  • @pedrobelluzzo
    @pedrobelluzzo 2 года назад +46

    This video was launched 20 minutes after a daily meeting i've had with my team, where we discussed that the next step in our game was to study and implement adressables. I knew Facebook was spying us, but you?!!?! LOL

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +7

      It's a great package! Best of luck with your game!

    • @pedrobelluzzo
      @pedrobelluzzo 2 года назад +2

      @@CodeMonkeyUnity Thank you very much!

  • @isawadelapradera6490
    @isawadelapradera6490 2 года назад +10

    18:36 You don't even need to define new classes to forgo the generic type parameters when writing your AssetReference!
    Instead of defining a new class, just import the generic type AssetReferenceT as an alias with the desired type, like so:
    using AssetReferenceAudioClip = UnityEngine.AddressableAssets.AssetReferenceT;
    //note that it's necessary to use fully qualified namespace names - don't omit the UnityEngine part even if it's among your imports
    Way less cluttery, and now you don't have an extra class to keep track of. Additionally any alias for AssetReferenceT is fully interchangeable with any other object defined through such alias. Sub-classes are NOT interchangeable and if you define two different classes AssetReferenceAudioClip they can never replace each other.

  • @aaronperron
    @aaronperron 2 года назад +6

    can't wait for the sequel to this tutorial! Remote hosting addressables will be a life saver.

  • @phodaOG
    @phodaOG 2 года назад +3

    YOURE SAVIOUR MAN, last few videos were EXACTLY what I needed at that point.

  • @Acid_Brad
    @Acid_Brad 2 года назад +31

    Been using this for awhile now, just have to mention while in the editor after making a build you might want to set the Play Mode Script to Use Existing Build this will show you in the editor what loading will be like in a Player. Addressables is great it has fixed a lot of the memory issues my project was suffering from.

    • @lee1davis1
      @lee1davis1 2 года назад +1

      I'd love to hear more about how it helped. I currently on see addressable as useful if you are making a large scale game or mobile app.

    • @Noixelfer
      @Noixelfer 2 года назад +1

      @@lee1davis1 Does not need to be big, I use addressables in smaller projects too. Having small resource folder and using addressables instead can be very good, imagine if you have a cutscene or any type of object that has a small lifetime during your game, instead of having his resources loaded and occupy memory at runtime you can only load it when you need it and remove it after that, it's a very good practice to use only the resources that you need. Lower RAM means that you can add more details or target lower end devices, also coupled with other optimization techniques and the device won't heat up during the gameplay. So lower build time (no resources folders, addressables content is build independent of project build), lower load time (no unused dependencies in scenes) and lower memory footprint. Addressables should be the way to go for any object that has a limited lifespan during the gameplay (at least imo)

  • @zpinacz
    @zpinacz Год назад +5

    Great comprehensive tutorial on addressables! I can't thank you enough for the time and effort you put into creating this video. It has helped me tremendously in understanding and implementing addressables in my own projects. Your clear explanations, step-by-step guidance, and real-world examples made it so much easier to grasp the concepts. Keep up the fantastic work, and I look forward to watching more of your tutorials in the future!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Год назад +1

      That's awesome, I'm glad the video helped you! Thanks!

  • @sjoervanderploeg4340
    @sjoervanderploeg4340 Год назад +1

    You can also use LoadAssetsAsync to retrieve a list of objects of the specified Type T to process!

  • @DavidZobristGames
    @DavidZobristGames 2 года назад +8

    Host I use all the time for testing the VR headset ( remote device) before moving the content to the unity buckets. Addressables can make you build bigger because of duplicates between groups, something to be aware of. That said our build is 1gb and +2gb come frome the remote buckets, when required, so its a huge benefit.

  • @NachitenRemix
    @NachitenRemix 2 года назад +5

    I just bought you turn based strategy course some days ago and loved it!! Im gonna be probably buying this ultimate unity overview couse soon. You explain very well and in lots of detail, I consider myself an intermediate experienced dev, but most of the things you tech I didnt know :) Thats awesome

    • @martin-schoen
      @martin-schoen 2 года назад

      go for it, it's also a nice course ;)

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад

      That's awesome, I'm glad you're enjoying the course! Thanks!

  • @reggieisnotadog4841
    @reggieisnotadog4841 Месяц назад

    I'm planning to make a slightly larger scoped game next, and learning about this stuff has mostly been a nightmare. Thanks so much for explaining it in a clear way.

  • @Visigoth_
    @Visigoth_ 2 года назад +6

    Very cool... these free videos are a really great resource!
    They're helping me wrap my head around Gamedev and coding (so I'm starting to feel like I'm slowly getting a grasp on them).
    It's a really important part of the journey that happens before you can make the decision that buying a course will be worth it for you/your goals (I'm getting there).

  • @ВасилийПотапов-ч3ч
    @ВасилийПотапов-ч3ч 2 года назад

    I've been working with Addressables, but you've covered some info I just didn't take attention on. Can't wait for a new vid about addressables

  • @PitiITNet
    @PitiITNet 2 года назад +2

    Amazing video! I am so happy you made it - it took me ages to get to know about them so it's great to have one place to get to know all about them! There's only one sad thing about the video. I was learning it all to make the video myself! :D

  • @honokiii
    @honokiii 2 года назад +1

    I just bought your Ultimate Unity Overview and Unity Turn-Based Strategy Game Courses!
    So excited to start them! I'll start after finishing my ongoing projects, can't wait to learn new things!
    Do you have a discord or something where we can ask questions to? I just think that it would be fun to interact with you and your other students while learning your courses.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +1

      I hope you like them!
      I tried Discord but it was impossible to be responsive since Discord is based on real-time
      I'm always available on the Q&A section of the courses, I answer all questions every day so if you need any help with anything just ask there and I'll do my best to help
      Thanks!

    • @honokiii
      @honokiii 2 года назад

      @@CodeMonkeyUnity i seeee~ well, I'll just send messages when I have questions. Thank you for the great courses!

  • @cydonia2987
    @cydonia2987 2 года назад

    That was a great video! I was just about to look into addressables when your video popped up in my feed! Great timing - and thanks for the video!

  • @RecOgMission
    @RecOgMission 2 года назад +1

    You’re a great coder and a great teacher. I always know how, and importantly, why, when watching your videos!

  • @pekpro
    @pekpro 5 месяцев назад +1

    Thank you so much! 🙂Perfectly explained. You're one of my all time personal heroes! 🍻

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 месяцев назад +1

      Thanks! I'm glad the video helped you!

  • @Robertganca
    @Robertganca 2 года назад +1

    Really good tutorial! I didn’t even know this was a thing that can be done.

  • @hypercharge26
    @hypercharge26 2 года назад +4

    Another nicely explained tutorial! Also, do you plan to expand on the NPC system (like movement, more behavior, etc)

  • @notlaw1567
    @notlaw1567 2 года назад

    Thanks for the tutorial! I didn't know there were so many approaches with this package!

  • @Maskedmous
    @Maskedmous 2 года назад +1

    Entirely Asynchronous is what you meant saying at 1:24.
    If it were entirely synchronous everything would be frozen.
    They do have a method call for synchronous loading, but calling this method will cause ALL other addressables that are asynchronously loading, to be loaded synchronously as well.
    It ain't advised to use that synchronous method, but some ppl in the community were complaining that everything was asynchronous.
    Addressables are awesome. But they do come with their own problems though.
    Especially when using scriptable object events. If you have a reference in the built-in scene and addressable load something that references that same scriptable object. Then it will be another instance of the scriptable object. So the scriptable object referenced in the scene is not the same as the one from the addressable loaded asset.
    Unless you load the scene itself as addressable it'll be the same again.
    Having addressables hosted on a content server makes it easy to do hot fixes. Forgot a reference? change the prefab or scene and just build the new addressables and put it on the server again. Fixed. No need for a new app build. You can make an in-game message stating that assets have been updated, get the new catalog, update the assets and reload the main scene.

    • @lee1davis1
      @lee1davis1 2 года назад

      See. Your example is the best use case for Add,s that I've seen. True. No need to re-download the entire build if the game only has a small bug fix.

    • @Maskedmous
      @Maskedmous 2 года назад

      @@lee1davis1 Yeah though, this hot fixing is only for bugs within assets. If there are bugs in your programming you'd still need a new build.
      Addressables doesn't allow code to be shipped. That's something that should be mentioned. So you can't update code with addressables, but you can update assets.

  • @hellfim
    @hellfim 2 года назад +2

    Great tutorial with good and logical structure!

  • @priyapianosongs7390
    @priyapianosongs7390 2 года назад

    Awesome tutorial, I was wanting to learn about Addressables for some time, you explained it really nicely, thank you.

  • @darkfafi
    @darkfafi Год назад +1

    I bought the Full Course. Thank you for this incredible resource!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Год назад +1

      Thanks! Make sure to check all the lectures, there's tons of obscure tools that Unity has, I hope you like it!

  • @bil8429
    @bil8429 2 года назад

    AMAZING TUTORIAL! I really need those cloud tutorials aswell I hope they're coming out soon :')

  • @ChrisHolden
    @ChrisHolden 2 года назад

    Another superb lesson. Can thoroughly recommend the full course!

  • @MathsPlusGames
    @MathsPlusGames 2 года назад +1

    Amazing, only problem is, if I end up bookmarking all your videos, bookmarks become meaningless, I think the thumbnail should be changed to Addressable. I might strugle to find this in the future because of the thumbnail
    I dont know how you add so much detail in such short period of time, considering the rate at which you make content!
    Keep it up
    I just realized this is part of the course which I have purchased but I have not started yet

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +3

      This was a tough video to make a thumbnail for, I'm not sure most people know what is Addressables so I chose to use that in the title and focus on one of the main benefits for the thumbnail. So by the title it should be searchable.

  • @nitinchipkar2928
    @nitinchipkar2928 2 года назад

    Hey I am from India 🇮🇳.
    You are doing well job 👏👍.
    I am watching your videos .
    Make more and more videos for us. Thanks a lot.

  • @joysonst
    @joysonst 2 года назад

    Excellent tutorial. Waiting for part 2.

  • @alec_almartson
    @alec_almartson 2 года назад +1

    Excellent video. 😄👍🏻
    This topic seems very important specially for mobile multiplayer games these days 🎮

  • @PRodi_
    @PRodi_ 2 года назад +1

    Great Tutorial Big THX!

  • @bluzenkk
    @bluzenkk 2 года назад +3

    at 9:35, I notice that you magically pressed a short cut key to auto generate the AsyncOperationHandle_Completed event and its function. How did you do that?

    • @TheAncientArrow
      @TheAncientArrow 2 года назад

      It's just the Tab key

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +1

      It's Visual Studio's default auto-completion, after you type += on an event if you press Tab it auto completes the event function. I don't think VS Code has it, at least not by default, I'm using VS Community

    • @bluzenkk
      @bluzenkk 2 года назад

      @@CodeMonkeyUnity ah... ok thx

  • @crazyfox55
    @crazyfox55 2 года назад +5

    I don't like that registering to the completed even occurs after the call to load the asset. In my eyes that is just bad flow, the completed event might fire before you get a chance to register for it. There might be some behind the scenes logic that the AsyncOperationHandle could check if its already completed when new subscriptions are assigned. However I still don't like how it looks in my code.

    • @lee1davis1
      @lee1davis1 2 года назад

      Good point

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +1

      Since the whole system is asynchronous I don't think it's possible for the event to fire before you register it, I think even when loading a 1KB file it will take at least one Update to complete so I don't believe that's a problem.

    • @BoundfoxStudios
      @BoundfoxStudios 2 года назад +3

      Add UniTask to your project and it’s super clean again, no ugly callback/event stuff:
      private async UniTask LoadAsync() {
      var go = await Addressables.LoadAssetAsync(…);
      Instantiate(go);
      }
      Ugly stuff is behind the scenes and we got a nice API. Also, UniTask is pretty much a standard Asset to use because all async/coroutine stuff is much better writeable and handleable :)

  • @f11bot
    @f11bot 3 месяца назад

    Amazing tutorial, detailed and easy to understand, thanks!!

  • @Patricebrouh
    @Patricebrouh Год назад

    I understand Adressables thanks to this video. Thanks

  • @cgh353
    @cgh353 2 года назад

    Super Tutorial Thank you for this and the ones following up on this with the cloud tutorial.
    Also just a request for maybe a async cloud based game in the future.

  • @barbarusonline
    @barbarusonline Год назад

    Thanks again. Amazing video. Helps us a lot currently

  • @EnderElohim
    @EnderElohim Год назад

    16:00 how you use label with string? is it same with AsyncOperationHandle asyncOperation = Addressables.LoadAssetAsync("Assets/_MS/Model/test.fbx"); but just label like ("environment")

  • @Greviouss
    @Greviouss 2 года назад +1

    Almost jelly how much faster you seem to learn newer unity concepts and absorb how they work. Oh and make a hey gang here's the whole thing dissected and explained..
    Meanwhile I gotta watch your video 3 times along with a slew of support alternatives to have any level of a working grasp on some of these things at all
    Sigh

    • @isawadelapradera6490
      @isawadelapradera6490 2 года назад

      if by "support alternatives" you mean checking out additional documentation, that's how you're supposed to be doing it to learn faster

  • @jacobester3846
    @jacobester3846 2 года назад

    Thank you, very helpful. I can see how this would be useful for managing things like weapons/armor/clothing that might change frequently on characters/NPCs.

  • @RenegadeVile
    @RenegadeVile Год назад +3

    One thing that's currently confusing me about Addressables is that using them seems to remove the usefulness of the editor? If all the assets need to be asynchronously loaded, what do you do during design time? For example, while creating your scene, and putting all the environment assets where you want them to be? If you make them addressables, you can't view them in the scene anymore, can you?

    • @johnsartain4160
      @johnsartain4160 11 месяцев назад

      I’m thinking that too

    • @dong8912
      @dong8912 8 месяцев назад

      I think it’s more for optimising and should be used after your scenes are complete. The whole point of addressables is to minimise ram usage by dynamically loading assets from the disk while the game is running. It has nothing to do with the editor.

  • @lime_68
    @lime_68 Год назад

    Have to learn it, it gives massive optimization power 💯

  • @maxg5196
    @maxg5196 2 года назад

    Great video. Super helpful!

  • @michaelsong741
    @michaelsong741 Год назад

    Thanks very good guide on addressables.

  • @PraveenKumar-gt9nv
    @PraveenKumar-gt9nv 2 года назад

    yes, more interesting. I am looking forward.

  • @PawanRamnani-r9b
    @PawanRamnani-r9b Год назад

    Amazing video 👏. Really helped me reduce my game size.
    I also watched your video on unity gaming services so i wanted to ask :
    Are you planning to make a video on how Cloud Content Delivery can be linked with addressables?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Год назад

      Yup I did cover cloud content delivery in another lecture on the full course

    • @PawanRamnani-r9b
      @PawanRamnani-r9b Год назад

      @@CodeMonkeyUnity i did see that now on your paid course, can you maybe post it on youtube too (as no one has properly covered it yet) or maybe just add a feature to just buy the particular video because i cannot really buy the entire course for one video.
      Thanks for the reply.

  • @navi1615
    @navi1615 2 года назад +2

    Quick question.. Is it really a good practice having the whole scene as a prefab? Or was just an example? I don't know if addreassables support scenes directly or not, but for baking light and that stuff it would be important. Or is it more oriented to "simple" assets instead of something like a scene?.
    Also, does it allow you to include new scripts with those packages? Or do you need a new build?
    Thank you!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +3

      It was mainly just an example, depending on the size of your level you might be ok with making it a single prefab if it's relatively small but definitely don't make it a single prefab if you have something on the scale of Skyrim.
      On a large world you would split it into chunks then use Addressables to dynamically load/unload them as the player moves to have no loading even in a huge world.
      Addressables is only meant for assets, not code. You can reference scripts that were included in the build, but you cannot include extra code in the addressables that wasn't present in the original build.

    • @navi1615
      @navi1615 2 года назад

      @@CodeMonkeyUnity Got it! Thanks!

  • @vlakitus
    @vlakitus 2 года назад

    Really helpfull and professional content, I already learned a lot from yout channel!
    Thanks a lot!
    Would be great to see how to make a melee combat system with finalization and slow motion in the last hit on the enemies.

  • @osamansr5281
    @osamansr5281 Год назад

    That was wholesome ❤

  • @tufanaydin6340
    @tufanaydin6340 9 месяцев назад

    Thanks for this amazing tutorial

  • @golamashraf1464
    @golamashraf1464 2 года назад

    Great intro to Addressables! Can you kindly post the link to the next part which covers Remote Addressables? TIA!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +1

      This video is a sample from my Ultimate Unity Overview course, the other 2 lectures on Remote Addressables and Cloud Content Delivery are available on the course unitycodemonkey.com/courses.php?c=ultimateoverview

  • @JamesWrank
    @JamesWrank 2 года назад

    I would love it so much if you could make more tutorials about Netcode and multiplayer with unity game service! The first tutorial about Netcode was great, a full overview of Boss Room soon would be such an amazing gift for us ♥️♥️♥️

  • @Cameo221
    @Cameo221 2 года назад

    I've been using addressables for a while now. I wasn't aware that the addressables are built upon a unity build like in the video?
    I always remember manually having to build addressables individually. What do I have to do to have this behaviour by default?
    Very nice video by the way. Even if I already know how this all works, it's great to solidify my knowledge. I like how the video only used minimal code, as it's way too easy to overengineer with addressables while self-learning this like I did :)

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +1

      There are both methods, I believe this behaviour is the default, I don't remember changing anything to make it build alongside the game build.
      After making the build then there's another menu to update a previously created asset bundle, it's what I used in the Cloud Content Delivery lecture to update some assets on the server.

  • @hakanviajando
    @hakanviajando 2 года назад

    Thank you, amazing explanation.

  • @GreazyController
    @GreazyController 2 года назад

    Nice video 👍 thanks a lot for your help!

  • @GaLzZy.
    @GaLzZy. 17 дней назад

    I'm asking this before watching, can addressables be good for let's say a battle pass in a game? Like load each tier as a scriptable object that you load in your game maybe? Thanks

  • @trantuananh421
    @trantuananh421 2 года назад

    Nice tutorial. Can you make more tutorial about download Addressables player content from cloud from initialization then load from local at runtime ? Thank you

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад

      If you use Addressables remote then you have that behaviour by default, the system is smart enough to first check for the hash on the remote server and only downloads all the data if the hash changed, if not then it uses the cached data

  • @tufanaydin6340
    @tufanaydin6340 4 месяца назад

    Hello CodeMonkey. I think the best idea for this thing position based addressables. Like if player close to assets load that if far unload. Can we make like this demo?

  • @lcd11001
    @lcd11001 6 месяцев назад

    Hello @CodeMonkeyUnity,
    How can I customize remote download URL async at runtime via script? For example, if my host require private authen token included in download URL.
    Thank you

  • @antonorlov8838
    @antonorlov8838 2 года назад

    Thank you again for tutorial :)
    I don't understand, Is Adressables is completely replaces the Asset bundles common flow in Unity? Or I still have to choose what approach to use - Asset Bundles or Adressables?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад

      Addressables is a tool built on top of Asset Bundles. When you make a build the system will go through all the Addressables you set up and automatically create all the asset bundles

  • @UC9o5XrlWjXFOZayVA5JCXcg
    @UC9o5XrlWjXFOZayVA5JCXcg 6 дней назад

    Is there any benefits compared to LoadFromFile besides not using a string?

  • @ahsanbloombig3213
    @ahsanbloombig3213 2 года назад

    That was Great Video and i have a question that can we load multiple Addressable Scenes at same time? and if we are loading whole scene from cloud how can we reload it in our game as it is'nt in our build settings so SceneManager.loadScene(0) will not work! waiting for Answer

  • @krtkonos8771
    @krtkonos8771 Год назад

    Thx very much. Can I ask? I have sets of scenes with large maps, the unity project would have like 100GB if I have them all in one project. I used asset bundles and add the chosen maps to the project or to the build to keep it small. Can I use addressables to achieve similar result? It took quite long to load large map from asset bundle

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Год назад +1

      Addressables is built on top of asset bundles so if you're already using that then this system won't make it any faster

  • @DigitalSummit
    @DigitalSummit Год назад

    I'm having an on my Quest app with addressable . My scene slows down when it is set as an addressable, and runs smoothly when loaded locally. I used Occlusion culling to get this fat scene to work smoothly at 90 FPS. Occlusion culling seems not working on Android addressable scenes could explain my problem.

  • @Brandincanterbury
    @Brandincanterbury Год назад

    Just curious. I love your videos, but how come you don't use the practice of using var myvar instead of AsyncOperationHandle myvar? I know this is a huge debate in the c# world. I prefer it over having to redefine the type in the event the assignment needs to change later due to requirements changing, and Ide's convert it at compile time anyway, so there really is no performance gain over one or the other.

    • @blockify
      @blockify Год назад +1

      I guess it’s up to personal preference. When I’m learning I use the full explicit version so I can remember all the names etc

    • @Brandincanterbury
      @Brandincanterbury Год назад +1

      @@blockify If you're coding on your own, it absolutely is up to personal preference. In a professional environment, you have to follow the code standards the company sets. companies are more often than not going with the "var" standard (It's even a highlighted nit in Rider), which is why I asked. Anyway, was just curious, not attempting to come down on anyone. :)

  • @BanditBloodwyn
    @BanditBloodwyn 2 года назад

    What video editing tool do you use? Maybe I want to create my own devlogs :)

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад

      I use Premiere for editing and OBS for recording, best of luck with your devlogs!

  • @Henry3dev
    @Henry3dev Год назад

    how can we add a loading bar 🙏🙏 to show that it is loading in background

  • @SonaliS-i8i
    @SonaliS-i8i 10 месяцев назад

    I'm currently working on a project and I want to load the scenes remotely through addressables. I have a doubt ,after downloading the scene 1 from cloud in play mode, will that downloaded scene remains in the project or it has to be downloaded again after exiting from the playmode

  • @paulthompson52
    @paulthompson52 2 года назад

    Would love to see if/how this could be used for streaming large environments!!

  • @bluzenkk
    @bluzenkk 2 года назад

    love this video~

  • @stylie473joker5
    @stylie473joker5 Год назад

    Thank you for the amazing explanation. btw Why did it take 2 seconds to load the level in Unity but 9 seconds in Build

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Год назад +1

      It has to do with how Unity manages memory, it's not necessarily exactly the same everywhere

    • @stylie473joker5
      @stylie473joker5 Год назад

      Thanks for the clarification much appreciated@@CodeMonkeyUnity

  • @MafiaSniper
    @MafiaSniper 2 года назад

    Hi CodeMonkey, please make more videos on multiplayer topics.

  • @enamulislamjisan
    @enamulislamjisan 6 месяцев назад

    Sprite load is not working on builds :/ even tough implementation is perfect & works in PlayModeScript set to UserAssetDatabase but does not work in other play mode script or in real build

  • @pianosouls_yt
    @pianosouls_yt Год назад

    could you made a tutorial how to update addressable content without download new version from app store thanks

  • @immutablecantrip
    @immutablecantrip 2 года назад +1

    At 13:40 watching you create an event subscription without any way of unsubscribing makes me ill lol

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад

      You can store the AsyncOperation and unsubscribe but its unnecessary, the Complete callback will never be called twice

    • @immutablecantrip
      @immutablecantrip 2 года назад +1

      @@CodeMonkeyUnity An event subscription will keep an object from being garbage collected. Most memory leaks in C# come from creating an event subscription without unsubscribing later

  • @GamingTherapy8890
    @GamingTherapy8890 8 месяцев назад

    can you please make video on Google Play asset delivery. Thanks in advance

  • @abdulwahab-wg2ok
    @abdulwahab-wg2ok 2 года назад

    Can you add links after every video from where you learn all the stuff, it would help us in searching our bugs, buz searching from google is skill too isn't it?.

  • @junnoonrafid113
    @junnoonrafid113 8 месяцев назад

    How can i implement it in a open world game (should i?). like should i use box triggers at different place and load the near by terrains when player triggers it, or can i make some sort of world streaming system which would load and unload terrains when the player is colse ( im not really sure of the second method definitely need some insites on this.)

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  8 месяцев назад

      Yup if you have an open world game you should definitely implement some kind of world streaming system to keep your game performant. And yes you would basically split your world into multiple chunks, and load/unload chunks as the player moves through the world.

  • @UnityMMODevelopers
    @UnityMMODevelopers Год назад

    Just wondering with Asset Bundles you are able to create an asset Bundle in one project and then load them in a game built from a totally different project. Is that possible with Addressables or would you have to set up the addressables from the project that you are building your game with? Basically I'd love to have one project just for world building where the addressables would be created from, then other projects for Server, Client, Maybe a Game Editor, and maybe a Offline World Viewer or something like that and share the addressables between all the projects.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Год назад

      Hmm I haven't tried out that scenario but Addressables is built on top of Asset Bundles so if you can do that with Asset Bundles then it sounds like you would be able to build the same thing with Addressables

  • @camushushuaia
    @camushushuaia 6 месяцев назад

    Why when you spawn the prefab for the scenario with the "T" key you do it as a transform instead of a gameobject?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  6 месяцев назад

      Just personal preference, normally I like to work more with Transform than Game Object unitycodemonkey.com/video.php?v=B-dVf9wUEbg

  • @jud.su.5developer895
    @jud.su.5developer895 2 года назад

    Nice ❤ i play some games they’re disabled objects when player far from it and it enable it when it’s near like house when you far you can’t see but when you be close you see it is this system good? I am sorry my English not good 😅

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +1

      Hmm sure you could load a simple Billboard when the player is far away and use Addressables to load the full object as the player moves closer, that would be a good use case.

  • @wakajak8634
    @wakajak8634 2 года назад

    Wow, fantastic tutorial. Super useful. I'm wondering how useful it'll be for me, as someone who makes relatively small 2d games.

    • @captainnoyaux
      @captainnoyaux 2 года назад

      same as you, I don't think it matters for small games even in 3d. If you build open world or big scenes maybe !

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +1

      Depends on the scale of the game, Hollow Knight is a 2D game with a huge world that would definitely require memory management.

  • @bhanukadasanayaka3457
    @bhanukadasanayaka3457 2 года назад +1

    Can you make tutorials for UI Toolkit

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +2

      Yup it's on my list but not sure when I'll be able to get to it

  • @lemetamax
    @lemetamax 2 года назад

    Apart from addressables' CDN feature, what's the difference between loading scenes (containing some parts of the game environment) additively and using addressables to load a group of the same game environment parts(labels)?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +1

      Functionally they would be similar, if you load a scene additively it has pretty much the same result as loading a giant prefab with addressables.
      The main benefit is with addressables you have more control, you can make a single texture or mesh addressable, whereas with the scene method you'd need to place that object on a separate scene

  • @iaderesel
    @iaderesel Год назад

    Where is the second video (about loading Addressables from a server)?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Год назад

      It's a lecture in the course, there's one on Addressables Remote and one on Cloud Content Delivery

    • @iaderesel
      @iaderesel Год назад

      @@CodeMonkeyUnity I see thanks, and the course is not on youtube but is paid, right?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Год назад +1

      Yup correct, there are some free sample videos like this one here on RUclips but the full course has all 60+ lectures.

    • @iaderesel
      @iaderesel Год назад

      @@CodeMonkeyUnity ok understandable, though I found it confusing that you mentioned in the video that you will later describe remote uses of addressables without mentioning that this will happen in another, paid video
      Besides that, this is clearly quality content

  • @iknowcturne7362
    @iknowcturne7362 2 года назад

    Hi !
    Do you plan on making somes tutorial about FPS ? In mean by that, some kind of controller, shooting behaviours, recoil, reloading or any of theses subjects ?
    Theses are just example but i think it would be great to have some kind of tutorial from.you on this very popular type of gameplay ! Thanks for Reading 😇

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад

      FPS is indeed a genre I'd like to cover, I haven't really made many videos on it, only made my FPS Microgame unitycodemonkey.com/video.php?v=twMkGTqyZvI
      Although I did cover a bit of shooting logic in my Third Person Shooter, it's pretty much the same in first person, just different animations unitycodemonkey.com/video.php?v=FbM4CkqtOuA

  • @19_nguyenvanduong25
    @19_nguyenvanduong25 Год назад

    very helpful video, but can i ask you this question, i'm referencing a prefab containing 200 sprites in my script, but why using Addressable still takes 5 seconds to finish loading that prefab, seems how Doing this still doesn't load faster than the normal reference way

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Год назад +1

      Not sure what you mean, Addressables doesn't make loading faster, it simply gives you control over when you load the asset

    • @mahna_mahna
      @mahna_mahna Год назад

      @@CodeMonkeyUnity The issue is you titled your video "How to use Addressables FASTER Loading" etc. I came here looking to find a way around some of the slow addressable loading. What you meant is "load the initial scene faster", I suppose. Even though that's still a bit (unintentionally) misleading, since the scene isn't usable without the other stuff then getting loaded.

  • @amirhossein_alimirzaei
    @amirhossein_alimirzaei 8 месяцев назад

    @CodeMonkeyUnity
    Why doesn't my memory release after instantiating an object in Addressables prefab? It starts at 65MB, goes up to 150MB, but when released it only goes down to ~120MB instead of the original 65MB. Why?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  8 месяцев назад +1

      It has to do with how Unity optimizes things in the background, not sure on the specifics but that's why the numbers never perfectly match.

  • @jamesderaja
    @jamesderaja 2 года назад

    Great video. Will this be useful for mobile games? What is the best way to do this when we are reloading the same scene again after a failure or something?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад

      Yes mobile has much less memory than PC/Console so it's especially useful there, only load the objects that you need to and nothing else.

    • @jamesderaja
      @jamesderaja 2 года назад

      @@CodeMonkeyUnity what about reloading the same scene again? Is there a better way to do that? Or a different way to load and unload objects? Or is marking them inactive good enough?

    • @jamesderaja
      @jamesderaja 2 года назад

      @@CodeMonkeyUnity thanks for the tip BTW. Loved your video.

  • @clarkmeyer7211
    @clarkmeyer7211 2 года назад

    hey codemonkey I was wondering if you think this would be possible and if so where to look. I want to make a system like skyrim where entering a building takes you to an entirely different scene thats approximately the same size as the house. the problem is that I want to make a prefab of it so its scalable so if I place down another house prefab I don't want it to enter the interior of a different house. I want it to create its own instance of the interior especially if I want these houses to be generated procedurally. Is there a way to make these prefabs create a new generic interior scene(one I have premade but want to reuse for different building interiors). This question seems to be a little complicated to ask so I hope it makes sense.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +1

      Sure, sounds like you just need some kind of level editor so you can build a house interior with a bunch of modular parts, then save that level data somewhere, perhaps a scriptable object, and when entering the house ask the house object for the level data and load that level.
      Alternatively if you don't want to do it through code you can place the house interior in a prefab then for each house object you attach a house script that has a reference to that prefab, you load the empty interior scene and spawn that prefab. Just assign different prefabs to different houses.

    • @clarkmeyer7211
      @clarkmeyer7211 2 года назад

      @@CodeMonkeyUnity thanks. I'll definitely look into the scriptable object idea.

  • @vincentl7022
    @vincentl7022 2 года назад

    Can we have the same benefit with async loading of a scene, what is the tradeoff , bigger exe size ?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +1

      Yup async loading a scene would work the same, the benefit of this system is you don't need to create an entire scene, you can individually load just a single prefab or texture or anything.

  • @jimmyfitzsimmons7170
    @jimmyfitzsimmons7170 Год назад

    Hello, I just bought your couse on udemy but now I wonder whats the difference between the course on udemy and the content of your Yt channel ?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Год назад

      The course has all 50+ lectures, here on RUclips I only uploaded about 4 free samples.
      For example this lecture on Addressables is a free sample exactly like the course lecture, but the following 2 lectures on addressables remote aren't available here on RUclips

    • @jimmyfitzsimmons7170
      @jimmyfitzsimmons7170 Год назад

      @@CodeMonkeyUnity Alright, thanks for the answer and your amazing content =)

  • @Ziplock9000
    @Ziplock9000 Год назад

    Just to mention, the half-way solution is to use resources, which can be loaded from disk when needed.

  • @speedeespeedboi9527
    @speedeespeedboi9527 Год назад

    I still get invalid key with the labels way. How to fix this?

  • @WelshGuitarDude
    @WelshGuitarDude 6 месяцев назад

    What's the purpose of groups though?

  • @Rook1e0ne
    @Rook1e0ne 2 года назад +3

    i got a question. why would someone choose this method instead of having multiple scenes and loading and unloading them respectively ? (watching the video , at least to my experience with mutiple scenes its the exact same functionality)

    • @KeyboardKrieger
      @KeyboardKrieger 2 года назад +1

      I personally would use it to store data in the cloud. You could add for example additional levels to your game without your users having to update it.

    • @Bothandle70
      @Bothandle70 2 года назад +2

      With this, you can micromanage assets of individual scenes too. That can give you extra performance boost. Also, main advantage of it is to store data in cloud and download new assets or update old assets without releasing new builds and also reducing the build size.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +2

      Sure, in terms of memory control both techniques can be used to similar results. I would say addressables is much easier to use if you have smaller use cases, like for example you want to load just one special enemy or a special sprite, with scene additive loading you would need to make a scene just for that enemy or sprite whereas here you just tick the box and mark it addressable.
      And beyond memory management the other main purpose of addressables is downloading new content from the cloud, like updated assets for a special event, can't do that with just scene additive loading.

    • @Rook1e0ne
      @Rook1e0ne 2 года назад +1

      Ok thank you for the replies all. I believe I understand now.

  • @calcoamara6240
    @calcoamara6240 2 года назад

    Is addressables an option when using WebGL, because it doesn't like anything outside main thread?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +1

      I believe it does work in WebGL, asynchronous doesn't necessarily mean multi-threaded

  • @maciejzareba9563
    @maciejzareba9563 7 месяцев назад

    Can someone explain to me why there is so much garbage still loaded after unloading addressables ?
    In video at 24.39 Started project with ~136 mb of ram usage
    at 24.52 code monkey has loaded addressables with enviro and ram usage jumped to ~616 mb
    at 24.55 code monkey has unloaded addressables and ram usage lowered to ~ 257 mb.
    There is still 120 mb of ram that was not unloaded. Can we do something about it ?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  7 месяцев назад

      As far as I know Unity has various optimizations that will attempt to use as much memory as possible as long as the device still has memory, so in that case I assume it keeps some things cached just in case you want to load those same assets in the future, and it will only completely unload that memory if the device is nearing the limit.

    • @maciejzareba9563
      @maciejzareba9563 7 месяцев назад

      @@CodeMonkeyUnity first of all thank you for anwser. Secondary I'm making R&D in this topic for my project with memory profiler and noticed some things related to my question that may help other users.
      1) When you had empty scene you were not using almost any materials and assets. When you loaded enviro it loaded all assets related to this prefab. In it were for example elements with lit shader. Most people don't know but when you requesting material it is loading much more then just material and it shader. For example it needs to load "error" shader and create material instance of it to have chance to display it if something goes wrong. If you then unload your enviro it will not unload those "debug" shader and material. This case is not only for materials. Similar situation takes part in other object's type.
      2) It is a bit follow up but it won't pile those "garbage" endlessly. If you Load Unload and repeat process you will not create additional garbage (at least amount will significantly lower).
      3) It is a bit connected if you want to manage your memory by addressables scenes there are some ways but it is not so great ideea. There is UnloadSceneOptions.UnloadAllEmbeddedSceneObjects for additive scenes. You must know that even if you mark unload as UnloadSceneOptions.UnloadAllEmbeddedSceneObjects it will only unload all resources that are serialize in scene. So for example every object that you spawn dynamically will not be unloaded. You need to know as well something a bit obvious that when you are loading scene and any script on this scene that reference prefab or any other resources needs to be loaded with scene.
      4) As CodeMonkey mentioned in comment above yes Unity has some build in solution to leave some elements not unloaded even when requested. It is kind of optimization that is great for 95% of use case but in other 5% is annoying as hell and there is no (at least known to me) way of disabling it.
      Bonus : It is not mention in video but i think it is some great info. When you are loading addressables from label and in this label you've got different types of objects. I'm recommending to use Addressables.LoadResourceLocationsAsync(labelName) that has callback with AsyncOperationHandle asyncOperationHandle where you are dystyngiush type of object.

  • @REDACT3D
    @REDACT3D 2 года назад

    Hey bud, have you done a Net Code Tutorial using Visual Scripting?
    if so, that would be grand
    keep up the good work bud!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  2 года назад +1

      Visual Scripting has the same nodes as C# so all the functions you see in this video can be called from VS, just make sure you add the multiplayer assemblies and all the nodes will show up

    • @REDACT3D
      @REDACT3D 2 года назад

      @@CodeMonkeyUnity beauty, thanks bud. Yeah I got the nodes going and just playing around with setting up subgraphs and such to make it easy.
      takes a while to translate from typed script to nodes, but totally doable.
      I guess what I need is to start with a login screen,
      most folks show how to setup the player object not so much how to setup the login screen.
      hard to get good feedback to see what's going on you know? like how you use your console thing