Real 3D "wall"-walk like in Avp

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Kayl
Posts: 14
Joined: Wed Jun 08, 2005 7:17 am

Real 3D "wall"-walk like in Avp

Post by Kayl »

Hello,

For a personal project of mine (included in my degree), I would like to create a 3D environment in which entities can walk on the "walls".
Imagine a 3D terrain with a tree in the middle, if the "agent" goes toward the tree and doesn't stop it will walk on it.
If there is a branch, it will walk on it. There is no notion of "up" and "down".

There is no gravity but agents can't "fly", they can just walk.

In fact i would like an implementation close to alien gameplay in Alien Vs Predator (when holding "wall-walk" key).

I've been doing some thinking, for example using a ray below the agent and in front of it to see what triangle it collides with and stick the agent to that triangle but there are too many special cases in which the "next" triangle will not be detected (sharp angles for examples).

Does anyone have any idea or material I could use to implement this ?
I can't find anything on the internet.
I know commercial game developpers don't share their implementations but I was hoping it was tricky enough so that someone had made a paper on it.

Thanks.
pfo
Posts: 370
Joined: Mon Aug 29, 2005 10:54 pm
Location: http://web.utk.edu/~pfox1

Post by pfo »

There is no gravity but agents can't "fly", they can just walk.
Sounds difficult, if not impossible. One cannot walk without gravity. When you walk, gravity pulls you down, your feet push back and you actually fall foward in a controlled manner in order to propel yourself forward. Without gravity, your first step would send you up into the atmosphere and eventually space unless something stopped your movement.
I've been doing some thinking, for example using a ray below the agent and in front of it to see what triangle it collides with and stick the agent to that triangle but there are too many special cases in which the "next" triangle will not be detected (sharp angles for examples).
I think in the end any system you came up with to handle this scenario would be nothing but dirty tricks and hacks and probably unwieldy.

I have a similar problem in my game, I want it to take place either on a terrain or in space, and its a FPS and space combat simulator. In space, I would like for 'people' to be able to exist on space stations or capital ships and experience artificial gravity inside the ship, but the direction that gravity exerts should be down from the frame of reference of the ship body (as opposed to straight down for most games). This alone is proving to be quite a challenge :) I couldn't imagine extending it so that a body could identify any wall at any angle to be 'down'. Good luck getting it to work though...
Kayl
Posts: 14
Joined: Wed Jun 08, 2005 7:17 am

Post by Kayl »

Gravity doesn't really affects insect walking because of the high number of "hooks" they have on their legs.
In my case it would be the same.

AvP guys did it once, i hope it is possible without huge hacks.
omaremad_

Post by omaremad_ »

this is not easy but still quite possible

make the gravity in irrlicht = to the normal of the nearest polygon!
Klasker
Posts: 230
Joined: Thu May 20, 2004 8:53 am
Contact:

Post by Klasker »

An interesting topic. Here is something off the top of my head:

Instead of trying to find the next surface, simply take every time one at a time.

First we need to determine how a polygon qualifies as climbable from the current position. Instead of using a line, try using a hemisphere around the agent's feet. We will use this hemisphere to determine if a given polygon X is currently climpable by the agent (he can reach it with his feet).

If there is one or more polygon in the hemi-sphere (or partially in it), find the polygon whose normal is closest to the agent's current up-vector - let's call this polygon A.

Now set the agent's up-vector to the normal of polygon A. Also apply a force opposite of gravity he is unaffected by gravity.

If no polygon was found, the agent must be in open air. Best turn the agent around. Use spherical interpolation (google it to find a formulae) to change the up-vector back to pointing upwards (towards the sky).

It is important that you turn him back to a normal orientation while in the air or he might land on his head. If he is upside down on the ground, the hemi-sphere enclosing his feet will not touch the ground and he will be stuck like that forever.
needforhint
Posts: 322
Joined: Tue Aug 30, 2005 10:34 am
Location: slovakia

Post by needforhint »

realize you could walk walls in AvP only if having pressed ctrl key down,
so if ctrl key is being pressed, you can disable gravity, or rotate the gravity, and put only your player mesh or camera to respond on it
what is this thing...
Kayl
Posts: 14
Joined: Wed Jun 08, 2005 7:17 am

Post by Kayl »

Thanks Klasker for your answer.

Let me show you an example :
Image

The agent is moving ON face 1 in "forward" direction.
Both my ray (in down direction) and your hemisphere won't detect face 2.

Shouldn't have mentionned gravity because in wall walk there is absolutely no external force applied to the agent which is really glued to the surface.

For those who have played AVP you know how the view make us sick when the alien is moving on surfaces with high angle changes. I want my agents to perform the same way.

The term "walk" is important here. The agent doens't move in the environnement "encountering" surfaces, it can only slide on surfaces and never be in middle air.
Klasker
Posts: 230
Joined: Thu May 20, 2004 8:53 am
Contact:

Post by Klasker »

Hm... another try.

Find the closest point on the polygon.. let's call it P.
Call the center of the agent C.
Now set the up vector parrallel to vector(C-P).
When he encounters a corner, he will move his center when moving, so even if the closest point remains the same after moving his up vector will be changed.

These two sketches should illustrate the idea:
Image Image
Blunt angles pose another problem though.. Maybe if you slightly lowered the agent's center so it isn't his true center but when he switch walls he will stay on the wall he just switched to so we doesn't jump back and forth.
Image
Kayl
Posts: 14
Joined: Wed Jun 08, 2005 7:17 am

Post by Kayl »

I'll try to play around with your 2 ideas and see what it gives because it's hard too see only on the paper if it really is supposed to work.

Stay in touch :)
Post Reply