Dynamic cover

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

GenoOfTheCrayon

l33t 14 year old with an iron sight RC50
Sep 30, 2001
936
0
0
Middleof Nowhere
Visit site
In all the realistic shooter games I've seen, one big problem is the AI's are always hard coded to hide behind a certain object, or in some situations, just sit out in the open, maybe go prone a la Infiltration's bot code.

So I got to thinking, how could you code a bot to utilize random cover, from anything like a box to even a stack of small boxes? Seeing as how we're moving to the Source engine, with it's sexy physics, this would be a nice thing to see, since boxes and such could be thrown about.

And I suddenly had an idea. Using tracers instead of hard coding to determine the best cover.

I'm thinking it'd probably work like this

1. Bot 1, Bob, gets shot at by Bot 2, Sam.

2. Bob calls up tracers around him towards Sam, maybe in a 10 yard radius or something like that, with 1 every square foot or so.

3. All the tracers that don't hit Sam, but are obstructed, are then given more tracers towards Sam in the surrounding area, maybe a two foot wide, six foot tall square, to determine if the tracer hit an object worth hiding behind.

4. All the tracer areas that are considered adequate cover are then given a distance check, to find which one's the closest to Bob, and also find which one is more infront of Bob.

5. If the tracers don't hit anything and all of them hit Sam, it can either run tracers in a larger area or just go prone on the spot.

The crazy thing about this is it wouldn't even have to be hiding directly behind the object. You could have a bot move behind an object 50 feet away into its shadow if it'd mean the enemy couldn't shoot at them anymore. It also wouldn't think of map geometry and objects as any different, so if some nearby cover near would be behind a vehicle like a tank or a jeep, it'd consider it adequate still. You'd probably have to tell it not to hide behind soft targets like people instead of vehicles, though.

It'd also mean it'd consider stacks or bunchs of little things to be cover, too. Right now, bots won't hide behind stacks of small things because to them it's just as good as hiding behind one small thing, so they instead opt for the much bigger boxes. Using tracers for discerning adequate cover would mean if a stack of small boxes or whatever could provide a big enough shadow for the bot, it'd use it.

I'm more of asking if this would be plausable to do, than if it could be implemented in Infiltration Source or whatever we're calling it. But if it could be done for Infiltration once it's finished for Source, that'd be sweet, and I'd consider playing against bots just to watch the cool cover-detection code.
 
Last edited:

Derelan

Tracer Bullet
Jul 29, 2002
2,630
0
36
Toronto, Ontario
Visit site
I once was a beta tester for my the game design company my brother works at, Pseudo Interactive. They were developing a modern sequel to Vectorman. In the game, the AI was coded brilliantly. There was a variety of ways the AI would react, based on the role they played, but the pussies would generally look around for the most immediate or obvious cover (behind a wall, around a corner, behind a box, behind the machine they were working on), while the stronger AI wouldn't do this until they actually felt threatened.

And none of it was scripted.
 

zeep

:(
Feb 16, 2001
1,741
1
36
Visit site
nice thinking geno. even tho i can play online whenever, i still appreciate good bot coding. your idea seems feasible enough to me ( non coder ) so maybe some inf source coder gets insipred too.
 

Crowze

Bird Brain
Feb 6, 2002
3,556
1
38
40
Cambridgeshire, UK
www.dan-roberts.co.uk
Because it's more work for the mappers who could (should?) be concentrating on making great maps. The flip side is, this method is more work for the coders, and although it would work (quite well I'd imagine) there are better ways (which in turn are even more work for coders). Bear in mind the CPU usage as well.
 

Logan6

TC Vet
Dec 23, 2003
601
0
16
Wait for HL2. Was playing that, turned a corner in the map, and suddenly a bot was rolling a flaming barrel down some stairs at me. Now thats AI!
 

[UMC]Ape

New Member
Aug 26, 2004
5
0
0
Logan6 said:
Wait for HL2. Was playing that, turned a corner in the map, and suddenly a bot was rolling a flaming barrel down some stairs at me. Now thats AI!
thats scripted
 

cracwhore

I'm a video game review site...
Oct 3, 2003
1,326
0
0
Visit site
The fact that the HL2 soldiers (appear to) communicate to an extent - and throw grenades at you and yell 'Grenade!'- while running for cover, (and I believe, they throw yours back?) isn't scripted in that sense.

It's not much I suppose - but it's better than nothing.

I was pretty impressed with the 'Halo 2' AI on the harder settings...

But, yeah, bots that go for cover like humans, and realize that getting shot sucks - that would be nice.
 

BobTheFearlessFish

New Member
Jun 2, 2000
740
0
0
Nottingham, England
there is a difference between the idea of scripted behaviour and AI.

scripted behaviour means that the agent (in this case a bot) behaves because it is told that it should behave in this way.

with an 'intelligent' agent the agent itself should decide what sort of behaviour is beneficial. genos method achieves this. good scripting does not.
 

geogob

Koohii o nomimasu ka?
Actually I don't see much difference between what you guys call AI and scripted behavior. The so called AI in games is nothing close to AI. It's simply a set of scripted behaviors (yes) that are triggered upon specific events. Events can be stuff like "seing a player", "hearing a sound", "being hit", "being shot at", etc.

There is actually very little difference (much less then you think really) between a script triggered by the player entering a certain location and by an AI script triggered by a dynamic event (like seeing a player or being out of ammo for example).

Where AI is a bit more evolved is in stuff like finding cover to hide or sneaking up on the enemy player. But that's all the same.

You really need to stop thinking about AI being intelligent. There absolutely no intelligence in game AI. In my mind, nowadays, there is not difference between scripted stuff and AI. Of course, scripted stuff can be more evolved. Lets take as an example a bot picking up a barrel and throwing it at you.

In a scripted behavior, that easier to do because you know where the bot is, where the player will be (trigger zone) and the barrel is. You know all the variables (or most of them). You could very easily do the same using "AI". It simply involves more "checks". If the bot has an enemy in sight and it is withing a certain distance and it sees a barrel near him, it could chose to take the barrel and throw it at the enemy, and that without any trigger or "scripted behavior" (commas and italic to put emphasis on the fact that AI is actully scripted behaviors).