👻 Reviving a Ghost

Rebuilding a Lost Childhood Classic with Tactical AI


🎮 The Inspiration: Chasing a Memory

We all have that one game. The one that lived on an old family PC or a sliding phone. The one that disappeared without warning.

For years, I searched for a specific card battle casino game with unique mechanics. It was gone. No archive. No APK. No trace.

When this Hackathon began, something clicked.

I did not need to find it anymore. I could rebuild it.

This project is the result of channeling professional GameDev experience into a deeply personal mission: honoring a childhood memory and rebuilding it with modern systems, clean architecture, and tactical AI.


🧠 The Brain: A Tactical Multi Personality AI

The soul of this project is the opponent.

I did not want a machine that wins by cheating. I wanted a rival that feels human. One that has intent. Style. Ego.

The AI evaluates the board using a deep Heuristic Evaluation Function, simulating multiple turns ahead before committing to a move.


📐 The Heuristic Formula

To determine the optimal placement, the AI computes:

$$ V_{total} = ((I \cdot W_{atk}) + (P \cdot 10) + (B \cdot W_{def}) + C_{crit}) \times U $$

Where:

  • ( I ) = Immediate points gained
  • ( P ) = Future potential, probability of completing high tier combos
  • ( B ) = Block value, preventing player scoring
  • ( W_{atk/def} ) = Dynamic weights dictated by the AI personality
  • ( C_{crit} ) = Critical combo bonus
  • ( U ) = Urgency multiplier that increases as the board fills

The result is not just strong play. It is context aware play.


🎭 Dynamic Personalities

To prevent predictability, I implemented 8 distinct AI personalities. The opponent does not just play to win. It plays with identity.

The Calculator

Meticulous and slow. Simulates everything. Rarely makes a tactical mistake.

The Aggressive

High risk. High reward. Ignores disruption to stack massive combos.

The Defensive

Pure sabotage. It would rather destroy your Straight Flush than score modest points itself.

The Opportunist

A master of resource timing. Saves Jokers and Thief cards for maximum psychological and point damage.

Each personality modifies ( W_{atk} ) and ( W_{def} ), reshaping the evaluation landscape.


🔥 Desperation Mode

When the score gap becomes critical:

( \Delta S < -1000 )

and the board is nearly full, the AI abandons its identity.

It switches to raw point maximization in a final attempt to flip the outcome.

This creates late game drama that feels intentional rather than scripted.


📱 The Web Challenge: Responsive Precision

This was a web focused project. Looking good was not enough. It had to be technically robust across devices.

DPI and Crispness

Custom scaling logic adapts to device pixel ratios to ensure sharp visuals from 4K monitors to small mobile screens.

The Orientation War

The game supports both horizontal and vertical play.

This required:

  • Dynamic UI anchoring
  • Hitbox recalculation
  • Layout reflow without breaking tactile feel

No matter how the device is held, the experience remains consistent.


☁️ Cloud Integration

I implemented full progress synchronization using Firebase.

The challenge was managing asynchronous state updates without race conditions or UI desync.

The goal was simple: The cloud should feel invisible.

Players can switch browsers or devices and continue exactly where they left off.


👨‍💻 The Indie Grit

This Hackathon was a marathon.

Long professional workdays. Late nights. Coffee fueled debugging sessions.

But this was the kind of crunch that reminds you why you started building games in the first place.

There is something uniquely satisfying about taking a fading childhood memory and rebuilding it through math, architecture, and clean code.

This project is not just a game. It is a conversation between who I was and who I am now as a developer.

And this time, the ghost does not disappear. 👻

Built With

Share this project:

Updates