Rollback netcode for Mega Man Battle Network!

Last update: Jun 17, 2022

Tango

Tango is rollback netplay for Mega Man Battle Network.

Supported games

  • MEGAMAN6_FXXBR6E: Mega Man Battle Network 6: Cybeast Falzar (US)
  • MEGAMAN6_GXXBR5E: Mega Man Battle Network 6: Cybeast Gregar (US)
  • ROCKEXE6_RXXBR6J: Rockman EXE 6: Dennoujuu Falzer (JP)
  • ROCKEXE6_GXXBR5J: Rockman EXE 6: Dennoujuu Glaga (JP)
  • MEGAMAN5_TP_BRBE: Mega Man Battle Network 5: Team Protoman (US)
  • MEGAMAN5_TC_BRKE: Mega Man Battle Network 5: Team Colonel (US)
  • ROCKEXE5_TOBBRBJ: Rockman EXE 5: Team of Blues (JP)
  • ROCKEXE5_TOCBRKJ: Rockman EXE 5: Team of Colonel (JP)
  • MEGAMANBN4BMB4BE: Mega Man Battle Network 4: Blue Moon (US)
  • MEGAMANBN4RSB4WE: Mega Man Battle Network 4: Red Sun (US)
  • ROCK_EXE4_BMB4BJ: Rockman EXE 4: Tournament Blue Moon (Rev 0 only) (JP)
  • ROCK_EXE4_RSB4WJ: Rockman EXE 4: Tournament Red Sun (Rev 0 and 1) (JP)
  • MEGA_EXE3_BLA3XE: Mega Man Battle Network 3: Blue (US)
  • MEGA_EXE3_WHA6BE: Mega Man Battle Network 3: White (US)
  • ROCK_EXE3_BKA3XJ: Battle Network Rockman EXE 3: Black (Rev 1 only) (JP)
  • ROCKMAN_EXE3A6BJ: Battle Network Rockman EXE 3 (Rev 1 only) (JP)

Design

Tango is composed of two parts: the launcher and the core. The launcher performs high-level control operations, such as starting matches and configuration, while the core performs emulation and netplay. There are additional supplementary tools (replayview, replaydump, keymaptool) that the launcher may also use for certain specialized operations.

The core and launcher send IPC requests to each other over stdout/stdin pipes.

Building

Core

The core is written in Rust. Despite being for Windows, you must have a POSIX-y MinGW environment set up. The following instructions are for Ubuntu.

  1. Install Rust.

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. Install the Rust target and toolchain for x86_64-pc-windows-gnu.

    rustup target add x86_64-pc-windows-gnu
    rustup toolchain install stable-x86_64-pc-windows-gnu
  3. Install mingw-w64.

    sudo apt-get install -y mingw-w64
  4. Dowload the DLLs for SDL2.

    pushd core &&
    ./get-windows-sdl.sh &&
    popd
  5. Ensure mingw-w64 is using the POSIX threading model.

    sudo update-alternatives --install /usr/bin/x86_64-w64-mingw32-gcc x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-win32 60 &&
    sudo update-alternatives --install /usr/bin/x86_64-w64-mingw32-gcc x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix 90 &&
    sudo update-alternatives --config x86_64-w64-mingw32-gcc &&
    sudo update-alternatives --install /usr/bin/x86_64-w64-mingw32-g++ x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-win32 60 &&
    sudo update-alternatives --install /usr/bin/x86_64-w64-mingw32-g++ x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix 90 &&
    sudo update-alternatives --config x86_64-w64-mingw32-g++
  6. Build the core.

    cd core &&
    cargo build --target x86_64-pc-windows-gnu

Launcher

