[PR #258] [MERGED] kb: Working two-player co-op in AC4 Black Flag: spawn a peer puppet, and bind UDP in the live game (Assassin's Creed IV Black Flag) #257

Closed
opened 2026-10-15 20:54:52 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rehan-remade/universal-modder/pull/258
Author: @Davidoff-byte
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/12/2026
Merged by: @rehan-remade

Base: main ← Head: kb/ac4-coop-udp-bind


📝 Commits (4)

  • 212e063 kb(ac4): working two-player co-op - spawn the peer puppet, bind UDP in the live game
  • b24acd0 kb: AC4 co-op UDP bind: review fixes
  • ba47bac Merge remote-tracking branch 'origin/main' into land/pr-258
  • 38b120a kb: regenerate the index

📊 Changes

4 files changed (+238 additions, -2 deletions)

View changed files

📝 knowledge/INDEX.md (+2 -1)
📝 knowledge/games/assassin-s-creed-iv-black-flag/coop-ghost-avatar.md (+4 -1)
➕ knowledge/games/assassin-s-creed-iv-black-flag/coop-two-player-udp-bind-in-the-live-game.md (+190 -0)
📝 knowledge/index.json (+42 -0)

📄 Description

What: Field note — working two-player co-op in AC4 Black Flag single-player: Kamzik123/AC4Coop spawns a real peer puppet (built from the local player's cached EntityBuilder) and animates it by action replication, plus the launch-chain UDP double-bind bug (WSAEADDRINUSE 10048) that killed the net, and its 3-part fix.

Field note: Working two-player co-op in AC4 Black Flag: spawn a peer puppet, and bind UDP in the live game

  • game: Assassin's Creed IV Black Flag
  • engine / route: native / native-hook
  • status: working
  • agents: OpenCode (DeepSeek V4.1 Flash)

Checked with um kb check; index regenerated with um kb index.

Checklist

  • um kb check passes (field notes) / uv run --with pytest pytest -q tests passes (code)
  • um kb index regenerated (field notes)
  • no game files, extracted assets, decompiled code dumps or secrets
  • nothing that cheats other players or bypasses anti-cheat / DRM / ownership checks
  • versions, verification and what was NOT verified are written down
  • authored by (agent + model / human): OpenCode (DeepSeek V4.1 Flash)

Why it is worth a note. The co-op itself is Kamzik123's work; the reusable finding is the transport trap — starting the UDP link in DllMain lets a transient process from AC4's launch chain bind the port and die, so the live game's bind() fails and it has no net at all (puppet spawns, never moves; netstat shows the port held by a PID that is not the live game). The fix is to start the net on the first in-world frame and add SO_REUSEADDR — and the warning that SO_REUSEADDR alone regresses, because the transient's corpse is then the last binder and steals the incoming datagrams.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rehan-remade/universal-modder/pull/258 **Author:** [@Davidoff-byte](https://github.com/Davidoff-byte) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/12/2026 **Merged by:** [@rehan-remade](https://github.com/rehan-remade) **Base:** `main` ← **Head:** `kb/ac4-coop-udp-bind` --- ### 📝 Commits (4) - [`212e063`](https://github.com/rehan-remade/universal-modder/commit/212e0636ef48b9075a7cb7796580c8ca3bf16c3d) kb(ac4): working two-player co-op - spawn the peer puppet, bind UDP in the live game - [`b24acd0`](https://github.com/rehan-remade/universal-modder/commit/b24acd06924097243208295d723c66d81da03fe2) kb: AC4 co-op UDP bind: review fixes - [`ba47bac`](https://github.com/rehan-remade/universal-modder/commit/ba47bac0090517ae38bf40a83f39d5733f0b6ae0) Merge remote-tracking branch 'origin/main' into land/pr-258 - [`38b120a`](https://github.com/rehan-remade/universal-modder/commit/38b120a13f33c4377514e42e1dd34143ae344552) kb: regenerate the index ### 📊 Changes **4 files changed** (+238 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `knowledge/INDEX.md` (+2 -1) 📝 `knowledge/games/assassin-s-creed-iv-black-flag/coop-ghost-avatar.md` (+4 -1) ➕ `knowledge/games/assassin-s-creed-iv-black-flag/coop-two-player-udp-bind-in-the-live-game.md` (+190 -0) 📝 `knowledge/index.json` (+42 -0) </details> ### 📄 Description **What:** Field note — working two-player co-op in AC4 Black Flag *single-player*: Kamzik123/AC4Coop spawns a real peer puppet (built from the local player's cached `EntityBuilder`) and animates it by action replication, plus the launch-chain UDP double-bind bug (`WSAEADDRINUSE 10048`) that killed the net, and its 3-part fix. Field note: **Working two-player co-op in AC4 Black Flag: spawn a peer puppet, and bind UDP in the live game** - game: Assassin's Creed IV Black Flag - engine / route: native / native-hook - status: working - agents: OpenCode (DeepSeek V4.1 Flash) Checked with `um kb check`; index regenerated with `um kb index`. **Checklist** - [x] `um kb check` passes (field notes) / `uv run --with pytest pytest -q tests` passes (code) - [x] `um kb index` regenerated (field notes) - [x] no game files, extracted assets, decompiled code dumps or secrets - [x] nothing that cheats other players or bypasses anti-cheat / DRM / ownership checks - [x] versions, verification and what was NOT verified are written down - [x] authored by (agent + model / human): OpenCode (DeepSeek V4.1 Flash) **Why it is worth a note.** The co-op itself is Kamzik123's work; the reusable finding is the transport trap — starting the UDP link in `DllMain` lets a transient process from AC4's launch chain bind the port and die, so the live game's `bind()` fails and it has *no net at all* (puppet spawns, never moves; `netstat` shows the port held by a PID that is not the live game). The fix is to start the net on the first in-world frame **and** add `SO_REUSEADDR` — and the warning that `SO_REUSEADDR` alone *regresses*, because the transient's corpse is then the last binder and steals the incoming datagrams. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 20:54:52 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rehan-remade/universal-modder#257
No description provided.