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 and Dark Physics] How can they be used together?

Author
Message
Chenak
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 27th Aug 2006 21:00
I'm trying to figure out the best way to get the character controller to follow the x and z coordinates of the AI entity without gittering and turning like crazy. I cannot use the kinematic object as its bad at the moment.

One method I had was just to simply let them go at the same speed since they are both time based... well it turns out their speeds are totally different and dark ai doesn't seem to have an option to get the speed or set how the timer based speed is calculated.

Is there a way to do this? What should I set the ai speed should the physics speed be say 10?

Cheers
Natflash Games
18
Years of Service
User Offline
Joined: 7th Feb 2006
Location:
Posted: 30th Aug 2006 01:19
Check thee Dark AI manual, it says something about using DP and Dark AI, its a page called "a note on physics" under "demos" it explains how to do it, hope it helps.


Check out my site for the latest on my games.
Chenak
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 30th Aug 2006 01:35
cheers I get that, its more or less what I'm doing now. It works but either you get jittering because its moving too fast or moving so slow it cant go through paths accurately.

Dark Ai doesn't have any info about what timer calculations its doing (if any) so its impossible to do without trial and error or calculating the speed beforehand which won't be very accurate since it differs.
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 31st Aug 2006 11:56 Edited at: 31st Aug 2006 11:58
When you set the object speed in DarkAI that is the amount of units that the entity will be moved in one second. So all you have to do is set the AI speed then try to match this using DP, then after each frame inform DarkAI of the entities new position using AI Set Entity Position Entity Number, X#, Z# because DP may have not moved it exactly where DarkAI needed it to be.

Oh and maybe I'm wrong on this, so don't quote me but... I think you would have to do manual control over DarkAI as automatic control could cause some problems.

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:07
I've gotten it to work pretty well Chenak. I've found that if I reset the AI Entity position every loop then it goes crazy. It looks like every time you reset the position then it resets the entity action, which drives it crazy.

I only reset the AI position if it gets too far away. My character is 60 units tall and I reset it if it gets more than 100 units away. Otherwise, I have the physics body turn toward it, move toward it, then I rotate it back to the AI Y angle.

Like I said, it's not perfect, but it looks good. Sometimes the AI entity is standing behind a table and the player character is trying to walk backwards to the position, which can be odd. But it's not terrible.

If I'm right about the issue with Dark AI then it is a bug. I'll play around with it and file another bug report if that's the case. Of course, all of my bug reports tend to get ignored even though they're clearly bugs.

If you don't want to mess with your code, I'd be happy to fix it up for you. Just send me an e-mail.


Come see the WIP!
Chenak
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 6th Sep 2006 04:07
I converted it to NGC at the moment but I'll have ago at converting it to Dark Physics again I might just code my own character collision with the raycasting commands, problem is it wont react with smaller objects, but then again character controllers don't effect dynamic objects anyway so it might be a good solution

Thanks for the offer, I'll see what i can do, got a certain old guy model to finish first though
bosskeith
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 8th Sep 2006 06:34
i cheated for interaction in the original challenge thread...i just made a hidden block that gets pushed in the direction the player character is moving using linear velocity for only 2 frames everytime the character displaces it's position(but not rotation)then destroy the object. It is cheating but worked well for me. to change the distance ahead of you to have an effect then just multiply the velocity values to change the power of the push adjust the mass.

Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 8th Sep 2006 10:38
I posted a thread in bug reports that demonstrates the exact bug causing the problem.

http://forum.thegamecreators.com/?m=forum_view&t=88565&b=15&p=0

No media required, just paste and compile. Enjoy!


Come see the WIP!

Login to post a reply

Server time is: 2024-04-19 16:51:30
Your offset time is: 2024-04-19 16:51:30