Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Is it possible to make a procedural generated tilemap?

Discussion in '2D' started by aybarsmete1, Nov 6, 2019.

Thread Status:
Not open for further replies.
  1. aybarsmete1

    aybarsmete1

    Joined:
    Oct 26, 2019
    Posts:
    43
    So, I am basically making a 2d sanbox game(like Terraria), and I could only find the ones with top down etc. Is it possible? If it is - how?
     
  2. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    Hi @aybarsmete1

    If you have to ask is it possible, and how, then you probably can't create such a hugely complex game yourself...

    Although I can't create such a game myself either, I can share some views and observations I've made;

    Games like Terrraria have usually a huge playing area (something like 8000x tiles wide). This alone will require you to split your world into chunks, so you only simulate manipulation of tiles, movement of NPCs, water (or such) only on active chunk. Maybe also simulate some stuff in further chunks with lower resolution, or update simulations to current state when player re-enters those areas.

    And the world maps are far from simple. Usually maps are generated using set of rules, and using noise algorithms like Perlin noise to place different things, based on noise values and height in world (for example). There are several YouTube videos floating around, if you just bother to google for procedural terrain generation. Similar algorithms can work for both 2d and 3d content. Then you will also have to create rules and routines to place the NPCs in similar manner.

    Also, game world in games like this is also usually persistent, so you'll have to persist you world as player can change it. You'll also have to create some sort of tile data system as Unity Tilemap alone won't cut it to store information about tiles and objects your player interacts with. Also, Terraria has pretty good amount of tiles at screen once, so don't ignore that either...

    Then there are tons of other stuff, like interaction with NPCs, inventory, item systems, leveling and so on - you probably get my point - lots of stuff to plan and create even if you already have a working example to clone features from.

    I'd think it is better that you try something more simple, as trying to create a Terraria clone might turn out to be a frustrating experience. Although I'm just speaking of my own experience...

    Also, there are several articles about creating Tilemap games like Terraria, just google.
     
    Last edited: Nov 6, 2019
    S1NATB likes this.
  3. APSchmidtOfOld

    APSchmidtOfOld

    Joined:
    Aug 8, 2016
    Posts:
    4,473
    Oh, thank you for asking! Take a look here:
    ;)

    Edit: downloadable example project here: Procedural Patterns to use with Tilemaps
     
    Last edited: Nov 6, 2019
  4. aybarsmete1

    aybarsmete1

    Joined:
    Oct 26, 2019
    Posts:
    43
    Before starting,I always google for atleast 30 mins before creating a thread. I saw you replied my several threads - why didn't you see that I use "Is it possible" in my every single thread? Despite, coming to topic, the tilemap I am going to generate is going to be 100x100. Plus, I advanced really far - the game it has is own inventory system, with breaking and placing blocks. I can say the only thing left to do is adding a good looking menu(mine looks crap), networking -which I think I can do later-, few more items and this procedural generated tilemap.
     
    VicMalicious likes this.
  5. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    @aybarsmete1

    Sorry - but just asking "is it possible" does make it sound otherwise, as quick 10 second query with "generate Terraria like map unity" yields many first page hits that will clearly depict how to approach such a task, explaining "how to create" such a map, which would have then answered to your question "is it possible" (= yes). Hence my answer.

    But seems like you have everything thought out - good luck!
     
    Last edited: Nov 6, 2019
  6. aybarsmete1

    aybarsmete1

    Joined:
    Oct 26, 2019
    Posts:
    43
    It's fine, but the procedural tilemaps in the google are not terraria-like. They are more like top- down. That is the reason I opened this thread. If you know any terraria-like procedural map, leave a link.
     
  7. aybarsmete1

    aybarsmete1

    Joined:
    Oct 26, 2019
    Posts:
    43
  8. Janneman96

    Janneman96

    Joined:
    Oct 21, 2019
    Posts:
    2
    I litterly googled it and got to your useless comment
     
  9. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    Sorry to hear @Janneman96

    I don't know what search engine you use, but this is what google gives me as first hits.



    Also, I might add, did you actually read my first answer up in the beginning of this thread? Maybe it wasn’t helpful, even thought it outlines common issues related to this specific game genre.

    Anyway, just for the future, I’m not sure if it was that wise to use your first post to bash some stranger…

    Remember, I or anyone else for that matter, have no obligation to help anyone, so if you didn’t find anything useful in this thread - move on, do another search with other keyword combination etc.
     

    Attached Files:

    Last edited: Mar 9, 2022
    Eclipse0S, DevAm00 and Kurt-Dekker like this.
Thread Status:
Not open for further replies.