Search Unity

Procedural 2d

Discussion in 'Getting Started' started by Uluor, Mar 2, 2015.

  1. Uluor

    Uluor

    Joined:
    Dec 10, 2013
    Posts:
    1
    Hello,

    I'm interested in working with the Unity engine in order to develop a procedural 2d game. I will need to be able to generate worlds and then save these worlds to a file (or files) for later access. At the moment, I haven't decided on whether or not these worlds will have borders or if they will have the capability to generate indefinitely as the player moves across the map.

    Is Unity a good choice for what I would like to accomplish? Since these maps may potentially become extremely large, does Unity offer any methods for the loading and unloading of segments / chunks of map data, or am I on my own? If it does not offer any methods, how flexible is the engine in terms of integrating such functionality?

    I'm trying to decide if it's worth building my project in Unity or if I should just design my own engine using C# with OpenTK. I find Unity really appealing as it would save me a lot of time dealing with the nitty-gritty.

    Thanks.

    -Steven
     
  2. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    It's perfectly doable. If you want a jumpstart, there's SpriteTile, but if you want REALLY huge worlds, it might run into limitations. You should go find its thread in the Asset Store section and ask.

    If doing it yourself, it's only a matter of storing tile references as efficiently as possible. If you're really careful you should be able to have a 1000x1000 tile map (tiles of any size) in a few megabytes. Even 10k square is within reason on a desktop computer, unless you make some sort of paging system to cut it down even more.

    And yes, you can unload unused data.
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Actually not. ;) You can generate new stuff on the fly, and save/load chunks, so you can make essentially infinite levels.

    --Eric
     
  4. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    Excellent, because I'm going nuts with big maps :)