Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Approach / Design For 2D Games In Unity

Discussion in '2D' started by Gemfruit, Apr 21, 2017.

  1. Gemfruit

    Gemfruit

    Joined:
    Sep 15, 2013
    Posts:
    10
    So this is a bit of an unconventional question / conversation, but I'm in a relatively unique position right now, and the advice would help me a lot. This will be a bit long-winded, but I'll do my best to be concise and explain exactly where I'm coming from.

    My Background

    I have quite a few years of experience in game development, almost entirely in Flash, using FlashDevelop and AS3 (no visual editor, just code and assets, proper OOP, etc). I defend my approach there, because we're all aware of the stigma of Flash games, and how varying the quality of both the game and development process can be. That being said, I while I haven't launched anything in Unity formally, I've dabbled with it for 20-50 hours, not much, but I'm not completely new.

    The "Problem"

    My main issue since moving to Unity, is leaving behind the framework(s) I used to use that took care of a lot of the nitty gritty for me. For instance, I used to use FlashPunk, which had a ton of built in functions for everything math related, tile based collision, working with the sprite sheets in animations, etc. I know a lot of that already exists here, but I don't yet know what it is, where it is, or exactly how it works - time will remedy that.

    What's really getting me caught up, is how to approach things I once new how to do. I don't know if I should be simply manipulating the X and Y properties for my movement using math for easing like I once did, or if I should be using the 2D physics engine. I sometimes hear the built in 2D tools and physics are terrible, but that could be biased advice, I just don't know.

    I have a platformer concept I'd like to make, and I was a bit overwhelmed on where to start given my lack of familiar tools and workflow. I've read various approaches, from physics, to AABB, to ray casting and moving against the tiles, etc. I know most programming / design issues don't have a perfect or "right" answer, but I feel like I need a bit of guidance, as I'm the kind of person who needs to plan before I dive in.

    Another game style I'd like to work with is in the style of Geometry Wars (Asteroids on crack if you're unfamiliar). Again, are 2D physics a good idea here? In the past I've had a LOT of enemies and bullets on screen (think 100 enemies, 200 bullets, 500+ particles, etc) - does this get super bogged down if the bullets or enemies and player have are using physics vs simply being manipulated via the transform?

    Conclusion

    All in all, these might seem like silly questions, but they're what's kind of holding me back from "toying" with Unity, vs making my venture back into the career of game development. The games I've made in the past have millions of plays, earned me a few thousand dollars, and did quite well, and while my programming has improved since then (lots of PHP, dabbling with Unity, etc), my game development specifically is rusty. I'd really like to get into this again, and any insight into the questions I've asked would be greatly appreciated.

    Links to some of my previous work for examples of what style games I'd like to make:

    Pixel Purge

    Tower of Greed
     
  2. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    A vague question .. and a vague answer :)
    Movement by changing the position yourself works, as does physics. The physics engine is good, but it all depends on the situation and what you'd like to see happen.
    20-50 hours is a great start, and as you get more familiar with what's available in Unity, you will undoubtedly create pieces of code/a game , that will later lead to more, etc.. :)
    Keep at it.. Dunno what else to say beyond that ;)

    Bogging down.. that's a much later question. First you get going what you want, then investigate if it's bogged down, and if/why [ can it be improved, etc.. ].

    There are many tools in the Unity Engine + your experience.. I'm sure you can do a lot and have fun :)
     
  3. Gemfruit

    Gemfruit

    Joined:
    Sep 15, 2013
    Posts:
    10
    Sounds about right - I tend to overthink these things. I guess I'll just hop in and get it working, then move from there :D
     
  4. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    Nothing wrong with thinking :) Definitely trying it out will open your eyes, though ;)
     
  5. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    I'll add from a pov of not having worked on a 2D game before - I think making two version of a very simple design would be a good test bed to find the benefits and limitations of both techniques - and to see where they can be used together.
    A very simple level of angry birds comes to mind - 1 bird, one obsticle, one enemy, a background, a slingshot, and a landscape - where both transform and physics could be used interchangeably, setup to not use any physics at all, or to use all physics to drive movement.
    Check the archived live training lessons. There is an angry birds example in there - or it might be in the 2D learn section.

    Then once you've got some hands on experience - you can compare/contrast both methods and how they can work side by side - and relate what you've learned to the type of game you are interested in creating.
     
  6. saltysquid

    saltysquid

    Joined:
    May 1, 2017
    Posts:
    41
    I have the same "problem" you are having. I'm leaving behind a lot of frameworks and tools I used/created for XNA by moving to Unity. I'm also about 20-50 hours into Unity and still have many many questions. My solution is to take as many tutorials as possible so I can re-learn how to do these things the Unity way. It seems that "simply manipulating the X and Y properties for my movement using math" is the old code-based way of accomplishing things, while Unity has a lot of these things handled using other means such as the physics engine. I'm brand new but I would highly recommend tutorials (I have been using Udemy) and try to do things the Unity way. Take advantage of a powerful tool and don't force your old habits into the engine. My two cents ;)

    Nice previous games btw.