Skip to content

About

A mobile-friendly Open Tibia 7.6 client for the browser

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

393 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OTClient Web

A mobile-friendly Open Tibia 7.6 client that runs in the browser. The goal: grab your phone, log into Tibia, walk around, and chat — without needing a PC.

Why

Real Tibia doesn't have a mobile client. The desktop client requires a full setup. We want to open a browser tab on our phone and be in Tibia.

What it does

This project connects to real Open Tibia 7.6 servers using the original protocol.

Tech stack

  • TypeScript + Vite for development
  • PixiJS 8 for WebGL rendering
  • Vitest for testing
  • Node.js proxy for TCP-WebSocket bridging

Getting started

# The test suite requires Node 24.15.0 or later in the 24.x series.
nvm install
npm install
npm run dev

Place your own Tibia.dat, Tibia.spr and items.otb in public/assets/760/. The Jamera client loads them from the URLs in that directory’s manifest.json.

Run npm run assets:check:760 to parse all four files listed in the local manifest, including the full map. The command reports each file separately and returns a failure status if a file is missing or the parser rejects it. The sprite check reads the header and offsets. Individual sprite payloads are decoded later during rendering.

Connecting to an OT server

Browsers can't open raw TCP sockets, so a small WebSocket↔TCP bridge sits between the client and the OT server. Start it alongside npm run dev:

npm run proxy          # bridges ws://localhost:8090 → 127.0.0.1:7171 (login) / :7172 (game)

Some 7.6 servers (e.g. the jamera stack in docker/) serve login and game on the same port 7171. For those, use:

npm run proxy:jamera   # same as `npm run proxy` but with OT_GAME_PORT=7171

Override the target with env vars when needed: OT_HOST, OT_LOGIN_PORT, OT_GAME_PORT, WS_PORT (see proxy/server.ts).

For the container image, OT_HOST defaults to host.docker.internal. On Linux, include --add-host=host.docker.internal:host-gateway in docker run, or set OT_HOST to the OT server container/service name.

The mock server paces movement at character speed 220 and grass speed 150. Set MOCK_GROUND_STRIP=1 with the generated test assets to alternate grass and faster road columns. Generated ground IDs 100, 101 and 105 have speed 100. Other IDs use the grass speed. Use MOCK_INSTANT_STEPS=1 for an explicit instant-confirmation fixture.

Playing from your phone (same Wi‑Fi)

In dev the client points its bridge at :8090 of whatever host loaded the page, so once you serve over the LAN there's no URL to hand-edit.

  1. Start the bridge and the LAN dev server (two terminals):

    npm run proxy:jamera   # or `npm run proxy` for a two-port server
    npm run dev:lan        # Vite bound to 0.0.0.0 — prints a "Network:" URL
  2. Find your computer's LAN IP (looks like 192.168.x.x):

    ipconfig getifaddr en0   # macOS (try en1 on Ethernet)
    hostname -I              # Linux
  3. On the phone's browser (same Wi‑Fi), open — replacing <LAN-IP>:

    http://<LAN-IP>:5173/jamera.html
    

    The client derives ws://<LAN-IP>:8090 for the bridge automatically. Make sure the OT server (e.g. the Docker stack) is running, and that your firewall permits inbound 5173 and 8090. To point at a bridge on a different host, append ?proxy=ws://<other-host>:8090 (honoured only for loopback or a host matching the page).

Development builds write browser diagnostics to the console. Run VITE_DEBUG_LOGS=0 npm run dev to silence them. New diagnostics can use debugConsole?.warn(...) or another console method from src/lib/debugConsole.ts.

In Settings, Follow game day and night lets you choose how dark nights get. Turn it off for a fixed light level. At 100% fixed brightness the world stays in full daylight.

Playing on an LG TV

After Developer Mode setup, npm run tv:deploy builds, installs and launches the hosted client and keeps its HTTP server and WebSocket proxy running. The hardware checklist covers the three asset files, local settings, pairing, diagnostics and controller-only login. TV setup and first play session

Project structure

src/
  lib/
    dat.ts, spr.ts, atlas.ts        # Asset pipeline
    otb.ts, otbm.ts, nodeTree.ts    # Map file parsers
    otbmParser.ts, otbmWorker.ts    # Map parsing (Web Worker)
    tileMap.ts, tileRenderer.ts     # Map rendering
    creatureRenderer.ts             # Creature sprite pool
    GameWorld.ts                    # Live server-driven world state
    viewport.ts                     # Camera/viewport
    player.ts, input.ts             # Player entity & input
    joystick.ts, keyboard.ts        # Mobile + desktop controls
    pathfinding.ts                  # A* pathfinding
    walkAnimation.ts                # Walk animation
    regionExpansion.ts              # Dynamic map streaming
    outfitColors.ts, outfitTint.ts  # Outfit color tinting
    lighting.ts                     # Day/night ambient lighting
    devControls.ts                  # Dev toggles UI
    fileLoader.ts                   # Asset loading
    BinaryReader.ts                 # Binary parsing utility
    net/                            # Network protocol
      Connection.ts, GameClient.ts
      PacketDispatcher.ts
      InputPacket.ts, OutputPacket.ts
      xtea.ts, opcodes.ts
      loginProtocol.ts, mapParser.ts
      creatureParser.ts, chatProtocol.ts
    chat/                           # Chat UI, state, speech bubbles
      ChatManager.ts, ChatUI.ts
      SpeechBubbleRenderer.ts
  __tests__/                        # Unit tests
proxy/
  server.ts                         # TCP-WebSocket proxy

Contributing

Branch protection on main requires the CI check status. It verifies that quality (browser and proxy lint, browser build, proxy typecheck, unit tests, and browser E2E) and security (npm audit for high or critical findings) both passed.

Contributions are welcome! This is an open project. If you're interested in Tibia, mobile gaming, or browser-based game clients, feel free to open an issue or PR.

License

MIT

Dependency audit

A daily audit of the lockfile on main opens or updates a tracking issue when it fails. Check the linked run for the affected package and dependency chain, or a registry error. Reproduce with npm ci and npm run audit:ci. Use npm explain <package> to find the direct dependency, then test the smallest patched upgrade.

If no patched release exists, record the upstream advisory, affected usage and any available mitigation in the issue. Investigate removing or replacing the vulnerable dependency. Keep the issue open until the audit passes. The required pull-request check continues to enforce the same high-severity threshold.

About

A mobile-friendly Open Tibia 7.6 client for the browser

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages