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 / [Dark Ai + Dark Physics] Ai and physics oddities...

Author
Message
Steve J
17
Years of Service
User Offline
Joined: 22nd Apr 2006
Location: Vancouver, Washington
Posted: 8th Aug 2006 04:31
Me and saikoro (mainly me) have been pulling out our hair recently on this uber crappy problem. Basically, like in the container demo, we want an enemy to follow us, and be directed at us. We can move around, but the stupid thing just sits there and does jack. Frame reducing jack.

Basically this is the whole source:


the parts giving me trouble are:



I dont see why, but maybe I am doing something. It doesnt give errors, just a stupid looking guy sitting there.

http://www.milkpaton.com/
http://phoenixophelia.com
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 8th Aug 2006 06:05
I think you will find that Physics command must be the last in the list eg the above may work like this



try something like that.

I'm not getting you down am I, Ho Look! another fancy Door?
Steve J
17
Years of Service
User Offline
Joined: 22nd Apr 2006
Location: Vancouver, Washington
Posted: 8th Aug 2006 06:10
Thats not what it means. It says that you need to update ai in your loop before you physics. example,



http://www.milkpaton.com/
http://phoenixophelia.com
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 8th Aug 2006 11:05
When mixing Dark AI and Dark Physics it may help to use kinematic objects. By doing this you can let Dark AI have control and you can reposition and rotate your objects using phy set rigid body kinematic position and phy set rigid body kinematic rotation. This will allow you to keep your physics based objects aligned to the AI ones.

I will look into creating a simple demo that shows how integration between Dark AI and Dark Physics can take place.
Steve J
17
Years of Service
User Offline
Joined: 22nd Apr 2006
Location: Vancouver, Washington
Posted: 8th Aug 2006 11:18
Wow, a direct response for Mike Johnson, thats very kind. Thanks for the help, Me and Saikoro will go over that

http://www.milkpaton.com/
http://phoenixophelia.com
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 8th Aug 2006 11:24
There's an example in the Demos\Rigid Body\Kinematic Objects that may be a good starting point
Steve J
17
Years of Service
User Offline
Joined: 22nd Apr 2006
Location: Vancouver, Washington
Posted: 8th Aug 2006 12:41 Edited at: 8th Aug 2006 12:56
I have him set to search the area, but he just stands there. Do I need to set the level as an obstacle? I tried the command to do that, but it just crashes without error.



http://www.milkpaton.com/
http://phoenixophelia.com
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 8th Aug 2006 12:45
Some how you now have to link the AI to this command to control movement

phy set rigid body kinematic position enemy1, x#,y#, z#

I'm not getting you down am I, Ho Look! another fancy Door?
Steve J
17
Years of Service
User Offline
Joined: 22nd Apr 2006
Location: Vancouver, Washington
Posted: 8th Aug 2006 12:56
ah ok.

http://www.milkpaton.com/
http://phoenixophelia.com
Steve J
17
Years of Service
User Offline
Joined: 22nd Apr 2006
Location: Vancouver, Washington
Posted: 8th Aug 2006 13:08
well, I tried this:



but it wouldnt work. The walls are 256 units tall, but I cant figure out what I am doing wrong0.o

http://www.milkpaton.com/
http://phoenixophelia.com
Chenak
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 8th Aug 2006 15:10
You want it lower than that then, 128 should be alright
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 8th Aug 2006 15:16
I would recommend you let physics control the object and use



to remove the object from AI control. Now when you update the AI system the entity positions will be changed internally, get these positions using AI GET ENTITY X/Z and use the physics kinematic commands to move the actual object. When you update the physics the physics system will prevent the object from moving through walls and adjust the object's position etc. Get this new position using the normal darkbasic commands OBJECT POSITION X/Z and use AI SET ENTITY POSITION to tell the AI system the new entity position. The AI system can now use the new adjusted position to continue with its internal movement, then get the new AI position and repeat by using the kinematic commands to move to the new AI position.

In brief:

Make a kinematic physics object to represent the character, but don't link this object with AI.

1) Update AI
2) Get AI position and using physics command to move character object
3) Update physics
4) Get new object position and pass it to AI
5) goto 1)
Xarshi
18
Years of Service
User Offline
Joined: 25th Dec 2005
Location: Ohio
Posted: 8th Aug 2006 20:35
I would find the only problem with kinematic is that when you touch cloth,it explodes. And that is sorta scary...well,the kinematic I used had no collision either. Otherwise this sounds like a wonderful idea.

Woohoo. DP is finally released!
Steve J
17
Years of Service
User Offline
Joined: 22nd Apr 2006
Location: Vancouver, Washington
Posted: 8th Aug 2006 23:17
Mike, It works now, but he just passes right through walls. Should I set him to aviod the level?

http://www.milkpaton.com/
http://phoenixophelia.com
FINN MAN
19
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 9th Aug 2006 03:34 Edited at: 9th Aug 2006 05:10
Steve J
17
Years of Service
User Offline
Joined: 22nd Apr 2006
Location: Vancouver, Washington
Posted: 9th Aug 2006 03:44 Edited at: 9th Aug 2006 04:55
edited

http://www.milkpaton.com/
http://phoenixophelia.com
FINN MAN
19
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 9th Aug 2006 04:12 Edited at: 9th Aug 2006 05:11

Login to post a reply

Server time is: 2024-04-19 02:08:56
Your offset time is: 2024-04-19 02:08:56