Game Development Community

Player gets stuck in stairs

by Trond Abusdal · in Torque Game Engine · 12/03/2006 (8:49 am) · 5 replies

I'm having problems with the player frequently getting stuck when walking up stairs. I've been searching the forums for answers, but people with this problem seem to end up making "fake" stairs using transparent collision meshes over the actual stairs, so it's like walking up a slope.

If anyone knows how to properly "fix" this (find it hard to believe noone already did, as it seems like a common problem), I'd be very grateful to know about it :) I'll be diving a bit deeper into the code myself now, but if the answer is available (and I just couldn't find it because of my poor search methods), I'd be very happy to save the time :)

-Trond

#1
12/03/2006 (9:23 am)
It'd be rather difficult to code in collision per foot and have the feet of the player lift one after the other to actually walk up stairs correctly, especially taking into consideration lateral movement and turning while moving on said stairs. This is why in basically 99% of games, invisible collideable ramps are used.
#2
12/03/2006 (9:49 am)
Thanks for the input!

I think I may not have been completely clear on what I'm looking for :) I don't expect the player to place its feet on each step, just be able to move up stairs without getting stuck. Walking up steps works most of the time, but often it is required to jump or reapproach the step to get up. It looks like walking up stairs is coded in, it's just a bit buggy or doesn't work correctly. I suspect they wouldn't have variables like 'maxStepHeight' and separate 'step'-functions if ramps were meant to be used. I'm currently trying to edit the step-code, but so far I've not come up with a working solution.

-Trond
#3
12/03/2006 (9:52 am)
Maybe you have too much rise... do you know what the scale of the stairs are compared to the player? I use 13 steps to get up a single story and I don't ever have any problems.

www.fractureduniverse.com/screenshots/MoreBuildings/screenshot_004-00007.jpg
#4
12/03/2006 (10:06 am)
Hmm. About 10 steps. Have had problems earlier with not being able to step up sidewalks. Don't know if there may be some problems with the level itself then. It all looks allright though. However, the steps should be the same size, and as mentioned, the player's not getting stuck on every step, only now and then. Have tried to play with the maxStepHeight as well...

-Trond
#5
12/10/2006 (2:46 pm)
I too have noticed this on rare occasions. My project is a randomly generated maze of up to 343 rooms of doorways and steps/stairs. Once every 2 or 3 weeks of regular use, the "player" will become frozen on a stairway. He/she can turn and look in any direction but motion is no longer available. Must hit escape to exit completely and start again. Returning to the same "rogue" stairway, it requires a fair amount of dancing about but eventually the player again becomes stuck. I have taken the room back into Quark and made slight changes to the area ( stairway, walls, floor, ceiling opening ) but have been unable to track down the problem.

It seams to happen in 2 of the over 400 rooms in the game library and at present I have simply deleted them!