Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411517 Posts in 69380 Topics- by 58436 Members - Latest Member: GlitchyPSI

May 01, 2024, 11:21:01 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Unity 2D physics and transitioning a project from Unity to Flash
Pages: [1]
Print
Author Topic: Unity 2D physics and transitioning a project from Unity to Flash  (Read 2306 times)
brian
Level 0
**


WHOAAA!!!


View Profile
« on: July 21, 2010, 04:04:15 AM »

Hi chaps, I've recently had a bit more time to do stuff outside of work and decided to turn a tigjam game into a more full bodied game. Anyhoo the game in question is a 2D text driven platformer, with some use of basic physics for level interaction.

Here's a link to the latest build: http://www.billyfletcher.com/unity/platexty.html
The commands are 'left','right','stop','jump','shoot','grab','drop','throw' and 'crouch'.

Anyway i've been using Unity for quite a while now and while it's fantastic for most things, doing 2D in it with the built in ConfigurableJoints to constrain them to a 2D plane is a nightmare. I'm not sure if it's some unexposed global joint stiffness value Unity doesn't expose, but as is they're incredibly temperamental and prone to random fits of flying about.

I've done a number of things to try and combat this, I made a rigidbody based character controller that uses spring forces to move about so it collides properly, tried different approaches to keeping stuff in 2D planes (like a script that constantly sets the rigidbody's rotation to identity and Z position to 0), but every approach seems to have some gigantic drawback.

Anyhoo, this issue, combined with the much smaller possibility of portal licensing with Unity is pointing me in the direction of Flash, which is obviously a lot more suited to a 2D project than Unity ever was. The main issue I have with switching the project over is time, so my main questions are:

Which of FlashPunk/flixel will suit a component based Unity game?

Is Box2D temperamental when dealing with combining rigidbodies so shapes from one body transfer to another?

Are there any areas that are going to be markedly different from typical game development that I should brush up on?

Also any suggestions with regards to the Unity 2D joints issue would be awesome too, even if I switch over this project I don't want to discount the possibility of doing more 2D plane stuff in Unity because it's too much hassle to deal with.

Thanks in advance to anyone kind enough to help, I love you all dearly.
Logged
BorisTheBrave
Level 10
*****


View Profile WWW
« Reply #1 on: July 21, 2010, 12:30:06 PM »

Hey, local box2d expert here. I don't know unity. Box2D supports multiple shapes per body, so moving shapes from one body to another is do-able. This is the recommended way of doing katamari type gameplay. There are weld joints too. Box2d is tunable, so you can increase the solver correctness for more complex joint interplay, but not too much, because you won't have the same horsepower to throw around that Unity does.

Both flashpunk/flixel are optimized for bitmapped games. They give worse performance for rotations typical of physics engines, and box2d is also a hog.

I remember this game!
Logged
brian
Level 0
**


WHOAAA!!!


View Profile
« Reply #2 on: July 22, 2010, 12:41:32 PM »

Thanks Boris, I'm pretty sure that anything I would've used a physics engine for isn't going to be as complicated as to necessitate one. Probably going to use FlashPunk and just model any simple joint behaviour myself if needed, I was hoping to have the solid feel of a more typical platformer with the benefits of being able to rope objects together but it's simple enough to write springs myself.
Logged
st33d
Guest
« Reply #3 on: July 22, 2010, 01:48:00 PM »

We've got a guy at work who's doing a game in Box2D and the art style is going to be double pixel. They're just rendering small and then drawing that to a bitmapData and scaling up.

I'm also using it for a lego type game with the loose bricks as MovieClips and the built structures rendered via copyPixels. (The built structures are not involved with the physics engine, we're just using Box2D for the loose bricks because it feels nicer and it gives me more time to concentrate on the lego code - which is fucking hard as it is.)

Just sayin that Box2D doesn't limit your rendering options.  Wink
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic