Skip to content
Projects

About

Pre-Renewal Ragnarok Online in the browser: a WebGL 2 client and a local rAthena host to play with friends.

Other Projects

How these counts are measured

Measured star growth

in 24h
0
in 7 days
Collecting history
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

Bifrost

CI Status: beta Release

Play Pre-Renewal Ragnarok Online in your browser. One person runs Bifrost and sends the invite link. Everyone else just needs a browser.

Prontera's fountain square in the Original look, crowded with bot players, one of them casting Increase AGI Battleground bots of two teams fighting in KVM with skills such as Sanctuary, Quagmire and Soul Destroyer

Prontera in the Original look, busy with bot players  ·  Battleground bots fighting in KVM

Bifrost provides its own WebGL 2 client and runs rAthena locally. The host supplies a Ragnarok Online installation with a readable, unencrypted data.grf. Game assets are served from that installation; they are not included in this repository.

[!IMPORTANT] Bifrost requires a GRF. The host must have a Ragnarok Online installation with a data.grf that is readable and not encrypted. Every sprite, map, sound and piece of game text is read from it at run time. Bifrost does not include or download any game files, and it cannot start without them. Players who join only need a browser.

Quick start

  1. Install Node.js 22.12+ and Docker with Compose v2, and have a Ragnarok Online installation with a readable, unencrypted data.grf.

  2. Get Bifrost and start it:

    git clone https://github.com/LemonMantis5571/Bifrost-RO.git
    cd Bifrost-RO
    ./start.sh --share
    

    On Windows, run start.cmd --share in the Bifrost-RO folder instead.

  3. Choose the folder that holds data.grf when asked. Then use the Play here link to play on this computer, and send friends the Friends link.

The first start takes a few minutes while it downloads the prebuilt bridge and game server. ./start.sh --check lists anything that is missing and says when a newer release is out. The sections below explain each step.

Host a game for friends

  1. On the host computer, you need:

    • a Ragnarok Online installation with a readable, unencrypted data.grf (see above);
    • Node.js 22.12+ and Docker Engine with Compose v2;
    • cloudflared, only if you plan to use --share;
    • Go 1.24+, only if no prebuilt bridge fits: when you have changed host/, or your computer is not Windows, Linux or macOS on x64 or ARM64.

    On Linux with systemd, start Docker with sudo systemctl start docker and make sure your user can access the Docker socket. On Arch Linux or CachyOS, the packages are nodejs npm docker docker-compose docker-buildx (buildx makes building the game server faster); after installing them, run sudo systemctl enable --now docker and sign out and back in if you add your user to the docker group.

  2. Clone and launch Bifrost:

    git clone https://github.com/LemonMantis5571/Bifrost-RO.git
    cd Bifrost-RO
    ./start.sh --share
    

    On Linux, ./start.sh starts a local game and ./start.sh --share also creates a friends link. You can also use npm start -- --share. On Windows PowerShell, use npm.cmd start -- --share if PowerShell blocks npm.ps1; start.cmd --share is available from the project folder.

  3. If prompted, select the folder containing data.grf. To set it explicitly, add --assets "/path/to/Ragnarok Online" to the launch command. You can also paste the path of data.grf itself. Bifrost remembers the folder. The first launch installs dependencies and downloads the prebuilt bridge and game server, which takes a few minutes. If your copy of host/ or rathena/ has changes, or a download is not possible, Bifrost builds that part from source instead: the bridge with Go, and rAthena in Docker (5 to 10 minutes, once). Run ./start.sh --check at any time to see what is ready, what is missing and whether a newer Bifrost is out, without starting anything.

  4. Use the terminal's Play here link to join from the host. Send friends the complete Friends link, including #invite=.... That link is for people you trust and changes each time you launch Bifrost. Keep the launch terminal open while everyone plays.

Friends can reach the host in four ways; the invite token in the link is what lets them play in every one:

