Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Angled Water Areas
xiphirx Offline
Senior Member

Posts: 662
Threads: 16
Joined: Nov 2010
Reputation: 5
#1
Angled Water Areas

Hello,

I noticed that angled water areas are not possible.. if you rotate a water area, it acts as if it is a large cube instead of a sloped plane...

This allows things to float in the air...

Is there a way to override this or get around this?

05-23-2011, 03:22 AM
Find
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#2
RE: Angled Water Areas

(05-23-2011, 03:22 AM)xiphirx Wrote: Hello,

I noticed that angled water areas are not possible.. if you rotate a water area, it acts as if it is a large cube instead of a sloped plane...

This allows things to float in the air...

Is there a way to override this or get around this?

Maybe turn off the collide for the plane? Don't know if that'll solve it.

05-23-2011, 03:59 AM
Find
Streetboat Offline
Posting Freak

Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation: 56
#3
RE: Angled Water Areas

What are you trying to accomplish? Perhaps some trickery could be applied.

[Image: signature-2.png]
05-23-2011, 04:35 AM
Find
xiphirx Offline
Senior Member

Posts: 662
Threads: 16
Joined: Nov 2010
Reputation: 5
#4
RE: Angled Water Areas

I have water running down a slope... so my water area needs to be sloped.

Russ: It's an area...

05-23-2011, 05:12 AM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#5
RE: Angled Water Areas

Select your area and press 'B'. This creates a compound which is rotated independently of the water area. This should work as long as you don't break down the compound afterwards.


EDIT: Wait actually I just tried and I'm able to rotate the area without making the compound...


Attached Files
.jpg   angled water.jpg (Size: 128.38 KB / Downloads: 145)

(This post was last modified: 05-23-2011, 07:46 AM by palistov.)
05-23-2011, 07:44 AM
Find
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
#6
RE: Angled Water Areas

He meant that if he rotates the area, in the game it behaves like a cube and that's how the engine works, so no fix for that I believe

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
05-23-2011, 02:09 PM
Find
xiphirx Offline
Senior Member

Posts: 662
Threads: 16
Joined: Nov 2010
Reputation: 5
#7
RE: Angled Water Areas

(05-23-2011, 07:44 AM)palistov Wrote: Select your area and press 'B'. This creates a compound which is rotated independently of the water area. This should work as long as you don't break down the compound afterwards.


EDIT: Wait actually I just tried and I'm able to rotate the area without making the compound...

Yea, I'm able to rotate it too, but in game it acts as if its a giant cube instead of like how its supposed to...

05-23-2011, 05:54 PM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#8
RE: Angled Water Areas

(05-23-2011, 05:54 PM)xiphirx Wrote: Yea, I'm able to rotate it too, but in game it acts as if its a giant cube instead of like how its supposed to...

I just tried making "steps" of water areas to emulate a slope. However, this doesn't seem to work.

I think the solution to this is going to require scripting buoyancy to a degree. Obviously we can't clip the shape by the area and calculate the submerged volume using current methods provided by the engine, so we are going to have to assume all objects are spherical - which unless you require perfect physics here is a fair sacrifice.

The idea is thus:
  1. Create a water plane as normal. This will be the surface.
  2. Create a thin script area running parrallel to the water plane. Call it liquid_1. This area should have a collide callback triggering on something like "object_*" with all floating objects prefixed with "object_". Have this call a function in your hps file on both entrance and exit.
  3. Duplicate the script area multiple times so we have various "slices" beneath the water area.
  4. Write some code to flag how many "tiles" each object is and store this information.
  5. For each object that is flagged apply a force away from the water based on how many tiles the object touches.
I am working on slapping some code together now Wink

Edit Done!
http://www.mediafire.com/?62ywej36g5w887w

Notes:
The values of the vector * volume displaced are VERY approximate. There is no reason why you shouldn't properly work out these values using some trig, and multiply them against volume. You could also produce a lookup table for objects and their volumes (remember to divide by the maximum no. depth objects they can flag), for much more precise forces when dealing with different sized objects. I am also not going to say right now this is bug free, it was put together in just under an hour (including writing this post), but it seems to behave fairly realistically considering. Finally, this WILL require some tweaking to get to work with saves, thanks to the use of the List class which wont be saved.

Edit 2: You can also apply the effects of current by changing the values of the vector*volume.
(This post was last modified: 05-23-2011, 10:02 PM by Apjjm.)
05-23-2011, 09:22 PM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#9
RE: Angled Water Areas

Oh I get what you mean! It behaves in-game like a giant cube. That's disappointing. Sorry mate

05-23-2011, 10:05 PM
Find
xiphirx Offline
Senior Member

Posts: 662
Threads: 16
Joined: Nov 2010
Reputation: 5
#10
RE: Angled Water Areas

(05-23-2011, 09:22 PM)Apjjm Wrote:
(05-23-2011, 05:54 PM)xiphirx Wrote: Yea, I'm able to rotate it too, but in game it acts as if its a giant cube instead of like how its supposed to...

I just tried making "steps" of water areas to emulate a slope. However, this doesn't seem to work.

I think the solution to this is going to require scripting buoyancy to a degree. Obviously we can't clip the shape by the area and calculate the submerged volume using current methods provided by the engine, so we are going to have to assume all objects are spherical - which unless you require perfect physics here is a fair sacrifice.

The idea is thus:
  1. Create a water plane as normal. This will be the surface.
  2. Create a thin script area running parrallel to the water plane. Call it liquid_1. This area should have a collide callback triggering on something like "object_*" with all floating objects prefixed with "object_". Have this call a function in your hps file on both entrance and exit.
  3. Duplicate the script area multiple times so we have various "slices" beneath the water area.
  4. Write some code to flag how many "tiles" each object is and store this information.
  5. For each object that is flagged apply a force away from the water based on how many tiles the object touches.
I am working on slapping some code together now Wink

Edit Done!
http://www.mediafire.com/?62ywej36g5w887w

Notes:
The values of the vector * volume displaced are VERY approximate. There is no reason why you shouldn't properly work out these values using some trig, and multiply them against volume. You could also produce a lookup table for objects and their volumes (remember to divide by the maximum no. depth objects they can flag), for much more precise forces when dealing with different sized objects. I am also not going to say right now this is bug free, it was put together in just under an hour (including writing this post), but it seems to behave fairly realistically considering. Finally, this WILL require some tweaking to get to work with saves, thanks to the use of the List class which wont be saved.

Edit 2: You can also apply the effects of current by changing the values of the vector*volume.


Cool, I was hoping that I didn't have to go in and script it, but that's fine as well. I'll look at the code and report back. I'm not too advanced in physics, but I should be able to understand it. Thanks man!

05-23-2011, 10:59 PM
Find




Users browsing this thread: 1 Guest(s)