Skip to content

Biblioteca de Juegos y Algoritmos de Aprendizaje. En este repositorio diferenciamos tres secciones principales. 1) Desarrollo de videojuegos, para uso del usuario. 2) y 3) Desarrollo de algoritmos para ganar a dichos juegos.

License

Notifications You must be signed in to change notification settings

JavierAM01/Machine-Learning-in-Games

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 

Repository files navigation

[Repository in Progress]

Library of Games and Learning Algorithms. It contains three main sections:

  1. Video Game Development. Creation of video games for general user enjoyment.
  2. Simple Solving Algorithms. In this section, we develop basic algorithms to solve and beat games, such as binary search, tree search, and expert systems (case distinction).
  3. Machine Learning Algorithms. In this section, we apply more advanced techniques, although they are not always the best option, such as machine learning, deep learning, and genetic algorithms.

Table of Contents

  1. Video Game Development

  2. Simple Solving Algorithms

  3. Machine Learning Algorithms

Video Game Development

Preview Link

Snake

Tic-Tac-Toe

Sudoku

Flappy Bird

Chess

Maze

Arkanoid

Simple Solving Algorithms

Sudoku

Preview Algorithm
The Sudoku solving algorithm uses recursion to solve this challenging puzzle. The main idea is to break down the problem into smaller sub-problems and solve them recursively. The algorithm looks for an empty cell on the board and tries different numbers from 1 to 9, checking if they follow Sudoku rules. If a valid solution is found, it moves on to the next empty cell and repeats the process. If no valid solution is found, it backtracks and tries another number. This process continues until all cells are filled or a complete solution is found. Recursion efficiently explores all possible number combinations.

view code

In this repository, I present a more human-like version of the Sudoku solving algorithm. Instead of relying solely on recursion, this version uses different techniques to find possibilities for each empty cell based on the rows, columns, and blocks on the board. A meticulous approach is used to explore different strategies to reduce options and make informed decisions at each step. Additionally, more advanced methods are incorporated to identify patterns and make logical inferences. This new implementation provides a perspective closer to how humans solve Sudokus, offering an interesting insight into game-solving techniques.

The code is written in Haskell, so the graphics are more primitive.

view code

Shortest Path Search

Preview Algorithm
Dijkstra's Algorithm. Dijkstra's algorithm is a shortest path search algorithm for a weighted graph. It is used to find the shortest route from a source node to all other nodes in a directed or undirected graph. It works by assigning a provisional distance to each node and updating these distances as the graph is explored, always selecting the node with the smallest provisional distance until reaching the destination node or all nodes reachable from the source node.

view code

Modification of Dijkstra's algorithm. This modification adds the consideration that the shortest path between two points is a straight line, thus shortening the search in some cases.

view code

Machine Learning Algorithms

AIGym - CartPole

Preview Algorithm
The CartPole environment is a classic challenge in reinforcement learning, where the goal is to balance a pole on a cart by applying discrete actions. In this repository, you'll find different approaches to solving this problem using algorithms such as Q-Learning, Deep Q-Networks (DQN), Policy Gradient, among others.

view code

Genetic Algorithm - Flappy Bird

Preview Algorithm
In this project, we explore the powerful application of a genetic algorithm to solve the challenging game Flappy Bird. By representing the birds as individuals in a population and applying genetic operators like selection, crossover, and mutation, we aim to find the optimal combination of traits and behaviors that maximize the ability to avoid obstacles and achieve high scores. Through iterative optimization based on fitness evaluation and generational evolution, the genetic algorithm converges towards increasingly better solutions. Discover how this mathematical technique allows us to tackle complex problems and achieve impressive results in the context of Flappy Bird.

view code

Introduction to Different AI Models - Tic-Tac-Toe

Preview Algorithm

In this repository, we conduct a comparison of three types of algorithms:

1) Neural Networks,

2) Reinforcement Learning,

3) Monte Carlo Tree Search.

To this end, we created a model for each of them and trained them to play Tic-Tac-Toe. Through this comparison, we aim to analyze and evaluate the performance and capabilities of each algorithm in solving this strategic challenge.

view code

About

Biblioteca de Juegos y Algoritmos de Aprendizaje. En este repositorio diferenciamos tres secciones principales. 1) Desarrollo de videojuegos, para uso del usuario. 2) y 3) Desarrollo de algoritmos para ganar a dichos juegos.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published