Search Unity

Saving and loading voxel map.

Discussion in 'Scripting' started by kennethrunescape2019, Jul 14, 2019.

  1. kennethrunescape2019

    kennethrunescape2019

    Joined:
    Feb 5, 2019
    Posts:
    72
    Last edited: Jul 15, 2019
  2. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,583
    Might help to share a link to the tutorial your following.

    As for saving and loading - look into serialization and writing to a text file and things about those subjects. You can basically write the coordinates and states at each coordinate to a file, and later read that file to load the world.
     
  3. kennethrunescape2019

    kennethrunescape2019

    Joined:
    Feb 5, 2019
    Posts:
    72
  4. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,583
    I hope you went to the second link at the top of that post for the newer tutorial!

    Which takes you here:
    https://forum.unity.com/threads/tut...h-infinite-terrain-saving-and-loading.293340/

    Anyway - yes if you follow through the parts of that tutorial (assuming its still available online, noticed the site seems to be down) you will find he adds some stuff about serialization of the chunks and you could take that a step further and save/load levels with those chunks if it doesn't already show you how. Here is where one kind fellow posted all the code to that tutorial in case you can't find the entire thing available online:
    https://github.com/z3nth10n/AlexStv-Unity-Voxel-Block-Tutorial
     
    Last edited: Jul 15, 2019