Epitech projectSoftwareApplied AIShipped

RPG HD-2D

Unreal Engine 5.6 RPG with a PyTorch-based combat AI.

Second-year Epitech project: an Unreal Engine 5.6 RPG featuring a PyTorch-based combat AI, developed together with a second AI developer.

Context

Second-year Epitech project built by a five-student team with Unreal Engine.

Team

Team of 5 students.

Role

AI developer: worked on the main enemy’s AI with a second AI developer, from representing the combat state to integrating the behavior into the game.

What was built

The AI layer converts a combat state into a normalized 92-feature vector, computes a mask of available actions, then runs a PyTorch MLP (92 → 128 → 64 → 5) whose five outputs pick an action. The decoder rules out impossible actions and always keeps a "Skip" action available. A trained checkpoint (.pt) ships alongside the feature and inference code.

Architecture

Unreal combat state → schema/JSON adaptation → normalization into 92 features → PyTorch MLP (92 → 128 →64 → 5) → valid-action mask → probabilities → chosen action.

Media gallery

Diagram / architectureArchitecture

Technical decisions

  • Fixed 92-feature state representation

    The combat state is converted into a normalized 92-value vector before reaching the model, with level-dependent normalization.

  • Action masking instead of after-the-fact filtering

    A mask computed from the state disables impossible actions before selection, always keeping "Skip" as a fallback.

  • From combat state to a playable action

    The combat state is turned into 92 normalized values describing what the model needs to know. The network then scores five possible actions. Before the final pick, a mask removes the actions that are impossible in the current state, and the chosen action is sent back to the game.

Stack

Unreal Engine 5.6C++PythonPyTorchC#

Skill → evidence

  • Structures a full Unreal Engine 5.6 project

    Project structured with EngineAssociation "5.6" and a dedicated C++ Runtime module.

  • Writes gameplay logic in C++

    C++ makes up about 85% of the project’s code.

  • Designs a learned game AI rather than a hard-coded script

    Trained PyTorch MLP (92 → 128 → 64 → 5), versioned .pt checkpoint, invalid-action masking.

Results

The AI is integrated into the game and drives the main enemy's action choices during combat.

Limitations

The project does not include a quantitative evaluation of the combat AI (win rate, comparison with a rule-based approach, etc.).