Run Friends join Good for
./start.sh --share A temporary public link through Cloudflare (needs cloudflared) Friends anywhere, nothing to set up
./start.sh --share lan A link on your own network, with a QR code in the terminal for phones Same house, LAN party, phones on the Wi-Fi
./start.sh --share tailscale A private https://<your-pc>.<tailnet>.ts.net link that stays the same every time (needs Tailscale with MagicDNS and HTTPS on) A regular group that is already in your tailnet
./start.sh --public-url https://play.example.com Through a tunnel or proxy you run yourself (playit.gg, ngrok, Caddy, a VPS), pointed at http://127.0.0.1:8099 Your own domain or tunnel

For solo play on the host, run npm start without --share. You do not need cloudflared for this. The local game and admin links usually use ports 8099 and 8100; use the printed URLs if those ports are busy.

Join and form a party

  1. Open the host's Friends link in a modern browser. You do not need to install Ragnarok Online or pick a GRF file.
  2. Select Create an account. Use 6–21 letters or digits for your username and at least six characters for your password. Sign in, select an empty character slot, and create a character.
  3. Meet in game. Press Alt+Z to open Party, create a party and invite your friends by character name. They accept the invitation in game. If the host has turned on Bifrost's helper NPCs, the Healer, Trainer and Warper in Prontera can help you get started.
  4. If the host runs bots, invite them the same way: they join your party, follow you and fight for it. See Bot players for what they can do and the commands they answer in party chat.
To do this Control
Walk, fight, talk to NPCs, pick up loot Left-click the ground, monster, NPC or item
Rotate or zoom the camera Right-drag or scroll
Open Inventory, Skill Tree, Quest Log, Party (and Friends), Guild or Options Alt+E, Alt+S, Alt+U, Alt+Z, Alt+G, Alt+O
Find a good place to level (when the host has the guide on) Alt+L or /guide
Use a skill from the hotbar Click it or use its assigned key
Chat or switch channels Enter to chat, Tab to change channel; start a line with % for the party or $ for the guild
Found a guild /guild and its name, with an Emperium in the bag; /help lists the other chat commands
Open the guild's storage (Bifrost's addition) Guild Storage on the Guild window's Guild Info tab, in a town; the master gives positions the right on the Positions tab
Show an emotion over your head /!, /?, /ok, /lv and the original game's other emotion commands; Alt+M lists them all, and Alt+1 to Alt+0 send the lines set there
Open a chat room, or join one Alt+C or /chat; click the room's sign over its owner to come in, /q to leave
Vend, or buy from a vendor A merchant with a cart (Alt+W) uses Vending and picks the cart's items and prices; click a shop's sign over its owner to buy
Send and read mail, with Zeny and items /mail
Find a party, or members for yours /booking or Party Booking in the Party window (Alt+Z)

On a phone, held either way, the windows and the hotbar fit the screen. A tap is a click. Hold a finger still for a right click: a menu for what is under it, or Sit down on your own character. Drag one finger to turn the camera and pinch to zoom. Tap the hint of an aimed skill to drop it.

Windows are dark by default. Choose Options → Display → Original (game UI) to draw the windows, the Basic Information box and the hotkey bar from the game's own interface pictures in the host's GRF, laid out like the game client. With a recent client's files, the login, character select and Make Character screens follow too, over the install's own title art, and a new character gets its gender, hair style and hair colour there. Interface skins in the install's skin folder (skin/<name>/, laid out like the game's interface folder) can be picked under Options → Display → Skin; a skin's pictures replace the game's own where it has them. Sound, graphics, key bindings, macros and window layouts are saved locally and backed up on the host for the signed-in game account. New Cloudflare links restore that account’s settings after entering the game. An old hostname’s local settings need one visit with this client while that hostname is still reachable to create the first backup. Use the same game account on the new link.

