Search Unity

Coding Practices

Discussion in 'Getting Started' started by TT1103, Mar 30, 2015.

  1. TT1103

    TT1103

    Joined:
    May 30, 2014
    Posts:
    3
    Hello, I am working on my first game and it will be a puzzle game. The game will contain many puzzles and I plan on making them by hand.

    Now the question is, should I make each level its own scene and just build the puzzles in each scene? Or should I just have one game scene that would load text files (or some sort of file) containing the level data?

    Which would be a better practice or which one would be easier in the long run?

    Thanks.
     
  2. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    It really, really all depends. If they're physically-based puzzles, scenes may be the most appropriate. If it's something like a tile game, maybe text files, or maybe not. You might even need some type of system to generate puzzles based on criteria, instead of building them explicitly. There are practically infinite possibilities that you could be looking at here, and it's not really possible to speak to which practice would work best for you.

    I say just try doing it one way, and if you find yourself wishing it were handled differently, refactor to do it that way.
     
    Kiwasi likes this.
  3. Sylvir

    Sylvir

    Joined:
    Mar 21, 2015
    Posts:
    396
    I would probably agree with Schneider21, just pick one and go for it, if it gets too tricky or confusing or the other seems better then go back and try that way. with unity, and game creation in general you have to not be scared to go back and try another way if something doesnt work.
     
  4. TT1103

    TT1103

    Joined:
    May 30, 2014
    Posts:
    3
    Alright, thanks for your input. I think I'll just go with using text files and I'll write my self a level builder.
     
  5. Sylvir

    Sylvir

    Joined:
    Mar 21, 2015
    Posts:
    396
    good luck, hope it goes well!
     
  6. CarterG81

    CarterG81

    Joined:
    Jul 25, 2013
    Posts:
    1,773
    I'm a bit tired, but why wouldn't you just use a Scene for each specific Level?

    That sounds easier, and much better use of Unity's interface style. Not that there is all that much of a difference, but at least then you keep it simple while you learn.
     
  7. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,175
    One nice benefit of this path is that you can allow players to create their own puzzles and distribute them to other players.