นำเกมเบราว์เซอร์ของคุณมา ที่เหลือเราจัดให้
ห้องออนไลน์ บัญชีผู้เล่น การบันทึกความคืบหน้า หน้าร้านค้า 20 ภาษา และแอปเดสก์ท็อปของเรา ฟรี การเผยแพร่ที่นี่ไม่ผูกขาด เกมของคุณจึงวางขายที่อื่นได้ด้วย
เล่นหลายคนโดยไม่ต้องมีเซิร์ฟเวอร์
ห้อง relay และ lockstep ทำงานฝั่งเรา เกมของคุณแค่ส่งไบต์ ส่วนห้อง ลิงก์เชิญ ลำดับคำสั่ง และผู้เล่นที่เข้ามาทีหลัง เราดูแลให้
ผู้เล่นพร้อมแล้ว
ผู้เยี่ยมชมเล่นได้โดยไม่ต้องสมัคร บัญชีเดียวใช้ได้ทุกเกม และแพลตฟอร์มเก็บความคืบหน้าให้ เกมที่รันบนเซิร์ฟเวอร์จัดอันดับได้ พร้อมกระดานผู้นำและทัวร์นาเมนต์
20 ภาษา ทั้งเบราว์เซอร์และเดสก์ท็อป
หน้าร้านค้าของคุณเข้าถึงผู้เล่นใน 20 ภาษา รวมถึงภาษาที่เขียนจากขวาไปซ้าย เกมของคุณทำงานในเบราว์เซอร์และในแอปเดสก์ท็อปของเรา พร้อมล็อกตัวชี้ เต็มจอ และจอยเกมเมื่อคุณขอ
เล่นกันอยู่ที่นี่แล้ว
เกมจากนักพัฒนาอิสระทำงานที่นี่พร้อมการเล่นออนไลน์ที่เราเพิ่มให้ และเกมของเราเองก็ใช้สัญญาเดียวกับที่เกมของคุณจะใช้
สตูดิโอของคุณ
เข้าสู่ระบบเพื่อดูสตูดิโอของคุณ
เข้าสู่ระบบวิธีการทำงาน
คุณสร้างเกมด้วย JavaScript หรือ TypeScript ตามสัญญาเล็กๆ ข้อเดียว: ฟังก์ชัน mount สำหรับฝั่งไคลเอนต์ และโมดูลเกมสำหรับฝั่งเซิร์ฟเวอร์หากเกมของคุณต้องใช้ เครื่องมือบรรทัดคำสั่งของเราจะบิลด์ ตรวจสอบ และอัปโหลดให้
ทีมของเราตรวจสอบทุกเวอร์ชันก่อนที่ผู้เล่นจะเห็น OneCompanion ให้บริการเกมของคุณในเฟรมแซนด์บ็อกซ์: เกมจะไม่เห็นบัญชีของผู้เล่น เข้าถึงเครือข่ายได้ผ่านห้องของมันเท่านั้น และข้อมูลที่บันทึกจะเก็บไว้กับแพลตฟอร์ม
มัลติเพลเยอร์
- none
- เล่นคนเดียวเท่านั้น ไม่มีห้อง
- relay
- ห้องส่งต่อข้อความระหว่างผู้เล่น เหมาะกับเกมโคออปและเกมปาร์ตี้ ไม่จัดอันดับ
- lockstep
- ห้องเรียงคำสั่งของผู้เล่นทุกคนตามสเต็ป และเก็บบันทึกไว้ให้ผู้ที่เข้ามาทีหลัง การจำลองของคุณต้องเป็นแบบ deterministic ไม่จัดอันดับ
- server
- โมดูลเกมของคุณเองทำงานคู่กับห้องและตัดสินผลทุกอย่าง สำหรับผู้ได้รับเชิญเท่านั้น
เผยแพร่จากบรรทัดคำสั่ง
สร้างโทเคนในหน้าสตูดิโอ แล้วรันคำสั่งเหล่านี้ในโฟลเดอร์เกมของคุณ:
ด้วย Bun
git clone https://github.com/onecompanion-net/sample-game
cd sample-game && bun install
bun run validate
export ONECOMPANION_API=https://onecompanion.net
export ONECOMPANION_TOKEN=oc_…
bun run publish:game ด้วย npm
git clone https://github.com/onecompanion-net/sample-game
cd sample-game && npm install
npm run validate
export ONECOMPANION_API=https://onecompanion.net
export ONECOMPANION_TOKEN=oc_…
npm run publish:game npm ติดตั้งแพ็กเกจและรันสคริปต์ได้ แต่ตัวเครื่องมือทำงานบน Bun 1.3 ขึ้นไป จึงต้องติดตั้ง Bun ไม่ว่าจะใช้แบบไหน
เริ่มเกมใหม่
ยังไม่มีเกม? เริ่มจากเทมเพลตเล็กๆ ที่เล่นได้: solo, relay (ผู้เล่นใช้หน้าจอร่วมกัน) หรือ lockstep (ผู้เล่นแต่ละคนสั่งยูนิตของตัวเอง) ซึ่งผ่านการตรวจตั้งแต่สร้างเสร็จ
bunx github:onecompanion-net/game-cli init my-game --template relay
cd my-game && bun install && bun run dev การแปล: คำสั่ง i18n จะเขียนภาษาที่ขาดเป็นสำเนาภาษาอังกฤษ แล้วพิมพ์พรอมต์ให้เครื่องมือเขียนโค้ด AI ของคุณแปล การอัปโหลดจะปฏิเสธสำเนาที่ยังไม่ได้แปล
เชื่อมกับเครื่องมือเขียนโค้ด AI
เปิดโฟลเดอร์เกมของคุณใน Claude Code, Cursor, GitHub Copilot หรือเครื่องมือเขียนโค้ด AI อื่น แล้วใส่พรอมต์นี้ มันจะอ่านคู่มือของเรา ปรับเกมให้เข้ากับแพลตฟอร์ม ตรวจสอบ และหยุดก่อนเผยแพร่
I want to publish my browser game on OneCompanion (https://onecompanion.net), which hosts it, lists it in its catalog and runs its multiplayer rooms. Help me integrate this project with the platform and get it ready to upload.
1. Read the developer guide first: https://onecompanion.net/developers/guide.md. It is the contract; where my code disagrees with it, the guide wins. When unsure, compare with the sample game: https://github.com/onecompanion-net/sample-game.
Use the OneCompanion integration skill as well: https://github.com/onecompanion-net/skills (the skill is skills/onecompanion-integration). If it is not installed in this tool, read its SKILL.md and the reference files it points to; use its templates (contract, client, relay, lockstep, dev host) instead of writing them from scratch.
2. Study this project and show me a short plan before you change anything: the engine, how the game starts and what it draws into, where its text lives, how it saves, any network code, and which room kind fits (none, relay or lockstep; server only if we were invited).
3. Integrate without breaking how the game runs today:
- Add game.json with "studio": "<my-studio-handle>", an "id" I approve (it becomes the URL and can never be reused) and "version": "1.0.0".
- Add a client entry that exports mount(host, options) and returns { onMessage, pause, resume, dispose }. Copy the types from the guide into src/contract.ts; import nothing from the platform. Draw only inside host, send onEvent({ type: 'ready' }) after the first frame, and make dispose() undo everything (animation loops, timers, listeners, DOM nodes, WebGL contexts, audio, workers).
- Move every player-facing string into messages/en.json and show it through options.t (ICU plurals for counts). Lay out with CSS logical properties so right-to-left works.
- Save with options.storage instead of localStorage, IndexedDB or cookies. Remove fetch and WebSocket calls to other hosts; load our own files with relative URLs.
- For multiplayer, send with options.online.send and receive in onMessage, using the guide's byte formats exactly, and validate every message. For lockstep, keep the simulation deterministic (the room's seed, no Math.random() or clock).
- Write listing/en.json (with "play" and "modes" lines if they fit the game); step 6 translates it. Prepare the art at the sizes in the guide, set the rating, and list every third-party asset and its licence under rights.
- Keep the client entry and its static imports under 450 KB gzip; load the rest with dynamic import().
4. Add the CLI as a dev dependency from GitHub, never from the npm registry by name: "bun add -d github:onecompanion-net/game-cli" (or "npm install -D github:onecompanion-net/game-cli"). Add the scripts "validate": "onecompanion-game validate .", "i18n": "onecompanion-game i18n ." and "publish:game": "onecompanion-game publish .". The tools need Bun 1.3 or later even when I use npm.
5. Copy the sample's dev page (index.html and src/dev.ts) so I can test solo, with ?net=room in two tabs, and with &lang=vi and &dir=rtl.
6. Run the i18n script and translate every file it marks "$untranslated" (the 12 launch store locales are required; in-game languages are up to me), removing the marker from each file you finish. Then run the skill's preflight check (node <skill folder>/scripts/preflight.mjs ., from an installed or cloned copy of the skill), then the validate script, and fix every issue until both pass.
7. Then stop. Tell me what you changed, what you could not do and what I should check by hand. Do not publish: I will set ONECOMPANION_API=https://onecompanion.net and ONECOMPANION_TOKEN in my own terminal and run the publish:game script. Never ask for the token, print it, write it to a file or commit it. แทนที่ <my-studio-handle> ด้วยแฮนเดิลสตูดิโอของคุณ หรือคัดลอกพรอมต์จากหน้าสตูดิโอ ซึ่งกรอกไว้ให้แล้ว
อย่าวางโทเคนสตูดิโอลงในแชท AI เด็ดขาด ให้ตั้งค่าในเทอร์มินัลของคุณเองตอนเผยแพร่
กฎ
- เป็นเจ้าของหรือได้รับอนุญาตให้ใช้ทุกอย่างในเกม และระบุสิ่งที่คุณใช้จากผู้อื่น
- แปลหน้าร้านค้าให้ครบทั้ง 12 ภาษา ข้อความในเกมต้องมีภาษาอังกฤษ และเพิ่มภาษาอื่นเท่าที่ทำได้
- ห้ามมีหน้าเข้าสู่ระบบปลอม กล่องโต้ตอบที่เลียนแบบแพลตฟอร์ม หรือลิงก์ออกนอกเกม ให้เรตเกมของคุณตามจริง