12-22-2002, 03:14 PM
I will be releasing the entire source code, including commented AI for QBDBZ with the final release. My AI is based on a finite state machine with rule based state transitions. For example the computer player may change from the idle state to the attack state if it is on the ground, its opponent is close, has less health and not currently blocking. A simplified version of the code works thusley:
You could also try bugging Hex for details about his AI design (I believe his is in a more functional state than mine).
Code:
sub computeAI
select case ai.state
case IDLE
'**** Computer is moving back and forth idly ****
if ai.onGround and distance < 150 then
if opponent.state = ATTACK then
ai.state = BLOCK
else
if opponent.state <> BLOCK and opponent.health < ai.health then
ai.state = ATTACK
end if
end if
end if
case ATTACK
'**** Attack state ****
....
end select
end sub
You could also try bugging Hex for details about his AI design (I believe his is in a more functional state than mine).
esus saves.... Passes to Moses, shoots, he scores!