Will I be able to do this? (Squad AI, A*)

Started by
4 comments, last by DanBrink 16 years ago
I'm really interested in AI, I'm specifically looking into Squad Behaviors now and it doesn't look tooo bad (Although, that's all theory and I haven't tried to practice any) Anyway the time has come for me to come up with a research project and I already submitted an idea of something I'd be very interested in. AI cops running the city. Experimental Design: Write a small city simulation where crime occurs randomly throughout the day and program a team of agents to handle situations with least casualties as possible while apprehending the suspect(s). Basically, I'd have a team of say 5 cops patrol a small area until something alerts them (crime) then they'd all move into position trying to eventually corner the suspect without harming citizens. (Not sure how I'm going to make citizens work into this, maybe the cop won't attack a criminal with long range weapons until he's X distance away from a civilian) I'd probably have this run off XNA (C#) as a simple 2D tile-based game. The cops would probably be blue circles while the criminals red. I'd get to jump into A* pathfinding too! Now, I've messed with genetic algorithms a little bit but that's the extent of my AI knowledge. I have a few months (so plenty of time really) to work on this project, is this feasible for someone like me? Or is this all far too difficult for me? Thanks in advance for reading this and feel free to comment! (Either on my design or the difficulty or both!)
Advertisement
The problem can be as easy or as hard as you make it. Do it iteratively and add more functionality each time.

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!"

AI is a tool of the game designer, used to express the story and to create a mechanism for gameplay. Unfortunately most designers cannot program AI so they work with programmers who can supply them with tools with which the designers can implement AI, given the constraints of the tools and the requirements of the game design.

You're presently stuck with the problem of trying to design a game to demonstrate AI, but you have a limited knowledge of AI techniques appropriate to games. This is not intended as a criticism but rather just an observation of your current state. You have some idea of the technique you want to demonstrate, but I fear that the game idea you have chosen will be far too difficult to design, implement, tune and balance to be a meaningful demonstration of the AI technique (in this case squad-level planning and control of NPCs).

I would recommend that IF your aim is to learn and demonstrate some acquired knowledge of AI, that you first forget about the final game design. Think of a core problem first and understand the solution to it. Then, IF you feel it necessary to write a whole game around this core concept go ahead... but don't expect that it will be any more than a demonstrator of technology.

Regards,

Timkin
Incidentally, a simple solution to your problem of trying to surround a bad dude is via influence maps. Look'em up.

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!"

Timkin is definitely right, what you have now will definitely take more than a few months. I haven't done much tile based stuff, so I'm not sure if that'll make it any easier than what I'm used to (maybe a tad easier). Everything that's been said is good stuff, especially the iterative approach, I'll expand on that. Here are the steps I'd take.

1) Write code for NPC's in a room. Maybe cops on one side, and criminals with hostage on the other. Randomize the cop/criminal/hostage position and have the cops act as well as they can based on this randomization. The room should just be a box with nothing but the npc's.

2) Add tables, and boxes walls to the room so that the AI needs basic pathfinding.

3) Add walls, make it so the cops don't know what is behind each wall. Using this you could even make a house.

4) Work on making everything smooth. Work on making more complex AI. Keep working on this step until you can't think of anything to make better.

5) Make a neighborhood with multiple instances of the rooms you made before, have 1 or so that already has criminals in it.

6) Make it dynamic.

7) Shoot for the sky.

So after 1 you have a demo that is pretty cool, and then every step after that is just icing on the cake (though I wouldn't consider it done until at least 3 or 4). I think you'll find that this will take a lot longer than you expect and this way you'll have something. You want some pretty good AI behavior in 1, but wait until 4 to do anything too crazy.

Good luck.
Thanks for the posts guys, I planned on doing something like Treb said first so I guess that'll work out great.

I'll be sure to research influence maps, anything else you guys want to add is welcome. Any particularly good references, etc.

This topic is closed to new replies.

Advertisement