Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (491)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
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 2705 times)
0 Members and 1 Guest are viewing this topic.
Offline luisoft

JGO Coder


Projects: 6


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


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 Wizard


Medals: 58
Projects: 11
Exp: 12 years


klaatu barada nikto


« 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?

Static Void Games - Play indie games, learn game programming, upload your own games!
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'
https://www.youtube.com/watch?v=m5HRBViuW8c
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.  

https://www.youtube.com/watch?v=VB0Z9LWDxyU
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: 20


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  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Nickropheliac (15 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (33 views)
2014-08-22 19:31:30

atombrot (41 views)
2014-08-19 09:29:53

Tekkerue (40 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (25 views)
2014-08-16 06:20:21

Tekkerue (37 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (49 views)
2014-08-09 21:09:32
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org 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‑gaming.org
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!