Has anybody used the 2D plugin available for unity3d to create 2D Games? Do them perform collision detection (I have spent a lot of times trying to do good collision detection with the elipsoid collider without much luck, for example on platform corners? Does they support slopes?.
From all the info I have read, best seem 2d toolkit and ex2D but don’t know if anyone can bring some other or give his opion on which is best.
i love 2d toolkit, it runs perfectly on ios and its very easy to use , it includes a feature where you generate polygon colliders, also for more complex shapes of colliders theres another cool asset in the store called polygon tool
with those you can generate colliders of any shape you can imagine, just be creative how you set the up
of course, anything you can draw with points, straight or rounded shapes in any direction
remember that the colliion in 2d games in unity its really 3d, but the movement of stuff its constraine to 2d and the camera set to orthographic to give the illusion of 2d, its all in the trickery
Yes, you are right, I did some tests aplications some time ago with my own systems. The problem is that unity physic system from my stats was eating a considerable amount of cpu, remember the target is an iphone/itouch. On the other hand there are some problems with physic engines like the one in the pic below:
When the player reaches the end of the platform it starts to sink into the edge because the collider is not a rectangle. How do you fix this things?
if you want the player to be a rectangle, make it use a rectangle collider, you can attach whatever collider you need to an object, if you need many, just attach them to child gameobjects.
also remember that you can control how frequently the physics engine updates with fixed time step and the solver iteration count setting in time and physics settings
Thanks for all the insights CoatlGames. And sorry for being so picky but would you mind answering this questions from your experience?:
Have you done any games with slopes with a rectangle collider? I think it will get stuck in slope changes that are not fully horizontal.
I know I can change some params of the physic engine calculations, but have you seen / have yo made any fast paced action platformer with more than 1 enemy and 3 bullets on screen being played smoothly on iphone 3GS or ipod touch 2G?
3GS has a pretty fast CPU, no problem using a lot of moving colliders, physics and moving objects on it. It’s just a little slower than iPhone 4+. My project is 3gs+ and I can move around 100 objecs on screen with physics and collision without problem.
Forget older devices.
You can smooth the rough corners of a box collider with spheres and/or capsule collider so it won’t get stuck on slopes. Also, make sure that the friction is set up properly.
In our project, we have a problem when the object is touching 2 colliders at the same time (e.g. wall and floor). It won’t jump as intended. Though, we’ve driven these situations to a minimum so you can’t actually feel it in the game itself. Or unless you’re very (un)lucky
There is a huge performance gap with pre-3GS devices, on the CPU and on the GPU side. If you code for them, you can’t have a very impressive game as you could have on 3GS+. So you sacrifice the older devices or your project will suffer inferior graphics on newer devices.
For the performance: use simple collider (I use mostly sphere or box collider), optimize your code at best, avoid all the expensive call, don’t instantiate and destroy and avoid garbage collection, don’t instantiate at runtime and so on.
The raycast thing is something I have thought about.
The problem with the box collider is that it won’t be good to go up on slopes. It will get stuck don’t you think?
A thing I’m fiddling with is to use 2 circles. One small for the base, this way the effect gets minimized and another bigger for the body. Or change the big circle by a rectagle. Have to test it, but I have little experience with physic engines applied to 2D games though.
I have used 2D Toolkit on my most recent project, a shooter game. I have 70+ moving objects on screen (bullets enemies explosions) a full screen scrolling background and a particle emitter to create a floating star backdrop. It runs 30FPS on a 3G. I had not even planned on targeting the 3G but if it runs well then why not?
As well as 2D toolkit I am also using path-o-logical pool manager. I would suggest that for every mobile game, plus It would take me way longer to create something similar than just paying the small amount it cost me.