Good Water Engine Needed

Blitz3D Forums/Blitz3D Programming/Good Water Engine Needed

asdfasdf(Posted 2005) [#1]
Since I'm making a ship simulator game, one of the most important things to make is a good water engine. Does anybody know how to make or know of a good water engine that can do things like: wake, locks, breakwaters, drydocks, etc?


big10p(Posted 2005) [#2]
Oh, I thought this thread was related to the rising petrol prices. :P


Red Ocktober(Posted 2005) [#3]
Becky Rose is the water expert of late... check out her sailing sim...

I'm making an Ocean class for my Blitz3D version of a Sub Sim... just finished a crucial part of it so that it appears to be seamless and expansive... wakes, yes... in a day or two... locks, breakwaters, drydocks... maybe, but not part of the OCean class...

there's a lot of code around here (ok, a lil) on how to make moving water in Blitz3d... textured, cubemapped and a lot in between... you gotta have that first...

good luck...

--Mike


jfk EO-11110(Posted 2005) [#4]
Water is more complex than one would think. There's water appearance (both surface and underwater), water physics, appearance of the stuff that is above the water surface, watched from under water etc.

I think it depends on the way you want to use it. Personally I use a simple underwater mode in my engine (reduced gravity). The sinus distortion of the screen is even very unrealistic, but I like it :) Oh yeah, and bubbles - they are very substancial.

Realistc water physics sound very hard to me because water with all it's reactions could be compared with an ordinary physics engine where every molecule is an individual entity. So I guess it must be simplified drasticly.


markcw(Posted 2005) [#5]
i am currently programming a watyer physcis system
where the water reacts to the surrounding environment
it is not ready yet but when it is i'll let you know.


IPete2(Posted 2005) [#6]
http://www.blitzbasic.co.nz/Community/posts.php?topic=51061

in another thread...


asdfasdf(Posted 2005) [#7]
When will this water physics be done? How much will it cost? How will it work?


Banshee(Posted 2005) [#8]
>>Becky Rose is the water expert of late... check out her sailing sim...
Wooo i'm famous!

>>Does anybody know how to make or know of a good water engine that can do things like: wake, locks, breakwaters, drydocks, etc?
It's kind of hard to answer that in so many ways. One persons idea of water is very different to another persons - the reason is because computers cannot accurately simulate water and therefore anything you code is always going to fall short in some aspect.

Do you want good physics? Storms? Rivers? Or maybe it should focus on still water transparency or perhaps your interested in under water? Or maybe you will only see your water from a bridge mounted high up on a super tanker?

Does your game allow for water visuals to consume 15% of the CPU load per refresh? Do you want particle spray on white water?

There's so many ways to go about simulating water, and none of them are a perfect simulation. PPU's will help, but we're still years away from being able to simulate water 100% realistically on a computer.

Therefore when you go about writting water for a game you have to be very clear in your mind just how you are going to address the problem and how you want the water to look. Whatever you do is only going to be a jury rig at best.

You must also consider that if you are writting a sailing or sea based game that the water visuals are what will define your game, therefore if you use a stock water system then your game will be very much defined by that system more so than anything else you do to the game.


asdfasdf(Posted 2005) [#9]
I would like to have storms but rivers would be big enough to send a super laker through so the would be like the lake. I don't need underwater or particle spray.


Banshee(Posted 2005) [#10]
I used a storm-ish effect in my project, actually it was more for showing windage but you could do a similar thing for storms. I basically lightmapped the mesh on a seperate texture layer. You could add to that by adding ripples and more choppyer waves with extra white water for a storm.

First of all though you'll need a wave system, does your wave system need to cope with wake aswell or are you going to do that on a texture? You also need to decide what altitude your water will be viewed from - maybe you are better off with waves done just as a texture, or perhaps they need to be mesh animations...


asdfasdf(Posted 2005) [#11]
A mesh animation would better because the user will be close to the water and sitting on the water as the ship goes by. If a mesh wake would hog too much cpu power then I might do a texture but I'd rather have a mesh wake.


Banshee(Posted 2005) [#12]
Then you need to make a mesh manually using the surface command set. You should end up with a grid where you can manually edit height references of the individual vertexes.

Do this for the near view, in the mid and/or far distance either space out the x/z position of the vertices or skip rows/columns in order to save on processing time as the far view does not need as much detail.

There are a number of ways to go about adjusting the vertice heights, for the most part it will depend upon what factors you want to influence the height. Sea strength, wind, lashing water near rocks etc, basically you'll use some kind of sin() wave of sorts, the question is what angle to give sin() and the amplitude based upon environmental factors.


asdfasdf(Posted 2005) [#13]
I'm using the water example (3D Water) which I modified to be able to change heights. How would I figure out which of the vertexes to change?


Banshee(Posted 2005) [#14]
It'll be something like:

vertex=( (horizontalIndex * sizeOfVerticalIndex) + verticalIndex ) -1


markcw(Posted 2005) [#15]
When will this water physics be done? How much will it cost? How will it work?


eta: tba.
price: ~20$.
pyhsics: according to environmental parameters (wind, rain, fluffiness, etc) and entities specified to interact with it (wakes, diffractions, etc).


VP(Posted 2005) [#16]
If you're needing to do a mesh wake, could it be pre-calculated? If the ship's movement will be the same (or even similar) each time then all the ways the mesh needs to deform can be pre-calculated and then played back at runtime.


asdfasdf(Posted 2005) [#17]
No, it will not be the same. Different ships, different speeds, foward, backward, left and right.