PDA

View Full Version : IRIS Bot AI



Ging
30th November 2006, 01:22
As part of my whimsical thinkings, I actually jotted down some thoughts on how an IRIS bot AI may work - it's something I've dabbled with in the past, I even have a basic framework bot setup in the code, it doesn't do anything mind you, but there is a start to it!

Anyhow, here's what my thoughts were when I most recently had a think about it and perused existing HL2 AI code for things to re-use / steal.


Path Finding
Use navigation meshes / existing A* implementation
Target Tracking
core fuzzy logic influences
position in "view cone"
target velocity
distance to target
size of object being carried by target
Team Work
travel in pairs
basic flocking rules (seperation / convergance)
Reorganise on the fly
If partner dies, join existing pair / another solo
final four stay together?
Communication
basic messages
"target here"
Causes all bots to move to location
"man down"
triggers pair reorganisation
"coming to you"
spare bot joining new grouping
bots in grouping slow movement to allow catchup
"out of ammo"
supply bot will attempt resupply
"low health"
partner will lead and provide more cover
if both in a group are low, maybe reorg?Now, don't take this as meaning anything, it was mainly a brief brain exercise about where I'd go with it were I to do it - the idea does indeed intrigue me, it'd be a massive tick in some good boxes (as Boxy would put it)...

A fair bit of the code is already available in the SDK in some form or another - it's 'just' a case of figuring out which bits are useful and plumbing it all together in a meaningful fashion... I suspect I could get a (very) basic bot up and running in a little under a week of fairly dedicated work, chances are it would just move about the place though.

So other than "yeah, do it" comments, any thoughts? (If you can't bring something sensible and useful to the conversation, don't even bother posting, I'll just delete it - this is not a thread you should be using to try and boost your post count)

Kira Yamato
30th November 2006, 02:01
Thats a fairly good plan, now what about Hidden - AI?

Paegus
30th November 2006, 02:12
targeting needs to be aware of

what texture is behind the hidden relative to the bot
lined textures are more revealing than randomly noisy ones. derelict's indoor upper floor is a prime example
how much light is falling on said textures
the brighter the texture behind the hidden relative to neighbouring textures the easier it is to detect distortions.
world delta
hard edges such as steps, window frames, corners etc. generate visible line distortions
if the target is completely stationary
pitching/yawing causes a dynamic distortion and should multiply the chances of attracting attention.
where the bot's 'eyes' are looking in their FOV at any given time
peripheral vision is nice and all but unless the target is moving in some way detecting line distortion is almost impossible unless you're focused on the right spot
POV delta
the more their POV is changing the lower the chance to detect
audible cues
self explanatory really

VoiceOfDecember
30th November 2006, 02:16
Could you program the bots to watch out for the Hidden in certain positions, such as the need to stop in a corner (such as a corner in the developers room in manor) and not move and sit and wait just as we as human players stop and do not move the mouse because we all know its much easier to spot the hidden if you are not moving.

I'm not sayin they should camp, but just as the 1st bot enters a room, he lets the next one come through but watches his back. Just a good 5-10 second look or even a pair of bots just say one is sitting on one of the two tanks (them big brown things are water tanks aren't they?) while the other buddy bot looks the other way.
When not moving their chances of seeing you increase (by whatever mathamatical equasion you have going).

Or is it planned to have bots on the move constantly? As you notice as the Hidden you have to wait till all (or some) of the IRIS group together because you know they will and when they do. POW! Pipebomb.

Then this idea could cause bots to frequently just stop and start and it would just be really stupid. I don't know much about code but if that sounds allright, go for it.

Ging
30th November 2006, 02:33
targeting needs to be aware of
what texture is behind the hidden relative to the bot
lined textures are more revealing than randomly noisy ones. derelict's indoor upper floor is a prime example
how much light is falling on said textures
the brighter the texture behind the hidden relative to neighbouring textures the easier it is to detect distortions.I'd just cheat that tbh - a bot doesn't have to follow the same detection rules as a human does after all... Querying the texture would be insanely stupid in terms of processing required, unless of course each material was tagged with something that could be read by the AI and used as a basis for what the texture was... Which would be a complete arse for our own stuff, let alone valves.

