Forums Gallery LOGIN |REGISTER

AI in vehicles: how do I make them act interestingly?

Gameplay Setup, SP/MP Logic, Audio Setup, AI Logic, Entity Usage, etc.


 

User avatar L0d3man
Just getting started
Just getting started
 
Posts: 23
Member since: 26.10.2011, 02:56
Location: Belgium
Likes: 0

AI in vehicles: how do I make them act interestingly?

Postby L0d3man » 06.01.2012, 20:15

Hey guys,

Today I've been messing around with the sample vehicle assets that you can find on the download page of crydev. So what I did was I placed an Abrams tank and a Grunt AI, and managed to let the Grunt get in the vehicle and drive along a simple path.

Very cool! However, after the Grunt has finished driving along the path, he seems to be completely unaware of his surroundings. When I shoot the Abrams tank the Grunt does not respond, as if I am not there.

Now, what I assume is going on is that the grunt behaviour simply isn't set up to deal with fighting in a vehicle. Is this the correct assumption? And if so how would I go about creating more interesting behaviour for the Grunt?

Thanks!
Image
User avatar L0d3man
Just getting started
Just getting started
 
Posts: 23
Member since: 26.10.2011, 02:56
Location: Belgium
Likes: 0

Re: AI in vehicles: how do I make them act interestingly?

Postby L0d3man » 07.01.2012, 16:29

On further investigation my assumption does indeed seem to be true. I noticed that the AI inside the tank would sometimes shoot when the canon was pointed directly at an enemy, but else it wouldn't shoot. So now I guess I need to enhance my AI behaviour to turn the canon and seek targets once the AI is in the tank. Any tips or a small tutorial on doing this would be greatly appreciated! I'd look at the Crysis 2 assets but unfortunately I do not have that game nor the sandbox that came with it :(
Image
User avatar L0d3man
Just getting started
Just getting started
 
Posts: 23
Member since: 26.10.2011, 02:56
Location: Belgium
Likes: 0

Re: AI in vehicles: how do I make them act interestingly?

Postby L0d3man » 11.01.2012, 21:13

Still need a poke in the right direction with this.
Thanks.
Image
User avatar Hamers
Junior Dev
Junior Dev
 
Posts: 289
Member since: 06.10.2008, 18:38
Location: Berlin, Germany
Likes: 3

Re: AI in vehicles: how do I make them act interestingly?

Postby Hamers » 12.01.2012, 10:16

You should place a driver and a gunner in your vehicle.

The gunner always fires automatically at enemies, if the vehicle has a gunner weapon like a MG.
If you also want the driver to shoot and drive automatically, you have to code new AI behaviour.

Look here: http://freesdk.crydev.net/display/SDKDOC5/AI+Scripting

I don't know if it's implemented in the free SDK, but for Crysis there is the behaviour TankClose for tanks, which you can use in conjunction with an AI>Signal FG node to make the tank drive back and forth on a specific path and shooting the player with the main cannon.
Image
Released !!! DOWNLOAD NOW !!!
User avatar L0d3man
Just getting started
Just getting started
 
Posts: 23
Member since: 26.10.2011, 02:56
Location: Belgium
Likes: 0

Re: AI in vehicles: how do I make them act interestingly?

Postby L0d3man » 12.01.2012, 13:18

Thanks Hamers.
I just remembered I still have Crysis 1 laying around, perhaps I'll reinstall it and have a look at it's AI behaviours and learn by example :)
Image