Jump to content
  • Advertisement
Sign in to follow this  

2D shooter AI project

This topic is 2922 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I did an AI project this fall semester in which we made a 2d shooter game. The bot in the game was implemented using a finite state machine.

The map consists of the player, the bot, obstacles, health packs, ammo packs.

The bot has 2 high level states : Combat and Replenish. Within combat, the states are attack, hunt or flee, depending on the bot's health and ammo, as well as its position relative to the player (whether it can see the player or not). The bot has a field of view which is a square of finite size around it.

Link for the code : code

I am looking for comments/suggestions, as I want to extend this further.

I have the following ideas right now :

1. Introduce a "dodge" state. This is necessary because when the bot is in line of sight of player, it starts shooting the player without changing its own position at all. It stays still till the player dies, moves out of line of sight or the bot's own health/ammo become low.

2. Use a fuzzy state machine instead of an FSM, so that a certain level of uncertainity is introduced.

To run the game, go into the src folder and then :
python Main.py
(You will need pygame for this)

To play:
WSAD standard movement.
Move mouse to change aiming direction
Left mouse click to fire.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!