Andrew Ens

I make games and tech demos.

View My GitHub Profile

22 December 2022

walk on a round 3D planet with gravity

by

About

This is research for Ship Crew RPG.

Before I made Tunnel Wars, I originally wanted to make Ship Crew RPG in 3 dimensions. (I decided on 2D to simplify the controls for the player and make development simpler).

This demo is a character controller for a round planet with gravity, like Super Mario World. I accidentally invented a piece of math called parallel transporting a vector to make this, which I later learned is an important concept in Einstein’s general relativity and coordinate geometry with manifolds – measuring the curvature of space and all that.

The controller works by rotating the character’s coordinate space so the minimum amount such that it is always tangent to the sphere where the character is standing.

Then, the character’s movement and orientation are defined in terms of that tangential coordinate frame.

Gifs

FreeCharacterRotation.gif

Final iteration.

MouseLock.gif A mouselock variant

NoCharacterTurning.gif

I had to manually make the character face in the direction of the camera. This is what it looked like before I did that.

FailedAttemptNo2.gif

My first few attempts were completely nonsensical lol

FailedAttemptNo1.gif

This is what my first attempt looked like



Experimenting with a spaceship controller

A big problem I anticipate in Ship Crew RPG is that controlling a spaceship in realistic gravitational fields may be unintuive. So I’ve worked on developing intuitive spaceship controls, so that flying a spaceship is closer to feeling like Star Wars than Apollo 13. Even in realistic gravity.

I’ve done more work since this demo here.

Gifs

FastAndUnstable.gif MirrorCollision.gif SecondPersonCrash.gif SatisfyingCompleteCircle.gif UmWhat.gif OrbitalSpaghetti.gif SlowAndControlled.gif ThirdPersonCrash.gif

tags: ship crew rpg - technical