Game Development Community

AI afraid of rain?

by Bryce · in Technical Issues · 05/25/2008 (8:38 am) · 8 replies

Hello everyone,

I've noticed yesterday that my AI players are classifying precipitation as projectiles...any ideas?

I have a stress system built into my bots that tells them when to fire from cover and when to duck back in. When a moving projectile is sensed by a radius search or a non-moving one is detected (an explosion), stress goes up. I added a precipitation object into a test firefight yesterday and the bots' stress sailed up to 100. Is there a fix for this? Help is appreciated.

#1
05/25/2008 (8:53 am)
I don't know of a fix still to new but I have to say that that is pretty funny. "AH ITS RAINING HIDE!!!!" You got gingerbread men you fighting? They going to melt if they get wet?
#2
05/25/2008 (9:02 am)
Bryce, I just checked through the precipitation.cc file and found your problem. Line 117
mTypeMask |= ProjectileObjectType;

I guess make a new TypeMask for precipitation and set it to that and you should be set, or there could be a simpler path....Either way, that's your problem.
#3
05/25/2008 (9:25 am)
I haven't played around with weather yet, but could you try getting the ID type/classname of the projectiles when they penetrate the radius and script an ignore function for PrecipitationData (or maybe use it's name like HeavyRain2 to indentify it)

I can't remember how to do it off the top of my head, my soccer team won the play-offs yesterday and my brain is a little befuddled, but something a bit like;

//bad psuedo-code
if (%col.getClassName() $= "Precipitationdata")
{
//don't do anything - just ignore it
echo("ignore rain");
}
else
{
//not rain it's a bullet - do something
echo("increase AI's stress");
}
//end of bad psuedo-code

Anyhow, something along that principal, though it probably would be better practise performance-wise to make a new TypeMask like Morrock suggests (less checks and callbacks that way I suppose).
#4
07/26/2008 (10:14 pm)
Is there any reason that precipitation should be counted as a projectile? If not, then change it :P On the other hand, it could make for some cool possibilities - like stress being increased by a rain of blood or fish or something ;)
As an aside, I'm also interested in a 'stress' level thing for my characters...
#5
07/27/2008 (12:56 am)
Ouch, why on earth have they made it like that ?

I guess this will be an annoying bug to fix, as your AI system is an attempt to be script only.
#6
07/27/2008 (11:15 am)
Why does everyone keep saying bryce is designing a script only AI? He bought the engine long ago and has been doing things like pathfinding and aiming in C++.
#7
07/27/2008 (11:49 am)
Because it was his awesome original plan, and despite some few hints a 'maybe putting some core stuff to C++' I havent seen this busy bee change his determination!

Sorry, if Im out of date with info. Regardless of that -Keep up the totally awesome work bryce!
#8
08/02/2008 (9:38 am)
@Christian--It was my plan when I didn't think I'd be able to buy the engine ;-). Now I have it, and I'm working on optimizing parts of the code so I can run more AI at a time. I want to keep a lot of it in script because moving too much into the core engine drains flexibility (who likes compiling every time they make a tiny change? Nobody!). Things such as aiming, visibility, line-of-fire checks, and cover searching will get moved into the core engine as soon as I can figure out C++.

BTW, a Tactical AI Kit Demo is in the works :-)