Planeamento

Aulas

Final Project Support

Discussion of the alternatives approaches to develop the final project.

Suport technics

Techniques to support the intelligent component in games. Features, frames and frequencies. Scheduling. "Anytime" algorithms and dynamic content generation. Levels of Detail (LOD). Examples of AI application in games. Examples of architectures for different types of games.

Learning in games

Learning concepts applied to games. Bayes classifiers. Decision trees. Reinforcement learning. Neural Networks. Monte Carlo Tree Search. Application examples.

Planning in games

Introduction to game planning. Basic concepts. Classical planning algorithms, search in state space. Neoclassical algorithms, search in the space of planes, POP and PNP algorithms. Planning Graphs. Hierarchical planning, HTN algorithms.

Turn based games

Search algorithms in turn-based games. Minimax and Alpha-Beta. Extensions and variants. Algorithms supported by memory and pre-defined plays. Board games and strategy.

Architectures and Behaviours

Decision trees; Finite state machines; Behavior Trees; Goal-oriented behaviors; Rules-based behaviors; Fuzzy architectures; Modeling with scripting languages; Tactical Analysis and Group Behaviors

Architectures and Behaviours

Decision trees; Finite state machines; Behavior Trees; Goal-oriented behaviors; Rules-based behaviors; Fuzzy architectures; Modeling with scripting languages; Tactical Analysis and Group Behaviors

Architectures and Behaviours

Decision trees; Finite state machines; Behavior Trees; Goal-oriented behaviors; Rules-based behaviors; Fuzzy architectures; Modeling with scripting languages; Tactical Analysis and Group Behaviors

Movement and Navigation

Path  planning algorithms; Path optimization; Hierarchical and continuous  planning of journeys; Simple movement; Steering Behaviors; Moving avoiding collisions; Prediction of physical effects; Movement in formation; Driving a Vehicle

Movement and Navigation

Path  planning algorithms; Path optimization; Hierarchical and continuous  planning of journeys; Simple movement; Steering Behaviors; Moving avoiding collisions; Prediction of physical effects; Movement in formation; Driving a Vehicle

Movement and Navigation

Path  planning algorithms; Path optimization; Hierarchical and continuous  planning of journeys; Simple movement; Steering Behaviors; Moving avoiding collisions; Prediction of physical effects; Movement in formation; Driving a Vehicle

Representing scenarios

Structures for representing the environment; Static and dynamic characteristics; Objects and autonomous entities; 2D and 3D environments; Tactics and Strategies

Introduction

Course presentation; Evolution of the application of AI in games; Current situation; The various fields of application; Macro and micro management; A quick overview of Python; Python, Pygame and PygameZero;

Final Project Support

Discussion of the alternatives approaches to develop the final project.

Suport technics

Techniques to support the intelligent component in games. Features, frames and frequencies. Scheduling. "Anytime" algorithms and dynamic content generation. Levels of Detail (LOD). Examples of AI application in games. Examples of architectures for different types of games.

Learning in games

Learning concepts applied to games. Bayes classifiers. Decision trees. Reinforcement learning. Neural Networks. Monte Carlo Tree Search. Application examples.

Planning in games

Introduction to game planning. Basic concepts. Classical planning algorithms, search in state space. Neoclassical algorithms, search in the space of planes, POP and PNP algorithms. Planning Graphs. Hierarchical planning, HTN algorithms.

Turn based games

Search algorithms in turn-based games. Minimax and Alpha-Beta. Extensions and variants. Algorithms supported by memory and pre-defined plays. Board games and strategy.

Architectures and Behaviours

Decision trees; Finite state machines; Behavior Trees; Goal-oriented behaviors; Rules-based behaviors; Fuzzy architectures; Modeling with scripting languages; Tactical Analysis and Group Behaviors

Architectures and Behaviours

Decision trees; Finite state machines; Behavior Trees; Goal-oriented behaviors; Rules-based behaviors; Fuzzy architectures; Modeling with scripting languages; Tactical Analysis and Group Behaviors

