Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Has anyone created an effect of water efficiently?

Author
Message
ProfVersaggi
12
Years of Service
User Offline
Joined: 6th Apr 2012
Location: Maastricht Netherlands / Chicago, USA
Posted: 9th Oct 2012 11:04
I need to create the effect of water, as in an ocean or river for a game. Has anyone implemented this efficiently and can would you share your experiences? I'm interested in the illusion as well as the physics of water in this context.

Many thanks in advance!



----
From the Desk of Prof Versaggi ...
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 9th Oct 2012 11:26
Have a look at this post (and a few others in that thread).

Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th Oct 2012 11:45
I did something for a top down game, would work for a game like Warcraft2 for instance.

I just had a single sprite for the background, but it was more like a whole island, fading to alpha at the shore, so when the image is overlayed on a water image, the water fades in at the shore. It can of course fade in for things like lakes and rivers.

Then, I used an animated water texture as a backrop, using a caustics image generator. So theres this animated water as a backdrop, then the 'level' is pasted on top, and the alpha fading lets the water bleed through.

It works great, looks awesome, might be just the ticket. If you like, I can upload the project - it's just a test but nothing at all that could be considered complicated.

Health, Ammo, and bacon and eggs!
ProfVersaggi
12
Years of Service
User Offline
Joined: 6th Apr 2012
Location: Maastricht Netherlands / Chicago, USA
Posted: 9th Oct 2012 11:55
Thank you Van B, if you could upload the project I'd be most grateful for any help at all. And if you like (but it'll be a while) but as I move forward w/this project of mine, you are welcome to peruse it and see how the water part of it manifests itself.

----
From the Desk of Prof Versaggi ...
Auger
12
Years of Service
User Offline
Joined: 21st Aug 2011
Location: Out There
Posted: 10th Oct 2012 03:11 Edited at: 10th Oct 2012 03:12
http://www.youtube.com/watch?v=wdcvPegJ1lw

Shows some very realistic water that is actually tiles. At the bottom of the video is a link information and source to make it. I took a passing look at it awhile back but was busy with too many projects to attempt it. But it sure looks good for tiled water.

Auger
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 10th Oct 2012 10:22
Auger, that's an awesome example and relatively simple to achieve a very realistic effect. Refraction of the stones on the riverbed could be faked using an animated sprite too (just use vary a distortion over the original image perhaps?).

There is always benge's animated sprite pack which has some simple animations for this sort of thing too:
http://www.thegamecreators.com/?m=view_product&id=2154

Click on "Show Animations 4" for the best examples.


this.mess = abs(sin(times#))
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 10th Oct 2012 18:48
Here's that demo. I like the effect Auger posted, but I'm not sure if that would work so well without shaders and 3D. Anyway, hopefully this demo will give you some ideas.

Health, Ammo, and bacon and eggs!

Attachments

Login to view attachments
ProfVersaggi
12
Years of Service
User Offline
Joined: 6th Apr 2012
Location: Maastricht Netherlands / Chicago, USA
Posted: 24th Oct 2012 12:21
Van B:

Thank you for the demo ... that most definitely is what I'm looking for and will examine it in detail for inspiration. Thank you !



----
From the Desk of Prof Versaggi ...
ProfVersaggi
12
Years of Service
User Offline
Joined: 6th Apr 2012
Location: Maastricht Netherlands / Chicago, USA
Posted: 9th Nov 2012 14:35
Van_B, were you able to test your demo on a tablet using the AppGameKit Android APP?

I tried it and it wouldn't transfer over any of the BMP files that comprised the water. They just appeared as X's on the screen.

I've just created a thread to inquire about this but figured to double check w/you as well.

Thoughts?

----
From the Desk of Prof Versaggi ...
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 9th Nov 2012 15:01
You are best using png images rather than bmp. That might be the problem.


this.mess = abs(sin(times#))
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 9th Nov 2012 15:04
Also, androids are case sensitive. So make sure if you have a file called Water for instance you make sure it matches in your code. It doesn't matter on windows, but on android you will end up with the red squares you mention. I am unsure if android support bmps either.

ProfVersaggi
12
Years of Service
User Offline
Joined: 6th Apr 2012
Location: Maastricht Netherlands / Chicago, USA
Posted: 9th Nov 2012 17:22
I have double checked the file names, they are all consistent across the board. I'll check the BMP thing, but that shouldn't bother the PNG sprite sheets. The interesting thing is that the other PNG graphics including other PNG sprite sheets came over just fine and work.

Strange ....

----
From the Desk of Prof Versaggi ...
ProfVersaggi
12
Years of Service
User Offline
Joined: 6th Apr 2012
Location: Maastricht Netherlands / Chicago, USA
Posted: 9th Nov 2012 17:34
OK ... it seems to be a combination of the BMP issue and some odd offset conversions. I ran a test using PNG's instead of BMP's and it worked as expected.

----
From the Desk of Prof Versaggi ...

Login to post a reply

Server time is: 2024-05-07 22:52:07
Your offset time is: 2024-05-07 22:52:07