The launcher is written in Node + Electron.

  1. Run npm install to get all Node dependencies.

    cd launcher &&
    npm install
  2. Make a dev-bin directory in launcher and copy the core files into it. Note you will need to do this on every rebuild.

    mkdir launcher/dev-bin &&
    cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll \
        /usr/lib/gcc/x86_64-w64-mingw32/9.3-posix/*.dll \
        core/target/x86_64-pc-windows-gnu/release/tango-core.exe \
        core/target/x86_64-pc-windows-gnu/release/replayview.exe \
        core/target/x86_64-pc-windows-gnu/release/replaydump.exe \
        core/target/x86_64-pc-windows-gnu/release/keymaptool.exe \
        launcher/dev-bin
  3. In the launcher directory, you can use the following commands:

    npm run start  # start webpack (keep this running in the background)
    npm run start:main  # start electron (run this in a new terminal)

Server

Signaling

The signaling server is the remote HTTP server-based component that Tango connects to. It doesn't actually do very much, so you can run it on absolutely piddly hardware. All it does is provide signaling by sending WebRTC SDPs around.

If you already have Rust installed, you can build it like so:

  1. Enter the core directory and build it.

    cd core &&
    cargo build --release --bin tango-signaling-server

That should be it! The server should be available in the usual Rust output directory.

ICE configuration

An ICE configuration server is not provided. You must write your own. Note that by default Tango will use Google's public STUN servers, but will not use any TURN servers.

If you want to guarantee connections across even funny NATed connections, you will need to use an ICE configuration server. This can be configured in Tango under Settings > Advanced > ICE configuration endpoint.

The ICE configuration server must:

  • Run over HTTP or HTTPS.
  • Accept, via POST, GetRequest and return GetResponse as defined in core/tango-protos/src/protos/iceconfig.proto. Note that these must be in serialized Protobuf format.

Automatic Updates

Whenever a new version of Tango is released, Tango will download the update for you automatically. When you see a purple dot on the Settings cog in Tango, the update is currently being downloaded. When you see a blue dot on the Settings cog, the download is complete, and will be installed once Tango is closed. When you next open Tango, it will be running the up-to-date version.

A note for Linux users:

The .AppImage release for Linux users also fully supports automatic updates! However, due to how the update process works, the original .AppImage you downloaded will be replaced with the latest .AppImage file, effectively renaming it. This renaming will break any scripts, shortcuts, or .desktop entries you may have created against the original filename. However, this can easily be avoided; simply rename your .AppImage to Tango.AppImage - the key is removing the version number. If you do this, you will still receive automatic updates, but the .AppImage won't be renamed after an update, meaning any scripts or shortcuts pointing to Tango will continue working after updates.

Language support

Tango is fully internationalized and supports language switching based on your computer's language settings.

The order of language support is as follows:

  • English (en): This is Tango's primary and fallback language. All Tango development is done in English.

  • Japanese (ja): This is Tango's secondary but fully supported language. All text in the UI, barring some extremely supplementary text (e.g. the About screen) is expected to be available in Japanese. If new UI text is added, a Japanese translation SHOULD also be provided. Tango releases MUST NOT contain missing Japanese text.

  • Simplified Chinese (zh-Hans), Spanish (es): These are Tango's tertiary languages. Support is provided on a best effort basis and translations are provided as available.

GitHub

https://github.com/tangobattle/tango
Comments
  • 1. Initial Linux support

    Most of the stuff breaking Linux support was already fixed thanks to some back and forth on Discord with @bigfarts . This PR mainly just adds some stuff to package.json to allow it to build an AppImage with everything it needs.

    Overview of this PR:

    • Added build:linux script to package.json, which does the build without calling the Windows-specific update-bin.sh script
    • Added dist:linux script to package.json, which is identical to dist except it calls build:linux instead of build
    • Added a linux section to package.json, which tells Electron to also copy libSDL2 shared objects from the host to the AppImage, this way the AppImage works fine even if the user's machine doesn't have SDL2 installed
    • Ensures tango-core is spawned from the launcher while inheriting the full environment. Otherwise it won't be able to find any bundled shared objects and will crash.

    Building:

    • The build process is straightforward, even easier than building for Windows. I believe your workflow already satisfies all the dependencies, it's just a matter of changing some of the commands out. But for completeness, here's what I used to build on a clean Ubuntu 20.04 Docker image:
    # Update system and install apt dependencies
    apt update -y
    apt upgrade -y
    DEBIAN_FRONTEND=noninteractive apt install -y alsa build-essential clang cmake curl git libnss3 libsdl2-dev libsdl2-ttf-dev pkgconf sudo
    
    # Install Rust, not using apt since apt's version is too old
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
    
    # Install node 18 because apt is on version 12 or something
    curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - && \
    	sudo apt-get install -y nodejs
    
    # Clone tango
    git clone --recurse-submodules https://github.com/tangobattle/tango
    
    # Build the core
    cd tango/core
    cargo build --release --target x86_64-unknown-linux-gnu
    
    # Copy the core binaries to the launcher
    cd ..
    mkdir -p launcher/bin
    cp core/target/x86_64-unknown-linux-gnu/release/{tango-core,replayview,replaydump,keymaptool} ./launcher/bin/
    
    # Install npm dependencies
    cd launcher
    npm install
    
    # Build the launcher and package the AppImage
    npm run dist:linux
    
    # AppImage will be found at:
    # ./packages/Tango-3.1.10.AppImage
    

    Things of note:

    • When packaging this for release, I recommend compiling on Ubuntu 20.04 instead of Ubuntu 22.04. This is so that it gets compiled with a slightly older version of glibc, allowing it to run on a wider range of systems. If this were compiled on Ubuntu 22.04, it would only be compatible with a very limited number of systems with the recent version of glibc used by 22.04.
    • I haven't tested this on an online PvP match at all. The game runs though, so I have no reason to believe the netplay would be broken. Perhaps some beta Linux builds can be released so the wider community can give it a try and report problems.
    • For whatever reason (at least on KDE), Tango's icon doesn't show in the application window. Instead, it uses the default placeholder X11 icon. Not a huge deal but I don't know why this is: image
    Reviewed by ubergeek77 at 2022-05-22 06:54
  • 2. Controller support

    There's always an external program that will help out with that, but not everyone is a tech literate person willing to take a minute to set up a keyboard emulation program. With Tango 3.0 focusing on user-friendliness (or so it seems to me), I feel like adding controller support fits in with that theme.

    Reviewed by Lumanator at 2022-04-28 05:35
  • 3. fix remaining bn4 issues

    Known issues:

    • Supports Blue Moon US version only.
    • You can only play on Final Destination.
    • You can only play a single round (will crash when going into round 2).
    • Do not use saves that, when being loaded, open the New Game+ menu.
    • Reveal setup doesn't work.
    Reviewed by bigfarts at 2022-06-04 07:52
  • 4. Automatically build for Linux

    This PR adds a GitHub Workflow that builds Tango for Linux as an AppImage. It should automatically attach the .AppImage to newly tagged releases, just like the Windows workflow already does.

    The Windows workflow has been renamed, since it's now not the only one. Both workflows also now target Ubuntu 20.04 specifically, since ubuntu-latest is going to be updated to 22.04 any day now, which might be an unexpected change.

    Reviewed by ubergeek77 at 2022-05-23 04:07
  • 5. bn3 save editor view

    things to do:

    • [ ] folder support
      • [ ] find where the folder info is stored in EWRAM
      • [ ] add chip data and icons
      • [ ] expose chip info via getFolderEditor
    • [ ] navicust support
      • [ ] get navicust cata
      • [ ] find where navicust data is stored in EWRAM
      • [ ] expose navicust info via getNavicustEditor
    • [ ] style support
      • [ ] find where style data is stored in EWRAM
      • [ ] make a UI for this
    Reviewed by bigfarts at 2022-06-19 20:59
  • 6. bn5 save editor view

    things to do:

    • [ ] folder support
      • [ ] find where the folder info is stored in EWRAM
      • [ ] add chip data and icons
      • [ ] expose chip info via getFolderEditor
    • [ ] navicust support
      • [ ] get navicust cata
      • [ ] find where navicust data is stored in EWRAM
      • [ ] expose navicust info via getNavicustEditor
    • [ ] modcard support
      • [ ] get modcard cata
      • [ ] find where modcard data is stored in EWRAM
      • [ ] expose modcards info via getModcardsEditor
    Reviewed by bigfarts at 2022-06-19 20:59
  • 7. bn4 ncp/modcards view

    things to do:

    • [ ] navicust support
      • [ ] get navicust cata
      • [ ] find where navicust data is stored in EWRAM
      • [ ] expose navicust info via getNavicustEditor
    • [ ] modcard support
      • [ ] get modcard cata
      • [ ] find where modcard data is stored in EWRAM
      • [ ] make bn4 modcards UI
    Reviewed by bigfarts at 2022-06-19 20:59
  • 8. more replay filter options

    a dropdown bar may also be a good place to show filter options, like being able to view only the replays from a specific game. Maybe you could also track whether a replay has already been rendered at least once, so users can view only unrendered videos which then get hidden from the list once rendering finishes.

    Originally posted by @ssbmars in https://github.com/tangobattle/tango/issues/9#issuecomment-1112851642

    Reviewed by bigfarts at 2022-05-18 07:59
Zenith - sort of like top or htop but with zoom-able charts, CPU, GPU, network, and disk usage
Zenith - sort of like top or htop but with zoom-able charts, CPU, GPU, network, and disk usage

Zenith - sort of like top or htop but with zoom-able charts, CPU, GPU, network, and disk usage

Jun 23, 2022
Send copy events over the network

Copiepate Copiepate is a small utility to remotely set the content of a clipboard. I created this tool as I frequently use a remote tmux+vim setup and

Jun 12, 2022
Generate QR code of your Wi-Fi network

ranpha Generate QR code of your Wi-Fi network. Usage: -p PROTOCOL -s SSID [-k KEY] [-f IMAGE_FORMAT] [-o OUT_DIR] [--size SIZE]

Jun 5, 2022
rollback netplay for mega man battle network / ロックマンエグゼのロールバックネットプレイ
rollback netplay for mega man battle network / ロックマンエグゼのロールバックネットプレイ

tango (logo courtesy of pnw_ssbmars / ロゴ提供:pnw_ssbmars) netplay for mega man battle network games in the style of https://github.com/ssbmars/BBN3-netc

May 23, 2022
Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

Jun 24, 2022
Command-line program to manage PS battle logs. WIP.

psbattletools psbattletools is a command-line tool written in Rust for manipulating Pokémon Showdown battle logs. Installation psbattletools currently

Dec 10, 2021
A sci-fi battle simulation implemented in the bevy engine.
A sci-fi battle simulation implemented in the bevy engine.

Bevy Combat It's a bevy port of my ECS Combat Unity demo. Check out the web demo in your browser. You can use the - and = keys to speed up and slow do

May 10, 2022
Backroll is a pure Rust implementation of GGPO rollback networking library.

backroll-rs Backroll is a pure Rust implementation of GGPO rollback networking library. Development Status This is still in an untested alpha stage. A

Jun 9, 2022
Bevy plugin for the GGRS P2P rollback networking library.

Bevy_GGRS Bevy plugin for the ?? GGRS P2P rollback networking library. The plugin creates a custom stage with a separate schedule, which handles corre

Jun 8, 2022
Docker containers on a synthetic network. Run applications in a context that lets you manipulate their network conditions.

Synthetic Network Docker containers on a synthetic network. Run applications in a context that lets you manipulate their network conditions. Dependenc

Jun 22, 2022
Cross-chain bridge message delivery network. We are hiring, [email protected]

Introduction Implementation of a https://darwinia.network node in Rust based on the Substrate framework. This repository contains runtimes for the Dar

Jun 20, 2022
Diem’s mission is to build a trusted and innovative financial network that empowers people and businesses around the world.
Diem’s mission is to build a trusted and innovative financial network that empowers people and businesses around the world.

Note to readers: On December 1, 2020, the Libra Association was renamed to Diem Association. The project repos are in the process of being migrated. A

Jun 23, 2022
The Nervos CKB is a public permissionless blockchain, and the layer 1 of Nervos network.

Nervos CKB - The Common Knowledge Base master develop About CKB CKB is the layer 1 of Nervos Network, a public/permissionless blockchain. CKB uses Pro

Jun 15, 2022
The Phala Network Blockchain, pRuntime and the bridge.
The Phala Network Blockchain, pRuntime and the bridge.

Phala Blockchain Phala Network is a TEE-Blockchain hybrid architecture implementing Confidential Contract. This repo includes: node/: the main blockch

Jun 15, 2022
Scriptable network authentication cracker
Scriptable network authentication cracker

badtouch badtouch is a scriptable network authentication cracker. While the space for common service bruteforce is already very well saturated, you ma

Jun 11, 2022
Network simulation in Rust

netsim - A Rust library for network simulation and testing (currently linux-only). netsim is a crate for simulating networks for the sake of testing n

May 23, 2022
A distributed, cryptographically-verifiable blog / social network

FeoBlog FeoBlog is a distributed blogging platform. It takes a lot of its inspiration from Mastodon and Scuttlebutt. It aims to solve a couple of prob

Jun 10, 2022
Streaming Network Overlay Connection Arbitration Tunnel

SNOCAT Streaming Network Overlay Connection Arbitration Tunnel snocat is a framework for forwarding streams across authenticated, encrypted QUIC tunne

Jun 21, 2022
Employ your built-in wetware pattern recognition and signal processing facilities to understand your network traffic

Nethoscope Employ your built-in wetware pattern recognition and signal processing facilities to understand your network traffic. Check video on how it

Jun 6, 2022
A neural network crate

RustNN An easy to use neural network library written in Rust. Crate Documentation Description RustNN is a feedforward neural network library. The libr

Jun 5, 2022