what's behind counter strike

Started by
1 comment, last by forsandifs 13 years, 7 months ago
hello guys,

i'm thinking of a simple third-person shot. man against cpu in a maze. something like counter strike. but i have no idea how to let the computers fight back in an intelligence way. can you give me some ideas?
Advertisement
Hooo boy. That's a whole book there, sir.

In fact, there are plenty to recommend. For starters, hit up Mat Buckland's "Programming Game AI by Example". That will teach you a lot of what you need to know. But you still won't have a complete bot at that point.

What I'm trying to say is that going from "I don't know" to "I can do a FPS bot" is likely a many-month educational adventure. Likewise, it isn't something that can be distilled into a forum post (which is why people write books on the subject).

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

Hello. Here's the way I would go about solving this problem.

First I'd break the problem down into componenets. What might the bot need to be able to do?

- Find you
- Aim at you when you are in line of sight
- Shoot at you when you are in its aim
- Choose an appropriate weapon from its arsenal
- Use the environment to its advantage
- Throw flash bangs round corners when it thinks you are nearby
- Replenish ammo from pickups
- Get new weapons from pickups

And there may be more things you would want your bot to do.

Many of these could be discarded in a simplified version of the bot. By giving it unlimited ammo, only one possible weapon (e.g. machine gun), making it pretty dumb, and making its aiming and path finding quite artificial, you could limit the list to something like:

- Find you given that it always knows your position
- Shoot at you when you are in line of sight given that the bot always faces towards the player

For the first point you'd implement something quite standard like the A* algorithm.

For the second point you would implement appropriate weapon damage on the target player everytime you implement the shooting animation for the bot. Make it miss a random number of times per number of shots. The number of times it misses per number of shots it takes would be a way to implement a simple difficulty level for the bot.

You can then make the bot smarter and more realistic by adding features to it in order of priority. (The hardest ones to implement might be having the bot use the environment to its advantage, and being able to do things like flash bang round corners).

To make the pathfinding a bit more interesting for example, you could implement an algorithm to simulate the bot having to deduce or guess where you might be. The result of this algorithm would then be fed into the A* algorithm as the target destination for the bot.

etc, etc...

I hope that's helpful!

This topic is closed to new replies.

Advertisement