Architectures and Behaviours

Decision trees; Finite state machines; Behavior Trees; Goal-oriented behaviors; Rules-based behaviors; Fuzzy architectures; Modeling with scripting languages; Tactical Analysis and Group Behaviors

Movement and Navigation

Path  planning algorithms; Path optimization; Hierarchical and continuous  planning of journeys; Simple movement; Steering Behaviors; Moving avoiding collisions; Prediction of physical effects; Movement in formation; Driving a Vehicle

Movement and Navigation

Path  planning algorithms; Path optimization; Hierarchical and continuous  planning of journeys; Simple movement; Steering Behaviors; Moving avoiding collisions; Prediction of physical effects; Movement in formation; Driving a Vehicle

Movement and Navigation

Path  planning algorithms; Path optimization; Hierarchical and continuous  planning of journeys; Simple movement; Steering Behaviors; Moving avoiding collisions; Prediction of physical effects; Movement in formation; Driving a Vehicle

Representing scenarios

Structures for representing the environment; Static and dynamic characteristics; Objects and autonomous entities; 2D and 3D environments; Tactics and Strategies

Introduction

Course presentation; Evolution of the application of AI in games; Current situation; The various fields of application; Macro and micro management; A quick overview of Python; Python, Pygame and PygameZero;

Aulas

Final Project Support

Final Project quick off.

Complete the small projects.

Final Project Support

Final Project quick off.

Complete the small projects.

Final Project Presentation

Some ideas for the final project you can develop.

Final Project Presentation

Some ideas for the final project you can develop.

Learning

Run the examples of Q-Learning and MCTS

Exercises

  1. Run the Q-Learning example.
  2. Change the reward function in (1) to solve the Cab example in the figure
  3. Run the example tictactoe in MCTS file package executing this file 
  4. Implement another game example to use MCTS (for instance Ultimate tic tac toe)

Learning

Run the examples of Q-Learning and MCTS

Exercises

  1. Run the Q-Learning example.
  2. Change the reward function in (1) to solve the Cab example in the figure
  3. Run the example tictactoe in MCTS file package executing this file 
  4. Implement another game example to use MCTS (for instance Ultimate tic tac toe)

Planning

Use of a planner "Planner" in several planning problems (python 3).

Objective

Using the planner, define several domains and build some planning problems.

Exercises

  • Run the zenotravel example with several scheduling issues.
  • Run the sokoban example with several scheduling issues.
  • Define the planning problem corresponding to the sokoban example from the class slides and find the plan to solve it.
  • Modify the planning domain to have a bot that can push two blocks.

Planning

Use of a planner "Planner" in several planning problems (python 3).

Objective

Using the planner, define several domains and build some planning problems.

Exercises

  • Run the zenotravel example with several scheduling issues.
  • Run the sokoban example with several scheduling issues.
  • Define the planning problem corresponding to the sokoban example from the class slides and find the plan to solve it.
  • Modify the planning domain to have a bot that can push two blocks.

Search algorithms in turn based games


Search algorithms in turn based games


Behaviour trees in games

The objective of this project is to study the application of a behaviour tree to control the steering and acceleration of a vehicle.

  1. Draw the behaviour tree to control the car (complete the BT in the slides).
  2. Use the  CarsBT.zip  example as a base to implement your behaviour tree.
  3. Add a new sensor to detect the other car in a 100 point range (bullets max distance).
  4. Add a behaviour branch to eliminate the opponent.

Behaviour trees in games

The objective of this project is to study the application of a behaviour tree to control the steering and acceleration of a vehicle.

  1. Draw the behaviour tree to control the car (complete the BT in the slides).
  2. Use the  CarsBT.zip  example as a base to implement your behaviour tree.
  3. Add a new sensor to detect the other car in a 100 point range (bullets max distance).
  4. Add a behaviour branch to eliminate the opponent.

