![]() For instance, if it sees a powerup and thinks it can reach it before the player, perhaps it ought to find a safe path to that tile and move there, keeping an eye out for bombs and avoiding them along the way. Sometimes, however, it should actually be moving to a target. Right now, your AI just wanders to nowhere in particular. The problem you're facing is that your AI never stops to make an intelligent decision about where it should place its next bomb, which leaves it just dropping bombs whenever it can and then working out "shit, shit, what do I do now!?" Pausing to think I need a better way to decide when to place bombs. If one of the other players or bots decide to place a bomb somewhere near you, it often happens that you have no place to hide and you die. However, leaving a trail of bombs behind leaves few places where you can hide. This is because the bot leaves a trail of bombs behind it, as long as it doesn't kill itself. One of the problems with this algorithm is that it tends to leave the bot with very few (frequently just one) safe cells on which it can stand. It doesn't kill itself, but it does have a habit of making itself vulnerable by going into dead ends where it can be blocked and killed by the other players.ĭo you have any suggestions on how I might improve this algorithm? Or maybe I should try something completely different? This algorithm makes the bot very trigger-happy (it'll place bombs very frequently). If (any safe cell in the current $(direction)): ![]() If (can find and reach divergent safe cell in current $(direction)):įor $(direction) in (up, down, left, right): for $(direction) in (up, down, left, right): This time you'll only need to look for a safe cell in only one direction (you don't have to diverge from it).ģ) If you still can't find a safe cell, don't do anything. if the direction is up or down, look for a cell that is found to the left or right of this path), then it's safe to place a bomb and move in that direction.Ģ) If you can't find and safe divergent cells, try NOT placing a bomb and look again. To find that cell, iterate over the four directions if you can find any safe divergent cell and reach it in time (eg. My current algorithm goes something like this (pseudo-code):ġ) Try to place a bomb and then find a cell that is safe from all the bombs, including the one that you just placed. ![]() What general tips do you have for implementing a Bomberman AI? Are there radically different approaches for making the bot either more defensive or offensive? The more sophisticated algorithms I have in mind (the ones that I expect to make better decisions) are too convoluted to be good solutions. This is the first AI I've ever tried implementing and I'm a bit stuck. Currently I have a working but not very smart rudimentary implementation (the current AI is overzealous in placing bombs). I'm trying to implement an AI algorithm for Bomberman.
0 Comments
Leave a Reply. |