Manage or stop the host

  • Open the local Admin panel link to change rates, helper NPCs and sign-up settings or manage accounts and characters. Some settings restart the game server. The admin page is accessible only from the host.
  • Bifrost's helper NPCs in Prontera (Trainer, Warper, Healer, shops and progression boards) are off by default, so the game plays like the original. Turn them all on with ./start.sh --helpers on (or npm start -- --helpers on), and off again with --helpers off; the choice is remembered. To pick them one by one, use the admin panel's NPCs tab.
  • Leveling help for new players, also Bifrost's own and off by default (admin panel, NPCs tab, Progression): Rested EXP, which builds while a character is logged out (faster in a town, up to one and a half levels) and makes monsters give double EXP until it is used up, shown as a lighter stretch of the EXP bar and a Rested badge; and the Where to Level guide (Alt+L), which shows the fields and dungeons that suit the character's level, with the monsters to hunt, what hurts them, which attack on sight and the way there from Prontera. The guide is built from the game server's own Pre-Renewal monster spawns, so it fits whatever the server runs.
  • With the Warper enabled in towns-only mode, all 23 towns in its menu have a return Town Warper. Switching modes or disabling the Warper applies to every copy.
  • Battlegrounds: players open the Battlegrounds window (Alt+B, or the Battle button) to queue for KVM, Tierra Gorge or Flavius from anywhere, and accept when the match is ready. In a party, its leader uses Join party to queue all online members on the same side; each member accepts their own entry call, and the match waits for everyone on the roster. Leave queue withdraws the original group application for all its members, even if a guest has since left the party. Idle bot fillers make room for a party before a match is called. Teams keep the official sizes: KVM 5 vs 5, Tierra Gorge and Flavius 10 vs 10.
  • Spectating: anyone with the invite can watch a battleground without a character. Press Watch beside a battleground in the Battlegrounds window, or add &watch=bat_c01 to the invite link (bat_c01 to bat_c03 are KVM, bat_a01/bat_a02 Tierra Gorge, bat_b01/bat_b02 Flavius, bat_room the lobby; &watch=@Name follows one player). The viewer sees the match with its score, the players of both sides, and picks whom to follow, or lets the camera follow the action. Up to eight people can watch at once.
  • To add bot players, to the world or to the battlegrounds, see Bot players.
  • Press Ctrl+C in the launch terminal to stop Bifrost and close the invite. Stop the database and game containers with docker compose down. This keeps the account and character data; down -v also deletes the data volumes.
  • To update, stop Bifrost, run git pull and start it again. The launcher says when a newer release is out, and CHANGELOG.md lists what each release changed. Accounts and characters stay.
Problem What to check
Friends see a missing or invalid invite Resend the current Friends link with its #invite=... fragment. The host's 127.0.0.1 link only works on the host.
No Friends link appears Start with --share and check that cloudflared --version works and the tunnel connects. With --share tailscale, check tailscale status; the first time, Tailscale may ask the tailnet owner to allow Serve.
Friends on the same Wi-Fi cannot connect with --share lan Allow port 8099 (or the printed one) through the host's firewall, and check that everyone is on the same network, not a guest Wi-Fi.
Bifrost will not start Run ./start.sh --check (or npm start -- --check) and fix each ✗ it lists.
Bifrost cannot load game files Pass the installation folder to --assets. GRFs scrambled by a private server's own protection, and kRO's protected archives, are unsupported.
Sign-up is disabled The host can enable it in Admin or create an account with npm run account -- PlayerName.

Quests and stories

The pinned Pre-Renewal server loads the original Moscovia, Lighthalzen/Biolabs, The Sign and other default story scripts. Optional scripts that rAthena leaves commented out are not all enabled; Bifrost additionally enables its 18 iRO repeatable hunting NPCs. Entry quests, item requirements and puzzles still apply.

Quest indicators above NPCs are personal: ! is an offer, ? is a turn-in or continuation. Bifrost adds conditions to the repeatable hunters, Fishbone and the opening Moscovia NPCs; native indicators from other scripts are also displayed. Markers depend on the character's actual level, quest state and required items.

Some world bots undertake the opening native story chapters: they hear Berbayeff and Ibanoff's story, hunt the materials to repair the ship, or work through Fishbone's favor and collect 20 Jellopy. They use ordinary travel, dialogue, drops and hand-ins; rAthena saves their progress. These chapters end with the repaired ship or Fishbone preparing access. Bots do not yet solve Moscovia's ship minigame or the Biolab laboratory puzzle. Other bots continue their repeatable hunts, supply trips and party routines.

Field Journal and World Studio

