Settings

Theme

Show HN: Navia Dratp – an online version of an out-of-print Bandai strategy game

naviadratp.com

2 points by explosionpunch a day ago · 3 comments · 1 min read

Reader

I built an online version of Navia Dratp, an out-of-print chess-like strategy game by Bandai (think chess plus mana and deckbuilding).

One interesting part was the Claude-powered AI opponent. The critical part wasn't getting it to play, it was making it safe: the backend only ever hands it server-validated legal moves to choose from, so a hallucinated or malformed move can't corrupt game state. It explains its reasoning after each move. The whole site is Elixir/Phoenix LiveView, with each game as its own process.

I had Claude keep a running development journal from its own perspective, including a story about one game it lost to me while we were building the game: https://naviadratp.com/journal

(Navia Dratp is © Bandai. This is a free, non-commercial fan project - a community preservation effort for an out-of-print game, not affiliated with or endorsed by Bandai)

Play: https://naviadratp.com

robinvdvleuten a day ago

This is a neat LiveView use case. The bit that jumped out to me is "each game as its own process", which feels very BEAM-y in the good way.

Curious how you're handling abandoned games. Do they just sit around until some timeout kills them, or are you persisting after each move so they can be rebuilt after a deploy/restart?

  • explosionpunchOP a day ago

    Thanks! I should have been more precise and said that each player's LiveView socket is a separate process, and each game is a PubSub topic. But yes, games are persisted in a database after each move so you can close the window, come back later, re-join on your phone, etc, just like you'd be able to do on chess.com. So games that are abandoned currently stick around in the database, but don't keep a long-running process up unless someone actually has their browser open the whole time. Games with a timer (regular games that were started with a per-move timer and all tournament games) eventually time out in a loss for the player who let the clock run out, but those stick around as well - you can view replays of any finished game.

    Deploys and restarts don't impact too much - sockets just reconnect and the state reloads from the db.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection