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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Level Layout or Instantiating?

Discussion in '2D' started by adrianrodriguez, Oct 27, 2015.

  1. adrianrodriguez

    adrianrodriguez

    Joined:
    May 29, 2013
    Posts:
    16
    I'm working on my first platformer and I'm wondering what's the best way to approach the level layout. Should I a) layout the level manually, or b) instantiate prefabs

    Most of my concern has to do with things that will be repeated but not all the time. So for example:



    You can see in this image, I have a sandy white background, and a dirt ground beneath the character. Those I plan on showing almost infinitely, except every now and then the dirt background my change into a different terrain, such as one with grass, or maybe even water, etc..

    This is definitely my first rodeo so I'm not trying to attempt on making the levels dynamic, but rather more purposeful, the only dynamic thing I might introduce is when I start spawning in enemies and other structures.






    Disclaimer: (art is not mine, grabbed from free resources, but I've modified them to fit my needs :) ) Check out the sources here:

    Character: http://opengameart.org/users/calciumtrice
    Ashland Rock: http://www.dumbmanex.com/bynd_freestuff3.html
     
  2. VorpalSilence

    VorpalSilence

    Joined:
    Oct 22, 2015
    Posts:
    13
    This choice really comes down to the intent of your project. Designing your levels by hand will almost always give a more purposeful feel to the game. It gives you much finer control over things like pacing and introducing new concepts to the player. Hand crafting however can take a very long time. Whereas procedural generation is very simple to implement in unity. And if you have nice consistent art assets you can also get a look that isn't too repetitive (look at the unity 2d roguelike tutorial for how to get this kind of effect.) But procedural content can make it harder to fine tune your games pacing and ensure that the player has learned everything they need to know correctly etc.

    Another thing to think about is that can always try a bit of both. In the past I have made procedural generation scripts that make the world, then simply run them a few times till I like what has been made, save that off as a prefab and then go to work adding in more detail and clearing things up etc. You can also look at mixing the two effects. Like at a certain point in play, the game will spawn a level that you have hand crafted but then it will go back to procedural levels until you want to deliver the next special level etc.
     
  3. tedthebug

    tedthebug

    Joined:
    May 6, 2015
    Posts:
    2,570
    Or do handcrafted for the first few levels while you introduce the concepts & then go procedural if you want.
     
  4. adrianrodriguez

    adrianrodriguez

    Joined:
    May 29, 2013
    Posts:
    16
    Thanks for the input guys, I think what you said was best, I definitely want more of a personality to it, so I am going to design more assets on top of the art I've found so that I can really personalize this and make it something unique and fun.