Year 2 university group project · 2024–25 · completed
OrOgins, Year 2: a Unity game and an AI that never met
My Year 2 university group project on OrOgins, a 2015 elemental strategy game. As Project Manager I built the game in Unity while a teammate trained a reinforcement-learning agent in Python, but the two halves were never connected. This page covers the university project only; my current commercial work on OrOgins has its own page.
- Context
- Year 2 university group project
- My role
- Project Manager, Scrum Master (Sprints 1 and 3), Unity developer and tester
- Team
- 3 students
- Dates
- Nov 2024 – Apr 2025
- Status
- Completed: a Unity game and a separate learning prototype, never connected; 15 of 26 whole-game checks passed
Stack
- Unity
- C#
- Python
- Gym
- Stable-Baselines3 (PPO)
On this page
The brief
OrOgins is a two-player elemental strategy game whose digital version was created in 2015. In this Year 2 university project, the brief was to modernise its interface and let people play it against an AI opponent.
· 2024–25 · completed
Two halves that never met
I managed our three-person team and built the game in Unity; a teammate encoded the rules in a Python Gym environment and trained a PPO agent on it. The plan was to export the trained policy and run it inside Unity. The export was never written, nothing in Unity called the model wrapper, and when the module ended the game and the AI still could not talk to each other.
| Area | My part | Teammates |
|---|---|---|
| Management | Project Manager; Scrum Master for Sprints 1 and 3; project plan in Microsoft Project; risk assessment and quality plan. | Trello board, GitHub; Scrum Master for Sprint 2. |
| Requirements and design | Functional and non-functional requirements; chose Unity over Unreal; board and piece art. | Five-phase plan and player-experience questions. |
| Unity game | Unity set-up, board, piece prefabs, and the C# scripts for pieces, moves, capture and neutral squares. | Unity game logic assigned to a teammate; the element rules stayed unfinished. |
| Learning environment | Helped with the environment design and debugging. | Gym environment, state and action spaces, and the Pygame prototype rules. |
| Model | Model testing, debugging and monitoring training, with the teammate. | Chose and trained PPO with Stable-Baselines3. |
| Testing | Wrote, ran and documented the test and validation scripts; analysed the failures. | Model validation. |
Two systems that were meant to meet
- Implemented
- My contribution
- Stored data
- Incomplete, or a gap found in testing
- Planned or proposed — not built
The trained policy was saved in Stable-Baselines3's own format. Nothing exported it to ONNX, nothing in Unity called the Barracuda wrapper, and nothing mapped the Unity board to the environment's 100-value observation. That missing bridge is the project's main unfinished piece.
Text version of this diagram
Parts
- Unity game · C# (my build)
- Game.cs controller — creates 10 pieces a side; neutral squares fill the rest; my contribution
- Pieces + move plates — OrOrginsMan.cs, MovePlate.cs: click to move, capture; my contribution
- Neutral-square rule — experiment: fire pieces only; incomplete or failed in testing; my contribution
- Element, capture, victory and turn rules — not implemented in Unity; incomplete or failed in testing
- AIModelManager — Barracuda wrapper; never called; incomplete or failed in testing
- Planned integration (planned, not built)
- Export policy to ONNX — planned, not built
- Map Unity board → 100-value observation — planned, not built
- Python RL · teammate's environment and training
- OriginsEnv (Gym) — board rules, rewards, game-over checks; teammate
- PPO training — Stable-Baselines3 MlpPolicy, 100k steps configured; teammate
- ppo_origins.zip — saved SB3 model
- Pygame play loop — opponent plays random legal moves; teammate
- Test + validation scripts — 9 tests, 9 validators, 4 evaluators; my contribution; I wrote, ran and documented the model tests
Connections
- Game.cs controller → Pieces + move plates
- Pieces + move plates → Neutral-square rule
- Game.cs controller → Element, capture, victory and turn rules (incomplete or failed in testing)
- OriginsEnv (Gym) → PPO training: observations, rewards
- PPO training → ppo_origins.zip
- OriginsEnv (Gym) → Pygame play loop
- ppo_origins.zip → Export policy to ONNX (planned, not built)
- Export policy to ONNX → AIModelManager (planned, not built)
- Map Unity board → 100-value observation → AIModelManager (planned, not built)
- AIModelManager → Game.cs controller: chosen move (planned, not built)
- Test + validation scripts → OriginsEnv (Gym): exercise the rules
What the agent learned from, what the tests showed, and how we ran it
Reading the environment code shows how narrow the agent's choice really was. It picks a square; the environment then moves that piece to the first legal destination it finds. Rewards say “legal move” or “illegal move” and ±100 at the end, so good play was never directly rewarded.
One step of the observation–action–reward loop, as coded
- Implemented
- Decision
- Incomplete, or a gap found in testing
Text version of this diagram
Parts
- PPO policy (MlpPolicy) — one policy plays both sides; teammate
- Action: a square, 0–79 — the policy never picks a destination
- Own piece on that square?
- Reward −1 — same player tries again
- Any legal move?
- Reward −1 — turn passes
- Take the first legal destination — fixed direction order
- Move, convert path squares, capture — reward +1
- Game over? — both arrived, a royal lost, or no moves
- Reward ±100 and reset — sign follows the mover, not the winner; incomplete or failed in testing
- Switch turn
- Observation: 100 integers — 80 squares, turn, 4 arrival flags, padding; bounds declared ±3 but pieces use ±6; incomplete or failed in testing
Connections
- PPO policy (MlpPolicy) → Action: a square, 0–79
- Action: a square, 0–79 → Own piece on that square?
- Own piece on that square? → Reward −1: no
- Own piece on that square? → Any legal move?: yes
- Any legal move? → Reward −1: no
- Any legal move? → Take the first legal destination: yes
- Take the first legal destination → Move, convert path squares, capture
- Move, convert path squares, capture → Game over?
- Game over? → Reward ±100 and reset: yes
- Game over? → Switch turn: no
- Switch turn → Observation: 100 integers
- Reward −1 → Observation: 100 integers
- Reward −1 → Observation: 100 integers
- Observation: 100 integers → PPO policy (MlpPolicy): next step
Without capture and victory rules in place, a win rate could not measure anything, so I tested what could be checked deterministically. The failures were the useful part: they pointed at missing rules rather than at the learning code.
Test and validation results recorded in the final reflection
- Board dimensions Passed10 columns × 8 rows
- Board initialisation MixedPieces and starting positionsTests passed; the stricter validator failed 1 of 4 checks.
- Observation encoding PassedLength and piece codes of the 100-value observation
- Element interactions MixedThe strength cycle, including fire against airTests passed; the air-against-earth validation crashed with an index error.
- Movement FailedPieces move in their allowed directions“Evolutionist man should move up”.
- Turn switching FailedThe turn passes after a move
- Destination timing MixedThe goal rows are recognisedStalemate after a maximum number of turns failed.
- AI decision checks MixedCapture and protective moves are availableChecks the rules, never the trained policy; strategic progress failed.
- Whole-game validation Mixed26 rule checks across the environment15 of 26 passed.
Several copies of the environment existed, so these results describe the build tested at the time, not a single final version.