The Field Journal menu button opens character-owned companion controls, an item/monster/NPC atlas, portal navigation and observed world news. Companions have configurable skills, duties, healing and resting thresholds, real equipment and supply trading, and saved ownership across sessions. Bots keep temperaments, goals and bounded memories; off-duty companions carry on with independent routines.

The local admin page's World studio creates portable content packs: paint new terrain and walkability, place NPCs, collection quests, monsters, shops and warps, and export/import the result. Collection quests use native Quest Log entries and personal markers. Saving prepares the next game-server start; restart from Admin when players are ready. World Studio also enables real bot vending/customer activity and optional hiring fees. Markets and fees are off by default.

See Living world for the controls, architecture, supported editor tools and verification limits. These features require the updated game-server image; refreshing only a browser does not install the native helpers.

Bot players

Bifrost can fill the world with bot players: scripted characters that sign in through the bridge like a browser and play Pre-Renewal the way a person would. They are Bifrost's own addition, not part of the original game, and are off unless the host starts them. Every bot is an ordinary account (its name starts with bot), made and geared by Bifrost the first time it is needed.

In the world

To do this Run
Start bots with the host ./start.sh --bots 8 (or npm start -- --bots 8)
Add bots to a host that is already running npm run bots -- --count 8
Stop them They stop with the host (Ctrl+C).

Up to 500 bots can play. They are characters of 22 jobs, from Knights and Priests to High Wizards, Snipers and Creators, with full Pre-Renewal builds: their class skills, +7 to +10 carded gear and a weight-safe bag of potions, gemstones and arrows. Their levels spread as on a live server, from second jobs at level 50 and transcendent ones at 70 up to 99; a lower level has the build's stats in proportion and wears shop gear in place of what it is too low for, and a bot grows with the EXP it earns. The first dozen keep Prontera lively; larger numbers spread over the towns, fields and dungeons and travel between them on foot, by Kafra and by ship, as players do. Homes are dealt out by job, so every town and hunting ground has a mix of classes. Each bot has a part to play:

  • Hunters fight monsters in the fields and dungeons their level can hold with their class's skills, loot, and rest when their SP runs low. When the bag gets heavy, the potions run low or the hunt has gone on a while, they go back to the nearest town: they save there with the Kafra on the first trip, put the cards they found in Kafra storage, sell the loot and buy wings and potions at the Tool Dealer, then head out again (a Butterfly Wing takes them to the town they saved in).
  • Buffers (Priests) heal and bless the players around them in town.
  • Wanderers and sitters walk the town squares, sit and chat, and greet the players who pass by.

Between those, town bots run errands with the game's own NPCs: they make their town their save point at its Kafra, visit Kafra storage, and walk into the Tool Dealer's shop to sell and restock. Now and then one calls a few bots nearby into a party, a healer and a front line first, leads them to a field or dungeon near town, hunts there for a while and brings them back.

Bots also take hunting quests, hunters and town bots alike. Each walks to a quest NPC on the fields, takes a quest so it shows in its Quest Log, hunts that monster while the server counts the kills, and comes back for the EXP, often for another round. The NPCs are the game's own: the 18 iRO repeatable hunting quests for levels 2 to 98 (Langry and the Fabres near Geffen, Gregor and the Peco Pecos near Morocc, and more; rAthena ships them switched off, Bifrost's game server loads them, so players can take them too), and Myu's Favor on a Geffen field, a thousand Kobold Archers and not one Wild Rose, for level 99. A hunt broken off for town stays in the Quest Log and is taken up again.

In your party

Invite a bot by character name (Alt+Z) and it joins your party, follows you from map to map, and fights, heals, buffs and resurrects the way its class does: High Priests heal and revive, Paladins tank and use Devotion, High Wizards cast on packs of monsters, Snipers keep their distance. Bots go through the Endless Tower with you. Talk to them in party chat, to all of them or to one by name (Galen buff):

Say The bots
follow / stay follow you, or hold where they are
buff, heal, res, sp buff the party, heal it, resurrect the fallen, give SP
attack / defensive fight everything in reach, or only defend and support
go, et take the portal ahead, or head into the Endless Tower
status report their job, map, HP, SP, potions and orders
reset go back to their save point with a Butterfly Wing (or respawn when dead)
leave leave the party
help list every command

