All projects
Software Engineering

Age of War: 2D Real-Time Strategy Game

Java · Swing · XML

This software engineering project involved recreating the famous real-time strategy game “Age of War” from scratch. In this 1v1 game, the player manages a dynamic economy to recruit units, defend their base, and evolve their civilization through three historical eras, all while facing an autonomous opponent. The development required designing a robust object-oriented architecture capable of simultaneously managing a smooth game loop, real-time collisions, and a custom graphical rendering engine.

Context

This academic project was completed at IMT Mines Ales as part of the Object-Oriented Programming Application (APO) course evaluation. The goal was not only to create a functional game but, above all, to demonstrate a deep understanding of advanced OOP concepts applied to a complex interactive system under tight time constraints.

Architecture

Unlike a data-focused project, the challenge here was code architecture. The project was structured around decoupled components to ensure maintainability:

  • Object-Oriented Modeling: Creation of a strict class hierarchy for Entities (Players, Bases, Units) managing stats inheritance across the 3 evolutionary eras.
  • Stats Management (XML): A dynamic data loading system that avoids hardcoding unit stats in the source code, instead loading them from an XML configuration file to allow for difficulty adjustments.

Methodology

The core of the game relies on a cyclic execution pipeline divided into 4 main phases:

Phase A: XML Parsing and Initialization

To make the game modular and easy to balance, character attributes (health points, damage, cost, speed) are stored in an XML file. Upon initialization, an XML parser reads this file and dynamically instantiates the game objects.

Phase B: The Game Loop

Instead of linear execution, the game relies on a real-time loop driven by a javax.swing.Timer. On each tick, the loop:

  1. Captures and processes user inputs (unit purchases, evolution).
  2. Updates physics: entity movement and collision detection (hitboxes).
  3. Resolves combat (range checks, health point reduction, unit deaths).

Phase C: Custom Graphical Rendering Engine

The graphical interface does not just use standard buttons. A fully customized rendering system was developed by overriding the paintComponent method in Java Swing. This engine draws the backgrounds, health bars, and unit images while respecting their layering.

Phase D: Opponent Intelligence

To make the game playable solo, an AI bot was programmed. It analyzes its own financial resources and elapsed time to generate consistent enemy waves. It is also capable of triggering its own era evolutions to match the player’s increasing power.

Results

  • Smooth Simulation: Efficient memory management and collision calculations allow for smooth rendering without slowdowns, even with numerous units on screen.
  • Dynamic Evolution: The 3-era civilization system is fully operational. When a player evolves, sprites, stats, and available unit types are instantly updated.
Next project Cybersecurity Dataset Construction via AI Agents & SAST LLM Fine-Tuning