I know it's relatively easy to get the colour values of the texture, which you could infer the brightness from - but at the same time, it's unlikely that you as a hidden player would really notice that you were caught out due to the change in texture brightness.




world delta
hard edges such as steps, window frames, corners etc. generate visible line distortions
if the target is completely stationary
pitching/yawing causes a dynamic distortion and should multiply the chances of attracting attention.
where the bot's 'eyes' are looking in their FOV at any given time
peripheral vision is nice and all but unless the target is moving in some way detecting line distortion is almost impossible unless you're focused on the right spot
POV delta
the more their POV is changing the lower the chance to detect

Again, these are all ways humans detect the hidden - the bot wouldn't need to follow half these rules (nor would you want it to unless you only want a couple to play against at once)

Providing the AI with a full geometric representation of the world and allowing it to understand it in any but the most basic of forms is just asking for a whole world of trouble. (there's a reason game AI still uses hints and waypoints in levels)




audible cues
self explanatory really

This ones the most reasonable one - if only because HL2 has a built in system that can be used to attach messages to sound effects (hence why the AI are 'scared' of grenades, they get a 'danger' message when one comes near them)

The aim here wouldn't be to create completely human realistic bots - it'd be to create something that's fun to play against and wouldn't require heavy processing time as it essentially renders a viewport for itself and does image processing on it.

Isolation
30th November 2006, 04:13
For realism sake, take a page from CSS bots and borrow the "go rouge" concept, except in H:S's case, make it so a bot has like, say, a 1 in 10 chance of just TK/TWing the whole team and then camp, waiting for 617.

That's always been something missing from most bot code...

EDIT: For the record, I am not joking. A true "random" element like that might add to the sense of reality, especially if people are using the bots for training as 617. Quite often, when 617, TK's and TW's become viable tactics for beating IRIS.

hutch
30th November 2006, 04:15
For realism sake, take a page from CSS bots and borrow the "go rouge" concept, except in H:S's case, make it so a bot has like, say, a 1 in 10 chance of just TK/TWing the whole team and then camp, waiting for 617.

That's always been something missing from most bot code...
Dude, you owe me another keyboard.

Isolation
30th November 2006, 04:17
Ging said he wanted "human realistic" bots, after all.

starstriker1
30th November 2006, 04:36
Alright, for the AI hidden detection, you obviously have that planned out. The only thing I'd add is a very basic emotion system... perhaps just a single float that basically specifies the adrenaline or panic level of the AI. From that you can scale some influences up and others down... a panicking player isn't going to see an immobile hidden as well, but they're going to be much more sensitive to movement or sudden changees in the environment. You might also want to consider checking distance. The hidden at long range is absurdly easy to spot while moving, for instance.

Also, what you mentioned about the "danger" signals given to AIs to avoid grenades is interesting. Given that would you be able to create two kinds of signals for the hidden: attack and examine? An "attack" message would be triggered by very obvious signals to the hiddens presence (IE, a knife swipe), while an "examine" message would be just a signal to focus the view over in the direction indicated, which would be triggered by less specific events like an object colliding with the world, or gunfire hitting a wall. Heck, they could all be part of the same message, just differing strengths.

Finally, a really big thing to consider is how the AI will be aiming. If they're like some big autoturret, thats no fun. Two important things are needed in that regard: some implementation of a reaction time, and imprecise knowledge of the hidden's location. Imprecise knowledge could mean that the AI might accumulate information on the hidden's location, except that each piece of information is sent in with some kind of random offset. The AI would then have to try and average out the error filled information to get an approximation.

ThunderDan
30th November 2006, 05:22
I'm assuming the bots will have some basic understanding of the various add-ons, although for simplicity I'd just give them laser scope and adrenaline. Laser scope would key them into a direct line of sight after a few 10ms spaced checks. Adrenaline would be used during a panic/flight situation like their buddy dying or them getting to withing one slash of dying.

Cheesey
30th November 2006, 06:59
I think the trickiest part will be the aiming. Cause if I'm jumping towards a bot and he is that god like that even when I'm pouncing my ass of he is hitting me, it won't be fun at all. Especially when you are near a bot it will be a tricky part...

And the communication shouldn't be annoying. Not just like: *throwing-nade* - "Danger" - "Danger" - "Danger" - "Danger" - "Danger" - "Danger" - "Danger" - "Danger" - "Danger"

And are they reacting on sounds like footsteps, voice-commands of 617 or slashes? Just like you are on the opposite side of a wall, slashing and talking, the IRIS gets mad on the other side?

Zabiela
30th November 2006, 07:05
Ging said he wanted "human realistic" bots, after all.



The aim here wouldn't be to create completely human realistic bots

:p

Im happy to see this on the drawing board.

Masterpod
30th November 2006, 09:49
I think the trickiest part will be the aiming. Cause if I'm jumping towards a bot and he is that god like that even when I'm pouncing my ass of he is hitting me, it won't be fun at all. Especially when you are near a bot it will be a tricky part...

A good point is made here, something to consider is the difficulty of the bots. How accurate should they be when they actually ''see'' the Hidden? If they were spot on accurate, new players wouldn't live so long, thus not really making it fun to play against bots in their case.

Obviously, more experienced players likely won't have a problem with the bots, but there are more newcomers than there are experienced people.

Furthermore, I'm assuming that they are going to forfeit the hidden selection at all times?

Personal thoughts about AI: Sounds like a great idea, it's a shame that the scare factor will probably be lost on them though :p . I do think that the point of AI is moot for the veterans here, as most of them don't play for winning anymore. Still, good for the new ones :) (For a while at least)

