Game Development Community

dev|Pro Game Development Curriculum

Where is My Physics?

by rennie moffat · 10/29/2011 (3:54 pm) · 11 comments

I have recently been playing, "Where is My Water? " (iOS app, for anyone that does not know), and am fascinated with its water make up, physics and interactive ground



I am (not be app requirement, simple experimentation), was inspired by this scenario, if I want have an object enemy. Enemy, must be destroyed. I may hit him at local point 0 12, then 30 12, then 48 7... etc. What I am trying to figure out is, beyond having a million objects, each making up the enemy, like molecules if you will, how, or could you create a situation where the damage occurred on the enemy is reflective of the points hit.


The ultimate example is Where is My Water? How do you guys think they figured out how to make A the water, and B the ground.

I am thinking that each is made by tons of little, mini objects that make up the various elements. So, for instance, a pool of water in the game was (my theory) made up by a dozen, little spheres making up the liquid. The ground, the same and when you stroke the ground, any sphere touched is removed. But what about the outline? if you notice the ground carries/holds an outline. If a grund molecule is exposed to the air, it has an outline alon any exposed edge.


Such a genius game.




Any programmers thoughts on Where is My Water or any other interesting object engineering thoughts are welcome.



Cheers
::))(((

About the author

My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.

Recent Blogs

• Touch Drag Menu System

#1
10/30/2011 (8:49 am)
The water is most definitely little spheres because thats traditionally how fluid physics are done. The ground looks like the standard digging code but generally that uses pixel perfect collision detection since you cut a section of pixels out of the image but generally physics engines dont use pixel perfect collision for things like water cause its too expensive. So my guess would be pixel removal + some kind of collision mesh they alter in real time. The line drawing is easy to do if they are using the pixel cutting method.
#2
10/30/2011 (8:53 am)
Actually looking at it again. I think they are not doing pixel cutting but I think instead its a mesh that is pretty dense and they are just removing vertices on touch and rebuilding the surrounding areas. You can tell this by the angles and stuff it makes when cutting, it looks very polygon vs pixel. That would make sense because then they could just feed that mesh into the physics engine for collision.
#3
10/30/2011 (1:48 pm)
The game is listed in the app store as "Where's My Water?" If anyone is looking for it.
#4
10/30/2011 (2:17 pm)
@Tim,
Cool.

So if you could guess, what engine, is there any way of knowing, what engine they built it on. I mean it is gorgeous. You can fill a void/pool, full of liquid and keep filling and filling with out any slowdown. Fantastic!!!




Great game, definitely one of my all time favourites.
#5
10/30/2011 (7:07 pm)
Would you happen to know, is there a "mesh" like material in Tourque? Would a tilemap do I suppose? One thing is that a tile map would not support individual cells and Thierry collisions would it? Only the entire tilemap as a whole.
#6
10/31/2011 (4:57 pm)
You would need a good physics engine like PhysX or box2d (maybe chipmunk?) to do the fluid physics. The built in physics in it2d couldn't handle it. With that said I believe there are community tutorials for integrating box2d into t2d/it2d and I remember at least a blog wher someone put chipmunk in. I am not sure if physX for iOS is available to the public, I have only seen it in UDK and Unity. To do the digging part you would probably want to create a custom mesh class for it in C++. Cause you'll want basically a flat plane with a lot of vertices that can be removed and then rebuild whats left. I would not use the tilemap for it. Basically you feed this objects mesh into the physics engine as a mesh collision and also update it when the player removes vertices and you have rebuilt it. That way all the little spheres that make up the fluid would collide with it correctly.
#7
11/01/2011 (10:43 am)
To answer you other question, they probably are using a custom engine with box2d. That is my best guess anyway. Only thing I know for sure is they use fmod for sounds because there is a credit for it in the credits menu.
#8
11/03/2011 (8:39 am)
@ Tim,
I am relatively new to programming, 2 years and only in Torque. How could I create an object in C++ then have it as some type of sceneObject? Seems beyond me. Guess I would have to research.


And thanks.
#9
11/04/2011 (12:45 pm)
I'm guessing it's probably all custom. The hardest part about doing water physics as particles is the NxN problem of determining what particles are next to you. A 2D grid that covers the entire surface of the 2D screen would cover that. That same grid could be used to generate a 2D marching cubes type of rasterizer that would work for the digging.

en.wikipedia.org/wiki/Marching_cubes

and this:

developer.download.nvidia.com/compute/DevZone/C/html/C/src/particles/doc/particl...

Might give you some insight...

But yea, this is a double black diamond sort of challenge.
#10
11/04/2011 (1:05 pm)
The liquid physics of "Where's my water" is just fantastic; not only the water but other fluids, like the poisonous ones that eat the surface.

here's a review

toucharcade.com/2011/09/23/wheres-my-water-review-who-knew-alligators-love-bathi...

other liquid physics game is "Sprinkle".
#11
11/05/2011 (9:18 am)
@Eric, so marching cubes, could be used to make a shape and then have it picked away at by some other object. Is anything like this possible in iTGB? I am guessing no, but could be built in? Anyway, what a great tool. And thanks for the links. Me thinks that the paper will be a good Saturday read.

Cheers.


@pedro, thanks the heads up on Sprinkle. I had never seen that before. Again, great little engine, more realistic graphics, but less realistic gravity and less clever game play. Cute game tho.