Bawa game browsermu. Sisanya kami yang tambahkan.
Room online, akun pemain, progres tersimpan, halaman toko dalam 20 bahasa, dan aplikasi desktop kami, gratis. Menerbitkan di sini tidak eksklusif: game-mu tetap bisa ada di tempat lain.
Multiplayer tanpa server
Room relay dan lockstep berjalan di pihak kami. Game-mu mengirim byte; kami mengurus room, tautan undangan, urutan perintah, dan pemain yang bergabung belakangan.
Pemain, siap main
Tamu bermain tanpa mendaftar, satu akun berlaku di semua game, dan progres disimpan oleh platform. Game yang berjalan di server bisa berperingkat, dengan papan peringkat dan turnamen.
20 bahasa, browser dan desktop
Halaman tokomu menjangkau pemain dalam 20 bahasa, termasuk yang ditulis dari kanan ke kiri. Game-mu berjalan di browser dan di aplikasi desktop kami, dengan kunci penunjuk, layar penuh, dan gamepad bila kamu memintanya.
Sudah dimainkan di sini
Game dari pengembang independen berjalan di sini dengan permainan online yang kami tambahkan, dan game kami sendiri memakai kontrak yang sama dengan game-mu nanti.
Studio Anda
Masuk untuk melihat studio Anda.
MasukCara kerjanya
Anda membuat game dengan JavaScript atau TypeScript mengikuti satu kontrak kecil: fungsi mount untuk klien dan, jika game memerlukannya, modul game untuk server. Alat baris perintah kami membangun, memeriksa, dan mengunggahnya.
Tim kami meninjau setiap versi sebelum pemain melihatnya. OneCompanion menjalankan game Anda di bingkai sandbox: game tidak pernah melihat akun pemain, hanya menjangkau jaringan melalui ruangnya, dan menyimpan datanya di platform.
Multipemain
- none
- Hanya main sendiri, tanpa ruang.
- relay
- Ruang meneruskan pesan antarpemain. Cocok untuk game co-op dan party. Tanpa peringkat.
- lockstep
- Ruang mengurutkan perintah setiap pemain per langkah dan menyimpan log untuk yang bergabung belakangan. Simulasi Anda harus deterministik. Tanpa peringkat.
- server
- Modul game Anda sendiri berjalan di samping ruang dan menentukan setiap hasil. Hanya lewat undangan.
Terbitkan dari baris perintah
Buat token di halaman studio Anda, lalu jalankan perintah ini di folder game Anda:
Dengan 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 Dengan 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 memasang paket dan menjalankan skrip, tetapi alatnya sendiri berjalan di Bun 1.3 atau lebih baru, jadi tetap pasang Bun.
Mulai game baru
Belum punya game? Mulai dari templat kecil yang bisa dimainkan: solo, relay (pemain berbagi layar), atau lockstep (setiap pemain memimpin unitnya sendiri). Templat lolos pemeriksaan begitu dibuat.
bunx github:onecompanion-net/game-cli init my-game --template relay
cd my-game && bun install && bun run dev Terjemahan: perintah i18n menulis setiap bahasa yang belum ada sebagai salinan bahasa Inggris dan mencetak prompt agar alat coding AI-mu menerjemahkannya. Unggahan menolak salinan yang belum diterjemahkan.
Integrasikan dengan alat coding AI
Buka folder game Anda di Claude Code, Cursor, GitHub Copilot, atau alat coding AI lain, lalu berikan prompt ini. Alat itu membaca panduan kami, menyesuaikan game Anda dengan platform, memeriksanya, dan berhenti sebelum menerbitkan.
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. Ganti <my-studio-handle> dengan handle studio Anda, atau salin prompt dari halaman studio Anda, tempat handle sudah terisi.
Jangan pernah menempelkan token studio Anda ke chat AI. Atur token di terminal Anda sendiri saat menerbitkan.
Aturan
- Miliki atau lisensikan semua isi game Anda, dan cantumkan apa yang Anda pakai dari pihak lain.
- Terjemahkan halaman toko ke ke-12 bahasa. Teks dalam game wajib ada dalam bahasa Inggris; tambahkan bahasa sebanyak yang Anda bisa.
- Tanpa permintaan login palsu, dialog tiruan platform, atau tautan ke luar game. Beri rating game Anda dengan jujur.