High-performance computing requires a deep understanding of memory management, hardware interaction, and low-level architecture. To demonstrate our foundational engineering capabilities, we undertook the complete architectural refactoring of the Battleship Engine, transitioning a legacy procedural C++ codebase into a robust, Object-Oriented system powered by the Allegro framework.
The original deployment interface (shown below) was maintained while the entire underlying logic was rewritten for maximum efficiency.

The Problem: The Cost of Spaghetti Code and Technical Debt
The initial iteration of this software was built under extreme constraints—developed in under 48 hours without proper software engineering modeling. The result was a monolithic “spaghetti code” structure. While functional, it lacked scalability, maintainability, and testing capabilities. In enterprise environments, this type of technical debt is a severe liability that prevents feature expansion and causes system crashes.
The Solution: Complete Architectural Redesign
Rather than applying superficial patches, we executed a full software engineering lifecycle process to rescue the codebase. We stripped the procedural logic and designed a strict Object-Oriented Architecture.
- Separation of Concerns (MVC-Inspired): As seen in the structural class diagram below, we isolated the
BattleshipGameEnginefrom theViewinterfaces. This decoupling ensures that the core game logic (ships, states, grids) is completely independent of the graphical rendering engine (Allegro 4.4.3), making the system modular and highly testable.

- Behavioral Flow Optimization: We modeled the entire system behavior to ensure predictable state management. As the activity diagram illustrates, the flow handles complex branching—from AI opponent logic to sequential turn processing and event-driven mouse/keyboard inputs—without blocking the main execution thread.

- AI Implementation: We integrated an algorithmic opponent capable of strategic decision-making (random searching combined with proximity-based targeting once a hit is confirmed), proving capabilities in state-tracking and logic algorithms.
The Impact
The Battleship Engine project stands as a testament to the value of proper software design. By conquering massive technical debt and applying strict OOP principles in C++, we transformed a fragile script into a scalable, high-performance software architecture. It showcases our ability to not just write code, but to rescue, refactor, and architect systems that are built to last.
The Architecture Behind the Build Complex integrations require a clear vision. The underlying architecture and core development of Battleship Engine were spearheaded by our Solutions Architect, Israel Villaroel, ensuring the system wasn’t just intelligent, but built to scale and deploy seamlessly into real-world enterprise environments.





