Character Controller

General discussion around Urho3D.

Re: Character Controller

PostPosted by JamesK89 » 05 Nov 2015, 00:21

Oh dear what can of worms have I opened?
User avatar
JamesK89
New user
New user
 
Posts: 15
Joined: 03 Feb 2015, 05:50
Location: North Carolina, USA

Re: Character Controller

PostPosted by weitjong » 05 Nov 2015, 01:13

JamesK89 wrote:Oh dear what can of worms have I opened?

No worry. So far, the gentlemen in this thread are well behaved. I will be watching you ;)
YaoWT - Leave no window unbroken ♪ (^。^) 
User avatar
weitjong
Contributor
Contributor
 
Posts: 1094
Joined: 16 Jan 2014, 15:34
Location: Singapore, 新加坡

Re: Character Controller

PostPosted by Bananaft » 05 Nov 2015, 09:40

Enhex wrote:
Zaroio wrote:To cimb a stair user a Kinematic Body and and a leg (raycast downward). Use a Kinematic Body, it will give you more controll



Raycasting will fail to detect ground if the character stands above a gap, or when you don't stand directly above the higher platform. It has to be a sweep test or a ghost object.


Or more raycasts, like Lemma did: http://etodd.io/2015/04/03/poor-mans-ch ... ontroller/

Image
User avatar
Bananaft
Active user
Active user
 
Posts: 154
Joined: 26 Nov 2014, 21:53

Re: Character Controller

PostPosted by Dave82 » 05 Nov 2015, 09:45

I still can't get why is everyone against my sphere cast solution ? :D
Infested : An old school puzzle solving survival horror game :
topic1430.html

Infested Facebook page
https://www.facebook.com/infestedgame
User avatar
Dave82
Active user
Active user
 
Posts: 136
Joined: 11 May 2015, 18:08

Re: Character Controller

PostPosted by Enhex » 05 Nov 2015, 15:19

Bananaft wrote:Or more raycasts, like Lemma did: http://etodd.io/2015/04/03/poor-mans-ch ... ontroller/

Image


You're just bolting hacks upon hacks.
It will always break when you only have ground where there's no raycasts, and unless you're going to do infinite raycasts it isn't going to cover all cases.
Insisting on not learning more advanced concepts has no advantages, just learn how to use sweep tests or ghost objects (AKA trigger in urho).



Dave82 wrote:I still can't get why is everyone against my sphere cast solution ? :D

Sphere cast is the same as a sweep test. It's fine when you're using capsule/sphere body because it's a specific shape.

Basically it's adding "leg extra length" at the bottom of the body and staying "step up when something touches the leg at bottom of the body".
You can do the same by using a trigger body and getting the highest contact point.
This method could actually work if you don't have low ceilings (Unless there are more failure cases I didn't think about):
Image

That also means that you can't reuse the body for hit detection, in an shooter game for example, because the rigid body hovers over the ground. So an additional body is required.

Advanced character controllers are difficult! And you ain't gonna top John Carmack's Quake method that easily ;) (which isn't general enough to handle Bullet's collision margin roundness which makes it even more difficult)
User avatar
Enhex
Most active user
Most active user
 
Posts: 325
Joined: 31 Dec 2014, 12:23

Re: Character Controller

PostPosted by Enhex » 19 Dec 2015, 12:00

Actually if the leg is a spring, this could work since the body will end up in a crouching position.
User avatar
Enhex
Most active user
Most active user
 
Posts: 325
Joined: 31 Dec 2014, 12:23

Re: Character Controller

PostPosted by Zaroio » 19 Dec 2015, 12:57

Enhex wrote:Actually if the leg is a spring, this could work since the body will end up in a crouching position.


Yes it does works. I've implemented it on Godot.
Last edited by Zaroio on 19 Dec 2015, 18:59, edited 1 time in total.
User avatar
Zaroio
New user
New user
 
Posts: 5
Joined: 12 Oct 2014, 16:10

Re: Character Controller

PostPosted by JamesK89 » 19 Dec 2015, 18:11

Enhex that is quite a genius idea!

I seem to recall a post-mortem for Call of Juarez where one of the developers described representing the player as a capsule overlapping with a sphere where the sphere would roll around according to player input with its angular velocity set to zero each physics frame.

I thought that article was on Gamasutra but I can't find it there, maybe it was in one of books somewhere.
User avatar
JamesK89
New user
New user
 
Posts: 15
Joined: 03 Feb 2015, 05:50
Location: North Carolina, USA

Re: Character Controller

PostPosted by bvanevery » 20 Dec 2015, 06:30

Do I understand from this that a "mountain goat demo" would be really compelling? Something that simply walks on uneven procedurally generated surfaces no problemo? AKA the "stumbling Roman legions in the rough" problem.
User avatar
bvanevery
Some active
Some active
 
Posts: 50
Joined: 16 Aug 2015, 05:59

Re: Character Controller

PostPosted by JamesK89 » 21 Dec 2015, 20:19

Here is a novel approach from an excerpt in the book, which I highly recommend; Game Coding Complete Third Edition on Page 538:
Image


It seems like it would work for a variety of environments. The purposed character hull looks like a Bacteriophage virus to me.
User avatar
JamesK89
New user
New user
 
Posts: 15
Joined: 03 Feb 2015, 05:50
Location: North Carolina, USA

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests