Status on the Player Controller

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Status on the Player Controller

Postby Spek » Mon Jan 16, 2012 6:48 pm

Wanting to use the PlayerController. But AFAIK, there are/were some issues... I have to admit I only checked the Newton 2.33 demo so far, but before changing code in my engine, I like to make sure if the following things are fixed, or soon-to-be-fixed:

1: Apply external forces (jump, blow away, explosion, ...) on a character
2: Interaction with other objects (bump over a box stack)
3: Collide with other characters (readed here and there that it would cause strange reactions)
4: Interaction with trigger volumes. In version 2.32, compound objects collide with trigger volumes, so just checking.
5: Can it be used for non-standard movement as well somehow (swimming, climbing a ladder, take an elevator, ... )

Is this all posible, or when will it be fixed? And, is there maybe a newer demo coming soon (or already available somewhere)?

Thanks
Spek
 
Posts: 66
Joined: Sat Oct 04, 2008 8:54 am

Re: Status on the Player Controller

Postby Julio Jerez » Tue Jan 17, 2012 8:06 am

a character controller is more a problem of Game logic/ai than it is physics. Physic provide the core collision and interaction with the physics world but it can no provide game intelligence.
Any attend to do that is a futile effort.
The basic functionality is already in the joint, I made the mistake to add the logic to it. but I realized that the problem is difficult because it is a shot gun wedding between water and oil.
Basically the player logic is a state machine, and the moment I do that, It becomes very difficult to get the consensus of form end user about what the player should do
The solution for that in Newton 300 is that the basic functionality will be there: move, jump, crouch etc
Bu the will not be relate to each other, instead there will be a high level player controller that will have player that will control the player logic.
for that I will use an new Tool introduce with Newton core 300, Newton AI.
Basically a player the logic of player controller is be done with a state machine an no inside the joint itself.
The play physics is done, it is the controller build into the joint that is no very good. Newton AI will fix that.
This pattern will be use a lot for other complex joint in Newton 300, the one I am doing now is the Vehicle which is at the very early stage still.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Status on the Player Controller

Postby Spek » Tue Jan 17, 2012 8:19 am

Yeah I guess controlling a player differs for each game. Making it a general capable-of-everything joint is near to impossible.

But ok, Newton3 should have that improved? Then my next question is... when Will Newton3 become available?
Is it a lot different compared to Newton2.xx? I'm using Delphi so always a bit behind when it comes to headers and such.

Greets
Spek
 
Posts: 66
Joined: Sat Oct 04, 2008 8:54 am

Re: Status on the Player Controller

Postby Julio Jerez » Tue Jan 17, 2012 12:21 pm

well Core 300 is in svn, you can download it an try it out.
core 300 is a drop in for core 200, but one you start using new functionality you can no go back.

On player controller, if you want I can start the demo and get it going, basically I work on stuff on demand.
since I do not have anyone else doing anything at all and the engine has ground big now.
for me the only way to maintain the engine is that stuff has to be robust the first time.

