Python Forum
[PyGame] AI Techniques applied to a Game
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] AI Techniques applied to a Game
#1
Greetings Everyone,

First of all, let me introduce my self. My name is inSignia and i am 24 years old. I need help implementing AI search algorithm techniques on a game (Snake game). BFS, DFS or AStar - i need to implement one of them on a snake game. I can implement them on a graph, but i dont have any idea how to start or implement them on an existing game code. I have a few game codes implemented by others but i do not understand them, is there anyone who could help me with my implementation or help me understand what the logic of the already implemented codes by some one else?
I need help please reach out to me!

Best Regards,
inSignia
Reply
#2
Do you know how to use BFS, DFS or AStar to find a solution to a maze? That is what you need to do here.

Your playing surface is a grid of cells. Most cells are open. One cell contains the goal. Some cells must be avoided. You take the current game situation (where is the goal, where are the snake segments) and create your graph. Pass the graph to the solver to get your next move. Repeat until you achieve the goal, get trapped or die.

If you playing field is large this is going to be very slow.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020