E: Water Rocket Simulator

Latest build: v. (15 Oct 2013). Press spacebar to launch.

Original Post:

I wanted to try my hand at a simulation with some sort of realistic physics. I spent a couple evenings last week experimenting with simulating a water rocket. For those who haven't seen them before, you take an empty coke bottle, strap some cardboard fins onto it, stick a lump of prestick on the base to weigh down the nose, partially fill it with water, clip it onto the end of a PVC pipe, use a bicycle pump to pressurize the air that's left in the bottle, carefully release the clip, and then get sprayed with water for about half a second as the bottle is launched a couple hundred metres into the air. People go crazy with these things, but I've stuck to a single-stage, single-bottle rocket (for now, at least).

I made a basic prototype in GameMaker, and gradually started adding things on... Right now, I have a water rocket which:
  • has an acceleration which varies in a manner that roughly resembles a real one,
  • a water level that drops at a rate that varies according to the air pressure inside the rocket,
  • centre of gravity and moment of inertia which are recalculated every 1/60th of a second while the water runs out,
  • and fairly realistic aerodynamic models for lift, drag and a pitching moment.
Admittedly, it's not exactly a game at the moment. Just a little physics simulation with all the parameters hardcoded in. To turn it into a game, I'm busy working on a basic menu where the player gets to set up the rocket. They fill it up with however much water they want, set the air pressure, choose how heavy they want the nose to be, and then choose what angle they want to launch the rocket at.

Anyway: here's a link to a very limited prototype. Press spacebar to launch.


  • A link to the latest build has been added to the top of the first post.

    The player is now presented with a menu where they can choose various parameters, so it's a bit more of a game. There's still no game enforced objective yet.

    In the actual simulation window, I've added a ground and made some sort of attempt at implementing my own sort of collision physics. In reality, if a bottle hits the ground, it bounces a bit (not very much though), but it also spins a hell of a lot and bounces back and forth until it comes to rest. I tried to get the bottle in the game to do that, but it turns out it's a bitch to figure out.

    What I've got at the moment is an angular momentum variable, and then on contact with the ground, rather than reverse the velocity component perpendicular to the ground like I'd normally do, I calculate the contact point, pin it to the ground, and try to keep a constant angular momentum throughout the collision, and then let gravity bring the rocket to stop. The rocket spun a bit too much at first, so I've also made it so 10% of the angular momentum is lost on impact. It sort of works, and the rocket spins like it should, but it doesn't really bounce much, and I'm not that happy with it, because that's not quite what happens in reality. This is supposed to be a simulation, and I'd like everything it does to be firmly grounded in reality.

    I think I'm going to have to have a look at how they do it here: http://www.myphysicslab.com/collision.html
    and have another attempt at it tonight...

  • edited
    Just a question, would the point be to launch the rocket as high as possible? Or as Far as possible. Obviously if its as high, then angle would always be 90 degrees :) I like the concept though, one of my favorite casual games is/was

    Back to your game: It could do with sliders to change the values , i like what you have done so far , with regards to visual feedback, but found the adding values to be a bit awkward.
    The reason Flight of the hamsters worked though was because you had 5 tries to get as far as possible and lots of random things in the way to help or hinder you, as well as having something to do while to hamster flew through the air.
    Also the launching of the hamster was a mini game in itself. There were also upgrades to the hamster themselves.
    So maybe looks for some ideas or examples in Flight of the hamsters.

    Just wondering how you can add more gameplay elements while still keeping the realistic simulation? You could even take it to the next level, like make it realistic, but completely crazy, like add different fluid other than water, or upgrade your bottle, or change the pump or materials. Im not too familiar with this latest craze, but just adding some suggestions that could make it more fun :)
  • I think you'll find that making something physically accurate and making something fun can be mutually exclusive at times.

    If you need it to bounce a certain way for the gameplay to work, it'd be far easier to dictate the post-bounce velocities manually than trying to tweak the simulation to always work right.

    That said, you can get some very rewarding gameplay when you get the simulation to behave right 90% of the time. It usually ends up with things happening that you'd never thought possible and emergent gameplay grows around your simulation.
  • @iceblademush Hmmm. I like the 5 tries idea... Anyway, I was thinking the objective should be to go as far as possible. I did this as an experiment and a challenge with no idea whether it would work as a game or not. I remember a flash game from a few years ago where you launch a paper plane out of an office window, and it just floats for ages through scenery. There were all sorts of hidden easter eggs. I'm hoping to get the same feel with this. With the variation of the angles and launch speeds, I was sort of hoping to hide things in the environment, so players would be encouraged to try different things and explore the environment, and not just go for the stated objectives. Unfortunately, I think my graphics abilities are nowhere near what they need to be to pull that off, so I'm focusing more on mechanics at the moment.

    I thought of sliders, but I want it to be such that, once you've started pumping up the air pressure, you can't go and add more water. I do agree it's a little clumsy at the moment though. Maybe I will make sliders presented to the player one at a time.

    @Nitrogen I've reworked the bounce mechanics now so it bounces much more realistically. Turns out that, as usual, I was over-complicating things. Now the rocket is sent into a spin if it hits the ground off-centre, and if it rocket is spinning a bit when it hits the ground, that can give considerable sidewards momentum, and I think that works well for a distance objective. I'm also hoping to add some variation into the terrain, so there will be upward slopes which will bounce the rocket backward if you hit them, and forward slopes which will give a final boost at the end. That's the very next thing on my to-do list at the moment.
  • @AlphaSheep - you could always consider turning this into a 2 player "worms-like" game, where players needed to get the mixture (air, water etc) just right in order to hit the enemy player. I remember there use to be a similar game with 2 gorillas chucking bannanas at each other after the player entered the degrees and velocity. Can't recall the name though
Sign In or Register to comment.