Paying for physics integration (character controller).

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Justei
Posts: 47
Joined: Fri Aug 20, 2010 11:20 am

Paying for physics integration (character controller).

Post by Justei »

Hello! I was wondering if anyone would like to help me and my friend add physics to our game, we already use irrBullet but it's not enough since we need to be able to walk up hills etc (were gonna use heightmaps for the game).

We can pay for the help but keep in mind were not rich lol, so if you can PM us with a offer/price then we would be very happy! Thanks!
(Oh we use Code::Blocks mingw for the code.)
Image
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Paying for physics integration (character controller).

Post by CuteAlien »

Ah yeah - hills are always tricky with pure physics solution. Usually you will do that different - make physics settings in a way you can walk everywhere - and then define walkable areas in an editor.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Justei
Posts: 47
Joined: Fri Aug 20, 2010 11:20 am

Re: Paying for physics integration (character controller).

Post by Justei »

CuteAlien wrote:Ah yeah - hills are always tricky with pure physics solution. Usually you will do that different - make physics settings in a way you can walk everywhere - and then define walkable areas in an editor.
Hmm, my thought atm is to make it so that I raycast in the direction the player is moving to get the height and then change the y coordinate accordingly...
Image
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Paying for physics integration (character controller).

Post by CuteAlien »

Bascially that's it, although people also often use box or sphere collisions (spheres are nicer at stairs). But depends on what kind of physics you use if that works. If you have for example a physic which has gravity you might slide down hills - which is depending on the game exaclty what you want or something you don't want at all.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Paying for physics integration (character controller).

Post by hendu »

No idea of irrbullet, but I recall the kinematic character controller could handle stairs fine. Is a hill not just smooth stairs?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Paying for physics integration (character controller).

Post by CuteAlien »

I don't know that character controller, so no idea how it is working.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Re: Paying for physics integration (character controller).

Post by devsh »

You could use a sphere with IMMENSE friction or basically make a VIRTUAL mech with two legs and a balancing weight which your software adds forces onto to balance the mech
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Paying for physics integration (character controller).

Post by Mel »

For hill climbing i do a raycast on the ground (with Newton, anyway...) to get the normal of the ground, and then, i perform a dot product with a vertical vector aiming to the positive Y axis (both normalized). The result of this is basically the cosine of the slope of the ground, meaning that 1 is a totally flat surface and 0 a wall. If the cosine is under a certain value (0.707 is the cosine of 45 degrees, and 0.5 is the cosine of 60 degrees of slope) you can stop walking, or start sliding down to a stable surface, with the stairs, on the other hand, there are more tricks, for instance,calculate if the surface of the next stair is high enough doing a raycast on the feet of the character, a, towards the moving direction, and check of there is a collision, if there isn't, it is safe to keep advancing. Then, you can perform another raycast to the ground to find the height, and place your character there. I don't know if it will work, but it is just a rough idea :)
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Justei
Posts: 47
Joined: Fri Aug 20, 2010 11:20 am

Re: Paying for physics integration (character controller).

Post by Justei »

Mel wrote:For hill climbing i do a raycast on the ground (with Newton, anyway...) to get the normal of the ground, and then, i perform a dot product with a vertical vector aiming to the positive Y axis (both normalized). The result of this is basically the cosine of the slope of the ground, meaning that 1 is a totally flat surface and 0 a wall. If the cosine is under a certain value (0.707 is the cosine of 45 degrees, and 0.5 is the cosine of 60 degrees of slope) you can stop walking, or start sliding down to a stable surface, with the stairs, on the other hand, there are more tricks, for instance,calculate if the surface of the next stair is high enough doing a raycast on the feet of the character, a, towards the moving direction, and check of there is a collision, if there isn't, it is safe to keep advancing. Then, you can perform another raycast to the ground to find the height, and place your character there. I don't know if it will work, but it is just a rough idea :)
Hmm, I was thinking along the same lines tbh, However I figured that one could add a invisible plane over the stairs so that it's techincally a ramp, don't think ppl would notice a THAT big difference if you do it nicely (however it would be a bit of cheating lol but w/e).
Image
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Paying for physics integration (character controller).

Post by serengeor »

