Evaluating Unity - A question or two

Hi,

First off, I apologize if this is not the correct forum.

I’m currently evaluating Unity to see if it will fit the needs for my in development iOS game. I’m currently using cocos2d but am looking to move over to a platform that offers more cross-platform support. Unity, being the only one that also supports a web based deployment option, became my first choice.

The problem (though my research has shown it’s probably not a “problem”) is the game is 2D. Beyond that, the game is not really a sprite based 2d game. It’s more of a “these bunch of images get combined dynamically to create the final sprite” game. Basically, the player will literally be building their characters from a bunch of different parts, each with a different look (8 different looking arms, legs, etc). These parts are then combined to create the character. This probably dosen’t make much sense, so if you’re looking for a bit more information you can check out my post over at TouchArcade: iPhone - Patchwork Battle - A new Crafting-Sim / RPG currently In Development | TouchArcade - iPhone, iPad, Android Games Forum

As I said, I’m currently using cocos2d. I’ve accomplished this by creating a container node that holds the different part sprites positioned correctly. At runtime I load up the data about the different parts and then attach the texture based on the class of that part.

I’m going to apologize now for the dumb question. I have never done 3d development, nor have I ever worked with a 3d engine (now is as good of time as any to learn!), but how can I accomplish this goal with Unity? I’m thinking it’s possible I’m just not able to wrap my head around how I would do it. I know I could create a skeleton rig and apply my sprites as skin (on a 2d plane, ignoring the Z). However, this would be overkill for the animation style I’m using (the different parts don’t move, instead the whole thing moves… imagine a kid walking a GI-Joe across a table). I’ve also looked into Sprite Manager 2 and what it offers, however it seems more designed for pre-built animations and not this dynamic “at runtime” approach I’m going with.

Any ideas, suggestions, and/or tips as to how I might be able to accomplish this with Unity? I like I’ve seen so far from Unity, and I love the ability to target pretty much every viable platform out there (Android, iOS, Web, Desktop, etc) with the “same” (at least with minimal differences!) code base. However I don’t want to take on Unity if accomplishing this is going to be a huge pain for me.

Many thanks in advance!

You can definatly create a 2D game in Unity. It has been done many times before. I’m sorry but that’s all I can say as I am not an iOS developer nor have I created a 2D game.

Good Luck!

ps: I have had a great time with Unity and recommend it to others all the time.

It is defiantly possible in unity.

I’m not sure how they do it, but it has been done many times. One method is to make sprites as textures and attach them to rigid bodies (physics).

There is also a 3rd party 2D plugin that I think works well.

Fairly easy stuff, just not quite drag and drop.

Do some searching (google, forums, unity answers), make a post in the scripting forum, muck around with the free version and make a simple web 2d game and see if it works for you. If it does, then fork out for the iOS.

I have not completed my first 2D game, but I have found a number of examples of 2D games in Unity. If you do some searches on the forums, you will find plenty of examples. There is also a ton of information out there with a bit of Google searching.

To get you started, let me point out two examples that I found educational.

The first is a thread titled “Doing 2D animation with 3d package?”. The user MikaMobile talks about the methods they used for their games “Zombieville” and “OMG Pirates!”.

The second is a series of three YouTube videos on creating menus. These can be found at Part 1, Part 2, and Part 3.

You should also take a look at Sprite Manager, a free script in the Unity wiki. The folks at 3D Buzz did a series of videos on how to use sprites and Sprite Manager that you can find here.

I highly recommend the other videos at 3D Buzz. Their Unity Essentials series is excellent.

I made my first game in C++ with xcode which is on appstore now. I got into unity and have never looked back for these reasons:

  1. its fast. Probably faster than cocos or even rolling your own opengl engine. This is because you can do so many tricks like culling, and physics and checking collisions is optimised internally so it won’t check for collisions from an object you potentially cannot collide with. It has raycasts and hundreds of make my life easy functions. It can also batch. If you are just throwing quads on the screen, cocos will be faster. If you are however, planning on something ambitious, it is likely unity will be faster.

  2. dev times. I think messing about with a wall of objective C or C++ is a pain in the arse. Here in unity I can choose between 3 different high level easy to use languages and even mix them if I want. Organising my code so the code is inside each object I am working with is revelation, it makes for very simple organisation. I think again: simple stuff, better in cocos. But anything remotely ambitious - can’t beat unity.

  3. content creation. Unity has this nailed from every angle, nuff said.

  4. xplatform. I can deploy to ios, not need to worry about resolutions, deploy to android - the same. Maybe I also want it on desktop mac and pc - no problem. In fact I’ve tested it on ipad, pc and mac without a single line of code needing to be changed. I liked that a lot. I mean a lot :slight_smile: You get conditionals so you can do an IF statement to check which device so you can use mouse or touch etc.

  5. plugins. Prime31 has literally a plugin for absolutely anything you could probably imagine doing for iOS, and frankly, thats a win right there. If like me, you’ve messed around putting iad in, or admob, or got pissed off with game center then doing it in one line of code from within unity is like… yes please!