Gusdor
30th November 2006, 10:08
[/LIST][/LIST]I'd just cheat that tbh - a bot doesn't have to
This ones the most reasonable one - if only because HL2 has a built in system that can be used to attach messages to sound effects (hence why the AI are 'scared' of grenades, they get a 'danger' message when one comes near them)

The IRIS bots would have to yell: WARNING TEAM hehe

Paegus
30th November 2006, 10:18
i'm sure you could fake some of the scare factor. but it would have to be carefully managed i think to keep it remotely realistic. a bunch of difficulty-level-governed slightly-randomized settings that build up to make the bot's personality. the CS:S bots are ok but they're too predictable really.


...perhaps just a single float that basically specifies the adrenaline or panic level of the AI...
have it scaled to difficulty level. the more difficult the bot is the lower its max panic value can be. the first timers panic really easy. once you've played a while you start guessing possible landing sights.


...while an "examine" message would be just a signal to focus the view over in the direction indicated, which would be triggered by less specific events like an object colliding with the world, or gunfire hitting a wall...
again depending on difficulty level. easy bots would react less to world interactions. medium would react to everything equally and hard would only react to things that aren't in their LOS and caused by teammates. so if a teammate behind the hard bot hits a crate and it goes 'skoosh' if the bot 'knows' that there's a teammate there it would be less likely to 'examine'.


Finally, a really big thing to consider is how the AI will be aiming....
for this i'd say difficulty level controls apparent mouse sensitivity. hard would be faster (though still not aimbot fast) with little over-steer. easy would be much more lazy and might yaw too far.


I'm assuming the bots will have some basic understanding of the various add-ons...
i can't really see bots learning to place alarms unless the maps are 'marked' with info_alarm nodes of varying priority.
without the LAM it would be pretty simple to engineer some extra over-steer i mentioned earlier. just have a region near the center for their FOV where they think they're pointing. then after they've fired they start to compensate. might help keep the team-damage up to reasonable levels especially if the bot can't tell its own bullet impacts from its teammate's if they fall too close to the assumed LOF.
with the lam they'd know where they're aiming of course but since the dot isn't actually supposed to interact with the hidden at all aiming is the only purpose it should serve them.
given the reply to my 1st post the flashlight will be useless to them as would the image intensifier goggles.
all i can think of for adrenaline is: don't forget to give them the blur effect :D

