ClaudeMods
☰
KO
● 0 명 접속 중 · 조회 0 회
후원프로젝트 제출
Reddit 게시물 · 작성자 cleverhoods

쓸모 있는 시간 - 그래요, Claude mod로 Doom을 실행할 수 있습니다

…이식하는 일이 정말 지긋지긋할 만큼 어려웠습니다. 작동 방식은 간단히 이렇습니다. mod 샌드박스에는 WebAssembly가 없어서, mod가 $.process.spawn으로 시작하는 네이티브 바이너리가 엔진이 되고 Unix socket으로 통신합니다(Windows에서는 127.0.0.1 + token). zig cc로 linux/macos/windows × x86_64/arm64용을 미리 빌드했으므로 kitty에서 컴파일러가 필요하지 않습니다.

번역 완료

이 mod 소개

…이식하는 일이 정말 지긋지긋할 만큼 어려웠습니다. 작동 방식은 간단히 이렇습니다. mod 샌드박스에는 WebAssembly가 없어서, mod가 $.process.spawn으로 시작하는 네이티브 바이너리가 엔진이 되고 Unix socket으로 통신합니다(Windows에서는 127.0.0.1 + token). zig cc로 linux/macos/windows × x86_64/arm64용을 미리 빌드했으므로 컴파일러가 필요하지 않습니다.

kitty에서는 화면이 엔진이 쓰는 파일을 가리키는 Image입니다. Claude Code는 경로만 kitty에 넘기므로 픽셀이 통과하지 않습니다. 다른 환경에서는 Raster의 사분면 블록(셀 하나당 4 px)을 사용합니다. 다른 움직임이 없으면 Claude Code는 ~3 frames/s만 그리므로 게임 아래의 띠가 30 ms마다 다시 그려 프레임을 계속 보냅니다. kitty에서는 약 ~31 fps, 블록 모드에서는 ~35-40입니다.

키보드 처리는 악몽입니다. TS에는 "onPress" 이벤트만 있습니다. 터미널은 키를 놓았다는 사실을 알려 주지 않고 반복 지연 뒤 최신 키를 계속 반복합니다. Claude Code는 kitty 키보드 flags 5만 켜므로 mod에서도 키를 놓은 것을 볼 수 없습니다. 처음에는 방향 전환 키를 220 ms 동안 누르게 하면 된다고 생각했지만, 키를 누른 상태의 회전이 반복이 시작되기 전 약 ~300 ms 동안 완전히 멈췄습니다.

그래서 다른 터미널 Doom이 입력을 흉내 내는 방법을 살펴봤습니다.

  • doom-cli: 반복 지연을 학습하고 다음 반복 시점까지 키를 유지
  • intermission: 누른 뒤 550 ms, 반복 중 120 ms, 마우스로만 회전
  • claude-doom: 누를 때마다 160 ms 펄스
  • doom-braille: 100 ms 동안 입력이 없으면 해제

doom-cli의 모델을 사용하고, 소스의 TODO가 제안한 수정도 더했습니다. 반복이 시작될 때까지 천천히 회전합니다. 이제 톡 누르면 약 ~10°만큼 돌고, 예전처럼 ~60° 돌지 않습니다. 키를 계속 눌러도 멈추지 않습니다.

마우스만 놓았다는 이벤트를 보고합니다. 따라서 게임에서 옆으로 드래그하면 a/d와 정확히 같은 속도로 회전하고 손을 놓는 순간 멈춥니다. w/s로 걸으면서 동시에 마우스로 방향을 바꿀 수 있습니다.

한 가지 더 있습니다. 지금까지는 linux에서만 플레이했습니다. macos와 windows 엔진은 빌드되어 있지만 아직 실행해 보지 않았습니다. mac/windows를 사용한다면 작동하는지 알려 주세요.

/plugin marketplace add reporails/arcade /plugin install doom@reporails-arcade를 실행한 다음 CLAUDE_CODE_NO_FLICKER=1 claude, 이어서 /doom을 실행합니다.

repo: github.com/reporails/arcade(MIT, 엔진은 GPL-2.0, 게임 데이터는 Freedoom, BSD). submitted by /u/cleverhoods [link] [comments]

설치

설치 방법은 원본 출처를 확인하세요.

원문 / README

... and it was annoying as hell to port it. how it works, short version: the mod sandbox has no WebAssembly, so the engine is a native binary the mod starts with $.process.spawn and talks to over a unix socket (127.0.0.1 + a token on windows). prebuilt for linux/macos/windows × x86_64/arm64 with zig cc, so no compiler needed in kitty the picture is an Image pointed at a file the engine writes. claude code just hands kitty the path, zero pixels go through it. everywhere else it's a Raster of quadrant blocks (4 px a cell) claude code only draws ~3 frames/s when nothing else moves, so a strip under the game redraws itself every 30 ms to keep frames coming. ~31 fps in kitty, ~35-40 with blocks keyboard managing is a nightmare, TS only has an "onPress" event. a terminal never tells you a key was released, it just repeats the newest key after its repeat delay. claude code turns on kitty keyboard flags 5 only, so mods can't see releases either. my first guess (hold a turn key 220 ms) made a held turn stop dead for ~300 ms before the repeats kicked in. what fixed it was reading how other terminal dooms fake it: - doom-cli: learn the repeat delay, hold a key until its next repeat is due - intermission: 550 ms after a press, 120 ms while repeating, mouse-only turning - claude-doom: 160 ms pulse per press - doom-braille: release after 100 ms of silence went with doom-cli's model, plus the fix its own source suggests in a TODO: turn slowly until the repeats start. a tap now turns ~10° instead of ~60°, and a held key never stops. the mouse is the only input that reports its release, so dragging sideways on the game turns at exactly the a/d speed and stops the moment you let go. walk with w/s and turn with the mouse at the same time. one more thing: played on linux only. macos and windows engines are built but they are yet to run, so if you're on a mac/windows, I'd love to know if it works. /plugin marketplace add reporails/arcade /plugin install doom@reporails-arcade then CLAUDE_CODE_NO_FLICKER=1 claude and /doom. repo: github.com/reporails/arcade (MIT; the engine is GPL-2.0, the game data is Freedoom, BSD). submitted by /u/cleverhoods [link] [comments]

비슷한 프로젝트