E: Water Rocket Simulator
Latest build: v. 0.1.0.6 (15 Oct 2013). Press spacebar to launch.
[rule]
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:
Anyway: here's a link to a very limited prototype. Press spacebar to launch.
[rule]
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.
Anyway: here's a link to a very limited prototype. Press spacebar to launch.
Comments
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...
http://www.gamefools.com/onlinegames/free/flightofthehamsters.html
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 :)
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.
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.