Gusdor
30th November 2006, 10:40
do CSS bots use knives ever? I think it would only need to be important for bots to respond to alarms in their area. As far as flashlights and LAMs go - just randomize ftw!

Ging
30th November 2006, 11:05
And the communication shouldn't be annoying. Not just like: *throwing-nade* - "Danger" - "Danger" - "Danger" - "Danger" - "Danger" - "Danger" - "Danger" - "Danger" - "Danger"

The communication I've described wouldn't be vocalised - purely a silent dialogue via code. Don't think about it from a player point of view, it's nothing like it!


Alright, for the AI hidden detection, you obviously have that planned out. The only thing I'd add is a very basic emotion system... perhaps just a single float that basically specifies the adrenaline or panic level of the AI.

Yeah, I'd thought about this sort of thing - it's part of the reason I'd be going for a Fuzzy Logic system so I could use these sorts of values to alter the output.


You might also want to consider checking distance. The hidden at long range is absurdly easy to spot while moving, for instance.


distance to target
:p


Also, what you mentioned about the "danger" signals given to AIs to avoid grenades is interesting. Given that would you be able to create two kinds of signals for the hidden: attack and examine? An "attack" message would be triggered by very obvious signals to the hiddens presence (IE, a knife swipe), while an "examine" message would be just a signal to focus the view over in the direction indicated, which would be triggered by less specific events like an object colliding with the world, or gunfire hitting a wall. Heck, they could all be part of the same message, just differing strengths.

I'll have to look into how the grenade does it - I suspect a fair bit of new code would have to be added to prop_physics to get them to send the right messages when they break.


Finally, a really big thing to consider is how the AI will be aiming. If they're like some big autoturret, thats no fun. Two important things are needed in that regard: some implementation of a reaction time, and imprecise knowledge of the hidden's location.

There would certainly be a reaction time - they'd be treated as a player in most respects, so they'd have to turn to face a direction rather than just snapping to it.

imprecise knowledge would come from the fuzzy logic - but I do agree with what you are saying and would have to work towards making sure it stayed nice.

Alt
30th November 2006, 12:12
The aiming issue can be easily overcome.

Imagine the bot has a circle for a crosshair. The bot shoots anywhere within this circle. Depending on say, fear factor the radius of circle would size accordingly. You could also lag the centre of the circle say, to the coordinates of the Hidden 1/2 second(s) ago (or predicted forward in time?).

Bot communication should definitely exist, but if a bot claims to see the Hidden they shouldn't all go and investigate, this is too systematic and not realistic.

For seamlessly 'random' movement/routes take the following example:

- Bot1 has 3 places he can go. A, B or C. He chooses route B.
- When Bot1 reaches desitination/waypoint B he has a new set of desitinations/waypoints he can walk/run to.

......E
..../
...B-F
../
A-C-G
..\
...D-H
....\
......I

The bots should also have the basis of a personality matrix. Like, some bots get more scared than others, some camp, some are trigger-happy etc...

Meh, I'll have a propper think later on, good luck with this Ging.

Bernardo
30th November 2006, 13:01
How will they react to being hit by the hidden? Or their partener being hit?
Will they chase bodies being dragged away?

Daedalus
30th November 2006, 13:02
A difficulty mode disabling the bots ability to shoot would be nice for people who just want to fling stuff at marines for no reason...

That is if the phys shadows collide properly. :D

Ging
30th November 2006, 13:28
Bot communication should definitely exist, but if a bot claims to see the Hidden they shouldn't all go and investigate, this is too systematic and not realistic.

It's not realistic for a human player, but as part of the fiction, it would make sense for the team to converge towards that location - of course the ultimate aim would be to have each pair take seperate entrances to the area in an attempt to cut off an escape, but even thinking about that is a looong way off.


That is if the phys shadows collide properly. :D