Behaviour trees in games

The objective of this project is to study the application of a behaviour tree to control the steering and acceleration of a vehicle.

  1. Draw the behaviour tree to control the car (complete the BT in the slides).
  2. Use the  CarsBT.zip  example as a base to implement your behaviour tree.
  3. Add a new sensor to detect the other car in a 100 point range (bullets max distance).
  4. Add a behaviour branch to eliminate the opponent.

Behaviour trees in games

The objective of this project is to study the application of a behaviour tree to control the steering and acceleration of a vehicle.

  1. Draw the behaviour tree to control the car (complete the BT in the slides).
  2. Use the  CarsBT.zip  example as a base to implement your behaviour tree.
  3. Add a new sensor to detect the other car in a 100 point range (bullets max distance).
  4. Add a behaviour branch to eliminate the opponent.

Decision trees and driving

Objective: Use Decision Trees to control the car behaviour on the track.

  1. Run the Decision Trees examples (DecisionTrees.zip)
  2. Remake the car example and incorporate the DT in the decision process of your car. 

Note:

  • Replace your AbstractCar class with this.
  • Add draw_sensors(win) to your car draw(self,win) function.
  • Use the information in the list self.sensors to check collisions (the order is  [front,left,right,back] with the track colour)

Decision trees and driving

Objective: Use Decision Trees to control the car behaviour on the track.

  1. Run the Decision Trees examples (DecisionTrees.zip)
  2. Remake the car example and incorporate the DT in the decision process of your car. 

Note:

  • Replace your AbstractCar class with this.
  • Add draw_sensors(win) to your car draw(self,win) function.
  • Use the information in the list self.sensors to check collisions (the order is  [front,left,right,back] with the track colour)

Driving a race car

The objective of this project is to develop the behavior that make the car to complete the track, avoiding obstacles whenever possible.

Although long, the code is relatively simple, the file race.py controls the movement of the vehicle, and you should simply redo the move methods in the AICar classs.
Many of the original funcionalities of the program have been removed and some new ones added (values ​​in the upper left-hand display).

To launch the program just execute the race.py file.

Driving a race car

The objective of this project is to develop the behavior that make the car to complete the track, avoiding obstacles whenever possible.

Although long, the code is relatively simple, the file race.py controls the movement of the vehicle, and you should simply redo the move methods in the AICar classs.
Many of the original funcionalities of the program have been removed and some new ones added (values ​​in the upper left-hand display).

To launch the program just execute the race.py file.

Moving characters

Using the  flock  example (you can use another example), implement the steering behaviours to control the flock movement.

Development:

Let's do this in phases, in a first step:

  1. The Guy behaviour should implement the rules of flocking
    1. complete the ###TODO in Guy class (cohesion, separation, go to objective (self.parent.goal))
  2. The pack follows a path given by the user
    1. successive clicks with the mouse define a list of points = path.
  3. The cohesion / separation of the flock depends on the distance to the target.
    1. Dynamic distances 
  4. Develop behaviour arrive;
    1. reduce speed according to the goal distance
  5. Identify a leader, remaining flock just follows the leader.
    1. the leader is the closest one to the objective
  6. Develop the alignbehaviour.

Moving characters

Using the  flock  example (you can use another example), implement the steering behaviours to control the flock movement.

Development:

Let's do this in phases, in a first step:

  1. The Guy behaviour should implement the rules of flocking
    1. complete the ###TODO in Guy class (cohesion, separation, go to objective (self.parent.goal))
  2. The pack follows a path given by the user
    1. successive clicks with the mouse define a list of points = path.
  3. The cohesion / separation of the flock depends on the distance to the target.
    1. Dynamic distances 
  4. Develop behaviour arrive;
    1. reduce speed according to the goal distance
  5. Identify a leader, remaining flock just follows the leader.
    1. the leader is the closest one to the objective
  6. Develop the alignbehaviour.

Construction of navigation algorithms.

Using the HillClimbing program build alternative navigation algorithms for the scenario. The map is covered by a grid of hexagons and the paths are calculated between the midpoints of two hexagons.

Exercises:

  • Test the operation of the program.
  • Modify the algorithm to only take cost so far of the path under consideration (UCS).
  • Extend the algorithm to use a bidirectional strategy (BIDI / UCS)
  • Modify the algorithm to use a global perspective (BFS).

Construction of navigation algorithms.

Using the HillClimbing program build alternative navigation algorithms for the scenario. The map is covered by a grid of hexagons and the paths are calculated between the midpoints of two hexagons.

Exercises:

  • Test the operation of the program.
  • Modify the algorithm to only take cost so far of the path under consideration (UCS).
  • Extend the algorithm to use a bidirectional strategy (BIDI / UCS)
  • Modify the algorithm to use a global perspective (BFS).

Representation of scenarios using regular grids.

Using the PathFinder program, construct alternative representations for the scenario

The Pathfinder program allows you to automatically build scenarios from a map and use this information to determine the best path between two points. There are three elements on the map:

  • Road: passable at cost 1
  • Grass: passable with cost 2
  • Water: obstacle

The map is covered by a grid of hexagons and the paths are calculated between two hexagons.

  1. Test the operation of the program.
  2. Modify the map (can use Paint/Gimp) to include new obstacles.
  3. Use different grids: squares and circles. In these cases, remember to conveniently redefine the functions neighbour, hex_to_pix, and pix_to_hex .

Representation of scenarios using regular grids.

Using the PathFinder program, construct alternative representations for the scenario

The Pathfinder program allows you to automatically build scenarios from a map and use this information to determine the best path between two points. There are three elements on the map:

  • Road: passable at cost 1
  • Grass: passable with cost 2
  • Water: obstacle

The map is covered by a grid of hexagons and the paths are calculated between two hexagons.

  1. Test the operation of the program.
  2. Modify the map (can use Paint/Gimp) to include new obstacles.
  3. Use different grids: squares and circles. In these cases, remember to conveniently redefine the functions neighbour, hex_to_pix, and pix_to_hex .

PyGame introduction

  1. Install PyGame on the machine.
  2. Put the pong game to work.
  3. Change the code so that the opponent behaves more intelligently.
  4. Play the game.
  5. Conclusions and results? Impossible to play?
  6. Change the code so that the opponent behaves more real

PyGame introduction

  1. Install PyGame on the machine.
  2. Put the pong game to work.
  3. Change the code so that the opponent behaves more intelligently.
  4. Play the game.
  5. Conclusions and results? Impossible to play?
  6. Change the code so that the opponent behaves more real

Final Project Support

Final Project quick off.

Complete the small projects.

Final Project Support

Final Project quick off.

Complete the small projects.

Final Project Presentation

Some ideas for the final project you can develop.

Final Project Presentation

Some ideas for the final project you can develop.

Learning

Run the examples of Q-Learning and MCTS

Exercises

  1. Run the Q-Learning example.
  2. Change the reward function in (1) to solve the Cab example in the figure
  3. Run the example tictactoe in MCTS file package executing this file 
  4. Implement another game example to use MCTS (for instance Ultimate tic tac toe)

Learning

Run the examples of Q-Learning and MCTS

Exercises

  1. Run the Q-Learning example.
  2. Change the reward function in (1) to solve the Cab example in the figure
  3. Run the example tictactoe in MCTS file package executing this file 
  4. Implement another game example to use MCTS (for instance Ultimate tic tac toe)

Planning

Use of a planner "Planner" in several planning problems (python 3).

Objective

Using the planner, define several domains and build some planning problems.

Exercises

  • Run the zenotravel example with several scheduling issues.
  • Run the sokoban example with several scheduling issues.
  • Define the planning problem corresponding to the sokoban example from the class slides and find the plan to solve it.
  • Modify the planning domain to have a bot that can push two blocks.

Planning

Use of a planner "Planner" in several planning problems (python 3).

Objective

Using the planner, define several domains and build some planning problems.

Exercises

  • Run the zenotravel example with several scheduling issues.
  • Run the sokoban example with several scheduling issues.
  • Define the planning problem corresponding to the sokoban example from the class slides and find the plan to solve it.
  • Modify the planning domain to have a bot that can push two blocks.

Search algorithms in turn based games


Search algorithms in turn based games


Behaviour trees in games

The objective of this project is to study the application of a behaviour tree to control the steering and acceleration of a vehicle.

  1. Draw the behaviour tree to control the car (complete the BT in the slides).
  2. Use the  CarsBT.zip  example as a base to implement your behaviour tree.
  3. Add a new sensor to detect the other car in a 100 point range (bullets max distance).
  4. Add a behaviour branch to eliminate the opponent.

Behaviour trees in games

The objective of this project is to study the application of a behaviour tree to control the steering and acceleration of a vehicle.

  1. Draw the behaviour tree to control the car (complete the BT in the slides).
  2. Use the  CarsBT.zip  example as a base to implement your behaviour tree.
  3. Add a new sensor to detect the other car in a 100 point range (bullets max distance).
  4. Add a behaviour branch to eliminate the opponent.

Behaviour trees in games

The objective of this project is to study the application of a behaviour tree to control the steering and acceleration of a vehicle.

  1. Draw the behaviour tree to control the car (complete the BT in the slides).
  2. Use the  CarsBT.zip  example as a base to implement your behaviour tree.
  3. Add a new sensor to detect the other car in a 100 point range (bullets max distance).
  4. Add a behaviour branch to eliminate the opponent.

Behaviour trees in games

The objective of this project is to study the application of a behaviour tree to control the steering and acceleration of a vehicle.

  1. Draw the behaviour tree to control the car (complete the BT in the slides).
  2. Use the  CarsBT.zip  example as a base to implement your behaviour tree.
  3. Add a new sensor to detect the other car in a 100 point range (bullets max distance).
  4. Add a behaviour branch to eliminate the opponent.

Decision trees and driving

Objective: Use Decision Trees to control the car behaviour on the track.

  1. Run the Decision Trees examples (DecisionTrees.zip)
  2. Remake the car example and incorporate the DT in the decision process of your car. 

Note:

  • Replace your AbstractCar class with this.
  • Add draw_sensors(win) to your car draw(self,win) function.
  • Use the information in the list self.sensors to check collisions (the order is  [front,left,right,back] with the track colour)

Decision trees and driving

Objective: Use Decision Trees to control the car behaviour on the track.

  1. Run the Decision Trees examples (DecisionTrees.zip)
  2. Remake the car example and incorporate the DT in the decision process of your car. 

Note:

  • Replace your AbstractCar class with this.
  • Add draw_sensors(win) to your car draw(self,win) function.
  • Use the information in the list self.sensors to check collisions (the order is  [front,left,right,back] with the track colour)

Driving a race car

The objective of this project is to develop the behavior that make the car to complete the track, avoiding obstacles whenever possible.

Although long, the code is relatively simple, the file race.py controls the movement of the vehicle, and you should simply redo the move methods in the AICar classs.
Many of the original funcionalities of the program have been removed and some new ones added (values ​​in the upper left-hand display).

To launch the program just execute the race.py file.

Driving a race car

The objective of this project is to develop the behavior that make the car to complete the track, avoiding obstacles whenever possible.

Although long, the code is relatively simple, the file race.py controls the movement of the vehicle, and you should simply redo the move methods in the AICar classs.
Many of the original funcionalities of the program have been removed and some new ones added (values ​​in the upper left-hand display).

To launch the program just execute the race.py file.

Moving characters

Using the  flock  example (you can use another example), implement the steering behaviours to control the flock movement.

Development:

