Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

2D games with Unity

Discussion in 'General Discussion' started by jstriedinger, Jun 12, 2012.

  1. jstriedinger

    jstriedinger

    Joined:
    Apr 19, 2011
    Posts:
    58
    Hi everyone!

    A couple of friends and I are designing a Point-and-click 2D adventure game and I was wondering if Unity was a good option.

    So, does anyone around here has experience creating 2D games with Unity? is it a good tool for a game like the one I want to develop? any helpful frameworks (like Orthello or something) ? should I be looking for another game development platform?

    I would really appreciate the help!
     
  2. kalamona

    kalamona

    Joined:
    Aug 16, 2011
    Posts:
    727
    I would like to know more about this topic too, so if anyone with experience would tell us about it, we would be very grateful :)
     
  3. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
  4. Khyrid

    Khyrid

    Joined:
    Oct 8, 2010
    Posts:
    1,790
    Unity is a very powerful tool that will give you a great deal of potential, it will be a more difficult learning curve than something like game maker. If you want to sell it one day and add a lot of cool features or perhaps branch off and do other kinds of games later, then definitely use unity, it's free and has a ton of support. If you only want to make simple 2d games and don't care to about a lot of advanced features etc, then a program designed specifically for 2d games like game maker would be better and easier to learn.
     
  5. kalamona

    kalamona

    Joined:
    Aug 16, 2011
    Posts:
    727
    Yep, now I consider unity for 2d because I want to target tablets, PC as a standalone application, PC on flash (as a demo/free/lite version). And unity knows them all.
     
  6. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    That is actually not quite correct. Learning Unity for the purpose of doing 2D is not more or less difficult than any other tool out there in my opinion. I doubt you have the flexibility that Unity gives you in other pure 2D engines. How would you go about creating AI for enemies for example. There are plenty of plugins available to you if you want to go with Unity which in my opinion is the right choice for 2D or 3D. The workflow/pipeline is almost the same.
     
  7. jstriedinger

    jstriedinger

    Joined:
    Apr 19, 2011
    Posts:
    58
    Thanks everyone for the good answers!

    In terms of plugins, does anyone has any recommendations???

    Thanks
     
  8. Khyrid

    Khyrid

    Joined:
    Oct 8, 2010
    Posts:
    1,790
    Trust me GML is way simpler than any script in unity. Find nearest instance of an object? One small line: instance_nearest(x,y,obj); In unity javascript that is a long block of code. Further more for a very beginner in game maker you can use drag and drop instead of coding and when you grasp the basic concept you can learn the code for each drag and drop element. The logic will be equally complicated in any program but some programs are better suited to making simple 2d games than unity.
     
    Last edited: Jun 12, 2012
  9. lmbarns

    lmbarns

    Joined:
    Jul 14, 2011
    Posts:
    1,628
    Yea I made a 2d html5 sprite engine prototype in plain javascript in a text editor from scratch before I had a Unity mobile license, and it was more intuitive/easy, I thought, than using Unity.



    But even S***ty code in Unity runs faster than well written javascript at the present time.....
     
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah it always seems easier using random stuff til you hit limits. Then you're screwed and that's when unity bails you out and you start selling stuff.

    I just think I'll enjoy spending my money earned thanks to unity's really robust cross platform support and endless versatility for just a few more lines of code.

    If you want to hold yourselves back by all means go for it, game makers are perfect for primitive 2D for people with no ambitious ideas. If your game is primitive and has no real need for anything but simplistic basics, take Khyrid's advice. Otherwise take Thomas' advice.

    As for Imbarns, he's just not helping you at all. He's just being geeky :p
     
  11. Khyrid

    Khyrid

    Joined:
    Oct 8, 2010
    Posts:
    1,790
    We are in complete agreement hippo, that's pretty much what I said in my initial post. Though you can jump from GML to java-script like I did, so Game maker doesn't hold you back as long as you abandon it for unity.
     
  12. Krobill

    Krobill

    Joined:
    Nov 10, 2008
    Posts:
    282
    I'm a huge fan of Unity and we're about to release a 2D game made with it but I would be a bit less enthousiastic that some. Not about the capabilities of Unity for 2D games but for the effort and knowledge it requires to produce quality stuff. With or without frameworks, you're supposed to know the basics of realtime 3D if you don't want to hit a wall the first time something doesn't work the way you want. You have to understand what are mip maps, how filtering works, what is acceptable in term of VRAM consumption or hardware fillrate capabilities, etc... I've seen too much people round here, asking endlessly why their sprites didn't appear as crystal clear as in Photoshop or why their 3 or 4, 1300x1700 sprites brought an iPad to its knees.
    If your project is 2D and don't requires 3D effects and it's your first major attempt at creating a game, by all means, be very careful if you go for Unity. I would rather recommand Flash / Air or even better Haxe / NME if you want multiplatform development. That's my 2 cents.

    Now if you want to use this as an introduction to a 3D engine go for it! ^^
     
  13. lmbarns

    lmbarns

    Joined:
    Jul 14, 2011
    Posts:
    1,628
    Agree completely.

    I love/use Unity for 3d but thinking of how I'd do some 2d stuff boggles my mind (I know it's possible, and very fast performance wise). In notepad with js/ecma3+5 I can make an atlas of all my sprite images and set my offsets for each, then reference them, very easily. In Unity if I take a dozen textures, add them to an atlas
    then what? I get http://answers.unity3d.com/questions/134496/texture-atlasing.html and what am I to make of this documentation: http://unity3d.com/support/documentation/ScriptReference/Renderer-sharedMaterial.html

    Sounds a lot more complex than just definining x, y offset coordinates to an object's image source.... Do I use a Rect to display a frame of the sprite and offset it's background position to animate it over time? That would be the closest to how I do it in notepad from scratch. But it's not clear in Unity how to proceed, there are a dozen ways to do it, and some are really bad.
     
  14. keithsoulasa

    keithsoulasa

    Joined:
    Feb 15, 2012
    Posts:
    2,126
    I'd say use Unity, but buy a 2D framework .,


    I actually found game maker to be pretty boring when I tried to use it last .
     
  15. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It's far faster to just use something like ex2D. It keeps all the sprites separate on independent game objects and instead only changes mesh parts when absolutely necessary (scale, uv, colour). rotation and position is handled by unity, which means it's dynamically batched very well. It also handles all the atlas stuff and sprite collections, trims your sprite sheets and more.

    Using it's animation tool you can quickly drag and drop frames in, from the atlas (it remembers them as individual frames!) making it all invisible, painless and very, very fast.

    You can also even add events to any frame you want. When you want to play an anim, you use Play("name of my anim");

    Get any easier? I don't think it does because you still have the power to set up everything you like and mix it with as much 3D as you like that unity supports.

    Want lights? no problem.

    Want a big 3D robot in the background? no problem.

    It's all just there, quietly solving all your problems so you can get on with the good stuff like making games. Maybe you're like me and want a mosiac special effect, or a post fx? unity to the rescue.

    Maybe you want your sprites to even have normal maps? no problem - just change the shader.

    Maybe I'd like to work in a team and the artists can send all these pre made sprites to me with one single click, right inside the unity editor (asset server).

    I could go on and on and on, but people are too dumb to see the wood for the trees so I'm giving up, and letting everyone knock themselves out in planet stupid.
     
  16. Krobill

    Krobill

    Joined:
    Nov 10, 2008
    Posts:
    282
    Actually there's a built-in function in Unity that will handle much of that for you ^^ The Texture2D.PackTexture method create automatically an atlas and returns an Array of rect with all the uvs for your different input textures. You have in fact no need to calculate any offset whatsoever, it's done for you. But you only need to know how this works if you want to implement your own 2D framework from scratch.
     
  17. Khyrid

    Khyrid

    Joined:
    Oct 8, 2010
    Posts:
    1,790
    It's common to underestimate game maker because it's so easy to make games with countless noobs that have no idea how to make a decent game have made games with it. It's actually a very capable piece of software as far as the developing time overhead to result ratio is concerned. But I don't know what Unities capabilities with 2D are, so I'm hesitant to recommend GM over Unity unless they only want 2D without awesome sauce.
     
  18. keithsoulasa

    keithsoulasa

    Joined:
    Feb 15, 2012
    Posts:
    2,126
    My beef is that your really limited .
    It makes more sense to just go buy a 2D tool kit with unity and make games with that .
    With gamemaker your one step above Little Big Planet , and your still not learning anything worthwhile . With unity your dealing with a respected engine thats used thoughout the industry
     
  19. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    In my experience I would say Unity CAN be used well for 2D but it is not `out of the box` designed specifically for it. Some engines/languages are much more 2D-specific and doing 2D stuff in them is a lot quicker and easier because you don't have to deal with all kinds of irrelevant stuff. BlitzMax for example is good for 2D games, so long as you don't want to get too advanced/cutting edge technology-wise (ie no shaders without effort). But then it only works on Mac/Windows/Linux. Or try their new Monkey language which supports mobile devices and HTML5 etc. Doing the equivelent stuff that Blitz can do in Unity does take extra effort with more `wrapper` stuff and set-up and workarounds etc, but if you use a toolkit to do it mostly for you or roll your own, once you do have things running up to that level of flexibility then Unity does make it easier to expand on that, like using/adding shaders, getting better performance, etc... not to mention the useful tools on the asset store that help with animation, editing, scrolling, tilemaps, sprites etc. So overall I'd say if you're looking for fairly intermediate/advanced-level 2D go with Unity. If you want just some basic stuff like scale/rotate images, then go with Blitz. I haven't tried GameMaker but my impression is it's mostly for beginners - although I'm sure advanced/skilled developers could make a great game with any engine. Another thing to keep in mind is that Unity does a lot of programming for you, covering the entire 3D engine, platform support, screen handling, audio handling, etc... which probably would be a lot of extra programming work in something like Blitz.

    For me personally I'm working on a 2D engine for Unity because I see the pain involved especially for beginners, plus there is a market for what I plan to do. You're an example of that. But meanwhile you might check out the asset store, e.g. EX2D, 2DToolkit, SmoothMoves, etc
     
    Last edited: Jun 12, 2012
  20. Khyrid

    Khyrid

    Joined:
    Oct 8, 2010
    Posts:
    1,790
    The moral of the story is with some low end programs made for 2d you can make okay 2d games with ease or you can painstakingly make a 2D game of exceptional quality with unity. It all just depends on what your goals are. What program is better is a subjective thing for different people. I don't feel horribly limited with game maker, I feel more limited making a 2d game with unity as I would have to learn it from the ground up.
     
  21. iamant

    iamant

    Joined:
    Aug 22, 2012
    Posts:
    2
    This thread was pretty serious. A lot of great information.
     
  22. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Just in case any one is interested... I'll be releasing a system for Point and Click adventure games on to the asset store. Built for a client at a subsidized price so that I can resell on the asset store, its probably only a few weeks from completion.

    It allows you to define many different kinds of interactions either in the scene or in XML data files. And handles all the saving and loading of game state, etc.

    It also supports extensible items (extend the ItemData class with anything that is XML serializable and it will automatically be loaded/saved/etc).

    The engine component is completely separated from the view and input so it should work with any game that needs such a system. The asset store will include a few simple views and inputs which you can use, extend or replace.

    Also planned is a dialogue system which integrates within the framework, allowing you to attach conditions between dialogue and items. e.g. If using rod with water and has asked about fishing contest (dialogue) and has mealy worm in inventory then catch fish.
     
  23. jstriedinger

    jstriedinger

    Joined:
    Apr 19, 2011
    Posts:
    58
    Thanks everyone for the answers!

    Yeah, a lot of people have told great things about the 2D Toolkit and SpriteManager2, guess I'll buy them to see how it goes. Orthello2D is also good thou

    That sounds great! when would it be avalaible ?

    Anyway, I guess Unity is becoming extremely powerful because of it's community. I mean the whole engine is great because is like impossible to say that in a big project you are not using an Asset downloaded form the store.
     
  24. JARA-A-I

    JARA-A-I

    Joined:
    May 15, 2013
    Posts:
    8
    In case anyone here is still working on 2D, me and our team have been developing a 2D framework for Unity that will be available soon. It has great features and comes at a low price.

    Look for it and give us some feed back: JARA 2D Animation.

    Best regards.
     
  25. Kelde

    Kelde

    Joined:
    Feb 28, 2012
    Posts:
    629
    the man is aking for assets to use.

    for a 2D game in Unity, take a pick:

    Uni2D
    Unitile 2D
    Ex2D
    2D toolkit

    those are the ones that seems to have the best reputaion for making 2d games faster. I used 2d toolkit myself in my project and i really cant complain.

    Uni2D is my next buy since it allows me to paint a full levelbase for a scene in photshop and slap it in unity as a main collider.

    2D games in unity is VERY doable, its almost better than most other 2D engines, and i mean that. Takes alittle learning, but once u know it, u wont be changing anytime soon.