OneCompanion

Разработчикам

Опубликуйте свою браузерную игру на OneCompanion.

Читать руководство разработчика

Принесите браузерную игру. Остальное добавим мы.

Онлайн-комнаты, аккаунты игроков, сохранение прогресса, страница в магазине на 20 языках и наше приложение для компьютера — бесплатно. Публикация здесь не эксклюзивна: ваша игра может выходить где угодно ещё.

  • Мультиплеер без серверов

    Комнаты relay и lockstep работают на нашей стороне. Ваша игра отправляет байты, а мы берём на себя комнаты, ссылки-приглашения, порядок команд и опоздавших игроков.

  • Игроки — уже готовы

    Гости играют без регистрации, один аккаунт подходит для всех игр, а прогресс хранит платформа. Игры, работающие на сервере, могут быть рейтинговыми, с таблицами лидеров и турнирами.

  • 20 языков, браузер и компьютер

    Ваша страница в магазине доходит до игроков на 20 языках, включая языки с письмом справа налево. Игра работает в браузере и в нашем приложении для компьютера, с захватом указателя, полноэкранным режимом и геймпадами, если вы их запросите.

Уже играют здесь

Игры независимых разработчиков работают здесь с добавленной нами онлайн-игрой, а наши собственные игры используют тот же контракт, что и ваша.

  • Saltline Сделано @felixrieseberg, здесь — в авторском виде. Онлайн-режим — от OneCompanion.
  • Lanternfall Сделано @loktar00, здесь — в авторском виде. Онлайн-режим — от OneCompanion.
  • Beaconyard Сделано OneCompanion.
  • Cinder Run Сделано OneCompanion.
  • Driftgate Сделано OneCompanion.
  • Voidwake Сделано OneCompanion.
  • Wrecktide Сделано OneCompanion.
  • Blindfire Сделано OneCompanion.
  • Ember Coast Сделано OneCompanion.

Ваши студии

Войдите, чтобы увидеть свои студии.

Войти

Как это работает

Вы пишете игру на JavaScript или TypeScript по небольшому контракту: функция mount для клиента и, если игре нужно, игровой модуль для сервера. Наш инструмент командной строки собирает, проверяет и загружает игру.

Наша команда проверяет каждую версию, прежде чем её увидят игроки. OneCompanion запускает вашу игру в изолированном фрейме: она никогда не видит аккаунты игроков, выходит в сеть только через свою комнату и хранит сохранения на платформе.

Мультиплеер

none
Только одиночная игра, без комнат.
relay
Комната пересылает сообщения между игроками. Подходит для кооперативных и компанейских игр. Без рейтинга.
lockstep
Комната упорядочивает команды всех игроков по шагам и хранит журнал для опоздавших. Ваша симуляция должна быть детерминированной. Без рейтинга.
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 создаёт каждый недостающий язык как копию английского и выводит подсказку, по которой ваш ИИ-инструмент для кода их переведёт. Непереведённые копии загрузить нельзя.

Читать руководство разработчика

Интеграция с помощью ИИ-инструмента для кода

Откройте папку игры в Claude Code, Cursor, GitHub Copilot или другом ИИ-инструменте для кода и дайте ему этот промпт. Он прочитает наше руководство, адаптирует игру к платформе, проверит её и остановится перед публикацией.

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> на идентификатор своей студии или скопируйте промпт со страницы студии, где он уже подставлен.

Никогда не вставляйте токен студии в чат с ИИ. Задайте его в своём терминале, когда будете публиковать.

Правила

  • Всё в вашей игре должно принадлежать вам или использоваться по лицензии; укажите, что вы взяли у других.
  • Переведите описание в каталоге на все 12 языков. Тексты в игре нужны на английском; добавьте все языки, какие сможете.
  • Никаких поддельных запросов входа, окон под платформу и ссылок вне игры. Указывайте рейтинг честно.