Product Chat / [SOLVED] Combat AI with extended view range and waypoints / searching AI

Author
Message
SomeoneNew
5
Years of Service
User Offline
Joined: 2nd Jun 2019
Location:
Posted: 2nd Jun 2019 23:35
Hello GameGuru
First off, thumps up for being the best non-coding game maker!
Second off, I am having trouble with standard AI for the Combat soldier and masked soldier (I first tried those from death valley bundle).
The thing is I want a combat AI with extended view range and waypoints / searching AI.
1)
When I insert "view range" increase by 100, 1000, 10000, 1000000 and "view cone angle" = 180 and "always active" = true it does not change behavior for the AI. All scripts standard. I first tried on "new random level" and then on "new flat level" to no avail.
2)
Then I tried inserting waypoints, the AI just go a little bit sideways (not moving along waypoint path), also tried changing script to "ai_patrol" to no avail.
3)
Then I tried all above with a huge "floor zone" to no avail.

Can you point me in a direction on what I might be missing / doing wrong ?
Thanks in advance

The author of this post has marked a post as an answer.

Go to answer
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 3rd Jun 2019 01:33
This is the way I do it and it works great for me ?
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
SomeoneNew
5
Years of Service
User Offline
Joined: 2nd Jun 2019
Location:
Posted: 3rd Jun 2019 12:26
Hey Synchromesh
Thanks.
I tried the waypoint again today and it worked. Yesterday I guess many things did go south.
I like to zoom out when I work on my levels and I think this is 1 little thing of the many that went wrong about waypoints.
Yesterday I have clicked a dosen times on create waypoint and nothing happend (I thought) because looking around alot of waypoints was created some long distance away and some long apart. I deleted some and had the darkblue waypoints left to test with.
Today the waypoint is red and the other colored waypoints seem to work to, as long as the character is placed near the stars.
Today I have created 7 different waypoints and it seems that some of the combat soldiers most far away sees me (2 of them) the go sideways and aims at me but then return to there waypoint path.
So the thing I think could be better is, if you place the waypoint with the mouse on creation, that would remove the frustration on where they were created (it seems you have to look down as it is now, to see it when you click the "create waypoint").

The 2 other things i mentioned, I still cannot get to work about "view range", "cone angle" and "always active" = true .
Placing a "combat soldier" facing the back or front on "player start" and set high view range and cone angle and "always active" = true does not work before I get close to the "combat soldier" eventhough I move and jump. What am I doing wrong ?
Thanks in advance
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 3rd Jun 2019 14:05 Edited at: 3rd Jun 2019 14:07
Setting Waypoints works best from Top down view ( we never had a 3D view initially ) so it was designed to work that way. AI are supposed to return to their waypoints when your out of range so maybe try playing with that a little closer to start.
You can always press "Tab" twice in test game and move the Debug slider up so you can visually see the range and cone angle of the characters ( very handy )

Always Active = on should make soldiers walk waypoint right away far in the distance .. If its off they stand there and don't move until you get closer ( for when they are out of view behind a building maybe )
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
SomeoneNew
5
Years of Service
User Offline
Joined: 2nd Jun 2019
Location:
Posted: 3rd Jun 2019 23:53
Hey Synchromesh
Quick reponse Thanks that is good service!

Placing a waypoint with the mouse is just those small things that make it delight and easy as the rest of the editor choices

My second problem is on plain sight no obstacles on the level (plain new level):
Placing a "combat soldier" facing the back or front on "player start" and set high view range and cone angle and "always active" = true does not work before I get close to the "combat soldier" eventhough I move and jump. What am I doing wrong ?
Even tried with the value 499999997952. Okay after test on the debug slider I can conclude max is 1500 so all values above dont work. I need 5000 max how to ? 1500 is way to short around 20 steps away (a bus length away, cant you see people more than a bus length away).
Thanks in advance
PM
Avenging Eagle
19
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 4th Jun 2019 07:21 Edited at: 4th Jun 2019 08:58
Quote: " I can conclude max is 1500 so all values above dont work."

This has been my experience too - the AI is hard coded to have a max viewrange of somewhere between 1500 and 2000. This seems to have been done for performance reasons, to free up resources when the enemy is far away...but it sucks for gameplay.

If you want to have more ranged enemies like snipers, that can be faked with a script. I'll see if I can dig up the one I use...

EDIT: Here's the thread about the sniper script. The last post in the thread contains the script, but you will likely need to edit it/customise it for use in your game. To see it in action, take a look at this:

https://youtu.be/GiQPIqwN4Kk?t=487

AE
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 4th Jun 2019 08:19 Edited at: 4th Jun 2019 08:21
Quote: "1500 is way to short around 20 steps away (a bus length away, cant you see people more than a bus length away)."


I Gameguru unit is 1 inch, therefore 1500 units is 1500 feet, which is the length of 4 football pitches, an average bus is 35ft to 40ft.

1500 should be plenty of range, unless you're scaling you models up huge.

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.
Avenging Eagle
19
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 4th Jun 2019 08:54
Quote: "I Gameguru unit is 1 inch, therefore 1500 units is 1500 feet"


If 1 GG unit is an inch, 1500 GG units is 1500 inches, or 125 feet, or 38 metres. Not exactly long range really...

AE
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 4th Jun 2019 09:46 Edited at: 4th Jun 2019 11:36
The "average" distance a long range sniper rifle can effectively fire from is around 3,300ft, which is double the viewing range, but unless you want to put long range snipers into a game at realistic range, (which would be daft in my opinion because a player would never have a chance of seeing them, which would frustrate them and a frustrated player is not really the target audience) an enemy wouldn't even see you at 1500ft unless they were looking right at you.

But my post was more about his comment that the viewing distance was like a bus length, which it definitely isn't.

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.
SomeoneNew
5
Years of Service
User Offline
Joined: 2nd Jun 2019
Location:
Posted: 4th Jun 2019 10:43
Hey Belidos
When I am in game 1500 units feels like 35ft (eventhough it might be 125ft), so if I feel its a bus length then its to little distance for me.
Back to my question how do I get 5000 units ?
Thanks both
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 4th Jun 2019 18:19
Quote: "The "average" distance a long range sniper rifle can effectively fire from is around 3,300ft, which is double the viewing range, but unless you want to put long range snipers into a game at realistic range, (which would be daft in my opinion because a player would never have a chance of seeing them, which would frustrate them and a frustrated player is not really the target audience) an enemy wouldn't even see you at 1500ft unless they were looking right at you.

But my post was more about his comment that the viewing distance was like a bus length, which it definitely isn't."

yes but as Avenging Eagle pointed out, 1 inch is not 1 foot, so GG's firing range is not 1500 feet...

1500 units is definitely not enough range for a sniper (or even a rocket or some larger units such as tanks or helicopters) so the fact that there even is still a hard coded limit is annoying, there shouldn't be a limit but let us decide with the AI properties - if we want to extend the range and risk lowering performance that should be our choice.

though if i was serious about making a project in GG and this was an issue for me i would personally just make my own system with raycasting (as with the sniper in the above video).
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
SomeoneNew
5
Years of Service
User Offline
Joined: 2nd Jun 2019
Location:
Posted: 4th Jun 2019 18:33
Hey Smallg
Thanks.
I am awaiting "Avenging Eagle" for the script workaround
PM
Avenging Eagle
19
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 4th Jun 2019 19:46
This post has been marked by the post author as the answer.
Sorry, I'm an idiot - posted the example video but not the thread My apologies...

https://forum.game-guru.com/thread/218058

Here's the fantastic script smallg wrote. All credit to him to getting this working! Attach it to your sniper enemy, then use the Sound0 and Sound1 field in properties to specific a whizzby (miss) sound effect and a fleshy impact (hit) sound effect.

AE

Attachments

Login to view attachments
SomeoneNew
5
Years of Service
User Offline
Joined: 2nd Jun 2019
Location:
Posted: 4th Jun 2019 22:30
Hey Avenging Eagle
Thanks, that script does the 5000 unit, but I think I wont rewrite it. It also seems to be best at still standing enemy and has to be a sniper.
PM
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 5th Jun 2019 00:10
doh, yeah, having a mad moment and mixing feet and inches.

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.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 5th Jun 2019 00:39
Very common mistake that the less well endowed make.
Been there, done that, got all the T-Shirts!
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 5th Jun 2019 00:56
Quote: "Very common mistake that the less well endowed make. "

LMAO
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
granada
Forum Support
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 5th Jun 2019 01:28
I wandered what the wife was laughing at

Dave
Windows 10 Pro 64 bit
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
Flatlander
GameGuru Master
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 5th Jun 2019 04:49
OMGosh, I had to get down in the gutter to finally get what AM was referring to.
Alienware Aurora R7 with SSD 256GB boot drive ( C: ) and a secondary drive ( D: ) that is 2TB
Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz 3.19 with Intel Turbo-burst
Installed RAM 16.0 GB
64-bit operating system, x64-based processor
Windows 10 Home
NVIDIA GeForce GTX 1070 with 8192 MB GDDR5 and 8095 MB shared system memory

Login to post a reply

Server time is: 2024-11-23 23:51:55
Your offset time is: 2024-11-23 23:51:55