Forum

Upside-Down Player + Walking on Ceiling

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Upside-Down Player + Walking on Ceiling

Postby Baker » Wed Jan 27, 2010 9:46 am

What needs to do be done to engine to be able to support walking on the ceiling upside down?
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby r00k » Wed Jan 27, 2010 1:28 pm

Hmm, I remember recently someone had a player walking on the walls, sideways. I think it was a quakeC hack not engine...
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Re: Upside-Down Player + Walking on Ceiling

Postby Teiman » Wed Jan 27, 2010 1:59 pm

Baker wrote:What needs to do be done to engine to be able to support walking on the ceiling upside down?


hard stuff..

collision stuff, and a minor visual stuff.

or maybe a fun hack on the visual thing.

theres not "gravity force vector" on the quake engine,... lets say the vector '0 0 1' is hardcoded everywhere.

you can start your experiments on the two different areas.. on the BSP loader, tryiing to rotate the map there. And on the "modding side" rotating the angle of the player (I suppose can be done if the health is -1 (???)) and faking gravity.

changing the gravity vector was something I planned for my engine, and never implemented.
Teiman
 
Posts: 309
Joined: Sun Jun 03, 2007 9:39 am

Postby Downsider » Wed Jan 27, 2010 7:03 pm

=O

This is interesting, isn't it? I mean, Quake doesn't support anything that you could easily switch on and off and see it go work. It'd probably be easiest if you're using QC along with it. I'd personally rotate the world around the player, would probably be easier but would cause artifacts with other objects affected by gravity and the like, most likely.

You could simply add the gravity variable that isn't already present, then go ahead flip that little switch before you do the player's physics and flip it back, but the problem would then be which direction to move the player, has to be relative to the "floor's" normal, assuming that you want to be able to walk on sideways walls and sloped surfaces as well and not just the ceiling.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby mh » Wed Jan 27, 2010 7:14 pm

sv_gravity -800 seems to work reasonably alright, but is obviously a hack rather than a general solution.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Teiman » Wed Jan 27, 2010 8:08 pm

mh wrote:sv_gravity -800 seems to work reasonably alright, but is obviously a hack rather than a general solution.



Ugh.. I forgot about that.

Then maybe rotating the angle of the view with health below zero is the next thing, or something.


Walking on the ceiling of the quake1 maps is one of my secrets dreams. I think theres even somewhere the maps compiled that way (heres another way to get that... recompile the maps rotated).
Teiman
 
Posts: 309
Joined: Sun Jun 03, 2007 9:39 am

Postby mh » Wed Jan 27, 2010 8:27 pm

Doin' the Lionel Ritchie:

Image

Wow, movement is all screwed up here! :lol:
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Spike » Wed Jan 27, 2010 9:40 pm

one issue is that hulls don't and cannot rotate, even if the world does. With q1 bsps, you can't even elongate them in a different axis.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Teiman » Wed Jan 27, 2010 10:46 pm

mh wrote:Doin' the Lionel Ritchie:


Wow, movement is all screwed up here! :lol:


So... how you did that, and what do you achieve? where the controls inverted?
Teiman
 
Posts: 309
Joined: Sun Jun 03, 2007 9:39 am

Postby mh » Wed Jan 27, 2010 10:55 pm

Teiman wrote:
mh wrote:Doin' the Lionel Ritchie:


Wow, movement is all screwed up here! :lol:


So... how you did that, and what do you achieve? where the controls inverted?


Yup, controls inverted. Physics is totally messed up, so you tend to slide around quite a bit. I guess there's no friction applied when you're moving "up" instead of "down".

How I did it? Removing the bounds on cl.viewangles[PITCH] and setting sv_gravity -800.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Sajt » Wed Jan 27, 2010 11:32 pm

Basically Quake considers the player to be on ground if "trace_plane_normal.z > 0.7", where trace_plane_normal is the normal of the surface he hits.

This is an optimized way of saying "DotProduct(trace_plane_normal, upvector) > 0.7", assuming upvector is '0 0 1' (straight upwards). So if you want to use a different upvector, you'd need to use this dot product equation.

The value 0.7 means that anything within roughly 45 degrees of "upvector" is considered to be ground. If you want to specify a different angle threshold, the full equation is cos(DEGTORAD(angle)). So 0.7 is actually equivalent to 45.473 degrees. But there's no point in changing this, 0.7 is fine.

If you implement an "upvector", you'd have to change a ton of stuff all over the place. I'm not that familiar with the Quake engine so I'm not sure what would all be involved. One example would be to make sure that the gravity force ("sv_gravity") is applied in the direction opposite to upvector. Quake is hard-wired all over the place to just do simple processing with the z component of vectors, which would all have to change. You'd probably have to rewrite half the physics and input, and most of the gamecode to implement upvectors...

I did do this once with an engine I wrote from scratch. But it was so annoying and hard to maintain (and I didn't have a use for it) that I removed it. I still have some videos of deathmatch gameplay where each player can press a button to reverse his personal gravity, allowing play on both floors and ceilings, but I don't have the bandwidth right now to upload them.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby metlslime » Thu Jan 28, 2010 12:04 am

Start with what mh did, then:

- change the player eye level to negative instead of positive?

- figure out some hack to set the .onground flag when you hit the ceiling?

- set m_yaw to negative?
metlslime
 
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Postby Error » Thu Jan 28, 2010 12:53 am

someone, break compatibility and make gravity a vector. align the player's orientation to however the gravity is. please, I've been wanting to walk around a "globe-like" object in Quake forever.
User avatar
Error
InsideQC Staff
 
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA

Postby metlslime » Thu Jan 28, 2010 2:37 am

Error wrote:someone, break compatibility and make gravity a vector. align the player's orientation to however the gravity is. please, I've been wanting to walk around a "globe-like" object in Quake forever.


The problem is, up and down are relatively easy. Any other direction invalidates the collision hulls.
metlslime
 
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Postby Baker » Thu Jan 28, 2010 7:31 am

Maybe the transition from up to down will have to be kind of improvised as a result.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Next

Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest