Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

Upside-Down Player + Walking on Ceiling Goto page 1, 2 Next

| Inside3d Forums Forum Index -> Engine Programming

View previous topic :: View next topic
Author | Message
--- | ---
Baker Joined: 14 Mar 2006 Posts: 1538 |

Posted: Wed Jan 27, 2010 9:46 am Post subject: 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? _________________ Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...

Back to top |

r00k Joined: 13 Nov 2004 Posts: 483 |

Posted: Wed Jan 27, 2010 1:28 pm Post subject: |

Hmm, I remember recently someone had a player walking on the walls, sideways. I think it was a quakeC hack not engine...

Back to top |

Teiman Joined: 03 Jun 2007 Posts: 309 |

Posted: Wed Jan 27, 2010 1:59 pm Post subject: 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.

Back to top |

Downsider Joined: 16 Sep 2008 Posts: 478 |

Posted: Wed Jan 27, 2010 7:03 pm Post subject: |

=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.

Back to top |

mh Joined: 12 Jan 2008 Posts: 910 |

Posted: Wed Jan 27, 2010 7:14 pm Post subject: |

sv_gravity -800 seems to work reasonably alright, but is obviously a hack rather than a general solution. _________________ DirectQ Engine - New release 1.8.666a, 9th August 2010 MHQuake Blog (General) Direct3D 8 Quake Engines

Back to top |

Teiman Joined: 03 Jun 2007 Posts: 309 |

Posted: Wed Jan 27, 2010 8:08 pm Post subject: |

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).

Back to top |

mh Joined: 12 Jan 2008 Posts: 910 |

Posted: Wed Jan 27, 2010 8:27 pm Post subject: |

Doin' the Lionel Ritchie: Wow, movement is all screwed up here! _________________ DirectQ Engine - New release 1.8.666a, 9th August 2010 MHQuake Blog (General)
Direct3D 8 Quake Engines

Back to top |

Spike Joined: 05 Nov 2004 Posts: 944 Location: UK |

Posted: Wed Jan 27, 2010 9:40 pm Post subject: |

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. _________________ What's a signature?

Back to top |

Teiman Joined: 03 Jun 2007 Posts: 309 |

Posted: Wed Jan 27, 2010 10:46 pm Post subject: |

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?

Back to top |

mh Joined: 12 Jan 2008 Posts: 910 |

Posted: Wed Jan 27, 2010 10:55 pm Post subject: |

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.
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines

Back to top |

Sajt Joined: 16 Oct 2004 Posts: 1026 |

Posted: Wed Jan 27, 2010 11:32 pm Post subject: |

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.

Back to top |

metlslime Joined: 05 Feb 2008 Posts: 177 |

Posted: Thu Jan 28, 2010 12:04 am Post subject: |

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?

Back to top |

Error Inside3D Staff Joined: 05 Nov 2004 Posts: 558 Location: VA, USA

Posted: Thu Jan 28, 2010 12:53 am Post subject: |

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. _________________ Inside3D : Knowledge Is Power Darkplaces Documentation Wiki

Back to top |

metlslime Joined: 05 Feb 2008 Posts: 177 |

Posted: Thu Jan 28, 2010 2:37 am Post subject: |

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.

Back to top |

Baker Joined: 14 Mar 2006 Posts: 1538 |

Posted: Thu Jan 28, 2010 7:31 am Post subject: |

Maybe the transition from up to down will have to be kind of improvised as a result. _________________ Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...

Back to top |

Display posts from previous:

| Inside3d Forums Forum Index -> Engine Programming | All times are GMT Goto page 1, 2 Next
Page 1 of 2

Jump to:

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2004 phpBB Group