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.
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: