About Store Forum Documentation Contact



Post Reply 
[SOLVED] Character Controller and Step Height
Author Message
Pixel Perfect Offline
Member

Post: #1
[SOLVED] Character Controller and Step Height
I'm having some issues with climbing steps in my game level.

Does anyone know what the default step height of the character controller is and is there any way to change it?

Steps of only 0.3m (1 ft) in height seem to present issues with the CC unable to climb them. See picture below. The physics shape has a ramp over the bulk of the steps but this initial step height seems too much for it. If I lower the step to 0.2m or so it's ok and climbs it.

   
(This post was last modified: 04-06-2014 12:05 AM by Pixel Perfect.)
01-03-2014 07:09 PM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #2
RE: Character Controller and Step Height
Hmmm ... no suggestions! I've never had an issue with these steps with any other physics engine/Character Controller and I'm a little surprised that the controller can't climb that initial step.

I've modified the steps now (lowered them) so this particular issue is sorted but I'm sure I'm going to run into other issues if it can't climb a step of this height!

I've not had a chance to play with mass yet as I've been busy with coding other things, maybe that will help ... is it just a lack of momentum or is there a definite step height restriction above which it's never going to climb by design?

Any help\advice gratefully accepted smile
01-05-2014 02:21 AM
Find all posts by this user Quote this message in a reply
Dwight Offline
Member

Post: #3
RE: Character Controller and Step Height
The legal requirements for stairs: 7 3/4" (~20 cm).
01-05-2014 12:36 PM
Find all posts by this user Quote this message in a reply
para Offline
Member

Post: #4
RE: Character Controller and Step Height
Hmm.. the controller should climb 0.3m high stairs easily. Try adding these test stairs and see:

.zip  stairs-step-test.zip (Size: 7.53 KB / Downloads: 7)
They are sized 0.35m, 0.3m, 0.2m.. I have no trouble stepping over all of them with the default Chr controller.

The source of the issue in this case is most probably the topology of the stairs mesh.. Or it might be coming from the stair-into-ramp shape setup you have - I don't think I've seen it done this way before, any particular reason?

-edit:
For modifying the step height itself, it seems it is set within the Controller class, which doesn't have any public methods or members affecting it, nor are there any sources available like for game object classes. So I think the best bet would be a feature request... IMO, basic stuff like this should be exposed anyway, it makes the built-in classes much more flexible...
(This post was last modified: 01-05-2014 12:59 PM by para.)
01-05-2014 12:44 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #5
RE: Character Controller and Step Height
(01-05-2014 12:36 PM)Dwight Wrote:  The legal requirements for stairs: 7 3/4" (~20 cm).
lol ... I don't think that was in place in medieval times grin

I'm not expecting it to climb huge objects but games set in older times will reflect stairs typical of the times. Clearly the majority of adults are able to step onto items higher than this (not just restricted to stairs) with ease!

(01-05-2014 12:44 PM)para Wrote:  Hmm.. the controller should climb 0.3m high stairs easily. Try adding these test stairs and see:

They are sized 0.35m, 0.3m, 0.2m.. I have no trouble stepping over all of them with the default Chr controller.
Cheers Para, I'll give those a try. It's come as a surprise as I've never had an issue with these particular stairs before.

(01-05-2014 12:44 PM)para Wrote:  The source of the issue in this case is most probably the topology of the stairs mesh.. Or it might be coming from the stair-into-ramp shape setup you have - I don't think I've seen it done this way before, any particular reason?
Simply because the controller failed to climb the stairs using the initial static mesh. Thought I'd try a ramp as an experiment to see if that improved the situation although ideally I don't want a ramp (they never look very realistic).

(01-05-2014 12:44 PM)para Wrote:  For modifying the step height itself, it seems it is set within the Controller class, which doesn't have any public methods or members affecting it, nor are there any sources available like for game object classes. So I think the best bet would be a feature request... IMO, basic stuff like this should be exposed anyway, it makes the built-in classes much more flexible...
Quite, I'd checked before posting but hadn't found anything but thought it was worth asking in case I'd missed something somewhere.