anyway core 300 has some new powerful feature that I will use wit the p[layer controller.
also the player controller will be different than all previous version of the engine.

basically people makes player controllers and they work in a contrive collision state.
this is the let the player collide in order to do anything.

Newton 300 closest distance now work on all collision shapes.
so this function will be use to get the object in proximity and have the control take action before it hit a wall.

this allow for smart controllers than can take action base of what they "see" not on what they "hit"
a typical example is for example dealing with ramps and steps.
basically setting a step high, or a max ramp is and abominations. because no matter how you set those parameters, there will be always an edge case where the test will fail.

if instead the player can sense with some distance when lays ahead the AI can make preparation for that, say for example the play is walking and you it see a single step.

the player receives this input, and the AI can now investigate of the step is a single step of a ladder of multiples steps.
If the environment determine it is a single step, he can decide a sequence of state change to take a single step. like play the step animation, etc

if the result of the queries determine is a stair or a ladder, he will do some different, but the action will be possible because the controller will be aware of then in advance..
right now for example if the step was a ladder change are that the code will receive a wall instead of a step.

there are ton of enhancement that this will bring to the controller, but the more important are easy to use, sine the logic will be in a state machine, so the end user will simple write new states, or
extend existing stated. and more reliability since the player will not operate in contingency recover after a perpetual collision.

another functionality is that player can be connected to other AI agents in et world, inclding paths, oteh players, navigation maps, ect.

for example right now when the player hit a rigid node in the world what is does is a moronic push by send an impulse, that always bother me,
new the interaction can be different depending of what the player hit.

Say for example the hit a gravity object. if he has a state for gravity objects he will do whatever that state determine. maybe step, may push, you name it will be simple adding a new state.

but say he is going to hit another player. he may no know what to do because he do no has that state
however the other object is and AI agent too, and the object may have a state then react to a player.

this is a very powerful functionality because it distribute the logic on the object in the environment and no in the players.
for example say you have a door, you can assign an AI agent to it with some states, like door open door closed, door jam etc.
the door do not anything else, say the play con close to the door.
now the tow Agent are linked with a very mush the same way rigid bodied are connected by joint.

now the door update send a single to the player, the player agent can process that signal and he can decide to either respond with open or close.
he can start playing he animation. and the door can start play his animation. even if tow or tree player are close at the same time the logic still work.
because all player receives the same signal, and the door receive multiple signals but the state decided what to do. you can place that door anywhere.
change the door logic will not change the way the play interact with it. The same apply for different objects, ex a Take cover block than when the play is close
allow the player to react to attack and also attack, etc.

anyway my plan is to make smart AIO agents not dummy player controllers.

if you like we can make the first demo.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Status on the Player Controller

Postby Spek » Tue Jan 17, 2012 2:31 pm

Cool, I'll try to download & use it, though it probably takes some time to get the Pascal/Delphi headers updated. Unless someone already did that?

>> if you want I can start the demo and get it going,
That would be very nice! I'm not a Newton expert, so demo's always help doing things in the right way.

>> Newton 300 closest distance now work on all collision shapes.
>> if instead the player can sense with some distance when lays ahead the AI can make preparation for that,

That's useful for animations and IK stuff. But also to hit the breaks eventually, preventing characters falling from falling down.

I already made sort of a state machine that checked wether the player is on the ground, falling, or hitting a stairstep by sending raycasts around the character to "sense" the environment. Never got it finished or properly working though. When doing 1 or 2 raycasts to check where your feet are going still can miss a lot.

Anyway, if that's built-in properly, that will surely make a very nice addition.


>> if you like we can make the first demo.
I'm very busy with Tower22, plus I don't know a whole lot about Newton... And it will be a Delphi demo then :) But what I can do is just trying to implement the character controller in our game, and report it "tutorial style" on the T22 blog. Thus one or more posts with code examples & pictures... At least, if you can help me on my way a bit :D It would come in handy, as an eventual next T22 demo has typical game movements:
- Interfacing with objects
- Doors
- Ladder
- Stairs
- Jump (and eventually grab a rope)
- Push an object
So that makes a good testcase. The planning is to have that demo finished somewhere half 2012 (though in practice things usually take a bit longer). So there is no real rush, but implementing character physics is certainly on the planning next months.
Spek
 
Posts: 66
Joined: Sat Oct 04, 2008 8:54 am

Re: Status on the Player Controller

Postby Julio Jerez » Wed Jan 18, 2012 2:44 am

wow I click on the link, That an imprsive video yo ugot there. that codul be an intersting cae to try a player controller with th eidea i mention before.
I will start the demo these weekend. there are two request for the controller now so I better clean up the demo.

I will have to separate code 300 fopr core 200 since now the new tool libraries star to us the new funtionality and the moment I do that they wil drift apart.
I will make a new archive in svn for core 300 separated form core 200.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Status on the Player Controller

Postby Spek » Wed Jan 18, 2012 3:44 am

Excellent!

That gives me a bit time to switch over to Newton 3 as well. That probably takes some week(s), but maybe Sascha Willems can help advising a bit as well. I send him mails with Newton questions for T22 now and then.

Ok, I start with the switch-over somewhere this week. Could you give me a sign when the demo is ready, or whenever something else important has changed? If you like, you can contact me via: rick AT tower22game DOT com


No idea how long it will take to get it (properly) implemented. The demo maps yet have to be made, as well as a better looking player model. But as usual I'll report the progress on the blog. And once I can write something useful about the character implementation, I make one or more tutorials with code on the blog and let you know if you like.

Thanks
Spek
 
Posts: 66
Joined: Sat Oct 04, 2008 8:54 am

Re: Status on the Player Controller

Postby Spek » Wed Jan 18, 2012 10:21 am

Oh... stupid question maybe... but where can I find Newton 3? Tried to search "Newton" on Sourceforce, but that didn't gave my anything.
Spek
 
Posts: 66
Joined: Sat Oct 04, 2008 8:54 am

Re: Status on the Player Controller

Postby Sweenie » Wed Jan 18, 2012 10:28 am

Easiest would be to download the TortoiseSVN client.
Then create a folder somewhere and rightclick on it at choise 'SVN Checkout'.
Under Url of repository enter http://newton-dynamics.googlecode.com/svn/trunk/
After that Tortoise should download all sourcecode for Newton 2.33 and 3.00 into your folder.
Sweenie
 
Posts: 503
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Status on the Player Controller

Postby Spek » Wed Jan 18, 2012 11:43 am

Thanks, that worked like a charm!
Yet another issue though... where are the DLL files? I can build the 4 core300 projects in VS2008, but that does not create DLL files (only LIB). I'm not really familiar with C++ & DLL's so if someone can hold my hand one more time?
Spek
 
Posts: 66
Joined: Sat Oct 04, 2008 8:54 am

Re: Status on the Player Controller

Postby Sweenie » Wed Jan 18, 2012 11:48 am

Check under packages\win32\releaseDLL(or debugDLL)
Sweenie
 