We worked in Agile sprints with a Trello backlog, stand-ups and reviews; SDLC structured the game track and CRISP-DM the learning track. Sprint 1 ran long because Unity and the rules took far more time than planned, so by the time the environment and PPO arrived there was little room left to connect them.
Three sprints, two tracks, one unfinished connection
| Sprint | Team goal (sprint plan) | My part |
|---|---|---|
| Sprint 125 Nov – 16 Mar | Initialise the project, set up Unity, build the board and pieces. | Scrum Master. Requirements, project, risk and quality plans; Unity setup, board, pieces and C# scripts. |
| Sprint 217 Mar – 3 Apr | Custom Gym environment, PPO training and integration. | Model testing and debugging with the teammate who built the environment. |
| Sprint 34 Apr – 6 Apr | Completion, evaluation, validation and the presentation. | Scrum Master. Ran and documented the test and validation scripts; sprint review. |
Sprint 125 Nov – 16 MarScrum Master: me
Initialise the project, set up Unity, build the board and pieces.
My part Requirements, project, risk and quality plans; Unity setup, board, pieces and C# scripts.
- Game track (SDLC) Requirements, plans, Unity board and pieces
Sprint 217 Mar – 3 Apr
Custom Gym environment, PPO training and integration.
My part Model testing and debugging with the teammate who built the environment.
- Learning track (CRISP-DM) Gym environment + PPO (teammate)
- Integration Trained policy inside Unity: not reached
Sprint 34 Apr – 6 AprScrum Master: me
Completion, evaluation, validation and the presentation.
My part Ran and documented the test and validation scripts; sprint review.
- Integration Trained policy inside Unity: not reached
- Testing Tests + validation
- Sprint or work
- Mine
- Planned, not reached
Text version of this diagram
- Sprint 1 (25 Nov – 16 Mar): Initialise the project, set up Unity, build the board and pieces. I was Scrum Master. My part: Requirements, project, risk and quality plans; Unity setup, board, pieces and C# scripts.
- Sprint 2 (17 Mar – 3 Apr): Custom Gym environment, PPO training and integration. My part: Model testing and debugging with the teammate who built the environment.
- Sprint 3 (4 Apr – 6 Apr): Completion, evaluation, validation and the presentation. I was Scrum Master. My part: Ran and documented the test and validation scripts; sprint review.
- Game track (SDLC): Requirements, plans, Unity board and pieces (25 Nov – 16 Mar)
- Learning track (CRISP-DM): Gym environment + PPO (teammate) (17 Mar – 3 Apr)
- Integration: Trained policy inside Unity: not reached (17 Mar – 6 Apr)
- Testing: Tests + validation (4 Apr – 6 Apr)
CRISP-DM for the learning track
- Business understandingAn AI opponent for a two-player strategy game
- Data understandingRules, board state, actions and observations
- Data preparationRules coded into OriginsEnv; only legal moves allowed
- ModellingPPO with Stable-Baselines3 (teammate)
- EvaluationMy test and validation scripts; rule checks, not a win rate
- DeploymentPolicy inside the Unity game: not reached
- Stage
- My contribution
- Incomplete, or a gap found in testing
- Not reached
Text version of this diagram
- Business understanding: An AI opponent for a two-player strategy game
- Data understanding: Rules, board state, actions and observations
- Data preparation: Rules coded into OriginsEnv; only legal moves allowed
- Modelling: PPO with Stable-Baselines3 (teammate)
- Evaluation: My test and validation scripts; rule checks, not a win rate (my contribution)
- Deployment: Policy inside the Unity game: not reached (not done)
What I took from it
- Situation
- An unfamiliar engine, complex rules and two technologies developed side by side.
- Task
- Plan the work, build the Unity foundation and keep the team heading for a working game with an AI opponent.
- Action
- I set up the plans, built the board and scripts, and turned testing into a record of which rules worked and which did not.
- Result
- A Unity prototype and a separate trained-agent pipeline, but no working connection between them.
- Learning
- Plan smaller end-to-end milestones, agree one environment specification, and test the integration boundary first.
- Test the connection first: the game and the model never met.
- Keep the rules in one place: they lived in both Unity and Python, and neither copy was complete.
- Reward good play, not just legal play: the agent was rewarded for legal moves.
- Test the policy, not only the rules: our checks never loaded the trained model.
OrOgins later became a separate commercial project, where I am Technical Lead. That work has its own page.