Not

Hacker News!

Beta
Home
Jobs
Q&A
Startups
Trends
Users
Live
AI companion for Hacker News

Not

Hacker News!

Beta
Home
Jobs
Q&A
Startups
Trends
Users
Live
AI companion for Hacker News
  1. Home
  2. /Story
  3. /Show HN: Martini-Kit, create multiplayer games without writing networking code
  1. Home
  2. /Story
  3. /Show HN: Martini-Kit, create multiplayer games without writing networking code
Nov 25, 2025 at 6:45 AM EST

Show HN: Martini-Kit, create multiplayer games without writing networking code

yaoke259
1 points
0 comments

Mood

excited

Sentiment

positive

Category

startup_launch

Key topics

Multiplayer Gaming

Game Development

Networking

Typescript

I was working on a multiplayer racing game and kept hitting the same issues. State desyncs where players would see different positions. Race conditions when two players interacted with the same object. The usual stuff.

The frustrating part was that these bugs only showed up with multiple real players. Can't reproduce them locally, can't easily test fixes, and adding logging changes the timing enough that bugs disappear.

After rebuilding networking code for the third time across different projects, I noticed something: most multiplayer bugs come from thinking about networking instead of game logic.

## The approach

In single-player games, you just write: ```typescript player.x += velocity.x; player.health -= 10; ```

So I built martini-kit to make multiplayer work the same way:

```typescript const game = defineGame({ setup: ({ playerIds }) => ({ players: Object.fromEntries( playerIds.map(id => [id, { x: 100, y: 100, health: 100 }]) ) }),

  actions: {
    move: (state, { playerId, dx, dy }) => {
      state.players[playerId].x += dx;
      state.players[playerId].y += dy;
    }
  }
}); ```

That's it. No WebSockets, no serialization, no message handlers. martini-kit handles state sync, conflict resolution, connection handling, and message ordering automatically.

## How it works

Instead of thinking about messages, you think about state changes:

1. Define pure functions that transform state 2. One client is the "host" and runs the authoritative game loop 3. Host broadcasts state diffs (bandwidth optimized) 4. Clients patch their local state 5. Conflicts default to host-authoritative (customizable)

Those race conditions and ordering bugs are structurally impossible with this model.

## What's it good for

- Turn-based games, platformers, racing games, co-op games: works well - Fast-paced FPS with 60Hz tick rates: not ideal yet - Phaser adapter included, Unity/Godot adapters in progress - Works with P2P (WebRTC) or client-server (WebSocket) - Can integrate with Colyseus/Nakama/etc for matchmaking and auth

## Try it

[Interactive playground](https://martini.blueprintlab.io/preview) - test multiplayer instantly in your browser

Or install: ```bash npm install @martini-kit/core @martini-kit/phaser phaser ```

Links: - Website: https://martini.blueprintlab.io/ - Docs: https://martini.blueprintlab.io/docs - GitHub: https://github.com/BlueprintLabIO/martini - npm: https://www.npmjs.com/package/@martini-kit/core

Open to feedback and curious if anyone else has hit similar issues with multiplayer state management.

Discussion Activity

No activity data yet

We're still syncing comments from Hacker News.

Generating AI Summary...

Analyzing up to 500 comments to identify key contributors and discussion patterns

Discussion (0 comments)

Discussion hasn't started yet.

ID: 46044897Type: storyLast synced: 11/25/2025, 11:46:09 AM

Want the full context?

Jump to the original sources

Read the primary article or dive into the live Hacker News thread when you're ready.

Read ArticleView on HN

Not

Hacker News!

AI-observed conversations & context

Daily AI-observed summaries, trends, and audience signals pulled from Hacker News so you can see the conversation before it hits your feed.

LiveBeta

Explore

  • Home
  • Jobs radar
  • Tech pulse
  • Startups
  • Trends

Resources

  • Visit Hacker News
  • HN API
  • Modal cronjobs
  • Meta Llama

Briefings

Inbox recaps on the loudest debates & under-the-radar launches.

Connect

© 2025 Not Hacker News! — independent Hacker News companion.

Not affiliated with Hacker News or Y Combinator. We simply enrich the public API with analytics.