The good: everything.

The bad: bloated app sizes. Yup, just accept players will need to download via wifi and all’s good. Hitting the 20mb limit is very easy indeed with unity. Wifi isn’t hard to come by and epic got just about every paying customer used to wifi with their 1gb download…

If you are starting with unity and ios, then be sure to (for the moment) download xcode 3.2.5 and compile for 4.2. This issue will no doubt be resolved but until then thats what you do.

Thank you all for the replies.

So I’m gathering 2d is going to be possible. My initial googling showed me that as well. The issue I’m having a hard time wrapping my head around is doing it all without 3d assets at all. The art my artist created was for cocos2d and thus is standard flat PNG files. When I try putting these on gameobjects and/or cubes (as a mesh) nothing comes out right. This is correct, though, I assume because these aren’t built to be a mesh to wrap a cube.

I come from a pure 2d background. I’ve never really had the desire to learn 3d game programming. My reasons for looking at unity is, like I said, the x-platformness of it.

Either way, thank you guys for the replies! They are greatly appreciated. I think I’m just going to have to keep plugging away at this until I can figure out how to get it to do what I want.

This ain’t going to be a problem - unless you actually want to do 3D - but unity has plenty of help.

http://unity3d.com/support/documentation/ScriptReference/Vector2.html

If you’re making a 2D game, it’s probably best to start with an isometric/orthographic camera (one of the many camera options available) instead of the default perspective. The sides of cubes should work fine, however using material’s scale + offset might be a chore if you have a ton of different shapes.

Maybe not that helpful but, Here you can see a screenshot of how some people approach the problem of 2D in a 3D engine. Hope it helps

Once again, thank you all for your help. The Dragon Keeper thread was actually pretty helpful. Getting a look at how they have it setup inside Unity was nice.

So it’s looking like Sprite Manager 2 is probably going to be my EASIEST route. However, I’m not sure how I can bend that to fit my specific need of how my sprites are actually built. As I said in my first post, it appears that Sprite Manager 2 is more built for animating a sequence of sprites within a sprite sheet (or as separate images). My need, however, is the ability to attach different textures at different positions within a container object.

I know I could use a rigid body for this and apply these sprites as skins but I have a feeling that might be overkill. I say overkill but the animation style we’re using does not animate each part but instead animates the sprite as a whole. As I said earlier, imagine a kid “walking” a GI-Joe across a table. I also have no idea how I would go about creating a rigid body to use :slight_smile: I’ve attached a set of sprites from my game to maybe help illustrate the point. Each of these body parts can be mixed with other body parts. Creating a sprite sheet for all the possible combinations would be ludicrous.

Thanks again for everyones feedback, input, help, and suggestions. It’s been greatly appreciated and, quite honestly, much more kind then I was expecting (I have low expectations for message boards in today’s internet age, haha).

568370--20191--$druidHat.png 568370--20188--$druidHead.png 568370--20190--$druidTorso.png 568370--20189--$druidArm.png

Rather than trying to apply textures to different positions on a single mesh, you might try a similar approach to what Mika Mobile does in their games: applying the pieces to different quads and slapping those together in the configuration you want (including using Z for layering). Even if you’re not animating parts individually, you should still be able to use this method. See these posts for a little more info: http://forum.unity3d.com/threads/74196-Doing-2D-animation-with-3d-package and http://forum.unity3d.com/threads/63861-Battleheart.

The approach taking in Battleheart seems like the way to go for me however I’m still not certain I need a full fledged bone / skeletal system. Could I create a scene that defines a bunch of anchor points, one for the head, one for the body, etc and then attaching my quads to those anchor points? This may be exactly what you’re saying and I missed it :slight_smile:

Sort of, yes. The way Unity works it wouldn’t be part of a specific scene necessarily. Unity uses what are called “Prefabs” for commonly used entities in your game that are scene-independent. But it’s totally possible to set up several Transforms in a hierarchal fashion and mount your quads in place or even have the quads already existing and simply change the material on them, depending on your needs.

Thank you very much burnumd. I’m starting to get my head wrapped around this stuff. I’m going to keep playing with Unity and seeing what I can figure out. Everything I need definitely seems possible. Maybe more work than a true 2d engine but that’s far outshadowed (IMO) by the xplatform deployment Unity offers.

Thanks again everyone! =)