Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in AI and Deep Learning by (50.2k points)

I know the title of the question is a bit vague but bear with me here is the problem, every time I write a game or a bot for a game I use a state machine, decision tree or a behavior tree. The problem with these techniques is that they require that I pre-program all the conditions that character/bot is gonna encounter so anytime the user does something unexpected that I did not put a condition for they lose.

Right now I am working on a starcraft bot (bwapi), using state machines I am thinking of using a single state machine for each unit and one master commanding soldiers what to do, but it still requires I pre-program ever thing and for a game like starcraft it is impossible, the only way I can think of I can make it learn is to use GP to evolve these state machines.

Say there is a bridge on the map if 20 marines try to go through the bridge at the same time there will be a big traffic jam which techniques I can use so that it can learn from a mistake? so I don't have to preprogram a condition that says go through the bridge one by one.

EDIT: Just because a question has the words starcraft or bot in it, it does not automatically make it non SO question this question also applies to robotics.

1 Answer

0 votes
by (108k points)

Let me first address your 2nd question that is "how can 20 marines cross a bridge simultaneously without turning into a cluster what". here you are describing group pathfinding, which is a different area of AI called heuristic search. Solving a path for multiple units or agents simultaneously has its own set of algorithms but is generally a much better-understood problem than your first. Off the top of my head, you might use an approach to solve for a subset of the units at the same time means depending on the width of the bridge and then moving the member in each group simultaneously. You can also try to solve each individual marine starting with the one closest to the other side of the bridge.

To get anywhere, you need first to define the empirical measurement of fitness for your bots. It's going to have to be something much clearer than "big traffic jam".

How do you measure that?

What is winning? Are there numerical indicators that your bot is "winning"? Solve this issue first, then when you have a real way of rating one bot against any number of others, plug it in as a fitness function for a GP algorithm.

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...