Fixing the phys shadows of the existing bots is a simple task, I know what the issue is and I've seen where it's doing it - just not high on my list of priorities.

starstriker1
30th November 2006, 15:32
Actually, that kind of flanking stuff can be done fairly easily if you just add an "overlay" to the AI net that the A* algorithm takes into account. The overlay is unique for each player, and just makes the bot think there is more or less distance between each node. If you wanted a certain bot to avoid one entrance and to favour another, you'd just put some strong values on the nodes around the doors you want them to avoid.

I currently use this kind of technique to get flanking behaviour out of my AIs (though it obviously needs work) and it can be easily extended to allow for stealth behaviour... ;)

Cheesey
30th November 2006, 15:43
The bots should also have the basis of a personality matrix. Like, some bots get more scared than others, some camp, some are trigger-happy etc

that shouldn't be overdone ;)

But it's a really cool idea to implement a proper A.I. to the bots in H-S! It won't be the same like playing with human ppl, but for training it would be perfect.

Maybe a good point to upgrade the tutorial with some bot-enemies :D

none-of-the-above
30th November 2006, 17:36
How about the occasional random freak-out?Quite often as hidden I hear gunfire from somebody shooting at a nearby wall,believing me to be on front of it :D

And how would they react to steam vents?Perhaps pause to examine them for a moment?

Lord Al
30th November 2006, 19:04
When you do get the basics working (I know you will) why not give each member of the iris team a basic personality after all they all have there own backgrounds story and training?

Night Raider
30th November 2006, 19:39
Remember to increase the 'panic' and decrease the 'detection' when the bots are blurred, such as when they are pipebombed or F303'd. Also, maybe increase the 'panic' and increase the 'detection' for a certain ammount of time after the Hidden uses a taunt sound.

Zabiela
30th November 2006, 21:05
Also, maybe increase the 'panic' and increase the 'detection' for a certain ammount of time after the Hidden uses a taunt sound.

For that the "good" bots should get increase in detection/direction. "Novice" bots would get increase in panic.

Daedalus
30th November 2006, 21:11
For that the "good" bots should get increase in detection/direction. "Novice" bots would get increase in panic.

QFT, to novices taunting is something they fear. To pros, it's just something that gives away your general direction which could lead to them pinpointing your exact location.

However...who taunts bots? :D

Paegus
30th November 2006, 21:27
i think it's safe to assume that some servers will have a set bot_quota to entice players to join. this could result in taunts being issued when there's a bot present.

Demented
30th November 2006, 21:48
Bots shouldn't do damage to other IRIS players. It would get impossibly annoying to get TKed by a bot, and I doubt it would be worth it to code the AI to avoid shooting at other players.

Neither should bots become the Hidden. Only players should be counted. Though I'm not sure how to reconcile that, if it's only one player versus bots, the player would be never become an IRIS.

Also, the easiest bots would be the ones simulating dx7 players. They just shoot randomly after being stabbed. =P

Paegus
30th November 2006, 22:11
it's not an accurate simulation of they don't hurt and kill the occational teammate.

a hidden bot would need 'pounce_nodes'

Cheesey
30th November 2006, 22:15
Yeah a hidden bot must be more difficult than IRIS. And there definitely SHOULD be an option to stop BOTS joining the 617 selection...

Either I don't think that a hidden-bot will be funny to play with...

Ging
30th November 2006, 22:46
Note the title of the thread people - were it a generalised bot discussion it would say so, rather then being very specific in what it's talking about.

Also realise that I'm not taking into account anything like difficulty levels here, this is purely the base theory and thinking behind the design and near enough 0 implementation detailing.

Fluffy
30th November 2006, 23:10
one question: how are you going to script the AI for using the fn303?

the weapon use of that is so much different than any other so you cant simply have the bot aim at it, you'd have to try to get it to adjust the pitch up or down depending on how far the hidden is. you also have to be careful not to let the bot hit too many times either because you know bots with 303's would rape any mediocre hidden any day...

Zabiela
30th November 2006, 23:36
one question: how are you going to script the AI for using the fn303?

