How to save Unity Tilemaps

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

КОМЕНТАРІ • 49

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

    Why I ❤this channel:
    Came here to learn about Tilemaps
    Encountered local functions for the first time
    Learned about both.
    Better game dev
    Better software dev
    20/10, video did the job of two videos

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

    Just perfect tutorial. Was a bit scared you wouldnt show how to save to json there but glad you decided to.

  • @vamporium432
    @vamporium432 2 роки тому +15

    You didn't tackle the Deserialize() part of the Level struct. Would you do it with string.Split() or string.IndexOf or similar string manipulation? Or do you have another (maybe more efficient) approach?

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

      In my implementation I used string.split, and used commas and brackets as seperators

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

      Hey man can you please share the code? I couldn't figure out how to doit@@LethalChicken77

  • @lollipop.4784
    @lollipop.4784 3 роки тому +3

    Dude, you are so underrated!!! Thank you so much for the video and you have helped me a lot! keep up the good work

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

    Thank you so, so much! This video has helped me immensely. It should have 10x more views, man!

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

    Exactly what I needed! Thanks!!

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

      You're welcome ❤️

  • @322ss
    @322ss 3 роки тому +5

    Thanks for the video, some interesting points there. BTW, it would not probably be a good idea to ever serialize those scriptable objects into json as is, those tile instance IDs can change AFAIK. So after adding or removing some stuff from project and then loading a level might not work as expected, even if the save/load was editor only feature. I guess you already know this, but there is that pretty print parameter for JSONUtility which outputs the data with line breaks and indentations, it is pretty useful when you need to read that data in text editor.

    • @Tarodev
      @Tarodev  3 роки тому +8

      You're right, you should never serialize a ScriptableObject. It was naughty of me to use it as an example. Hopefully viewers don't stop the video right there and take it to heart without listening to the following advice, heh.

  • @Виктор-ъ4ь8л
    @Виктор-ъ4ь8л 3 роки тому +2

    Cool, thanks so much for your time and consideration

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

    Love the video man! However I couldn't figure out how to deserialize the more optimized way you showed at the end. Can you please help with that?

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

    Nice, when I finish the videos of the tactics games I search for how to do exactly this!!!

  • @Lee-ku3uw
    @Lee-ku3uw 21 день тому

    Awesome piece of content.

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

    Hi @Tarodev it's very very useful tutorial, I have modified your tutorial into very efficient with combine between Scriptable Objects and Tile, so I can call the tiles after I quit the game, Thanks for the tutorials!

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

    Really nice tutorial! The only thing that was really missing was how to unserialize the .txt file but good overall!

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

    Also, Inspector GUI sounds like a show on BBC.

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

    Amazing vidoe. Helped me a lot!

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

    Subscribers++;
    I'm crunching on a game and this might just save some features from the chopping block. Thank you!

  • @박정수-k4i1z
    @박정수-k4i1z 2 роки тому +1

    Thanks for the video!

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

    is there a good solution if I have a mix of RuleTiles, AnimatedTiles and normal Tiles? do I have to create individuell "LevelTiles" and save them in different Lists ?

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

      Yeah, I created a LevelRuleTile and gave it its own tilemap. Only minor changes to the code were necessary.

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

    Hi, I use this save and load system to load/unload chunks in my tilemap, it works but, when i load a chunk this have a little lag :( , i try changing the max tile change count from my tilemap collider 2d to a lower number but, this only made it slightly better
    Can you think of any way to fix that?

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

      It should be async save and load (dont really into it)

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

      The problem was that the collider 2d mesh didn't have a simple geometry and that's why it took so long to load and save, currently this system works perfectly for me :)

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

    I need level editor ingame, with tilemaps and layers😥

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

    I humbly request you zoom into your code editor :)

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

      I do in new videos 😊 I've learned!

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

    Cool :)

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

    Why don't you just create the scriptableobject at the start, then add and remove SavedTile objects as you place them at runtime? No need to look through the tilemap :)

    • @lee1davis1
      @lee1davis1 Місяць тому

      That was my thought process as well

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

    Is it possible to use this script with rule tiles? When I try to safe a rule tile to my level the "Tile" field stays empty

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

      Don't try to serialize the entire rule tile, save the tile type and position. When you load you check that it's a rule tile and lay it down

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

      @@Tarodev Could you explain it a bit, I have no Idea what I should do

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

    thanks for helpng me

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

      Glad it helped you 😊

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

    My personal favorite solution to this is to simply not. Unfortunately sometimes it is required.

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

    Enums don't have to have Serializable attribute. :)

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

      Indeed. I serialize them to see them in the inspector (I don't remember if I used them in the inspector in this video)

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

    Пригодится

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

      Making me google translate :P

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

    That is NOT the use of the word save I though you were going for :P I thought you were "saving" the tilemap feature from being bad :)

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

      I am only human 😂

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

      Ha ha :D In all seriousness, it's not as bad as I first thought. I think I'm finally getting the hang of it. Took a few months though!

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

    Damn. That's why I kinda hate Unity. Such a commonly needed functionality have to be coded using all sorts of crutches...

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

      Like serializing and saving tile maps? Yeah... I agree things like this should be native

  • @light-light
    @light-light Рік тому

    Why unity does not provide this basic function?