Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
ViolentBeetle

On item collision and different ports

Question

I am in the process of making a map right now which involves a small lift with a key on top of it. Ideally, lift's window should be too narrow and too low for player to use but enough to let player call it down and grab a the key.

 

It seems different source ports have different ideas whenever key should fall down or not, and I'd really like not to needless limit players just for one gimmick's sake. Can anyone provide reliable information on:

How much lift must extend from the key for it to reliably go down?

How short must a distance be for player to grab it from the ledge, without need to run into wall at full speed?

Share this post


Link to post

3 answers to this question

Recommended Posts

  • 0

Both questions have the same answer, basically. A key's collision box is a square of 40 map units per side (with the origin point of the key in the center, 20 units away from the sides), and 16 map units high (with the origin point at the bottom).

 

To pick up an object, the player's collision box must overlap with the object's collision box (including vertically). Grabs are possible because the check for overlap is done in the movement function before the checks for collision with geometry are done, so the player is allowed to be in an impossible place and collide with theoretically unreachable objects before being shunted back to playable space.

 

So for the player to get the key without a grab, the key must "stick out" a little bit out of the lift on the open side. Here's an example:

CuLNh0P.png

Red: geometry the player can't go to. Green: geometry the player can go to. Blue: lift geometry. As you can see it's a 40x48 sector. Yellow: key collision box. It's been placed on the lift centered vertically, but a bit off the side so part of it stick out in the void in the player area.

Share this post


Link to post
  • 0

An actor's height is uniform, it's the same on all points.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×