Buttons

Photobucket Photobucket Photobucket Photobucket Photobucket

Labels

Showing posts with label Artificial Intelligence. Show all posts
Showing posts with label Artificial Intelligence. Show all posts

Tuesday, February 21, 2012

Collaborative Artificial Intelligence

Programming language: C++
Software: Microsoft Visual Studio
Engine: Opengl

Owner is a cleric, he/she have a pet, a Dragon.
Owner had to take care of the Dragon, and the Dragon will protect the owner till it dies.

FSM  # 1 - Owner    
States

If Dragon hunger is more than 50, the Owner FEED the Dragon.
If Owner never see monster, Owner MOVE around.
If Owner see monster, Owner send message to Dragon. While Dragon protecting Owner, the Owner is in STAND BY mode to fight monster. (Even if Owner feeding the Dragon)
If Dragon’s health point less than 80 over 100, Owner will HEAL Dragon every 0.5 second.
If Dragon dies, Owner will FIGHT the monster.
If Owner health point less than or equal to 0, Owner will DIE.

Conditions

If Dragon hunger is more than 50, the Owner FEED the Dragon.
If Owner never see monster, Owner MOVE around.
If Owner see monster, Owner send message to Dragon. While Dragon protecting Owner, the Owner is in STAND BY mode to fight monster. (Even if Owner feeding the Dragon)
If Dragon’s health point less than 80 over 100, Owner will HEAL Dragon every 0.5 second.
If Dragon dies, Owner will FIGHT the monster.
If Owner health point less than or equal to 0, Owner will DIE.


FSM  # 2 – Dragon(pet)       
States

If Dragon hunger more than 50, the Dragon will be HUNGRY and send message to Owner.
If Owner never see monster, the Dragon will MOVE around with Owner.
If Owner see monster, the Dragon will PROTECT Owner. (Even it is hungry)
If Dragon health point is less than or equal to 0, the Dragon will DIE.

Conditions

If Dragon hunger more than 50, the Dragon will be HUNGRY and send message to Owner.
If Owner never see monster, the Dragon will MOVE around with Owner.
If Owner see monster, the Dragon will PROTECT Owner. (Even it is hungry)
If Dragon health point is less than or equal to 0, the Dragon will DIE.


Finite State Machine

Programming language: C++
Software: Microsoft Visual Studio
Engine: Opengl

Player is a pirate, gun as a weapon.
When the player shoot the bullet, it must hit the ghost or out of the playable area, then the player able to shoot again.
Player had to pass through the protector and go into the door to get the treasures.

FSM # 1                                       States

Ghost spawning machine (enemy)

When ghost is less than 4 and player had not kill 20 ghosts, spawn more ghost to 4.
When player shoot ghost, the ghost get hit by the bullet, the bullet had same position as the ghost and ghost health point more than 0, follow and damage the player.
If the bullet is not same position as the ghost and the player in the healing area, Ghost move around.
Ghost health point is less than or equal to 0, ghost get destroyed.

Conditions

Ghost spawning machine (enemy)

When ghost is less than 4 and player had not kill 20 ghosts, spawn more ghost to 4.
When player shoot ghost, the ghost get hit by the bullet, the bullet had same position as the ghost and ghost health point more than 0, follow and damage the player.
If the bullet is not same position as the ghost AND the player in the healing area, ghost move around.
Ghost health point is less than or equal to 0, ghost get destroyed.

State Transition Diagram



FSM # 2                                     States

Protector

When player is in healing area and health point less than 50, start heals players’ health point till full, 100.
When player is not in healing area or health point reach 100 after healing or players’ health point more than 50, idle.
When player killed 20 ghosts, open the door to exit.

Conditions

Protector

When player is in healing area AND health point less than 50, start heals players’ health point till full, 100.
When player is not in healing area OR health point reach 100 after healing OR 
players’ health point more than 50, idle.
When player killed 20 ghosts, open the door to exit.

State Transition Diagram









Other Inputs

Keyboard Inputs
W - Move Forwards
A - Move Left
S - Move Right
D -Move Backwards
Enter - Shoot

Animation
- Collision Detection against ghost (player)
- Healing Health Point (player & protector)
- Player’s movement (left & right)
- Bullet’s movement & explosion
- Ghost’s movements