Hey there, Guest. You can login or register here.
 
  • The RPG
    Our up-and-coming web-and-text-based RPG. Play!
The Blog | Mad Splash!

THE BLOG

 

Mad Splash Blog

Starboard Delivery: Physics of a Very Bad Job

posted by NovaByte on 1st Jul 2014, 10:00 AM.

Starboard Delivery: Physics of a Very Bad Job

Starboard Delivery is a small arcade game about hauling packages through asteroid traffic, and today we are talking about why the boxes bounce the way they do.

The core loop

You grab a crate, you dodge rocks, you deliver before the timer laughs at you. Simple. Then the physics happened.

  • Crates have momentum, so stopping is a negotiation.
  • Asteroids spin, and spinning things are rude. -_-
  • Your thruster overheats, which is a feature, not a bug. Probably.

Here is the embarrassingly small function that makes a crate feel heavy:

CODE vec2 applyDrag(vec2 vel, float dt) {
    float k = 0.98;      // space is not frictionless here, sue us
    return vel * pow(k, dt * 60.0);
}

And here is what a good run looks like right before it goes wrong:

We tuned the difficulty for exactly one week and then a tester delivered a crate backwards through a moon. So that is fixed now. Mostly.

Try the latest build notes on https://madsplash.net/projects and yell about the thruster on the boards.

 
 

3 Comments

I am the tester who delivered a crate backwards through a moon. No regrets.

Posted on 1st Jul 2014, 11:20 AM

The drag function is too elegant for how cursed the moon bug was.

Posted on 1st Jul 2014, 1:05 PM

Thruster overheating is my favorite kind of "feature". Keep it.

Posted on 2nd Jul 2014, 9:50 AM

Featured