Grégory LARGANGE

TASK FORCE 301

EXPLORING GAME POSSIBILITIES WITH PYTHON

— SKILLS

UI design, PathFinding, AI Decision Making, HEAP Optimization, Procedural generation


— TECHNOLOGIES

Python, OpenCV, QtDesigner, CSS


— DURATION

Several months

Summary

This project is what happened when my interest in Python, QtDesigner and video games overlapped. What if I use pyqt5 as the base for a game engine written in Python ?…

This project was my first serious dive into the world of video game programming and design. Units movements, projectile bahaviours, UI design, procedural generation, Pathfinding… It was, in short, an attempt at building a Python Game Engine !


Team

Solo


Achievements

- Programmed all movements (position based).

- Programmed Procedural maps generation.

- Programmed Pathfinding algorithm.

- Programmed AI Decision making.

- Designed and programmed UI.


More Informations

Task Force 301 source code


Battle Setup and UI

- Designed and programmed all UIs.

- Procedural map generation according to player settings.

- Ship generation according to ship settings by player.

- Adverse AI mix ships types and designs to match player total fleet cost as close as possible.

The map generator interface, first step of the battle setup

Base UI for fleet creation

Each parameter modifies charateristics of the ships and impacts their in-game behaviour

Procedural Map Generation

- First experience at procedural objects generation.

- Spares the user from creating maps by hand.

- The generator will follow a set of customizable parameters.

- Fast map generation, albeit with simple objects.

A Homemade GameEngine with Python

- All movements handled with self programmed geometrics/linear algebra.

- Collision checks.

- Controllers for AI speed and rotation (Propotional controller, planned PID controller).

- Turn radiuses calculations.

- Brake distances and drag.

- Angles calculations.

- And more, feel free to check the source code.

I like to write down what the problem I want to solve is. Here i was looking for how to calculate the brake distance of an object starting at an initial speed Vinit and with a constant deceleration.

Here i was looking for the formula which would allow me to calculate the turn radiuses of my ships, and if a target point given by the player is accessible given the ships calculated turn radius.

pseudo code for determining ship detection systems, and target sorting

Pathfinding

- My first application of an A* algorithm.

- Smoothed with weights and HEAP optimized.

- Queued request for multi-agent handling.

- Follow mode: A unit can follow another.

AI Decision Making

Hereafter the decision making process of the AI when auto-selecting a target:

- Excludes non targetable ships (not in line of sight, out of gun range).

- Takes as input target distance, size, armor.

- Calculates hit probability according to target size, distance, own gun numbers and dispersion.

- Chooses between Armor Piercing and High Explosive according to target's armor.

- Computes potential damage.

- Sorts all targets according to potential damage to them in a HEAP data structure.

- Shoot at first element in HEAP.

Note: The provided screenshot represent only the potential damage calculation function.