In battlegrounds

Battleground bots fill KVM (Level 80 and up), Tierra Gorge and Flavius. Each queue holds one bot fewer than a match needs (9 for KVM's 5 against 5, 11 for the others' 6 against 6), so a match starts as soon as one player joins from the Battlegrounds window (Alt+B); once it is on, more bots join until both sides are 10 strong. The queue puts them on either side. As a match starts, Bifrost spreads the healers (Acolytes, Priests, High Priests), performers (Bards, Dancers) and sages (Sages, Professors) evenly over the two sides, players' too: one moves to the side with fewer of its kind, in exchange for a player of another class, and one who joins a match in progress goes to that side. Players who queued as a party or guild stay together. This is Bifrost's rule; rAthena alone puts every player who queues on a random side.

They are a roster of 48 of their own (botbg… accounts), apart from the world's bots: every class bots can play, from High Priests and Paladins to Bards, Rogues and Creators. They wait in the lobby (bat_room) and take turns: each queue gets a healer, a front line, magic, range and damage in turn, picked from whoever played longest ago, and a bot that has waited a long time for a player hands its place to another. So no two matches bring the same faces.

In a match they fight as a team, the way players fight Pre-Renewal battlegrounds. Knights, Crusaders and their Transcendent jobs hold the front; wizards, sages, archers, Bards, Dancers and Alchemists stand behind them in reach of the enemy; priests heal from behind those. Some bots take up the team’s called target while others pick their own, mostly the other side's healers and casters, while the front line peels whoever reaches its casters and Assassins dive for the healers. Each job plays its own openers: Storm Gust on a clump and Jupitel Thunder on the frozen, a second wizard's Meteor Storm where a Storm Gust already lands, Lex Aeterna then Asura Strike, Devotion on the casters, Spell Breaker on a cast, Enchant Deadly Poison before a dive. A hurt bot backs off to its healers and comes back healed (sooner in KVM, where a death counts), and after a respawn the wave gathers and buffs before it goes back in; Crusaders and Paladins put Devotion on then. A bot does not start a long cast such as Jupitel Thunder or Shield Chain while an enemy is hitting it, nor one over a second while an enemy archer has it in shot, since a hit would cut it off: it uses its instant skills, or a caster steps back behind its front line first. In Tierra Gorge the team splits: the damage dealers raid the other camp's Food Storage or Food Depot, a few stay to defend their own, and the main body takes the Neutrality Flag and then pushes on the camp. In Flavius the main body brings down the other camp's two Guardians and then the Crystal they protect, calling out where a Guardian has chased someone, while a few defend their own Crystal. When a match ends they talk to the Vintenar for their badges, go back to the lobby and wait for their next turn. Their movement and waiting times vary by bot, and a stationary melee teammate does not hold the team in place. They never join parties.

In a match bots use up their arrows, gemstones and potions as players do, under the same limits. Between matches (back in the lobby, when they sign in, and as they arrive in their next match) Bifrost fills their supplies up to what they started with (npc/custom/bifrost_bg_supplies.txt). That refill is for Bifrost's battleground bots only; players' items are never refilled.

To do this How
Turn them on or off The admin panel's NPCs tab, Battleground bots (applies at once, without a restart), or ./start.sh --bg-bots standard / --bg-bots off (remembered)
Choose their gear The same setting: budget, standard or bis. Players pick it too, as Noob, Normal or BIS, at the bottom of the Battlegrounds window (Alt+B). A new tier never takes bots out of a match: it comes in once none of them is in one
Run them by hand on a running host npm run bots -- --battleground standard

All three gear tiers are PvP gear: their weapons carry Hydra (against Demi-Human, which players are) instead of the monster builds' boss cards, and their shields Thara Frog.

Tier Gear
budget +4, no cards
standard +7 weapons and armor with Hydra, Thara Frog, Marc, Raydric and Verit cards; plain headgear
bis +10 weapons and +9 gear with the full build's cards

The admin panel can also put Bifrost's Battleground Recruiter beside the Kafra of 14 towns that do not have Maroll's own recruiter. It sends players to the battleground lobby and explains the Battlegrounds window.

In the War of Emperium

Invite a bot by name to your guild (Guild window, Alt+G) and it joins, if it is in no guild yet. Invite it to your party too, and it follows you to the castles. In a castle during the War of Emperium, a guild's bots fight players of every other guild (allied guilds and guildless players excepted), and hit the Emperium and guardians as rAthena allows. They fight nearby enemy players before attacking the Emperium. Your guild needs Official Guild Approval to damage the Emperium.

Bifrost's bots also accept orders in guild chat ($ before the message). A guild order takes priority over party following and stays active through a respawn. Bots use the castle's room warps to reach their destination; they use ordinary travel routes and items rather than GM commands.

Order What bots do
siege prtg_cas01 Travel to that castle, fight nearby defenders, and advance to the Emperium room
defend prtg_cas01 Travel to the Emperium room and fight enemies near it
rally prtg_cas01 198 184 Gather at the given castle coordinates and fight nearby enemies
retreat Return to Prontera and stay there until another guild order
cancel Clear the guild order and resume party following or ordinary routines

Prefix an order with a bot name, for example Aldric siege prtg_cas01, to address just that bot. defend alone uses its current castle order; rally alone uses the sender's position when the sender is visible in the same castle. Leaving the guild clears its orders. These orders are Bifrost's own addition; they do not change rAthena's siege rules.

rAthena's War of Emperium runs at its usual weekly times (Tuesday and Thursday 21:00 to 23:00, Saturday 16:00 to 18:00, by the game server's clock). To practise now, open the admin panel's Battlegrounds tab, War of Emperium, and start a practice one for 5 to 180 minutes. Castles change hands as in a scheduled War of Emperium. End it now ends whichever War of Emperium is running, a scheduled one too.

Good to know

  • Bots take part in the game like players: they count as online characters, share maps and monsters, and can be seen in the admin panel's account and character lists.
  • Their accounts and plans are kept in .bifrost/bots.json and .bifrost/bg-bots.json; their passwords are random and only Bifrost uses them.
  • A host that stops during a battleground match takes its bots out of it. rAthena would count that as deserting, so Bifrost lifts that penalty when the bots sign in again.
  • To see where every bot is and what it is doing, send the bots' process the USR2 signal (kill -USR2 <pid>); each bot prints one line.

How it works

Bifrost has four parts on the host and one in the browser. Players need only the browser; everything that touches the game files or the game server stays on the host.

