PROCEDURAL ENDLESS TOWER
"INFINITE GENERATION, STRATEGIC EXPLORATION AND PROCEDURAL SCALABILITY"
"INFINITE GENERATION, STRATEGIC EXPLORATION AND PROCEDURAL SCALABILITY"
An infinite procedural tower generator developed in Unity, designed to showcase dynamic generation algorithms, scalable architecture, and adaptive progression systems.
Team size: Solo Developer
Role: Systems Architect, Procedural Generation, Level Design and UI
Stack: Unity, C#
Art & Design: Aseprite
Infinite procedural floor generation using seed-based randomization
Room building algorithm with isolated room removal
Dynamic final room identification (furthest room)
Progressive reveal minimap system
Scalable architecture for difficulty scaling
Event-driven control and input system
Generation Implemented FloorArchitect to control the complete generation cycle:
Seed-based randomization ensuring repeatability across playthroughs
Sequential room creation algorithm in random directions
Grid-based floor planning with marked cells: normal (1), corridor (2/3), final (4), initial (5)
Boundary validation preventing rooms outside grid limits
Developed CreateRoom() method with robust validation:
Each iteration selects a random direction (up, down, left, right)
Verifies next position is within grid boundaries
Creates vertical (2) or horizontal (3) corridor as connection
Increments room counter only when new room is successfully placed
Implemented CleanGrid() method to remove isolated rooms:
Checks each grid cell against its 8 neighbors (3x3 neighborhood)
Removes disconnected rooms by marking them as -1 (invalid)
Guarantees final layout is fully connected
Developed MarkFurthestRoom() using squared distance calculation:
Calculates squared distance from all rooms to initial position
Marks the furthest room as final destination (value 4)
Enables dynamic objective design for each floor
Implemented CreateFloor() to materialize the layout:
Iterates through grid instantiating prefabs based on cell values
Applies distanceMultiplier for consistent spacing between rooms
Creates border of empty rooms surrounding the structure
Sets player spawn position at initial room
Developed MiniMap with progressive reveal mechanics:
2D grid mirroring the floor structure
Reveals rooms and corridors as player explores
Dynamic highlight of current player position
Toggle functionality using Tab key
Implemented GameManager using singleton pattern:
Controls global flow: menu → exploration → next floor
Maintains customizable seed for reproducible experiences
Increments floor counter per generation
Persists across scenes using DontDestroyOnLoad
Configured Random.InitState() for reproducible generation:
Customizable seed via inspector or input
Each floor receives unique seed: currentSeed + currentFloor
Enables players to share seeds and explore identical layouts
Implemented PlayerMovement with event-driven input:
Input based on Horizontal/Vertical axes
Animator integration for movement animations
Automatic flip system for directional facing
Control toggle for game flow coordination
Challenge: Create layouts guaranteeing all rooms are explorable and connected
Solution: Implemented post-generation validation removing isolated rooms and sequential pathfinding-like room creation
Challenge: Ensure final room is always optimal distance from start, even on non-euclidean grids
Solution: Used squared distance (dx² + dy²) to find the furthest point in the grid
Challenge: Allow different players to explore the same floor using identical seeds
Solution: Seed-based initialization integrated into GameManager, enabling precise control over randomization
Challenge: Keep minimap synchronized with exploration while maintaining performance
Solution: Copied grid to MiniMap during instantiation and revealed dynamically as player entered rooms
Implement advanced algorithms like Dungeon Generation (cellular automata, BSP)
Integrate difficulty scaling based on floor progression
Add visual themes variation per floor (procedural tilesets)
Improve performance with object pooling for rooms and decorations
Expand variety of room types and special structures
Scalable architecture for infinite content generation
Robust grid validation and cleanup algorithm
Reproducible seed-based randomization system
Progressive reveal minimap seamlessly integrated
Solid foundation for difficulty scaling and meta-progression