Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
TheZag
16
Years of Service
User Offline
Joined: 11th Feb 2008
Location: Milan Italy
Posted: 13th Mar 2008 16:44
About

phy make box character controller a#, b#, c#, d#, ...

What is exactly means "size on X/Y/Z axis" ?
It's not clear for me.
Dewi Morgan
16
Years of Service
User Offline
Joined: 16th Jan 2008
Location: London, UK
Posted: 14th Mar 2008 22:45
"phy make box character controller ID, x#, y#, z#, size x#, size y#, size z#, up, step#, slope limit#"

This command makes an INVISIBLE box around the player, that woll control collision.
I will explain all the arguments.


"ID - identification number of the character controller, these ID numbers are unique to character controllers"

I just use the character object id number for this.


"x#/y#/z# - position of the character controller"

These three numbers say where the character controller is in the world.


"size x#/size y#/size z# - size of the character controller on the Z axis"

This is the bit you were asking about.

Supposedly, it is how wide (size x#), tall (size y#), and deep (size z#) the invisible box will be.

But... it's not! If you try to make a character-controller-box that is the same size as your character's object, you will get a controller-box that is MUCH bigger.

Why? I think it's because of the "skin width", which is apparently really quite big for the character controller.

The file:
C:\Program Files\The Game Creators\DBPro\Projects\Dark Physics\Documentation\Information.chm
explains "Skin width" in more detail (that's where I have it saved, you may have it elsewhere).

But basically, it means that the box is bigger than you tell it to be, which can cause you to get pushed down through the floor if you have a low ceiling.

To find out how big you really want the box to be, use the debugger, from:
Windows "Start" menu -> "Programs" -> "The Game creators" -> "Expansion Packs" -> "Dark Physics" -> "Tools" -> "Debugger".

Then in your code put "phy enable debug" just BEFORE "phy start", and when you run your program, you should see the character controller in the debugger. Change the size until you have a size you are happy with.


"up - which axis is pointing upwards"

I always make this 1.


"step# - if the height of an obstacle is less than the step# value then the character controller can step over it"

I make this a power of 2, because it makes map design much easier.


"slope limit# - defines the limit for moving on polygons in degrees"

I go for something steeper than 45 degrees... 50 or more.

Yet another programmer - http://www.thudgame.com/mmo
All my posts are Public Domain unless I say otherwise.
You may use all my code and ideas as you see fit.
TheZag
16
Years of Service
User Offline
Joined: 11th Feb 2008
Location: Milan Italy
Posted: 20th Mar 2008 00:49
Wow! Really thanks. Now is more clear, very clear.
I also understand while playing the code I always have the camera floating slowing down... passing the ground.

Thanks a lot!

I still have some doubts about how to force the object to stay on the ground... If a turn the camera up, the object goes like flying... And i don't find the right pages on the books for it.

Login to post a reply

Server time is: 2024-05-19 22:43:53
Your offset time is: 2024-05-19 22:43:53