[art] New "water flow" graphics.

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
Post Reply
User avatar
Eros
Posts: 173
Joined: July 14th, 2009, 8:53 am
Location: UK

[art] New "water flow" graphics.

Post by Eros »

[game] New "water flow" graphics.

I have been reading around the forums over the last few months while the new animated water was created. It looks FAB but (for rivers esp) it isnt very "acurate". I am not suggesting replacing the graphics but adding a new feature. I am not an artist but I have done a fair chunk of programming so I am willing to do the maths/programming if someone will give me a hand with the art. Some one asked on one of the forums why there wasnt graphics for running water and the reply was that it wasnt possible and the attempts that people had done in the past (not in BfW) looked very bad. I dont think that is necessarily true so here goes....


Idea

Use SPH(Smooth Particle Hydrodynamic) to model the velocities of the fluid in a river.
sph_1_1.png
sph_1_1.png (175.28 KiB) Viewed 5091 times
SPH is used by scientists etc to model fluids in flows. When using realistic equations It csn be very processor intensive (esp) in 3D. It is also used by graphics designers/film makers for special effects. In 2D with a small scale and a basic set of equations it could run I would have thought at speeds in the same ballpark as the current animated water.

The problem with all games with running water is that it cant account for variations in the terrain. (You end up having the infamous water flowing into a bank scenario). SPH can solve that problem by modeling the fluid as it is in real life.
sph_1_2.png
sph_1_3.png
The calculation for the animation could be done at run time or it could be done before the scenario is loaded. The animation would then be put together (either at runtime or before) and displayed.

I am not an artist but I assume that it is possible to make a graphic that's intensity depends on the velocity. You could for example have a base colour (faster water is usually deeper and hence darker) with streaks on top (length depending on speed of water) then particles on top (dead leaves, bubbles) that move at the speed of the flow.

You would have to add an option to turn this off for slower machines.

This idea could be extended to the sea to add say prevailing winds and rivers flowing into the sea but I'll wait to get the response to this before I explain that.


Pros
  • Hopefully it would look good.
  • It would make BfW well ahead in the field of cool graphics for a cool game. (The better the graphics the worse the game especially in open source)
  • It solves the annoying problem that we have no flow in our rivers at present.
  • It is completely adaptable. It can turn out relatively accurate and goodlokking images in any situation.

Cons
  • It would be slow.
    Probably wouldnt be a problem. On my home machine single core 2.65 Ghz machine I can get realtime results for quite complicated, critical scenarios. Removing all the complicated maths (50% of the cpu demand) and reducing the frame rate (to about 20?) would meen I could run it at realtime in the background but that would be unneccessary. A model of the velocities could be made in say 5s depending on the amount of water and the base animation (in my example above colour and streaks) put on top and then all that happens at runtime is that debris/foliage etc needs to run down stream (This could also with a bit more difficulty could be done at the start of the scenario). (I would have thought that for reasonable quantities of debris the runtime demand would be little more than there already is for the current animated water)
  • It would require a lot of effort.
    True, but we wouldnt have BfW at all without effort.
  • There is no point.
    Whats the point in anything?

Explanation of SPH

I realise that most of you wont know how SPH works. basicly you take a element in a fluid and you model its interactions with other elements of the fluid. In scientific work there are lots of other problems like boundry conditions/viscosity etc. In what I propose all you need is no slip conditions on the edge of the flow, a linear kernal (no this is not linux. A kernal in SPH measures the amount we need to consider a neighbouring particle depending on the distance) and a few extra bits (like turbulence in the "still" spots, vortices etc). Because we dont want scientific accuracy there is little need to do all the technical stuff that usually comes up in SPH.
sph_1_4.png
sph_1_4.png (179.51 KiB) Viewed 5091 times

Conclusion

I have already written SPH software and I am willing to give it a go if the developers etc will give me relevant info on how I would fit it into BfW.

NB: I am currently studying engineering at uni so I wont be the fastest of workers.
NB2: I am a windows user which probably disqualifies me straight away. :)
NB3: I can explain this further if you wish.
NB4: For the sea there is actually a much, MUCH easier algorithm that would require no extra cpu demand at all and still make it look much more realistic.
NB5: I can post screen shots of relavent SPH simulators/my own if people are interested.
NB6: There are lots more issues etc that I have thought about but this is enough for now.
"Genius is 10% inspiration and 90% perspiration" (Thomas Edison) Which is why I smell so bad!
User avatar
Eleazar
Retired Terrain Art Director
Posts: 2481
Joined: July 16th, 2004, 1:47 am
Location: US Midwest
Contact:

Re: [game] New "water flow" graphics.

Post by Eleazar »

Eros wrote:I am not an artist but I assume that it is possible to make a graphic that's intensity depends on the velocity. You could for example have a base colour (faster water is usually deeper and hence darker) with streaks on top (length depending on speed of water) then particles on top (dead leaves, bubbles) that move at the speed of the flow.
Yeah, well, there's the rub. You can calculate as many velocity profiles (etc) as you want, but it's no good unless there's a way to translate that info an animation that looks like water. I can imagine such a thing in general terms but not anything that isn't extremely complicated in code and art.
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
User avatar
Gambit
Loose Screw
Posts: 3266
Joined: August 13th, 2008, 3:00 pm
Location: Dynamica
Contact:

Re: [game] New "water flow" graphics.

Post by Gambit »

:augh:
Just let the map designers do this manually (if they want).
1. It's a lot of math work.
2. It's a lot of art work.
3. It's a lot of WML work.
4. After all that work you end up with more rules which is:
a. anti-KISS
b. Restrictive to map makers who don't give a rat's hat about geologic principles (almost all of them?), or actually want to defy them.
5. This can all be done manually by the map designers given a big enough map (sandbars, meanders, alluvial fans, et cetera).
6. HAPMA
7. Speed! Even the directionless water we have right now is massively bogging down the game (more a fault of the animation engine than the math involved, but still).
8. ???
9. Very little profit
10. WINR

I appreciate how cool this could be, and it's amazing that you put so much work into those diagrams, but it just isn't going to happen.
User avatar
Captain_Wrathbow
Posts: 1664
Joined: June 30th, 2009, 2:03 pm
Location: Guardia

Re: [art] New "water flow" graphics.

Post by Captain_Wrathbow »

You've at least got to give him credit for the idea and post itself. The idea is incredibly well thought out, and the post is well written and thoroughly explained. :)
User avatar
Eros
Posts: 173
Joined: July 14th, 2009, 8:53 am
Location: UK

Re: [art] New "water flow" graphics.

Post by Eros »

Ok, and thanks. The real reason for the post is that I have - some - spare time on my course and I would like to do something for BfW. I am a Java/Lisp programmer by training but I have done some Cpp. Most of the work I have done has been algorithms based, SPH, compilers, etc but I am happy to try and put my hand to anything.
"Genius is 10% inspiration and 90% perspiration" (Thomas Edison) Which is why I smell so bad!
User avatar
thespaceinvader
Retired Art Director
Posts: 8414
Joined: August 25th, 2007, 10:12 am
Location: Oxford, UK
Contact:

Re: [art] New "water flow" graphics.

Post by thespaceinvader »

Someone with more terrain graphics experience than I could probably say more about this, but it seems like this sort of scheme would be difficult to accomplish using tiled graphics. It seems a lot more complex than static tiles could work on. It feels like it would require a particle engine which, whilst it would be awesome, we don't have.

Check out EasyCoding for ideas of things you could help out with.
http://thespaceinvader.co.uk | http://thespaceinvader.deviantart.com
Back to work. Current projects: Catching up on commits. Picking Meridia back up. Sprite animations, many and varied.
User avatar
Eros
Posts: 173
Joined: July 14th, 2009, 8:53 am
Location: UK

Re: [art] New "water flow" graphics.

Post by Eros »

I can do the particle engine but I think I agree with what has been said so far that it is not practical.

Edit: I will see if I can understand enough to do some coding sometime.
"Genius is 10% inspiration and 90% perspiration" (Thomas Edison) Which is why I smell so bad!
User avatar
Cloud
Art Contributor
Posts: 502
Joined: December 17th, 2008, 7:43 pm
Location: The land of pixels
Contact:

Re: [art] New "water flow" graphics.

Post by Cloud »

:augh:
Have you any idea how complex rivers are? Yes rivers tend to deviate to the outside of bends, but there are cases when that's not necessarily true. What's below the surface generally makes the greatest effects (cross reference: stoppers, standing waves, etc.). You start coding that for something like Wesnoth and you won't be able to stop. The gains definitely won't outweigh the effort you'll need to put it.

I've yet to see a game do rivers accurately, actually I find it better when they don't try too hard - that way I don't analyse the inperfections
Softly/SoftlySplinter on IRC. Will be lurking around more these days
Mainline Animations|The Væringjar
Art for these mead-sodden, bearded mushroom-junkies by Girgistian!
User avatar
Eleazar
Retired Terrain Art Director
Posts: 2481
Joined: July 16th, 2004, 1:47 am
Location: US Midwest
Contact:

Re: [art] New "water flow" graphics.

Post by Eleazar »

A particle engine however, would be generally useful for things like attacks and hits, magic and otherwise.
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
User avatar
Eros
Posts: 173
Joined: July 14th, 2009, 8:53 am
Location: UK

Re: [art] New "water flow" graphics.

Post by Eros »

I can try and program one but I would have thought that the awsomeness of new attacks wouldnt repay the processor cost. You could pre-record the effects (either on "homegrown" software or on a piece of professional kit like 3DMax (I get free copies from my university)) and turn them into animations.

EDIT: I realise that you couldnt prerecord really cool stuff like
  • Jevvan die in RoW could have a large wave of magically goodness sweep across the map.
  • Atmospheric effects (the ever suggested weather addition to wesnoth of which I am a keen supporter).
EDIT2: I would love to program it if you want it though. :)
"Genius is 10% inspiration and 90% perspiration" (Thomas Edison) Which is why I smell so bad!
User avatar
thespaceinvader
Retired Art Director
Posts: 8414
Joined: August 25th, 2007, 10:12 am
Location: Oxford, UK
Contact:

Re: [art] New "water flow" graphics.

Post by thespaceinvader »

If we're to have a particle engine, we would immediately need graphics acceleration, I suspect, which we also don't have...
http://thespaceinvader.co.uk | http://thespaceinvader.deviantart.com
Back to work. Current projects: Catching up on commits. Picking Meridia back up. Sprite animations, many and varied.
User avatar
Eros
Posts: 173
Joined: July 14th, 2009, 8:53 am
Location: UK

Re: [art] New "water flow" graphics.

Post by Eros »

OK :(
"Genius is 10% inspiration and 90% perspiration" (Thomas Edison) Which is why I smell so bad!
Post Reply