Skip to main content

The RoyaleSim logo: a red crown shield with a white gear on it, outlined in gold

RoyaleSim

CI License Python Docs Discord Last commit

Engine: Rust, whole numbers only Tick: 50 ms, 20 per second Coordinates: 18,000 units to one tile

The Clash Royale battle engine your bot plays in. It runs the whole match on your own machine. Most people use it through RoyaleGym and never call it directly.

An engine battle in the RoyaleViser viewer, 18 units on the board

Install

pip install "royalegym[all]"

That installs this engine and everything else. Use Python 3.12. Install has more.

Try it

import json, royalesim

b = royalesim.Battle(card_names=None, slot_of_k=[[0, 1, 2], [0, 1, 2]])
ids = {row[0]: i for i, row in enumerate(json.loads(b.catalogue_json()))}
deck = [ids[n] for n in ["Knight", "Archer", "Goblins", "Giant", "Musketeer", "Fireball", "Arrows", "Skeletons"]]
b.reset(seed=0, decks=[deck, deck], shuffle=1, start_tick=0, elixir_milli=[5000, 5000], tower_hp=None, spawns=[])
b.step([], 100)                                          # nobody can play in the opening seconds
r = b.step([(0, 0, 9000 * 18, 10000 * 18)], 20)         # blue plays its first card, then 20 ticks pass
print(json.loads(b.state_json())["tick"], royalesim.DEPLOY_REASONS[r[0][1]])   # 120 OK

Next

  • The engine's Python API: API
  • How it works inside, how fast and how accurate it is, building from source: Engine
  • Questions: Discord

MIT License.

Metadata

Release files for royalesim 0.1.20

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

Source distribution (sdist)

Source distribution for royalesim 0.1.20
File Size Uploaded
royalesim-0.1.20.tar.gz 3.1 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for royalesim 0.1.20
File
royalesim-0.1.20-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
royalesim-0.1.20-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details
royalesim-0.1.20-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details
royalesim-0.1.20-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
royalesim-0.1.20-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 23.6 MB

Release files / royalesim-0.1.20.tar.gz

Download URL royalesim-0.1.20.tar.gz
Size 3.1 MB
Tags Source
SHA-256 checksum
How to use checksums
a6cb2e3485a84cfcd380375e9b57ee7a77995268e8dff11cccc0885b4a566466
BLAKE2b-256 checksum
How to use checksums
40a73c41055959f9f32f53048993e4dff4f0fe70461cfd8a3840faf48b9f37ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / royalesim-0.1.20-cp310-abi3-win_amd64.whl

Download URL royalesim-0.1.20-cp310-abi3-win_amd64.whl
Size 4.0 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
5bd3821f6759dfdf1571a732c77506eef35300d4fc818e057d61238c8e59411c
BLAKE2b-256 checksum
How to use checksums
b0edc94e1ac1eee9476da305f30d29d54c0c8c7a54e6b945fb777cec5bb1879f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / royalesim-0.1.20-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL royalesim-0.1.20-cp310-abi3-manylinux_2_28_x86_64.whl
Size 4.2 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
6af62c4100a50ea8e500a65d2ac73e29ed4a7cd1995c5b9d83fd0a070db5eb33
BLAKE2b-256 checksum
How to use checksums
a3d1dc9c4aa392e26ed4aa44f9578bedcfde5932215bf29365bacfbfadeb3640
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / royalesim-0.1.20-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL royalesim-0.1.20-cp310-abi3-manylinux_2_28_aarch64.whl
Size 4.1 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
db1dd3dce7589493d4649a8722fbb9b139701116ab275caca7732115a9bd0367
BLAKE2b-256 checksum
How to use checksums
469104e4e6188ba1c94a09ff7d2fa433e37c375c26027adec4124abfab77bcc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / royalesim-0.1.20-cp310-abi3-macosx_11_0_arm64.whl

Download URL royalesim-0.1.20-cp310-abi3-macosx_11_0_arm64.whl
Size 4.0 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cfc7bee998065817e0189af56d8066b55a81b1daf25d7c5689e3cd211644e0e7
BLAKE2b-256 checksum
How to use checksums
907309a9e3246988e7848b4bc51bbd151ad441de0c764bb2bb241a8dc62493fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / royalesim-0.1.20-cp310-abi3-macosx_10_12_x86_64.whl

Download URL royalesim-0.1.20-cp310-abi3-macosx_10_12_x86_64.whl
Size 4.2 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
65ba0f421568751d0e00521b9bc3dc3e73c2ea03d2100b6533e6f76cbee5138c
BLAKE2b-256 checksum
How to use checksums
878bdbc8b5bdaca279abbb05023f1119fc52ca11027141843695e7713e1a6960
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.20 This release

6 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