Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (843)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  How to create game like where's my water  (Read 5903 times)
0 Members and 1 Guest are viewing this topic.
Offline luisoft

JGO Coder

Projects: 6
Exp: 10 years

Java games rock!

« Posted 2012-11-19 20:59:32 »

I have no idea how to code the effect like where's my water ipad game. I'd like to create something like that using the mouse. I was planning to add an entry like that for java4k this year... but no idea. Or maybe something like worms armaggedon.

Any tips? Thanks!
Offline luisoft

JGO Coder

Projects: 6
Exp: 10 years

Java games rock!

« Reply #1 - Posted 2012-11-21 18:54:59 »

I'm used to create very simple games using tiled maps. Is it possible to create such effect using tiles? thanks
Offline KevinWorkman

« JGO Plugged Duke »

Medals: 283
Projects: 12
Exp: 12 years - Coding Tutorials!

« Reply #2 - Posted 2012-12-17 17:10:11 »

Perhaps you could be more specific: what exactly is the effect you're looking at creating? I've never heard of the game you're talking about, and you might be talking about different aspects of it.

So, what specific effect or mechanism are you trying to achieve? - Coding Tutorials!
Happy Coding forum - Come say hello!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline namrog84

JGO Ninja

Medals: 46
Projects: 4

Keep programming!

« Reply #3 - Posted 2012-12-18 14:29:14 »

I would assume he probably means the water/physics based model

Although I haven't ever designed/implemented something like that.
For the physics/water itself, one way to implement it that I could think of is to have balls/nodes/particles.

Each node would attempt to keep itself a minimum distance(not forced minimum) from other nodes. If the node was too close, it would simply exert a repulsion force.  however would have some mild elasticity to other nodes to keep it 'together',  up to a particular distance.

here is an example using 'square nodes/particles'
This example has no special effects or modifications to the graphics.

As you can see I've highlighted in red what I believe are the individual nodes, occasionally in the game, you can sorta see the artifacts of this approach. Most of the time they are 'bundling' or 'grouping' together, but each droplet can be represented as such.
Although I am sure there are some defined shapes/colors as static images, I'd imagine there is some procedural manipulation/generated imagery going on.

Depending on how big your particular node/particle is, would influence a lot on the water's appearance.  However fluid mechanism in game has always been a very difficult thing to do, at least in larger scale. Since it is usually represented as entities or object, in water you will often have a high order of magnitude to represent more realistic water.
6 million particle engine simulation.

Whereas in where is my water, they are representing water in very low amounts of particles/nodes, for 2 reasons. Mobile devices can't handle the higher amounts of calculations. Also its quite apparent in the way the water looks and moves, that its being represented with a relatively low number of particles.

I would suggest you start looking at physics simulations and particle engines as a good place to start.

"Experience is what you get when you did not get what you wanted"
Offline ClickerMonkey

JGO Coder

Medals: 26
Exp: 10 years

Game Engineer

« Reply #4 - Posted 2012-12-19 00:58:28 »

I've used steering behaviors before to good success. I used a separation and cohesion behavior, as well as a simple gravity behavior. To render the particles was "simple". Group up the particles based on their distance from each other, then compute the convex hull for each group, then add some buffer around that hull (to round of corners and what not). If you don't want to go the computational geometry route for drawing, you could just render particles larger than the separation distance. If you're using OpenGL you could use blending to blend the particles together.

Pages: [1]
  ignore  |  Print  

EgonOlsen (37 views)
2018-06-10 19:43:48

EgonOlsen (20 views)
2018-06-10 19:43:44

EgonOlsen (39 views)
2018-06-10 19:43:20

DesertCoockie (186 views)
2018-05-13 18:23:11

nelsongames (122 views)
2018-04-24 18:15:36

nelsongames (121 views)
2018-04-24 18:14:32

ivj94 (861 views)
2018-03-24 14:47:39

ivj94 (122 views)
2018-03-24 14:46:31

ivj94 (758 views)
2018-03-24 14:43:53

Solater (139 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!