Scripts / Timing for AI Character Movement Controls

Author
Message
GoDevils
9
Years of Service
User Offline
Joined: 24th Sep 2014
Location: Arizona USA
Posted: 7th May 2015 21:28
I've been playing with the AI movement commands

ModulateSpeed(e,v)
AIEntityGoToPosition(g_Entity[e] ['obj'], x, z)
AIEntityStop(e)

Currently, I have these in a loop which is replayed until the entity reaches it's location. The process works correctly, but I'm wondering if it's OK to have these three commands repeated with each loop of the script ? I have an if/then that looks at where the entity is and when it get's close to the end, it sends the script on to a different section. Once the movement has begun does GG ignore these commands until the request is completed? Is there a variable which returns the fact that the GoTo command has been completed and the character is no longer moving?

"THERE IS NO SPOON"

AMD 6300 6 core 3.5 ghz, Windows 8.1, 8GB ram, GTX 650 2GB ram
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 8th May 2015 12:51
why would you want to move and stop at the same time? i dont think you need the AIEntityStop(e)
AIEntityGoToPosition(g_Entity[e] ['obj'], x, z) automatically stops at the destination but there's no way for us to get that information without checking ourselves no, the way you are currently doing it is the way i've always done it (checking position compared to destination)... calling AIGoToPosition once however is enough (same as the ModulateSpeed(e,v)) unless you have another call effecting these it wont change until you do so.
however i've never noticed any fps loss for looping the command anyway so not really an issue
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
GoDevils
9
Years of Service
User Offline
Joined: 24th Sep 2014
Location: Arizona USA
Posted: 8th May 2015 19:15
Thanks as usual smallg

I tried a bypass so it would only pass the commands one time, but it worked the same as with the commands being looped. I'm trying to create a character version of my entity movement script. This will be able to string together dozens of movement steps for the attached character. I got it working at a basic level, and tested it in an open flat terrain, but when I tried to use it in my Mill Town environment it is not working?? In the process of trying to figure out why.

Thanks again
"THERE IS NO SPOON"

AMD 6300 6 core 3.5 ghz, Windows 8.1, 8GB ram, GTX 650 2GB ram
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 8th May 2015 20:14
did you already set anything on the floor as forcesimpleobstacle = 3? dont think there's any other reason they wouldnt move except sometimes they get a bit weird if there's lots of obstacles

Quote: "I tried a bypass so it would only pass the commands one time, but it worked the same as with the commands being looped"

exactly, that's why i said you only need to call them once but don't think it matters much.
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
GoDevils
9
Years of Service
User Offline
Joined: 24th Sep 2014
Location: Arizona USA
Posted: 12th May 2015 23:28
Just a follow-up to this.

I spent some time playing with this. Got the script to run correctly when the character was on the Terrain. However, when I moved the character off the terrain, and placed it on a surface above the terrain, the same script would not work. I can see the character trying to move, but it does not.

I concluded that since characters cannot yet walk up stairs, and to levels above the base terrain, that this is something that will be available when characters can operate on surfaces above the terrain. So I reworked the script using move and turn commands and it works fine.

I'll have to look into this forcesimpleobsticle fpe command.

thanks
"THERE IS NO SPOON"

AMD 6300 6 core 3.5 ghz, Windows 8.1, 8GB ram, GTX 650 2GB ram
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 13th May 2015 00:37
Characters getting off the terrain and onto surfaces is still a WIP.

use the Asylum building parts as a guide for constructing your stuff.

And forcesimpleobsticle=3 is what you will want to use if you want AI to get around them. Answered your FPE post in the other thread with info you will be interested in.

Floors no higher then 5cm from the terrain or AI cant deal so well at the moment.
I have been able to get them up to about 46cm off the ground with a gradual ramp, that the incline is no more then ankle high for every 3 or 4 feet forward. Zombies are going to be your best bet to even try anything with, as the soldier are waypoint driven and not free roaming.

I am sure there will be more questions.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

Login to post a reply

Server time is: 2024-05-07 09:19:47
Your offset time is: 2024-05-07 09:19:47