Character Controller for NPC

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Character Controller for NPC

Postby mauro78 » Sat Apr 03, 2010 1:36 pm

Hi All!
I'm just wondering what is the best way to use Newton as a physic layer for Non Playable Character (NPC) ; right now I use newton for:

    collision tree for the level
    rigid bodies for objects inside the level
    a player controller for the playable character (User Controlled)
    a CustomKinematicController for doors, elevators, ecc...

but for NPC like enemies what is the best controller to use? a charachter controller or a custom kinematic controller?

I just need to implement a simple seek behaviour , where enemies always look for the primary player (User Controlled) and seek it.

Regards
mauro78
 
Posts: 13
Joined: Mon Feb 16, 2009 5:40 pm

Re: Character Controller for NPC

Postby mauro78 » Sun Apr 04, 2010 1:32 pm

I've decided to use a modified version of PlayerController class (CustomKinematicController was difficult to use with NPC); obviously the NPC character's are not driven by keyboard but I use steering behaviour to control them.

I'll post results and maybe a video later...
mauro78
 
Posts: 13
Joined: Mon Feb 16, 2009 5:40 pm

Re: Character Controller for NPC

Postby Julio Jerez » Sun Apr 04, 2010 2:53 pm

you only need to thanslate the Steering bahavoir to speed, and direction. I do not see how that prevents the current player controller from being use for NPC players.
Basically the hard part of the NPC is not how to drive it but how to Get the Path and is out the scope of the Physics engine.
But if you get it that is good too. I look forward to see the video.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Character Controller for NPC

Postby mauro78 » Mon Apr 05, 2010 1:20 pm

well Julio I've just "slighty" modified the PlayerController class code just to remove input from keyboard; but PlayerController works great.

Some videos:

http://www.vimeo.com/10695164
http://www.vimeo.com/10695979


First Video: 3 NPC with just a simple level, the AI NPC just seek for "my" position; they've different speed.
Second Video: 1 NPC with a complex level with collision tree; in this complex environment a "obstacle avoidance" or "pathfinding" must be used to avoid NPC "stalling"; but overall the "NPC Controller" works great in collisions terms.

I've also placed an skinned mesh inside capsule (orienting it correctly) and the overall results are not bad.

Like you said now It's time to implement "PathFind", but I'm happy that I can use Newton as "Physics Layer" under the AI.

Cheers, Mauro
mauro78
 
Posts: 13
Joined: Mon Feb 16, 2009 5:40 pm

Re: Character Controller for NPC

Postby Julio Jerez » Mon Apr 05, 2010 1:31 pm

Hey that is not bad.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Character Controller for NPC

Postby mauro78 » Mon Apr 05, 2010 1:40 pm

Julio Jerez wrote:Hey that is not bad.

Thanks Julio!

Sorry for bad quality, the level is just a demo of an old build without textures and without HUD active. We're using Newton 2.x as a physics layer

Regards
mauro78
 
Posts: 13
Joined: Mon Feb 16, 2009 5:40 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests