Rollback netcode for Mega Man Battle Network!

Overview

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.

Comments
  • bn3 save editor view

    bn3 save editor view

    things to do:

    • [x] folder support
      • [x] find where the folder info is stored in EWRAM
      • [x] add chip data and icons
      • [x] expose chip info via getFolderEditor
    • [x] navicust support
      • [x] get navicust cata
      • [x] find where navicust data is stored in EWRAM
      • [x] expose navicust info via getNavicustEditor
    • [x] style support
      • [x] find where style data is stored in EWRAM
      • [x] make a UI for this
    enhancement good first issue 
    opened by bigfarts 7
  • Missing instructions to connect logitech controller input on MacOS

    Missing instructions to connect logitech controller input on MacOS

    MacOS: Ventura 13.0 Processor: Quad-Core Intel Core i7 Tango version: 4.0.23

    I tried playing with my logitech controller but it wasn't detected by Tango (in game or in the input setting section). I found SDL Github repo this issue https://github.com/libsdl-org/SDL/issues/5781 and saw the link to this page https://nachtimwald.com/2020/11/08/macos-iohidmanager-permission-issue/

    Based on the page I had to give Tango Input Monitoring privileges which worked

    Not sure where to put this kind of documentation in Tango for other users, but happy to open a PR given directions

    opened by btruhand 6
  • support switch joycons

    support switch joycons

    Tango's launcher doesn't detect Switch's JoyCons, NES, and SNES controllers, ignoring any button requests when attempting to map these controllers.

    Strangely, Switch Pro Controllers work perfectly fine, not sure how the above controllers operate differently from SPCs.

    enhancement 
    opened by LanHikariDS 6
  • Auto Updater

    Auto Updater

    For some reason, whenever a version change is made(3.2.44 to 3.2.45, for example) the program won't auto-update for me. I have stable update channel on and I don't know what I'd have to enable to allow it to auto update.

    enhancement 
    opened by goldspacedragon 3
  • [4.0] graphics are broken in obscure corner cases

    [4.0] graphics are broken in obscure corner cases

    • glutin:

      • up-to-date drivers: fine
      • nvidia: fine but stream is dark on discord?
      • really old intel graphics drivers: horrible texture mangling
      • mesa (with srgb): doesn't work, NoAvailablePixelFormat
      • mesa (without srgb): wrong colors
      • angle (using gles): wrong colors but slightly less wrong
      • powervr (using gles): lol
    • wgpu:

      • up-to-date drivers: fine
      • some intel drivers: crashes on vulkan, must use d3d12
      • angle (using gles): wrong colors but just as wrong as glutin gles
      • mesa (using gles): doesn't work at all, just hangs
      • powervr (using gles): lol
    bug 
    opened by bigfarts 2
  • Initial Linux support

    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
    opened by ubergeek77 2
  • Controller support

    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.

    enhancement 
    opened by Lumanator 2
  • juice: Send failed, datagram is too large

    juice: Send failed, datagram is too large

    unsure why this happens

    [2022-09-28T11:44:27Z WARN  datachannel::sys] rtc::impl::IceTransport::LogCallback@354: juice: Send failed, datagram is too large
    
    opened by bigfarts 1
  • Add license scan report and status

    Add license scan report and status

    Your FOSSA integration was successful! Attached in this PR is a badge and license report to track scan status in your README.

    Below are docs for integrating FOSSA license checks into your CI:

    opened by fossabot 1
  • read ncp/chip/etc info out of the ROM instead of bundling it

    read ncp/chip/etc info out of the ROM instead of bundling it

    marwe — Today at 16:34 nice, I think that's pretty much the only way to make the dynamic dream a reality otherwise the other option would have to be like the patch devs supplying additional hardcoded metadata for the save viewer

    enhancement 
    opened by bigfarts 1
  • replay desync

    replay desync

    opened by bigfarts 1
  • Tango keeps crashing on open when Switch joycons are connected to Macbook

    Tango keeps crashing on open when Switch joycons are connected to Macbook

    MacOS version: Ventura 13.0 Processor: Quad-Core Intel Core i7 Tango: 4.0.23

    I saw that support for Switch Joycons is available for Tango. But whenever I try to open Tango while my Macbook is connected to my Switch joycons it would crash. The log outputs are always the same (pasting just the crash reason):

    thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: SdlError("Couldn't open Bluetooth_057e_2006_0x7fe5e8704080")', tango/src/main.rs:253:54
    stack backtrace:
       0: _rust_begin_unwind
       1: core::panicking::panic_fmt
       2: core::result::unwrap_failed
       3: core::result::Result<T,E>::unwrap
       4: tango::child_main
       5: tango::main
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    

    The program doesn't crash when Tango is already open and I connect my Switch joycons, but the program wouldn't pick up the inputs from the joycons (didn't check the logs for thesee, but can try and replicate if needed)

    I also noticed that my Switch joycon bluetooth connection identifier (the green lights) would be at 2 green lights whenever I have it connected with Tango open, which I think means that it is connected as the second device to the bluetooth interface. But I checked and there were no other bluetooth devices connected to my Macbook

    opened by btruhand 1
  • bn123 makes weird beepy noises

    bn123 makes weird beepy noises

    i'm not sure why:

    • this only happens during the turn (also the audio gets scrunkly)
    • in the custom screen the audio is not scrunkly
    • doesn't seem to cause any timing issues
    • maybe skipping samples?
    bug help wanted 
    opened by bigfarts 1
  • bn6 random battle support

    bn6 random battle support

    this seems relatively complicated to implement, as during the random battle screens there is SIO communication going on. i don't really know what the SIO in question is, though, and how much of it is actually required (and how much of it can just be fudged).

    enhancement help wanted 
    opened by bigfarts 0
Releases(v4.0.27)
Owner
Tango
Rollback netcode for Mega Man Battle Network! ロックマンエグゼのロールバックネットコード!
Tango
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

Annika 2 Dec 27, 2022
A simulator for Street Fighter 6 battle data.

sf6_sim A simulator for Street Fighter 6 battle data. Very early in development. It can currently simulate boxes, cancel lists, and movement. Online v

null 4 Jun 18, 2023
A mansplainer for man commands, cheeky and rude, use at your own risk

mansplain mansplain is a Command-Line Interface (CLI) tool built in Rust that mansplains a command to you Prerequisites Rust and Cargo installed An Op

Pratik Kanthi 3 Oct 24, 2023
Pink is a command-line tool inspired by the Unix man command.

Pink is a command-line tool inspired by the Unix man command. It displays custom-formatted text pages in the terminal using a subset of HTML-like tags.

null 3 Nov 2, 2023
A more compact and intuitive ASCII table in your terminal: an alternative to "man 7 ascii" and "ascii"

asciit A more compact and intuitive ASCII table in your terminal: an alternative to man 7 ascii and ascii. Colored numbers and letters are much more e

Qichen Liu 刘启辰 5 Nov 16, 2023
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

Benjamin Vaisvil 1.6k Jan 4, 2023
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

Loïc Carr 14 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]

Yuki Okushi 6 Oct 25, 2022
Captures packets and streams them to other devices. Built for home network analysis and A&D CTFs.

?? shiny-donut shiny-donut is a packet capture app that supports streaming packets from a remote system to another device. The main use for this is to

Justin Perez 3 Nov 30, 2022
When your network-sense tingles 🚨

HTTP Sense HTTP Sense is a reverse proxy and network monitoring tool that provides comprehensive network monitoring for your backend servers and micro

HTTP Sense 6 Dec 22, 2022
Set of tools that make it easier for the operator to manage a TAPLE network.

⚠️ TAPLE is in early development and should not be used in production ⚠️ TAPLE Tools TAPLE (pronounced T+ ?? ['tapəl]) stands for Tracking (Autonomous

Open Canarias 5 Jan 25, 2023
🪂 SkyFolder shares your folders on the network!

Skyfolder Easily share your files & folders on the network. Security, Simplicity, Style all built in. It's like your own personal Google Drive! Skyfol

null 20 May 29, 2023
Share clipboard between machines on your local network.

Clipshare Do you ever have to work on multiple machines? Do you ever used your Github™ Gists just to send some text between then? Clipshare is here to

Rodrigo Navarro 39 Jun 19, 2023
JA4+ is a suite of network fingerprinting standards

JA4+ Network Fingerprinting JA4+ is a suite of network fingerprinting methods that are easy to use and easy to share. These methods are both human and

FoxIO 94 Oct 5, 2023
A simplified example in Rust of training a neural network and then using it based on the Candle Framework by Hugging Face.

candle-simplified-example A simplified example in Rust of training a neural network and then using it based on the Candle Framework by Hugging Face. H

Evgeny Igumnov 8 Sep 26, 2023
⚡🚀 Content Delivery Network written in Rustlang, optimized for speed and latency.

Supported Formats HTML Javscript Css Image PNG JPG JPEG GIF SVG Video MP4 WEBM FLV Audio OGG ACC MP3 Archives ZIP RAR Feeds & Data JSON YAML XML Docum

Noname 3 Apr 9, 2024
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

murk.land 8 May 23, 2022
Mod loader for Mega Man Battle Network Legacy Collection.

chaudloader chaudloader is a mod loader for Mega Man Battle Network Legacy Collection. For users Run install.exe. If you are on Steam Deck, you will n

The Rockman EXE Zone 6 Apr 23, 2023
Mod for Mega Man Battle Network Legacy Collection to restore the WWW base music in the postgame.

MMBNLC Postgame WWW Base Music mod This is a mod for Mega Man Battle Network Legacy Collection Vol. 2 adjusts the field music played in the WWW base i

Prof. 9 3 May 7, 2023
A networked (p2p), cross-platform physics simulation example using rollback netcode

bevy_gaff (work in progress) bevy_gaff is an attempt at making a networked (p2p), cross-platform physics simulation using rollback netcode. It synchro

Johan Klokkhammer Helsing 13 Sep 5, 2023