Skip to main content

Splatoon Bot

GitHub Actions Workflow Status

Automate painting posts in Splatoon based on BlueZ, and optimize its efficiency via Traveling Salesman Problem (TSP).

The mailbox is a service in the Splatoon hub that allows players to create drawings and share them via social media. The drawings may be viewable by other players and may be displayed as signs or graffiti in the hub and in various stages in multiplayer matches.

Installation

BlueZ is a Bluetooth protocol stack included with the official Linux kernel distributions. If you have a Linux machine with a Bluetooth connection, then things become easier:

$ pip install splatbot

If you're using macOS or Windows, an external Bluetooth adapter is needed and please follow the instructions below:

  1. Install VirtualBox
  2. Install VirtualBox Extension Pack
  3. Install Vagrant
  4. Clone splatbot and make a Vagrantfile:
    $ git clone https://github.com/necusjz/splatbot.git
    $ cd splatbot/vagrant
    $ ./make_vagrantfile.py
    

After that, a Vagrantfile will be generated and the current directory is the location where you run any Vagrant command.

Usage

Generate the macro represents the actual painting process:

$ splatbot macro -i <image>

Wirelessly painting the post on switch console or another window:

$ splatbot start -i <macro> [--dry-run]

Several Vagrant commands that might be useful:

Create and configure guest machines according to your Vagrantfile:
$ vagrant up

SSH into a running Vagrant machine and give you access to a shell:
$ vagrant ssh

Shut down the running machine Vagrant is managing:
$ vagrant halt

Stop the running machine Vagrant is managing and destroy all resources that were created during the machine creation process:
$ vagrant destroy

Pathing

We optimize pathing efficiency by treating the painting process as a variant of Traveling Salesman Problem (TSP). It's a classic optimization problem where the goal is to find the shortest possible route that visits a given set of cities and returns to the original city.

If you want to solve it without returning to the start, it essentially becomes the problem of finding a Hamiltonian Path, which visits each city exactly once. To further scale down, we divide the image into 8x3 parts (with patch size of 40) and label the contiguous region as a city.

Benchmark

We provide a dataset collected from ikasumi.art to easier achieve performance test on your pathing algorithm:

The results will be shown in the pipeline (via pytest -s -v --color=yes tests/):

+------------------+-----------+------------+--------------+
| Benchmark        | Current   | Previous   | Result       |
+==================+===========+============+==============+
| jellyfish.png    | 17078     | 44514      | 2.61x faster |
+------------------+-----------+------------+--------------+
| judd.png         | 32728     | 52616      | 1.61x faster |
+------------------+-----------+------------+--------------+
| kanji.png        | 41557     | 55961      | 1.35x faster |
+------------------+-----------+------------+--------------+
| marie.png        | 43280     | 53238      | 1.23x faster |
+------------------+-----------+------------+--------------+
| octoling.png     | 38008     | 54232      | 1.43x faster |
+------------------+-----------+------------+--------------+
| sakura.png       | 63809     | 66214      | 1.04x faster |
+------------------+-----------+------------+--------------+
| skyline.png      | 61949     | 63751      | 1.03x faster |
+------------------+-----------+------------+--------------+
| splattershot.png | 34804     | 52910      | 1.52x faster |
+------------------+-----------+------------+--------------+
| Geometric Mean   | N/A       | N/A        | 1.33x faster |
+------------------+-----------+------------+--------------+

Contributing

We love contributions! Before submitting a Pull Request, it's always good to start with a new issue first.

License

This repository is licensed under MIT. Full license text is available in LICENSE.

Metadata

Release files for splatbot 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for splatbot 2.1.0
File Size Uploaded
splatbot-2.1.0.tar.gz 8.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for splatbot 2.1.0
File Interpreter ABI Platform
splatbot-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.5 kB

Release files / splatbot-2.1.0.tar.gz

Download URL splatbot-2.1.0.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c9b304e9be31b6191fa0b48dbe38f4164d7d91b9fa9705a5174c9b8716323e10
BLAKE2b-256 checksum
How to use checksums
fdf166a25a079d0af33c645322710756b9e58b60f7f9bc7be613d71bca43ee67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / splatbot-2.1.0-py3-none-any.whl

Download URL splatbot-2.1.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc6cbef63daa9ac9d006dd4a4a595770ed9751fabc0c0f7f21a0e07461eee9f0
BLAKE2b-256 checksum
How to use checksums
8f8f9d92e5a77ac1579c723498bee87631fe93279868eddece115c3675df7e15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page