Let's do this in phases, in a first step:

  1. The Guy behaviour should implement the rules of flocking
    1. complete the ###TODO in Guy class (cohesion, separation, go to objective (self.parent.goal))
  2. The pack follows a path given by the user
    1. successive clicks with the mouse define a list of points = path.
  3. The cohesion / separation of the flock depends on the distance to the target.
    1. Dynamic distances 
  4. Develop behaviour arrive;
    1. reduce speed according to the goal distance
  5. Identify a leader, remaining flock just follows the leader.
    1. the leader is the closest one to the objective
  6. Develop the alignbehaviour.

Moving characters

Using the  flock  example (you can use another example), implement the steering behaviours to control the flock movement.

Development:

Let's do this in phases, in a first step:

  1. The Guy behaviour should implement the rules of flocking
    1. complete the ###TODO in Guy class (cohesion, separation, go to objective (self.parent.goal))
  2. The pack follows a path given by the user
    1. successive clicks with the mouse define a list of points = path.
  3. The cohesion / separation of the flock depends on the distance to the target.
    1. Dynamic distances 
  4. Develop behaviour arrive;
    1. reduce speed according to the goal distance
  5. Identify a leader, remaining flock just follows the leader.
    1. the leader is the closest one to the objective
  6. Develop the alignbehaviour.

Construction of navigation algorithms.

Using the HillClimbing program build alternative navigation algorithms for the scenario. The map is covered by a grid of hexagons and the paths are calculated between the midpoints of two hexagons.

Exercises:

  • Test the operation of the program.
  • Modify the algorithm to only take cost so far of the path under consideration (UCS).
  • Extend the algorithm to use a bidirectional strategy (BIDI / UCS)
  • Modify the algorithm to use a global perspective (BFS).

Construction of navigation algorithms.

Using the HillClimbing program build alternative navigation algorithms for the scenario. The map is covered by a grid of hexagons and the paths are calculated between the midpoints of two hexagons.

Exercises:

  • Test the operation of the program.
  • Modify the algorithm to only take cost so far of the path under consideration (UCS).
  • Extend the algorithm to use a bidirectional strategy (BIDI / UCS)
  • Modify the algorithm to use a global perspective (BFS).

Representation of scenarios using regular grids.

Using the PathFinder program, construct alternative representations for the scenario

The Pathfinder program allows you to automatically build scenarios from a map and use this information to determine the best path between two points. There are three elements on the map:

  • Road: passable at cost 1
  • Grass: passable with cost 2
  • Water: obstacle

The map is covered by a grid of hexagons and the paths are calculated between two hexagons.

  1. Test the operation of the program.
  2. Modify the map (can use Paint/Gimp) to include new obstacles.
  3. Use different grids: squares and circles. In these cases, remember to conveniently redefine the functions neighbour, hex_to_pix, and pix_to_hex .

Representation of scenarios using regular grids.

Using the PathFinder program, construct alternative representations for the scenario

The Pathfinder program allows you to automatically build scenarios from a map and use this information to determine the best path between two points. There are three elements on the map:

  • Road: passable at cost 1
  • Grass: passable with cost 2
  • Water: obstacle

The map is covered by a grid of hexagons and the paths are calculated between two hexagons.

  1. Test the operation of the program.
  2. Modify the map (can use Paint/Gimp) to include new obstacles.
  3. Use different grids: squares and circles. In these cases, remember to conveniently redefine the functions neighbour, hex_to_pix, and pix_to_hex .

PyGame introduction

  1. Install PyGame on the machine.
  2. Put the pong game to work.
  3. Change the code so that the opponent behaves more intelligently.
  4. Play the game.
  5. Conclusions and results? Impossible to play?
  6. Change the code so that the opponent behaves more real

PyGame introduction

  1. Install PyGame on the machine.
  2. Put the pong game to work.
  3. Change the code so that the opponent behaves more intelligently.
  4. Play the game.
  5. Conclusions and results? Impossible to play?
  6. Change the code so that the opponent behaves more real