i'm creating bomberman-like game, anyone have an idea about the AI for the "computer player"? (it should be able to adjust the diffculty)

thank you.

edit: sorry that i put the subject to my name, it's just accident in clicking, i tried to edit the subject name but it's not effect the subject list in the game forum... sorry.

edit: adjusted your title so it reflects your subject -H-
Posted on 2003-02-04 01:06:08 by doby
have u searched on the net ? on a quick google search i found some
bomberman with source codes (mostly delphi, c)

here is a pseudo code from Bomberman for Linux
  /*

Basic plan:
If ( not safe )
move;
else
{
if ( near powerup )
{
move to get it
}
else
{
if ( near block )
{
blow it up
}
else
find player
drop bomb near him
}
}
*/


hope it helps somehow ...
Posted on 2003-02-04 02:31:50 by TBD
hi , TBD
yep, i saw the one that u posted...is there any others idea?
Posted on 2003-02-04 03:11:07 by doby
doby: what are you looking for ? be more specific ?
do you want a more simple approach to be easier to implement in ASM ? or ?

btw, if you do a bomberman game in ASM that you can play on network
please keep me updated. i'm a sucker for bomberman games :tongue:

if you need .xm background music, let me know :)
Posted on 2003-02-04 03:19:47 by TBD
hi TBD,

i just want only the algorithm (or idea) for the "computer player" to play with user.
the pseudo that you posted is one solution. but i just want to see is there any other or better idea about the idea (faster, simpler,....).

the game is completed already except the computer's AI part.

thank you.
Posted on 2003-02-04 03:27:15 by doby
IMO (not that my opinion amounts to much) the above pseudo code is the simplest, possibly too simple.

The most tricky part, of course, is:



find player

;) ;) ;)

You might want to create some sort of 'weighted scoring' to determine which direction your AI should move to go near the player, you could also implement some sort of A* or pathfinding algo to find a path toward the player, but that IMO (again, my opinion is not much use) may be a bit of overkill.
Posted on 2003-02-04 06:21:57 by AmkG
Hi AmkG,

to find a palyer, i saw the above source code used exhaustive search by recursive all possible path.
for the small area map (like bomberman game, at most 12x12), will A* algor improve the performance much? is it worth to try? because A* take some more overhead to calculate the h() value and sort the node in the open list.
or i should just use exhaustive search for this kind of small map?

thank you.
Posted on 2003-02-05 09:31:41 by doby
Game difficulty could be adjusted by altering the 'find player' part of code. With the most advanced level predicting the path of the player and dropping bombs in front of them. You could adjust the accuracy/frequency of finding and bombing. Also the aggresiveness of finding powerups can be adjusted.
Posted on 2003-02-05 12:44:50 by bitRAKE
"Weighted Need" is an easy solution to the problem of game enemy AI.
It works well for both 2D and 3D environments.
For each enemy, imagine a number of lines drawn from the enemy to objects around it.. thinking in terms of XY vectors for the rays, decide if each vector should be positive or negative by whether the object is desirable to the Enemy or not, and multiply each by a weighting factor, then calculate the average of all the vectors to achieve a single resulating vector determining movement of the Enemy.
The weighting values are where the "IQ" level of the AI is found, and can also be used to "learn" via something called a "feedback loop".

This is Neural Networks for beginners.
Posted on 2003-02-06 09:27:30 by Homer

"Weighted Need" is an easy solution to the problem of game enemy AI.
It works well for both 2D and 3D environments.
For each enemy, imagine a number of lines drawn from the enemy to objects around it.. thinking in terms of XY vectors for the rays, decide if each vector should be positive or negative by whether the object is desirable to the Enemy or not, and multiply each by a weighting factor, then calculate the average of all the vectors to achieve a single resulating vector determining movement of the Enemy.
The weighting values are where the "IQ" level of the AI is found, and can also be used to "learn" via something called a "feedback loop".

This is Neural Networks for beginners.


So THAT'S what it's called... And ignorant me, creating an AI for a board game structured just like that, he he he.
Posted on 2003-02-07 03:09:43 by AmkG
"Weighted Need" is an easy solution to the problem of game enemy AI.
It works well for both 2D and 3D environments..."

I'm messing with a rather more complex solution at the moment.
It's a true neural network with a "hidden layer" of neurons.

What I wanted to do was to associate the outputs of one or more attributes of an object with the inputs of one or more attributes of another object.
A similar concept is found in the "IK Handles" used to help animate skeletons.
We have an association or link between an attribute of a source node and one or more attributes of one or more target nodes.
The network is not completely parallel however.
Most input neurons won't affect ALL output neurons.
Thus the "hidden" layer of neurons is simply a list of targets per source.
This network can be stored as a linkedlist if the list nodes support N-branching (no predetermined number of branches per node) or if the maximum number of branches per node is greater than the number of targets for any given input.

By associating attributes of objects with one another in this way, we can perform complex logic without having to think too hard.
A good example is automating the landing gear of a jetplane model, by associating the Y height of the jetplane in 3D with the angular state of the landing gear.
Now when the plane takes off and lands, the landing gear will be animated FOR us.
I'm starting to digress from the original topic, I just wanted to emphasize the importance of networks as a most useful databasing system,and the spinoff benefits that can come from this object-oriented approach to programming.
Posted on 2003-02-10 08:54:12 by Homer