the weapon use of that is so much different than any other so you cant simply have the bot aim at it, you'd have to try to get it to adjust the pitch up or down depending on how far the hidden is. you also have to be careful not to let the bot hit too many times either because you know bots with 303's would rape any mediocre hidden any day...

Consult Letum Ex, im sure you remember him ;)

Paegus
30th November 2006, 23:49
calculating trajectories isn't that hard. nor is calculating lead. predicting lead is a slightly different story but far from impossible.
a bot can easily be quite godlike with that gun

Ging
1st December 2006, 00:04
one question: how are you going to script the AI for using the fn303?

That's more part of the actual implementation, but as Paegus has said - doing the calculations for the 303 is fairly trivial.

starstriker1
1st December 2006, 01:15
Yeah. AIs can easily handle the low level stuff like aiming, shooting, and moving far better than any human can, and it's easily implemented. Its making them do these things believably, and the less straightforward tasks, that is challenging from a programming perspective.

For example, in an RTS game, micromanaging and keeping track of individual units locations, health, etc is something an AI will do far better than a human player could possibly hope to. However, something as trivial for a human player as identifying a bottleneck on the map is extremely difficult for the AI to manage.

Cheesey
1st December 2006, 06:33
Do you also want to do a 617-Bot or just IRIS?

The M.A.N6
2nd December 2006, 08:26
Do you also want to do a 617-Bot or just IRIS?


Note the title of the thread people

:]

Cheesey
2nd December 2006, 22:57
:]

Erm... did I really wrote that? Hmmm... was some kind of dozy.... sorry.... ;)

Gusdor
2nd December 2006, 23:03
That's more part of the actual implementation, but as Paegus has said - doing the calculations for the 303 is fairly trivial.
This takes me right back to uni, both with Kevin and Phil - trying to seperate design from implementation, especially where code was concerned, was a nightmare for me. I always work to my capabilities - rather than saying "i want to do this" and doing it. Pretty lmiting thinking :O

Sil
2nd December 2006, 23:26
Would it be far too complicated or stupid for the bot to merely remember the hidden's position within the last three seconds, jotted down in his mind with intervals of, say, 100ms, so that he could easily calculate the hidden's path on a distance, but would, at close range, be left with just dots?

Ging
2nd December 2006, 23:45
Why would we want to do that? We could instead query the hiddens position and velocity, use a bit of logic to decide if we can see him or not and from that decide if we should plot his approximate destination based on position + velocity.

Sil
3rd December 2006, 00:13
Or you could do that. I'm no coder, nor have I aspired to be.

Although the bots probably would need a short stall when turning, because if they had unlimited turning speed -- argh, you see where it's going already.

Ging
3rd December 2006, 02:14
The bots, in terms of movement, will act like human players, with the same turning speed and requirements to rotate to face a direction over time rather than just snapping to it.

Alt
21st December 2006, 10:35
Ging, will you try and implement a 617?? That'll be a daunting task matey ;)

Paegus
21st December 2006, 10:50
other posts in thread say: no

Alt
21st December 2006, 10:55
Heh, whats new...

Ging
21st December 2006, 12:36
I can't see playing against a 617 bot being particularly fun - so it's not really worth the effort to make it anywhere near good.

Felf
21st December 2006, 16:17
this could almost be in a PM i guess, but i suppose some other people might be interesting...

Ging: i'm getting into coding atm (as one does in his spare time), and i'm pretty curious about AI... How DO you go about coding fuzzy logic in the context of bots etc, and is there a decent book i can go away and read on the subject (at beginner shittyness level) ? Chars

starstriker1
21st December 2006, 19:09
While (admittedly) I haven't done too much research into it myself, the basics of fuzzy logic include simply representing values of true or false as having a DEGREE of truth or falseness... a float from 0 to 1.

One of my books that covers it is...

...a book that I have conveniently misplaced. I'll post it if I come across it.

Ging
21st December 2006, 19:18
A good book for starter AI stuff is "Programming Game AI by Example" written by Mat Buckland - once you know a bit more, the AI gems series is fairly good (not bad for beginners, but it's less useful in terms of "this is how to do this").

Felf
23rd December 2006, 14:45
awesome, cheers :) I could actually get a book on source AI specifically; it'd be an easy way to get the basics down methinks... I'm off to surf amazon and remind myself how little moneys I have. Laters.

Oh btw, did you guys finish your Uni courses now, out of interest?

Zabiela
23rd December 2006, 19:01
Ging- will we still be able to "turn off" the bots? I like being able to test a map without being shot :o

Ging
23rd December 2006, 19:09
Uni course : All done, I'm now employed by the uni to pass on my Source modding knowledge - though only on a part time basis!

Yeah, I'll be sure you can make them 'dumb' bots for map testing and the like.

Zabiela
23rd December 2006, 19:20
Congrats

Cheesey
23rd December 2006, 20:02
Would there also be a command like bot_stop or bot_freeze so the don't run around? Would be nice for making screenshots...

Niar
26th December 2006, 23:21
Using the panic level that was mentioned earlier in the thread, it would be nice if the bots reacted with teammate's corpses, and reacted more if they were.. say for example, hanging from a roof. If this was implemented, they would have to have a range for seeing the corpses, and a different panic level depending on the state of the corpse (PSed, hanging, normal corpse etc.)

Nuka5
27th December 2006, 21:36
This may seem a little far fetched, but in my opinion would definately improve the experience:

Bot Personalities. these would be randomly selected, on several sliders such as:

alertness
movement style (start-stop, run around,
checking / looking style (some may look up, others won't. some will check corners imidiately, others scan the entire room...)
tracking ability (how easily the bot follows the hidden)
accuracy
weapon preference
stalk/camp - style of play


now this would diversify the way that the game can be played; making it no harder or more limiting, yet not allowing predictable occourances. for instance, if all bots are the same, you can learn patterns to beat them, such as hiding in X and attacking when they bots go through Y.

would this be possible?

Zabiela
27th December 2006, 21:49
Might also be good to have a chance the first 1 or 2 bullets shot at a "spotted" hidden will be off target, depending on the bot's skill of course.

If this didnt happen, everytime a bot would shoot at the hidden, hed hit it, and you wouldnt get much warning as the hidden.

HiddenAlex
30th March 2010, 19:18
Alright, for the AI hidden detection, you obviously have that planned out. The only thing I'd add is a very basic emotion system... perhaps just a single float that basically specifies the adrenaline or panic level of the AI. From that you can scale some influences up and others down... a panicking player isn't going to see an immobile hidden as well, but they're going to be much more sensitive to movement or sudden changees in the environment. You might also want to consider checking distance. The hidden at long range is absurdly easy to spot while moving, for instance.

Also, what you mentioned about the "danger" signals given to AIs to avoid grenades is interesting. Given that would you be able to create two kinds of signals for the hidden: attack and examine? An "attack" message would be triggered by very obvious signals to the hiddens presence (IE, a knife swipe), while an "examine" message would be just a signal to focus the view over in the direction indicated, which would be triggered by less specific events like an object colliding with the world, or gunfire hitting a wall. Heck, they could all be part of the same message, just differing strengths.

Finally, a really big thing to consider is how the AI will be aiming. If they're like some big autoturret, thats no fun. Two important things are needed in that regard: some implementation of a reaction time, and imprecise knowledge of the hidden's location. Imprecise knowledge could mean that the AI might accumulate information on the hidden's location, except that each piece of information is sent in with some kind of random offset. The AI would then have to try and average out the error filled information to get an approximation.

Well an even simpler method is: Footsteps are recorded in their datalog, so are any sounds. Then a new data cache is opened for movement, simply, they see X texture at X distance moving at X mph, they take a 1 second delay to shoot and calculate where to shoot by taking the distance moving+sounds+distance compile them into an average of where the target would be and shoot at any area within say a 5cm around where the crosshair should be.