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.

Dark Physics & Dark A.I. & Dark Dynamix / Need better character controller commands

Author
Message
Chenak
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 5th Sep 2006 14:28
At the moment, character controllers are very bad, the commands that are used to control its movement are... well totally pointless. They are over complicated for what they need to do. I mean... displacement... what? It's just silly.

I thought the idea of character controllers was to make placing a character in your game a simple task, well at the moment they just are not, in fact it would be easier to build your own character collision using DP's raycasting.

All it needs is equivalent of position object xyz and move object up,down,left,right. Please do not try to carry on with the displacement thing, It cannot be defended . A position character controller command would make it sooo much better and actually worth using.

Cheers
Lani
18
Years of Service
User Offline
Joined: 14th Aug 2006
Location:
Posted: 5th Sep 2006 15:00
I agree, the character controller commands seem a bit lacking at the moment, but I was thinking it was because I wasn´t good enough at using them yet.. (and I´m not dismissing that possibility yet )
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 5th Sep 2006 15:02
The way the commands work right now allow you more flexibility and control over everything. You cannot expect to simply drop in these commands and all of a sudden everything is going to just work. It takes time to set things up and add in jumping, strafing etc exactly the way you want. I could have put these commands in for release but then I suspect people would have been asking for commands like we have now to get further control. The idea of the current command set is to let you control it exactly the way you want. It made sense to do it like this first and then add on extra commands at some later stage.

For a future update how exactly would you like to see this work? Things like "phy move character controller up" etc. can be added in without too much work. As for a "phy position character controller" command - I'm not too sure whether this would work. A kinematic rigid body is used underneath the character controller but I dont know how trying to position this would affect everything else. I cannot say for certain about that. Another way of setting the character controllers position is to directly set the position of the controller itself but this doesn't check for collisions which isn't going to be much use to anyone really unless you are doing some kind of reset.
Chenak
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 5th Sep 2006 15:32
Well I think one of the main problems is the displacement commands are not documented so its a lot of guessing work to find out how to use them and if they work. I'm still not sure what they even do.

The move commands would be quite good for now, but applying those to AI is still complicated if you want things like strafing to work as you expect.

Using the kinematic rigid body to position the character controller sounds okay but then again I haven't seen the ageia sdk so only you guys would know how it works . It should work, theres only one way to find out If its kinematic it would probably react the same way they do... falling through static objects and kicking the crap outta cubes with 140times its own mass
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 5th Sep 2006 21:08
I had the same problem with implementing character movement with DarkA.I, because I was trying to get DP to move the character controller exactly X/Z where DarkA.i wanted it to go and I got very jerky movement and it didn't look very nice.

The other day I was wondering why my player char' controller moved so smoothly, then it hit me the reason it moves smoothly is because when I press 'w' to move forward I'm not trying to calculate an exact position to move to I'm just moving forward simple as that, then I thought well why can't I just do the same with DarkA.I controlled NPCs.

So what I ended up doing is forgetting the exact X/Z co-ords that the A.i wanted me to move to and just payed attention to which direction the A.I wanted me to move in and used the exact same code as I do for the player.

This is the first implementation of my npc team member movement code in my game:


You will notice that all I get from A.I is the direction it wants me to move in and then move it as normal and this works perfectly under manual mode, also (this is important) because I'm making a squad based game I need the equivalent of ai entity follow player for manual mode, so logically I used ai entity go to position and passed in the players position, and simply called this every loop to make the entity follow the player but this causes problems as the entity seems to dance around in circles and does all kinds of strange things, but if you just call it once then the entity moves normally to the position you specify.

The only way around this problem I have found so far is to create a path to the player from the entity then assign this path to the entity, this seems to result in smooth movement, but maybe you or somebody else knows of a better way?

Anyway hope this helps with the A.I thing.

I know the voices aren't real, but they have good ideas!
Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 5th Sep 2006 21:17
I just have the character controller move toward the AI position every loop, but I don't update the actual AI position unless they get too far apart. It's pretty simple and looks good.

You can freely rotate the character controller. You can point the character controller towards the Dark AI position (using the same controller Y position) and then move it towards it be the distance that separates them. Then you can rotate the character controller back to the Dark AI Y position. It's not perfect, but it works well and looks good.

It appears that the issue is that if you update the AI position every loop then the action keeps getting reset, which doesn't work very well with physics and animation. It appears to be a bug with Dark AI.


Come see the WIP!
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 5th Sep 2006 21:38
Cash Curtis:

Oh right, so you calculate how far the player is for instance away from the last destination point then if its above a certain threshold then you update the entities destination?

I know the voices aren't real, but they have good ideas!
Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 5th Sep 2006 21:45
Yeah. My character is 60 units tall, so I update the AI if it is 60 or more units away. Anything less is just too much.

However, I'm not using destination points. I'm just using the XZ position of the AI Entity. I'm letting the AI pretty much run on it's own, and the physics try to match it as closely as possible. It's pretty good.


Come see the WIP!
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 5th Sep 2006 21:50 Edited at: 5th Sep 2006 21:53
But if there is a static obstacle inbetween the entity and the destination, like in the ascii piccy below

###############################
#.........................E...#
#...................###########
#.........................D...#
###############################

Where E is the entity and D is its destination.

In this case the entity is just going to rotate towards the wall and try to walk through it, getting stuck.

EDIT: have you reported the state resting everytime you set the destination as a bug?

I know the voices aren't real, but they have good ideas!
Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 5th Sep 2006 22:08 Edited at: 5th Sep 2006 22:09
Not exactly. What happens is I point the controller toward the AI position, move toward it, then rotate back to the correct angle. Sometimes it looks like the character is walking backwards.

Since it resets when the distance is the height of the controller it balances out pretty well. The AI might get stuck behind the table, but it doesn't stay there long.

I think that separate collision is necessary for the AI entity to eliminate that problem. Basically, I need to know if the AI entity is colliding with a table or something, and that's impossible right now, as the physics body and AI entity aren't always in exactly the same place. I think that the easy solution will be to use Sparky's collision with sphere-casting against the static meshes. It's fast, so it shouldn't affect the speed. Ideally, the diameter would be the same as the AI entity and I'd stick it right in the middle of the entity.

I've not reported this yet, I'm going to test it and make an easy to use example first.


Come see the WIP!
Dark Developer
18
Years of Service
User Offline
Joined: 31st Aug 2006
Location: Mindspace
Posted: 23rd Oct 2006 20:07
If I calculate X and Z positions for the character controller with sin() and cos() functions, Could I use phy set character controller displacement ID, x#, y#, z# command to position my cc there?

Or its cousing collision problems?

Login to post a reply

Server time is: 2024-11-24 14:27:35
Your offset time is: 2024-11-24 14:27:35