Thanks for your help. I'll try your stairs as a comparison and see if its actually an issue with the geometry of my stairs as opposed to having hit an internally coded limit which your comments suggest not smile
01-05-2014 01:48 PM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #6
RE: Character Controller and Step Height
hmm ... interesting, I can still only walk up the 0.2 steps, both of the others left the controller stuck at the first step!

   

I'm not using the standard chr class but my own class based on game:obj which borrows from the chr class. Guess I need to review my code.

Have been doing a lot with EKI One recently Para and have run into a few issues which I'll forward on to you. Not show stoppers fortunately ... I have come up with workarounds for both. Real shame it's not still being developed though as it would have been nicer to have the bugs fixed!
01-05-2014 03:50 PM
Find all posts by this user Quote this message in a reply
para Offline
Member

Post: #7
RE: Character Controller and Step Height
Hmm, that's very strange,... before reviewing your code, try those stairs in one of the tutorials with a character controller... or maybe the capsule/character size dictates step height or something like that?
01-05-2014 04:34 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
RE: Character Controller and Step Height
I think that Controller radius affects the step height
I'll check if I can add a separate parameter for step height
01-09-2014 04:50 AM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #9
RE: Character Controller and Step Height
Thanks Greg, a separate parameter would make life a lot easier smile
01-09-2014 08:30 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #10
RE: Character Controller and Step Height
Hi,

next release will have:
-added new 'Controller.step_height' member (by default set to controller radius) allowing to manually control max controller step height

But you still may need to set custom actor group (Actor.group) for the stairs, and include that group index in the "Physics.ctrl_ground_group_force" (to ignore collision normal vectors)
01-09-2014 09:38 AM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #11
RE: Character Controller and Step Height
That sounds great and thanks for the additional info smile
01-09-2014 10:39 AM
Find all posts by this user Quote this message in a reply
Kiekos Offline
Member

Post: #12
RE: Character Controller and Step Height
@Pixel Perfect, for some reason I'm not able to send you a PM so I'm forced to post this here (maybe a little off-topic).

How do I make capsules, boxes and white wires visible in-game? I only know about Renderer.wire() and cannot find anything else to make those happen...
01-22-2014 11:58 AM
Find all posts by this user Quote this message in a reply
KraaxLeNain Offline
Member

Post: #13
RE: Character Controller and Step Height
Normally you have this feature all packed in already. When you push the caps lock all this should appear.

If you don't have the feature the key is to use physics draws.

This is what I have in the DrawGame Function, should give you what you want :
Code:
if(Kb.b(KB_CAPS) && (!Gui.kb() || Gui.kb().type()!=GO_TEXTLINE))
   {
      if(Renderer.rebuildDepthNeededForDebugDrawing())Renderer.rebuildDepth();
      Physics.draw();
   }
(This post was last modified: 01-22-2014 01:48 PM by KraaxLeNain.)
01-22-2014 01:47 PM
Find all posts by this user Quote this message in a reply
Kiekos Offline
Member

Post: #14
RE: Character Controller and Step Height
I don't have that yet so thanks a lot! Perfect, that'll help a lot smile
01-22-2014 02:46 PM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #15
RE: Character Controller and Step Height
(01-09-2014 09:38 AM)Esenthel Wrote:  Hi,

next release will have:
-added new 'Controller.step_height' member (by default set to controller radius) allowing to manually control max controller step height

But you still may need to set custom actor group (Actor.group) for
I have ignored this until now as I'd been concentrating on AI development. However, I'd got to the point where I couldn't anymore as my agents were having issues walking up stairs in buildings which was restricting my ability to test the AI.

I'm convinced there is nothing wrong with my code as I can reproduce this in the 'world with character' example if I place the steps in the level and reduce the radius of the capsule to be similar to mine.

Increasing the step-height seemingly makes no difference but I have found that if I reduce the Physics.ctrl_ground_slope to zero then they climb all the steps, just not sure what other repercussions there might be to doing this!

Greg, I'm not sure I understand your reference above to setting a custom actor group for the stairs, and include that group index in the "Physics.ctrl_ground_group_force" (to ignore collision normal vectors). Do slopes come into play even when they are on objects below the currently set step height? If you, or anyone else, could just explain this in a bit more detail I'd appreciate it as I want to ensure I get this right.

Thanks smile
03-26-2014 11:43 PM
Find all posts by this user Quote this message in a reply
Post Reply