Justei wrote:
Mel wrote:For hill climbing i do a raycast on the ground (with Newton, anyway...) to get the normal of the ground, and then, i perform a dot product with a vertical vector aiming to the positive Y axis (both normalized). The result of this is basically the cosine of the slope of the ground, meaning that 1 is a totally flat surface and 0 a wall. If the cosine is under a certain value (0.707 is the cosine of 45 degrees, and 0.5 is the cosine of 60 degrees of slope) you can stop walking, or start sliding down to a stable surface, with the stairs, on the other hand, there are more tricks, for instance,calculate if the surface of the next stair is high enough doing a raycast on the feet of the character, a, towards the moving direction, and check of there is a collision, if there isn't, it is safe to keep advancing. Then, you can perform another raycast to the ground to find the height, and place your character there. I don't know if it will work, but it is just a rough idea :)
Hmm, I was thinking along the same lines tbh, However I figured that one could add a invisible plane over the stairs so that it's techincally a ramp, don't think ppl would notice a THAT big difference if you do it nicely (however it would be a bit of cheating lol but w/e).
I don't think that is really a good solution, because every single thing that pops up a bit should have a plane near it and it would be a pain in the a** for mappers. Also imagine small rock like thing or just small box is on the ground, you would have to make planes from all directions for it.
I'd stick with the ray cast solution.
Working on game: Marrbles (Currently stopped).
Justei
Posts: 47
Joined: Fri Aug 20, 2010 11:20 am

Re: Paying for physics integration (character controller).

Post by Justei »

serengeor wrote:
Justei wrote:
Mel wrote:For hill climbing i do a raycast on the ground (with Newton, anyway...) to get the normal of the ground, and then, i perform a dot product with a vertical vector aiming to the positive Y axis (both normalized). The result of this is basically the cosine of the slope of the ground, meaning that 1 is a totally flat surface and 0 a wall. If the cosine is under a certain value (0.707 is the cosine of 45 degrees, and 0.5 is the cosine of 60 degrees of slope) you can stop walking, or start sliding down to a stable surface, with the stairs, on the other hand, there are more tricks, for instance,calculate if the surface of the next stair is high enough doing a raycast on the feet of the character, a, towards the moving direction, and check of there is a collision, if there isn't, it is safe to keep advancing. Then, you can perform another raycast to the ground to find the height, and place your character there. I don't know if it will work, but it is just a rough idea :)
Hmm, I was thinking along the same lines tbh, However I figured that one could add a invisible plane over the stairs so that it's techincally a ramp, don't think ppl would notice a THAT big difference if you do it nicely (however it would be a bit of cheating lol but w/e).
I don't think that is really a good solution, because every single thing that pops up a bit should have a plane near it and it would be a pain in the a** for mappers. Also imagine small rock like thing or just small box is on the ground, you would have to make planes from all directions for it.
I'd stick with the ray cast solution.
Nono I didn't mean like that, I meant JUST for stairs, I would still use raycasting, was mostly thinking since stairs are like small walls as well it could be a problem.
Image
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Re: Paying for physics integration (character controller).

Post by cobra »

Justei already knows and uses this, but just for the record:

I recently added the kinematic character controller to irrBullet.

It's only available from the SVN currently.
Josiah Hartzell
Image
ScreenOfDeath
Posts: 21
Joined: Thu Dec 22, 2011 11:16 am
Location: Germany - NRW

Re: Paying for physics integration (character controller).

Post by ScreenOfDeath »

Hi,

pls look at my thread:

I want to help you! ( Programm in a team ) - http://irrlicht.sourceforge.net/forum/v ... =1&t=45482

There I´m offering ( for nothing but the experience to be in a team and to programm with you ) my help.

I´m using PhysX ( Nvidias Physic engine ) for my game.

But, pls look at these, there are more information about it.

( And here is another thread by me , included video of my ( very alpha state ) game - which displayed a Irrlicht - shadow errors !)
http://irrlicht.sourceforge.net/forum/v ... =4&t=45492

I´m really looking forward to hear from you.



Best regards,

Christoph
I´m from germany ^^ So, if you find some errors , you can keep it!
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Re: Paying for physics integration (character controller).

Post by devsh »

i believe I did your video playing...

I think I could play around with bullet to get your character controller done... but can I get a small cut out of your project with bullet already set up so I didn't have to try to compile your ENTIRE game on linux?
ScreenOfDeath
Posts: 21
Joined: Thu Dec 22, 2011 11:16 am
Location: Germany - NRW

Re: Paying for physics integration (character controller).

Post by ScreenOfDeath »

Hi devsh,

I dont know if you are talking to me, but I dont need help by coding a character controller ... and I´m using PhysX.

I think you arent talked to me, are you?
I´m from germany ^^ So, if you find some errors , you can keep it!
Post Reply