Advertisement

Passive - Active

Started by April 13, 2003 02:14 PM
2 comments, last by Ilici 21 years, 7 months ago
i''m currently workin on a 3D bomberman (cool a?) i just got to the AI part and i''m now thinkin how to do it my problems are: pathfinding: not just simple pathfinding (thats easy) but pathfinding considering bombs. my first ideea was to recursivly go through the path and compute some value at every cell and choose the one with the best value. attack or run like hell: when to tell the player to go and place a bomb and when to run from one?
This is just my first thoughts, I have not written a bomberman AI before.

Before pathfinding I would loop through and assign each square two ratings:

danger, say start at zero and add a danger point for every bomb that will explode over this square.
chance to kill, again start at zero and figure out, if I put a bomb here how many people would it kill.

Then I would use those values to determine where I wanted to place a bomb, and use the danger values to influence the costs of a square whilst A*''ing to my destination.

Actually, this is quite intresting. I think I might have a go at writing a bomberman ai...

Alan
"There will come a time when you believe everything is finished. That will be the beginning." -Louis L'Amour
Advertisement
another prob

when the AI player is locked between blocks and has to bomb one to get out, how do i know where 2 put the bomb.
As well as setting a "danger" and "chance to kill" rating for each square, also set a "how many blocks would get destroyed" setting.

Then, starting at your position, flood fill to find all squares you can get to. Now you just choose what you want to do. If any of the squares you can get to have a "chance to kill", you could try to kill one of your opponents, if not pick the square with the highest "how many blocks..." and blow that up.

Although, as well as just, which square will let me destroy the most blocks, you might also want to take into consideration how far it is from your current location. Destroying one blocks by putting a bomb in the next square, is probably better than going half way accross the map to destroy 2 blocks.

Alan
"There will come a time when you believe everything is finished. That will be the beginning." -Louis L'Amour

This topic is closed to new replies.

Advertisement