flowchart LR
  subgraph browser [Player's browser]
    client["Bifrost client<br/>WebGL 2, plain JavaScript"]
  end
  subgraph host [Host computer]
    tunnel["cloudflared<br/>(only with --share)"]
    bridge["bifrost-host<br/>Go bridge, 127.0.0.1:8099"]
    web["Web server<br/>Node, loopback only"]
    install[("Ragnarok Online install<br/>data.grf")]
    rathena["rAthena, Pre-Renewal<br/>login · char · map"]
    db[("MariaDB")]
    admin["Admin page<br/>127.0.0.1:8100"]
    bots["Bot players<br/>Node"]
  end
  client -- "HTTPS and WebSocket" --> tunnel --> bridge
  bridge -- "/ws: game packets over TCP" --> rathena
  bridge -- "pages, game files, text" --> web
  web -- reads --> install
  rathena --> db
  admin -- "rates, accounts, restarts" --> rathena
  bots -- WebSocket --> bridge
Part Code What it does
Browser client client/ Speaks the game protocol, reads the game's file formats (GRF contents such as SPR, ACT, GND, RSW and RSM), draws the world with WebGL 2 and the windows with HTML and CSS. It is served as it is, with no build step.
Bridge host/ Relays each WebSocket to a TCP port on its allowlist (the three local rAthena ports) after checking the invite token. It never reads the packets. Every other request goes to the web server.
Web server server/web.mjs Serves the client, the game files the browser asks for from the host's install (/assets), walkable cells from rAthena's map cache (/cells) and the English text tables (/locale).
Text tables server/locale/ Built at start into .bifrost/locale/en from rAthena's databases and the install's English client files, and rebuilt only when a source changes.
Game server rathena/, compose.yml rAthena at a pinned commit, built for Pre-Renewal with packet version 20220406, plus Bifrost's NPC scripts and items. Runs in Docker Compose with MariaDB; its ports listen on 127.0.0.1 only.
Admin page server/admin.mjs, server/admin-ui/ A page and API on the host only: rates and rules, helper NPCs, accounts, characters, parties, logs and database backups.
Bot players server/bots.mjs, server/bots/ Scripted players. Each one runs the client's own session code in Node, signs in through the bridge like a browser, and plays its class: travelling, hunting, joining parties and answering party chat.
Launcher scripts/host.mjs npm start: checks the machine, downloads the bridge from the matching release (or builds it with Go), starts the containers, builds the text tables, then starts the web server, bridge, admin page, optional tunnel and bots, and prints the links.

The install is read in the client's order (server/assets.mjs): loose files first (data/, System/, SystemEN/, BGM/, AI/ and skin/, or those folders under dll_exe/), then the archives in the [Data] section of DATA.INI, lowest number first. Without a readable DATA.INI, every GRF in the folder is read, smallest first. server/grf.mjs reads GRF versions 0x101 to 0x103, 0x200 and 0x300 (signed "Master of Magic" or "Event Horizon", and .gpf patches in the same format), with zlib, LZMA, stored and DES-encrypted entries and CP949 or UTF-8 file names. Archives that a private server scrambles with its own scheme, and the entries of kRO's protected archives, are skipped with a message.

A session in order:

  1. The launcher makes a random invite token for this run and prints the Play here link and, with --share, the Friends link. The token travels in the URL fragment, so it is never sent in a page request.
  2. The browser loads the client from the web server. Game files are fetched one by one as the client needs them, so players never install anything.
  3. The client signs in by opening /ws?to=127.0.0.1:6900&token=…, then the char and map servers the same way. The bridge refuses any other target and any session without the token.
  4. Map packets become events (client/map-events.mjs) that update one state store (client/state.mjs). The renderer and the windows read that state; neither parses packets.

See SECURITY.md for what the invite link and each port allow.

Develop and test

npm ci
npm run build
npm test

npm test checks the text, then runs the client, server, Go and end-to-end login tests. For the live multiplayer test, start the Docker stack with docker compose up -d --build --wait, then run npm run test:rathena. The opt-in npm run test:siege checks guild and party invitations, castle entry and room travel, rival combat, capture, and guild orders against a running host. Run it outside WoE with Kriemhild unowned and empty; it creates isolated accounts and cleans them up even when an assertion fails. Set BIFROST_GAME_ASSETS to an install folder to also run the tests that read real game files. Run npm start -- --help for launcher flags, and see CONTRIBUTING.md before opening a pull request.

Releases are version tags. Pushing a tag such as v0.2.0 makes .github/workflows/release.yml build the bridge for Windows, Linux and macOS and publish it in a GitHub Release, with that version's section of CHANGELOG.md as the notes. CONTRIBUTING.md has the steps.

Folder Contents
client/ Browser client: protocol and session (protocol.mjs, session.mjs), state, file formats (formats/), renderer (render/), windows (ui/) and tests (test/).
host/ Go bridge (cmd/bifrost-host, internal/bridge).
server/ Web server, GRF and Lua readers, text table builder (locale/), admin page, bots and tests.
rathena/ Game server image: Dockerfile, start script, Bifrost's NPC scripts (npc/) and items (db/).
scripts/ Command-line entry points: launcher, setup, build, accounts, bots, admin, director, text audit.
docs/ Design notes, such as the study of a Bifrost game server (server-plan.md), and the pictures at the top of this page (media/).

License

Bifrost is licensed under GPL-3.0-only. Its pathfinding is based on rAthena; Korangar served as a packet and format reference. The vendored js-lzma decoder by Juan Mellado is MIT licensed. Ragnarok Online is a trademark of Gravity Co., Ltd. Bifrost is independent of Gravity and includes none of its game data.

Explore related projects

Loading…