Posts: 503
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Status on the Player Controller

Postby Spek » Wed Jan 18, 2012 12:01 pm

Ah, I had to toggle the VS "Active configuration" to "releaseDLL|WinXX". Thanks again!
Spek
 
Posts: 66
Joined: Sat Oct 04, 2008 8:54 am

Re: Status on the Player Controller

Postby Julio Jerez » Wed Jan 18, 2012 12:46 pm

I start to add the player controller already.

The controller estrategy now is a "walk and shew gum at teh same time" kind of controller.

The base lass in in the dAILibrary library.
Bascially the way it will work is that teh Player si an AI Agen where teh AI or the Playe will send intrution fo eth controll to execute.

In intenally teh controller will have many autmatioca system with are all inpendent AI agent with stated machine simulat to when the Brain of a Mamal .
Thsi systej are cordinate by teh Main agan whi a\ct as the intelengt part for the Brain.

for exampel the brain can say I wna to walk, and it will walk, but it will no do so in a stupid way teh Locmotion Agen will wal and check for collision or any oeteh even that requred in\strution form the main Agen.
when the lomotion find such an event, it will ask teh main agen wha to do.
some action will can be handle by the lomotion system without tellin the brain what to do, for exampl goin on a small slowpe o fteak small step.
an Big uptacle will definfy be notofied for action, but unti new intrution it will try to do teh best it can.

the base call will only have locomition and the main AI agent action and a enveriment sensor and coordination the function of the lomomotion system, will execute.
the end user can add more subsystem, for example say you have a player that uses weapon to attack other players.
these a new susbsystems can be added to controll diffrent aspect of the player, and the main brain will cordinate then,
for example say you have fire Pistol, fire with sword or a machine gun, etc.
The brain knows all the stuff that every sub system can do but it does not micromanage how the subsystem will do then, it will simply tells the subsytem do this action now.
by doin this all teh subsyetms will work together wothout knowing they are working in cooporation with othe system.
They will all work competives and cooperative (Carl Sagan) to achibe a goal.

example say the player wants to attack with a pistol he send the signal attack with Pistol. The upper body will do all it needs to do to to attack with pistol.
teh brin will also tell the lomotion in waht way it want to wlak, if the walk with pistol is diffent the what withot pistol.

so basically the way the smart controller will be acomplished is by having the brain of the Controller (teh roo Agent) be in mutiples states at the same time.

a typical example can be teh lomotion system having an IK foot loacking for walking on uneven terrain.

The brain simpel tell teh system walk, teh lomotion system sence that is on a terrain system so it move to teh Stare with IK that modifi all teh bodie part to do that.
but if teh enveroment is a flat terrain it will go to teh state tha do a IK desigen for adjustin fook on flat tarrain.
mean whiel teh main Brain is goin aboput it busessne of deall with the Game logic, the enviroment, and what not.

This is what the demo will do.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Status on the Player Controller

Postby Spek » Wed Jan 18, 2012 6:27 pm

I think I get it,setting up a (custom) state machine and have Newton signalling it.
It sounds a bit like the stuff I had (unfinished) before in the game. A humanoid for example would have 2 state machines; 1 for the lower body (movement) and another 1 for the upper body (looking around, interfacing, action). Then both would be subdivided in many states. Depending if the legs are on a solid floor, water, falling, et cetera.

The transitions between states would be caused by game events (getting hurt, activate a special item, press a certain button, etc.) and what Newton "sees" around the player. In my case I use raycasting and Newton Trigger volumes in the environment maps to make water-beds, ladders, hazardous areas, teleporters, conveyor belts, AI info nodes, and so on.


Anyway, sounds like the AI agent can mix perfectly with that. Got to see how it works of course. But first I have to switch over to Newton3. Got some weird behavior, but that might be due incorrect headers (using Delphi here). I saw some functions were added/changed/removed. Is there an overview of changed header functions somewhere maybe?
Spek
 
Posts: 66
Joined: Sat Oct 04, 2008 8:54 am

Re: Status on the Player Controller

Postby Spek » Thu Jan 19, 2012 7:03 pm

Got the physics switched over to Newton3 and working a bit now. So next step is to add the AI functions from the DLL.

But before I go there, one "bug" (or I'm doing something wrong) remained: TriggerVolumes.
In Newton 2.33, if I set something to a triggervolume with
NewtonCollisionSetAsTriggerVolume( nCollider, 1 );

Objects would intersect the volume without getting stopped, but nicely did a contact callback. EXCEPT compound objects. They just collides on the volume as if was solid.


Now with Newton3, compound objects still bounce off, but others made of a single convex hull fall through WITHOUT making contact callbacks... Is this is a bug, or am I doing something wrong? Getting TriggerVolumes is pretty important for the AI in my case, as I use it to help the AI agents to get their interface options (swim here, climb there, dangerous, et cetera). Plus I'm also using it for making water-beds that trigger bouyancy and such...
Spek
 
Posts: 66
Joined: Sat Oct 04, 2008 8:54 am

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest