|
3 registered members (bigsmack, 3run, AndrewAMD),
37,438
guests, and 3
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: water vs earth
[Re: slowglider]
#221187
08/12/08 17:28
08/12/08 17:28
|
Joined: Apr 2004
Posts: 516 USA
Trooper119
User
|
User
Joined: Apr 2004
Posts: 516
USA
|
Alright, normally I would leave this kind of post alone but this idea really intrigues me. One question needs to be answered before I can really help you out though. What scale are you looking for. I think others were saying 2d and 3d are a big difference was because if you used particles you could do it easily. But only a small number of particles could be done this way before it got out of control and takes up all your CPU's power. So are we talking a small pond, a lake, ocean, what?
Also what kind of deformation speeds are we looking at here? If calculations need to be done quickly due to a large area being changed quickly some techniques can't be done.
Are you doing an RTS and doing a top-down view? Or are you just saying that for reference? Are you using a box or mesh for the water, or particles, or something else? Also how accurate does this need to be, does it just need to look nice or are we simulating real water here?
Based on what you said I'll give my best idea a foot forward. What I would suggest is if you are using particles all you need to do is give them some physics, tell them to fall until something obstructs them and bounce with a certain trajectory (according to what the normal of what the water contacts with) and that would solve your problem easily, however is computer intensive with massive volumes of particles. Probably over a large area, if you aren't looking for super accurate results you could combine blocks of water with particles of water, I'll go into more detail: You have a box that is serving as your water, this, for whatever reason you decide, is told to lower because of the water going somewhere else. Either a invisible box, or a bunch of rays will lower with the water to look for for obstructions for the water. You take water particles and bounce them off this obstruction for a small distance, if it hits water, it expands the water by a extremely small amount, if it hits land, it records the distance it moved, and bounces again, if it doesn't move a certain amount and hasn't hit water it creates its own water block of the water in the area. Every water droplet (particle) will either create its own water box or find its way to an existing block of water when it can't move anymore. Things to watch out for: The water droplets "contribution" to the water supply it finds has to be really small. All the particles of water formed during a drop in the main water box has to have a smaller "contribution" then what is dropped by the main water box, otherwise an infinite loop will arise.
I really hope this is a main part of your game because unless your designing a small field to put this in (and can use the particle method), this could take up a lot of effort to make. Otherwise I suggest that unless you have a large amount of programming experience and want to do this on a large scale, this just isn't a smart use of resources for a minimal part of a game.
Good luck, Trooper119
A clever person solves a problem. A wise person avoids it. --Einstein
Currently Codeing: Free Lite-C
|
|
|
Re: water vs earth
[Re: Trooper119]
#221194
08/12/08 18:21
08/12/08 18:21
|
Joined: Apr 2008
Posts: 17
slowglider
OP
Newbie
|
OP
Newbie
Joined: Apr 2008
Posts: 17
|
thx for your post i want to make a 3d rts style dike(nl:dijk)creator simulater the idea was to create a sort off logorithime that calulate when the see is going down and up this hasnt be done every single frame but maby every 1/2 sec so you wont notice i know that is is going to be very cpu heavy so i want to create somthing like 1km * 1km so the terain while be somthing like 1000*1000 my first try did use al my cpu whiteout any thing in my lvl because rts style cost alot of ai so cpu i didnt want to use traces i have 2 terains above each other white the same size en vertex only differnet texure's i use vec_for_mesh and vec_to_mesh to calulate the distance from each other btw i didnt want to use pshycic because i dont like it about the 2d: if you do it like pic1 it could be easyer then when calutated then pic2 pic1  pic2 i was more looking for pic2 but now there the dijk is getting higher but the water stays the same even if i would drain everything below the dijk white a water pomp in to the sea(water) slowglider
|
|
|
Re: water vs earth
[Re: slowglider]
#221218
08/12/08 21:14
08/12/08 21:14
|
Joined: Apr 2004
Posts: 516 USA
Trooper119
User
|
User
Joined: Apr 2004
Posts: 516
USA
|
For that particular issue, why don't you just lower the water? It should work just fine, my example was for creating puddles from a pre-existing large water body. If your just raising and lowering things, moving the water should work just fine. Why doesn't that work?
A clever person solves a problem. A wise person avoids it. --Einstein
Currently Codeing: Free Lite-C
|
|
|
Re: water vs earth
[Re: DJBMASTER]
#221367
08/13/08 17:49
08/13/08 17:49
|
Joined: Apr 2008
Posts: 17
slowglider
OP
Newbie
|
OP
Newbie
Joined: Apr 2008
Posts: 17
|
 this is before the player starts in the lvl  now the player has build a dijk (hill,somthing that make sure the water isnt getting to the other side) still the water is there  now the player has build a water pomp and is pomping out the water behind the dijk small link white a demo but isnt working http://boxstr.com/files/3146889_27xir/water.cd.zip
|
|
|
|