Scripts / Some questions about AI behavior

Author
Message
Methos
7
Years of Service
User Offline
Joined: 21st Sep 2016
Location:
Posted: 24th Jun 2017 07:03 Edited at: 24th Jun 2017 07:04
So, in terms of view distance .. what is the max value for AI? I think I read somewhere that it's 6,000 but that kinda doesn't make sense. I would think their range would be at LEAST that of their weapons, right? The M700 sniper has a range of 20,000 so why wouldn't the AI soldiers as well? Kinda defeats the purpose of having snipers, don't you think? I'm thinking they should have an enormous maximum range but then allow the user to shorten that as needed - like have your standard troops set to 10,000 or so but then have snipers in guard towers set at max. Or even just to give AI stationed at higher elevations a higher view distance to simulate better line of sight. (Note: I tried setting this value to 20,000 to match the weapon but there was no change so guessing the max range is hard coded? I would strongly suggest raising that value tremendously.)

Next bit of AI business .. their stupidity level. (Lol) But seriously, I was testing whether you could destroy a structure that had a floorzone across it and stop the AI from crossing it. In this case, a bridge. The test was to first see if the AI would cross the bridge and second, if destroying the bridge would prevent them from crossing or if the floorzone served as an invisible platform and they would walk across the air. Well, it mostly worked. They crossed the bridge and when I blew it up, they could no longer walk across. So they plummeted vertically, essentially walking down into the "river" and proceeded to walk across the bottom (without breathing apparatus mind you) and upon reaching my side .. well, just watch and see.

https://youtu.be/MQJkCwmp_Hc

Ummm, yeah I have no words. (lol) So apparently things like dramatic drops in elevation mean nothing to the AI :p Is there a way around this? I even put up barricades and they walked around the barricades and jumped into the water! (lol)
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 24th Jun 2017 07:50 Edited at: 24th Jun 2017 07:51
The limit is 3000, basically its an optimisation thing, to keep the resource usage low and maintain a higher fps, it keeps the memory from getting clogged up with too many scripts running at one time.

To override it so you can have larger ranges you can set the character to always active in its properties.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
Methos
7
Years of Service
User Offline
Joined: 21st Sep 2016
Location:
Posted: 24th Jun 2017 10:38
Yes I'm aware of the always on parameter .. but does that mean that by enabling that you can increase their view distance? I thought it just meant that if you are outside a certain range, they are basically, "dormant" .. won't patrol or anything. You're saying setting always active to yes will allow a higher view setting though? (Sorry, I'm at work right now so can't try it out so, gathering info to put into my tests).

Which brings up another question but I'll put it in another post. Thanks!
PM
Methos
7
Years of Service
User Offline
Joined: 21st Sep 2016
Location:
Posted: 24th Jun 2017 10:41
Ya know .. now that I think of it (thinking - what a concept. Lol), that actually makes sense. So they COULD potentially have a higher view distance value BUT if they are inactive until MY character moves into their range, they won't act. Gotcha.
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 24th Jun 2017 10:45
You, now that you question it, i'm not 100% sure on the range part (the always active part is right), I've never tried it, i'm just assuming that the 3k limit on AI is limiting the range in their properties, let me know how it works out.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 24th Jun 2017 10:51
OK, just tested it myself and i'm a little wrong, changing the distance to 10000 and setting it always active will make it respond to you, it turns and faces you etc, but still wont make it attack until you get into weapon range, I think there's something in the script that effects aggro range that would need changing too, but not sure what.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
Methos
7
Years of Service
User Offline
Joined: 21st Sep 2016
Location:
Posted: 24th Jun 2017 10:52 Edited at: 24th Jun 2017 10:52
Well that will be the real test. While it's good to set the DEFAULT value to something conservative so that it won't bog down performance, I honestly think that should be left to the end user to decide. I mean, you may only need it for 2-3 entities and that really shouldn't affect performance.

With regard to those values though, 3000 .. 10,000 etc. do they correspond to real world measurements of any kind or are they based on the game grid? Some type of measuring system would be nice. For now, I just make objects in Sketchup and desired lengths and use them to measure in GG. I'll probably use some to test distances.
PM
Methos
7
Years of Service
User Offline
Joined: 21st Sep 2016
Location:
Posted: 24th Jun 2017 10:55
Hmmm .. did you try giving the AI a sniper rifle with super long range? I've already had them do this .. I fire and they turn and face me but don't shoot, don't charge, nothing. They just wait for me to pick them off like rabbits. Lol
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 24th Jun 2017 11:13
1 unit is 1 inch if I remember right.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
Methos
7
Years of Service
User Offline
Joined: 21st Sep 2016
Location:
Posted: 24th Jun 2017 11:44
Cool .. thanks!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 24th Jun 2017 12:32
The various ranges at which behaviour is triggered is probably alterable in the AI Lua scripts, you just have to figure out which script they are set in and alter them to suit.
Been there, done that, got all the T-Shirts!
PM
Methos
7
Years of Service
User Offline
Joined: 21st Sep 2016
Location:
Posted: 24th Jun 2017 21:40
Thanks for that .. that'll be my next step.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Jul 2017 09:59
Its not, the fire code is not available to us and has a limit at what range it can detect the player (I think it was either 1500 or 3000 - you can tell by Prompting(GetPlayerDistance(e))
From the AI in question.

The way around it is to use the ray cast commands to make your own.
There is a sniper script on the board here that does just that.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Login to post a reply

Server time is: 2024-04-19 00:49:17
Your offset time is: 2024-04-19 00:49:17