I’ve been away for a few weeks doing tons of research for new materials that I can bring for this blog and thinking how best to organize them. Also, I’ve been designing a study and project plan to share my AI, Data Science and developer journey with the community and I believe. After much deliberating , I decided to split the blog into three main categories :
This will be the direction of my publications from now on , of course research and development takes a good deal of time so don’t expect a development article every other day, however , with the Opinion Pieces I pretend to be able to publish more regularly , while de R+D takes place in the background.
One of the most interesting applications for Artificial Intelligence is strategy games: how do enemies know where to go and where to hit? , this article illustrates one of the most basic principles of pathfinding , through the creation of a simple Python text videogame.
The premise of the game is exceedingly simple. Our player has to cross the board map while an enemy is in pursue. Every time the player makes a move , the enemy closes in its position until the player manages to cross the whole board , in which case he will win, or the enemy catches him , in which case the player will lose.
This game is then comprised by three objects: Board, Player and Enemy
Before we go into the details of how these three objects interact with each other , we need to briefly discuss how computer agents are conceived
In general , an Agent is anything that can perceive its environment through Sensors and act upon the environment through Actuators. In the case of computer agents , the agent may detect things like keystrokes , specific data values , files or network data packages.
The agent decides how to act through its actuators with a decision function called agent function, that takes as input whatever information is perceived through its sensors. The agent then is able to act upon its environment.
#python #artificial-intelligence #pathfinding #games