Dibya Sarothi
Dibya Sarothi
Game DevelopmentActive DevelopmentIn Development (2026)

Ashenfall: Echoes of the Forgotten Crown

2D Atmospheric Action-RPG & Metroidvania Game

Crafting precise combat mechanics, deterministic state machines, and atmospheric world systems in Unity and C#.

Ashenfall: Echoes of the Forgotten Crown overview
Ashenfall: Echoes of the Forgotten Crown preview 1
Project Overview

Ashenfall: Echoes of the Forgotten Crown is an independent 2D atmospheric action-adventure and Metroidvania game built in Unity and C#. Drawing inspiration from Hollow Knight and dark fantasy classics, it features responsive combat mechanics, interconnected level design, hierarchical boss state machines, and rich hand-animated sprites.

Problem Statement

Developing responsive 2D action games requires frame-perfect physics, precise input buffering, and clean decoupled game architecture. Many indie games suffer from physics jitter, input delay, and brittle combat state transitions that break under complex boss encounters.

Engineering Rationale

Game architecture is one of the most demanding disciplines in software engineering: it requires managing real-time loops, deterministic physics collisions at 60+ FPS, memory allocation discipline to prevent garbage collection spikes, and modular AI behavior trees.

Engineering Objectives

Engineer a custom 2D character controller with responsive input buffering and coyote time.
Develop a hierarchical finite state machine (HFSM) governing multi-phase boss encounters.
Implement a modular combat system with poise, hit-stop, camera shake, and directional slashes.
Create an atmospheric lighting and particle pipeline utilizing Unity's Universal Render Pipeline (URP).
Build a scalable save/load system serializing game world state and character progression.
Architecture Blueprint

System Architecture

Built using Unity's Universal Render Pipeline (URP) with a modular C# architecture. Core gameplay follows component-based design patterns, decoupling input management, physics resolution, visual feedback, and combat logic into dedicated subsystems.

01

Hierarchical Boss State Machines

Boss AI is driven by decoupled state machines managing telegraphing, attack execution, cooldown recovery, and phase transitions.

02

Deterministic Combat Resolution

Hitbox and hurtbox queries utilize non-allocating 2D physics casts to prevent memory fragmentation and GC pauses.

03

Juice & Polish Subsystems

Centralized combat feedback manager synchronizes micro-freeze frames (hit-stop), camera impulses, and particle impacts.

Core & Backend Implementation

  • Custom C# PlayerController with kinematic physics calculations and slope handling.
  • State Machine Pattern implemented for player states: Idle, Run, Jump, Fall, Dash, Attack, Hurt, Dead.
  • Non-allocating Physics2D queries (Physics2D.OverlapBoxNonAlloc) for high-performance collision detection.
  • ScriptableObject architecture for weapon stats, enemy definitions, and audio event configurations.
  • Custom batch build scripts and automated asset validation pipelines.

Client & Interface Layer

  • Custom 2D pixel-perfect and atmospheric lighting shaders in URP.
  • Sprite animation state blending with synchronized sound effects and particle triggers.
  • Dynamic camera system utilizing Cinemachine with framing transposer and impulse noise.
  • Diegetic HUD displaying health, soul energy, and acquired abilities.
  • Interactive dialogue and lore delivery system with character portrait styling.

Data & Schema Design

Engine / Tier: Binary / JSON Serialized Save State System

Persistent world state manager serializing player stats, unlocked checkpoints, defeated bosses, and inventory flags.

Core Models & Entities
PlayerData (Health, Upgrades, Currency, Relics)WorldState (Discovered Rooms, Opened Shortcuts, Boss Defeat Flags)SettingsData (Keybindings, Audio Mix Levels, Video Settings)

Authentication & Security Controls

Auth Model: Offline Local Save System with File Checksum Verification
  • Save file integrity hash checks preventing corrupted save states.
  • Graceful fallback to backup save files in case of sudden application termination.

Engineering Challenges & Technical Decisions

Key Challenges Solved

Challenge: Preventing floating-point physics jitter on moving platforms.
Engineering Solution: Switched to custom FixedUpdate kinematic velocity accumulation and manual contact normal verification.
Challenge: Eliminating garbage collection spikes during high-intensity boss encounters with dozens of projectiles.
Engineering Solution: Engineered generic object pools for particle effects, audio sources, and projectile instances.

Trade-Off Decisions

Decision: ScriptableObjects for Combat Data Configuration
Architectural Rationale: Allows fine-tuning attack damages, knockback vectors, and frame delays directly in the inspector without touching core logic code.
Decision: Kinematic Controller over Rigidbody Dynamic Physics
Architectural Rationale: Standard dynamic physics introduce uncontrollable floatiness; kinematic control provides the snappy, responsive feel essential for competitive action platformers.

Testing & Verification Methodology

Frameworks & Approach: Unity Test Framework (NUnit), Automated Playmode Physics Tests
  • Frame-rate stability benchmark: Consistent 60+ FPS on mid-range hardware.
  • Input buffer accuracy: Verification that jump/dash buffers trigger reliably within 100ms prior to landing.
  • Memory profiling: Zero heap allocations during sustained combat loops.

Results & Engineering Takeaways

Gained comprehensive understanding of real-time state machines, game loops, and frame timing.
Deepened expertise in C# memory management, avoiding boxing allocations and optimizing hot code paths.
Bridged technical engineering with aesthetic craft: animation timing, visual audio feedback, and level pacing.