Grid Core
Pure C# logic for world-to-grid coordinate conversion, tile bounds, and cell occupancy.
Engineering Case Study
A Unity technical prototype exploring grid-based placement, rotation-aware footprints, and modular gameplay architecture.
Role
Gameplay Systems Programmer
Project Status
Technical Prototype
Technical Focus
Grid Systems, Gameplay Architecture, Placement Validation, Data-Driven Design
Section 01

Section 02


Section 03
This project is a grid-based building system developed in Unity to explore object-oriented programming, modular gameplay systems, and practical software architecture.
Inspired by builder-style games such as Clash of Clans and SimCity, the primary goal was to create a reusable foundation for building placement rather than develop an entire city simulation.
Section 04
A flexible placement system must translate world coordinates into discrete grid cells, validate occupancy and bounds, and support buildings with different footprints and rotations.
Separate grid calculations from Unity presentation logic.
Support single-tile and multi-tile buildings.
Prevent placement outside valid grid boundaries.
Account for footprint changes when buildings rotate.
Provide readable visual feedback during placement.
Keep building definitions configurable through data.
Section 05
The prototype separates grid representation, placement validation, building definitions, and visual feedback into distinct responsibilities.

Pure C# logic for world-to-grid coordinate conversion, tile bounds, and cell occupancy.
Evaluates whether a building footprint occupies valid, available grid cells.
ScriptableObject-based configuration for selecting and representing building types.
Ghost placement feedback and pooled footprint visualization during user interaction.
Section 06
The implementation focuses on the underlying placement mechanics and a maintainable division of responsibilities.
Converts placement positions in world space into discrete grid coordinates.
Tracks occupied cells and checks whether placement remains within grid boundaries.
Supports structures occupying more than one grid cell.
Adjusts the occupied footprint according to building rotation.
Uses ghost previews and pooled footprint visuals to communicate placement state.
Uses ScriptableObjects to support a UI-driven building selection workflow.
Section 07
Problem
A building footprint cannot be validated as a fixed set of cells once the building can rotate. Its dimensions and candidate cells must be evaluated against the current orientation.
Solution
The placement flow derives candidate grid cells from the building footprint and rotation, then checks bounds and occupancy before allowing placement.
Trade-off: Keeping validation separate from visual feedback makes the rules easier to reason about, but requires the preview and commit paths to share the same validation result.
candidateCells = footprint.cellsFor(rotation)
if (!grid.isWithinBounds(candidateCells)) return Invalid
if (grid.isOccupied(candidateCells)) return Invalid
return ValidProblem
Hardcoding every building type into placement logic would make the system difficult to extend and tune.
Solution
Building definitions are represented as ScriptableObjects so selection and footprint data can be configured independently from the placement system.
Trade-off: The data-driven workflow adds asset setup overhead, but reduces branching in gameplay code and supports more consistent iteration.
Section 08
Method: Attempt placement near and beyond the grid boundary with different footprint sizes.
Result: The placement rules account for the complete footprint rather than checking only the cursor cell.
Method: Attempt placement over occupied and available cells.
Result: Placement feedback distinguishes available cells from cells that cannot accept another building.
Method: Rotate multi-tile footprints before checking candidate cells.
Result: The candidate footprint is recalculated for the active orientation before placement is committed.
Section 09
View other projects or get in touch.