Game Development Community

Farseer Phsyics, CEV & the PSK

by Tim Newsome-Ward · in Torque X 2D · 09/14/2010 (12:19 pm) · 6 replies

Posted in PSK too.

Hey all,

I was wondering how people were doing with converting the PSK to use the Farseer functionality in the CEV (thanks Ron and Pino). I’m not sure if anyone has tried it yet?

I have been playing around with it a little bit and obviously a lot of the platformer framework is tied into the native Torque X collision and physics classes.

Now my problem is..dun.dun.dun..i’m not a coder, I know a very basic amount of C#, which has allowed me to have a look around.

I’m working on a small title for XBLIG and was hoping to use some of the platformer framework with Farseer. There are various components which obviously reference native Torque X physics e.g.:

PlatformComponents uses
T2DCollisionComponent
ActorComponent uses
T2DPhysicsComponent, T2DCollisionComponent, T2DCollisionMaterial, T2DResolveCollisionDelegate, T2DCollisionInfo
ActorContoller uses
T2DCollisionInfo

I’m pretty much ready to go with developing a small prototype now and this has halted production. I doubt the PSK will be updated any further due to XNA 4.0 and I was wondering if it’s worth me advertising this as a small job? I’m willing to pay to get this implemented.


Any advice would be appreciated,

Cheers
Tim

#1
09/15/2010 (12:27 am)
Hey Tim, I really dont think you need to change much of anything. I'm willing to work with you to get it functioning as you need. Ive been working with farseer since they first started adding it to the CEV, and I have the PSK.

Shoot me an email (its in my profile)

Aaron
#2
09/15/2010 (5:36 pm)
@Tim, my guess is it's not going to be easy. In many way's you would be re-inventing the wheel on that, and thats usually a big no-no in the world of programming. Instead of trying to re-factor the physics engine that the platformer kit is based on, rather, see if you can use Farseer to effect the properties of an object in the PSK...

Example..

1. Create a body of water.

2. Add a Farseer Component to the water, and your Character.

3. Create a water state for the actor.

4. Write code that handles your character when in the water. IE WaterPhysicsState

Because only farseer objects would be in the water, your character will be safe, and because he has a water physics state, he would be free to interact with the water, etc...

Other farseer things could be handled in this way. You can rip the pieces you need, you don't need to re-factor the whole kit, that would be utterly ridiculous. Not to mention, you have no idea how your PSK will perform with a much more robust physics engine, it may actually slow your thing down. Where two small components will not at all change your tick time, 200-300 component's may.. Many more reasons.. but you catch my reasoning.

Finally. Build your game to order. In other words, figure out what you want, and do that. This will lead to less wasted development time.
#3
09/15/2010 (9:12 pm)
@Will,

Thanks for the reply!

I've have got Farseer working in the PSK. I had objects responding to gravity and interacting with water. It all looked nice. But my issue is with the Torque X native physics talking with Farseer stuff! Especially the character code. I have a clear idea of what I want to achieve and how, it’s just my lack of coding knowledge sometimes slows me down.

Farseer wasn’t originally in my project schedule but I’ve amended it now to include some extra time, I’m hoping it will add to my game rather than detract.

I'm hopefully working through a solution now with Aaron. Thanks again and I'll post our progress

As always thanks for your time ;-)
#4
09/15/2010 (9:58 pm)
Just to clarify, torqueX's native physics would not have to talk to farseer in the above example. If you create a physics state in the actor component for water.

Anyways, sounds like you guy's are merry on your way, so have fun. Glad I could be of some assistance.
#5
09/18/2010 (11:34 pm)
Tim, I tested the PSK with the 2D CEV 4.0 build last night, after Pino got T2D working with the Tank Buster demo. It works great so far, still more testing to do, but it works :) , PC only for now.

Best Regards.
RF
#6
09/19/2010 (12:45 pm)
Ah thats great news! A step in the right direction. Hopefully we can get it running on the Xbox too.