[Video] Physics based flying game (WIP)

Edit: new video -

I’ve had the mechanics for this flying game in my head for years, finally found someone to do it.

I hired Victor Blanco to code the mechanics, and he gave me the tools to tune all the variables in the physics to get them just right.

The ship
You control a perfect sphere that can fly in almost any way you want.

You can rotate on all axes: yaw, pitch and roll. The rotation is done by torque, and since the ship has mass, the rotation accelerates smoothly.

You can throttle forward, back, up and down. There is no strafe, it has been replaced with roll, which is the main challenge of the flight mechanics.

If you’ve flown a helicopter in Battlefield, the flight mechanics are pretty close to it, except you also have throttles forward and back.

Collisions are quite nice, because the ship is a perfect sphere, so you can always anticipate the direction you’re going to be bumped to and how you’re going to rotate.

Regaining control after a collision is also challenging. I’d say these mechanics will be great in a race scenario.

Somehow I can tell from the camera movement that the “feel” of the flight control is just right - look like a lot of fun! Also reminds me of Descent, so bonus points for that:

That’s remarkable, I love it! I wonder if you’re be willing to explain a bit more of how you did that? Would it be a lot of work for me to implement something like this myself, do you think?

look awesome, all it needs is a model :smiley:

I grew up playing Descent, so it was definitely at least a partial inspiration, though Descent didn’t have gravity, this does. The main inspiration was just generic helicopter flight controls.

But I do think the weight of the controls is really nice, no jerky movements, you have to be graceful. Still tweaking the gravity and mass of the vehicle to get it just right. But the end product will definitely be very close to what’s in the video now.

I’m hoping to be able to remove friction so that you don’t go into a crazy spin when you bump into something. Even tho it’s a cool mechanic, because rescuing yourself from that spin takes skill, after a few bumps you’ll go mad and get a headache.

For the specifics on how to actually create those mechanics, you’ll have to ask the coder, I linked his forum profile up there.

Thanks I’ll do that, this is literally exactly what I’m looking for.

The system works in a very easy way, its really simple.
The flying ball is derived from Pawn directly, and its movement component is PawnMovementComponent, but its not used at all. What im doing, is adding a Sphere component as root for the vehicle, letting physics control it, and then add forces to it with the imput.
It has some acceleration in the forces it gives, and it only has 2 forces, one in the local Z direction of the character( vertical) helicopter style, that i get with the function " FVector TopDirection = GetActorRotation().Quaternion().GetAxisZ(); " and then use the function AddForce in the sphere compnent. For rotations, i do a similar thing, but with AddTorque.

Thanks much for the help, I’ll continue to update as I try to implement this myself.

New little video showcasing the freedom you have in terms of how you can fly.

I’ve gone a pretty good way towards implementing this successfully but I’ve hit a weird snag. All the controls are just about right, but then when I enable collision detection on the Sphere component of the pawn, suddenly all the controls go funky. The AddForce movements seem to slow way down and the AddTorque movements don’t seem to work at all with collision detection enabled. Anyone have any ideas why that might be happening?

mew, did you ever have any luck getting rid of the friction on the collisions?

It is almost removed when you make a physical material with 0 friction and add it to the sphere and the surface. But there seems to be a bug where it still sometimes applies friction at random.

Okay I’ll give that a try, thanks.

I realize this is a really old post, but I was wondering if anyone knew of something similar to this? This looks smoother than anything I’ve seen so far but the author hasn’t been active for some time. :frowning: