Upside-Down Player + Walking on Ceiling
Moderator: InsideQC Admins
24 posts
• Page 1 of 2 • 1, 2
Upside-Down Player + Walking on Ceiling
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?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
Re: Upside-Down Player + Walking on Ceiling
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
=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.
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.
-

Downsider - Posts: 621
- Joined: Tue Sep 16, 2008 1:35 am
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
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
Teiman wrote:mh wrote:Doin' the Lionel Ritchie:
Wow, movement is all screwed up here!
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
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
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.
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
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.
-

Error - InsideQC Staff
- Posts: 865
- Joined: Fri Nov 05, 2004 5:15 am
- Location: VA, USA
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
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?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
24 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest