Changelog¶
All notable changes to RoyaleGym. The format follows Keep a Changelog, and the version follows Semantic Versioning. Until 1.0, a minor version may change the observation's shape; each such change is listed here.
0.1.31 (2026-11-20)¶
Changed¶
- royalesim 0.1.54, which changes engine settings and lets a building into an opened pocket (below). The one-seat battle on the Environments page now ends 2-1 in 610 steps, and every other example on the site prints the same numbers. A snapshot bank saved by royalegym 0.1.27 or older loads only under the settings it was saved under, so one saved on royalesim 0.1.53 is refused on 0.1.54; a bank saved by royalegym 0.1.28 or newer still loads, as the card data and the elixir rules did not change.
- The action mask follows
placement.BUILDING_TERRITORY(royalesim 0.1.54). Underenemy_tower_no_deploy_rects, royalesim 0.1.54's default, a building may be tapped in the enemy's pocket once that lane's princess tower has fallen: its tap is judged as a troop's, with the river band closed, and the engine judges where its box lands, as for every building. Underown_half(an engine without the key, and the 15.535.29 client's arms) a building stays on its own half.DeployRules.building_territorysays which. MockEngine keeps buildings on their own half, having no box to judge, and says so.
0.1.30 (2026-11-13)¶
Changed¶
- royalesim 0.1.53. The Hero Electro Wizard plays on the 16.635 card table, which gains the unit
type
ElectroWizardHero. Unit types are numbered in name order, so on that table every type after it moves up one: aunit_namespin made there before 0.1.53 lacks it and is refused by name (append it to the pin, so no pinned id moves), and a pin made on another table is unchanged. Every example on the site prints the same numbers.
Added¶
EntityListObsBuilder(unit_buffs=True): up to six buffs per unit, the most time left first. Each slot's id is in a newentity_buffskey (uint8 [N, 6], 0 for none), and its time left / 10 s is an appended column. Ids come from the member names of the engine's buff kinds, sorted (RustEngine.buff_kinds(), royalesim 0.1.53 on), or from abuff_namespin in any order, andconfig()carries the vocabulary.buffs_droppedcounts the buffs that did not fit.EntityListObsBuilder(unit_extras=True): a spawner's clock and the units left in its wave, the dash state and its ticks, the speed and hit speed a unit's buffs give it, and the river jump, as eight appended columns. The builder asks the engine for these values when it binds (RustEngine.set_entity_extras); they are the seven new trailingEntityStatefieldsspawn_ms...jumping, which read -1 ("not said") when not asked for.- Both flags are off by default and append after
unit_actions. MockEngine says neither and is refused by name.
0.1.29 (2026-11-11)¶
Changed¶
- royalesim 0.1.51. Some battles play slightly differently, as royalesim 0.1.47 to 0.1.51 bring ten more of the current client's behaviours (the Goblin Machine's rocket, the Fisherman's drag speed, a stunned Electro Giant no longer reflecting, a Phoenix egg's first frames and a Tornado's pull on units touching another among them), but every example on the site prints the same numbers. Game Values and the Environments page are stamped on royalesim 0.1.51.
- royalelearn 0.5.26 (CUDA-graph rollouts, opponent affinity, a ladder that rolls back to its
champion, evaluation on the GPU and in lockstep, each off by default) and royaleimitate 0.2.17
(a
championreference anddemo_bc, each at its own precision).
Added¶
SpatialObsBuilder(unit_velocity=True): eight planes of how far each unit moved since the seat's last observation, in its own frame, as tiles per 5 ticks (each axis clipped to 3 tiles), split by sign intoown_dx_plus...enemy_dy_minusand summed within a tile. The real tick gap is scaled to 5 ticks, so 250 and 500 ms decisions read the same speed. Off by default; appended after every other optional plane. The builder keeps where each seat saw each unit, and a snapshot carries it; a builder with the flag refuses a snapshot saved without it.EntityListObsBuildertakes a fuller per-unit row as four flags, each off by default and appending after the card one-hot:unit_motion(has_prev, dx, dy, per seat, saved with a snapshot),unit_stats(log max hp, shield, the target's offset),unit_status(one column per status bit) andunit_actions(charge, ability ticks, the attack phase, facing, a tunneller's landing point). Signed columns are [-1, 1] and the Box carries each column's own bounds.entities_droppedandspells_droppedcount the rows the last build had no room for.- Three vector options for both builders, each off by default and appended after
enemy_queue_5_8:own_button_pending(which own buttons have a press waiting),own_waiting_plays(each own play waiting to run: its tap, ticks left and cost) andenemy_card_cycle(per card, the plays until it is back in the enemy's hand, from the deduced cycle, and the plays since the enemy last played it).EntityListObsBuilderalso takes the vector optionsSpatialObsBuilderhad (evolutions,evolution_progress,card_status,button_index,enemy_queue,elixir_income). SymmetricRustEngineselects the owner's-frame arm of the two seat-asymmetric keys royalesim 0.1.52 adds (formation.EXPLICIT_OFFSETS_FRAME,spawner.EVO_BARREL_OFFSET_FRAME), so a symmetric engine stays symmetric on them; an engine without the keys is unchanged.- A trace records the engine's command delay (
TraceHeader.command_delay_ticks, [] in older traces), andverify_tracesays in one line when the verifying engine runs another delay, where it listed every hash.
Fixed¶
protocol.mirror_stateturns a unit's facing, a tunneller's landing point, each waiting play's tap and the projectiles, which it left in the original frame. The seat-flip check could not see a builder reading them wrongly for Red.- Under a command delay, an env with a recorder that keeps every tick's frame (the default) or an
attached viewer handed the observation only the last tick's report of the delayed commands that
ran, so its counted elixir went wrong (and
exactFalse) while the same battle unwatched stayed exact. It now gathers every tick's. No observation shape or config changes. ClashGymEnv.metadata["render_fps"]is one frame per decision (4 atdecision_ms250), where it was 2 at every cadence.ElixirLeakPenaltyand theelixir_leak_stepsstat count decisions, so the same leak weighs twice at 250 ms; their docs say so.
0.1.28 (2026-11-05)¶
Changed¶
- royalesim 0.1.46. Some battles play slightly differently, as royalesim 0.1.45 and 0.1.46
bring eleven more of the current client's behaviours (a hero's attack loading through its
ability, the Evo Mega Knight's thrown units, the Giant Skeleton's death bomb, the Fisherman's
river drag, a healed unit under homing shots and the Executioner's axe among them), but every
example on the site prints the same numbers. The cards, forms and unit types are the same on
every table. Game Values and the Environments page are stamped on royalesim 0.1.46. Its spell
rows send the two columns 0.1.27 added (from royalesim 0.1.45), so
SpellState.levelandSpellState.formnow carry the engine's values.
Fixed¶
- A snapshot saved by this royalegym (
env.snapshot(), a bank fromsave_snapshots) loads on a later royalesim that leaves the elixir arithmetic alone. Its observation memory now records the elixir laws its counts ran on (the bar's regeneration, cap and overtime, and withelixir_incomethe payout timers and what each unit pays), and is refused only when one of them differs, naming it. Before, it recorded a digest of the whole calibration, so a royalesim release that moved any value (a unit's, a spell's) refused it with "the memory was saved under another calibration", as royalesim 0.1.45 did with 0.1.44's. A snapshot saved by royalegym 0.1.27 or earlier still carries that digest and loads only under the calibration it was saved under: save it again. The engine checks its own saved state apart from this, and refuses one saved on other card data (0.1.44 refuses 0.1.43's).
0.1.27 (2026-11-04)¶
Changed¶
- royalesim 0.1.44. Some battles play slightly differently, as it brings ten more of the current client's behaviours (Poison's edge, the Dark Witch's Bats, the Little Prince, the Evo Mega Knight's throw and the Hero Mega Minion's warp among them), but every example on the site prints the same numbers. Game Values and the Environments page are stamped on royalesim 0.1.44. The default and Season 88 tables have the same cards, forms and unit types as before.
- On the 16.635 card table the Evo Giant can now be played (the Evo Mirror still cannot), and
the table has one more unit type,
Giant_EV1. The engine lists unit types by name, so on that table every type afterGiant_EV1moves up one place in an unpinnedunit_idsvocabulary. A run that pins its unit vocabulary appendsGiant_EV1after the Season 88 table's four names, so a default-table pin takes five names on its end, not four, and the ids agree with a Season 88 pin's. Until then RoyaleGym refuses the pin and names the type. - A battle saved with royalesim 0.1.43 or earlier does not load with 0.1.44, on any card table:
the Evo Giant's support changed the engine's card data on each. A snapshot (
env.snapshot()), a bank of them (save_snapshots) and aRustEngine.save_stateblob all raiseValueError("snapshot was saved against different card data"). Save them again on 0.1.44.
Added¶
- Two columns on the end of each spell row:
SpellState.level, the object's level (asEntityState.level, so a Mirror's copy reads one above its card), andSpellState.form, which of its card's records made it: 0 basic, 1 evolution and 2 hero, as inPlayerState.forms, and 3 an evolution's decoy (the Evo Goblin Barrel's). Each is -1 from an engine that does not send it, as royalesim 0.1.44 and earlier do not. An engine that sends them needs this royalegym or newer: an older one refuses an engine whose spell rows are wider than it knows, so upgrade both together (pip install --upgrade "royalegym[all]").
0.1.26 (2026-11-03)¶
Changed¶
- royalesim 0.1.43, royalelearn 0.5.20 (counts a fraction rounded into a
uint8plane,health/obs_codec_rounded;rollout.codec_float16_planeskeeps a plane's fractions) and royaleimitate 0.2.15 (itsShardReaderwarns once per plane that the run's codec stores rounded). Some battles play slightly differently, as royalesim 0.1.41 to 0.1.43 bring more of the current client's behaviour, but every example on the site prints the same numbers. Game Values and the Environments page are stamped on royalesim 0.1.43: the same cards and forms.
Added¶
SpatialObsBuilder(elixir_income=True)counts the elixir the board pays into both counted bars: the Elixir Collector's payouts and the elixir paid when it dies, and the elixir an Elixir Golem's pieces pay the other side when they die. Without it the countedenemy_elixirmisses every payout, so it reads low against a Collector player andexactgoes False at the first payout. Off by default, so no observation or saved memory changes. It needs an engine that says what each unit pays (RustEngine.unit_mana), which royalesim 0.1.43 does.- royalesim 0.1.43's 16.635 card table plays through RoyaleGym:
calibration_overrides={"cards.CARD_TABLE": "client160635007_20261103"}. It carries the Season 88 values and has the Season 88 table's unit types, so a pinned unit vocabulary takes the same four names on its end (BarrelGoblin,ElectroGiant_EV1,IceWizardHero,IceWizardHero_IceCube). The Evo Giant and the Evo Mirror cannot be played on it yet; the Giant and the Mirror can. On it, as on the 16.402 tables, the Elixir Collector pays every 15 s, andelixir_incomecounts that.
0.1.25 (2026-10-20)¶
Changed¶
- royalesim 0.1.40, royalelearn 0.5.19 (train through a transform of the policy of your own,
ppo.policy_transform) and royaleimitate 0.2.14. Some battles play slightly differently, as royalesim 0.1.34 to 0.1.40 bring more of the current client's behaviour, but every example on the site prints the same numbers. Game Values is stamped on royalesim 0.1.40: the same cards and forms. - On royalesim 0.1.40,
RustEngine.config()'s card-table hash (cards_json_fnv1a64) is the one the engine reports for the table it loaded (cards_json_hash_sourceis"engine"), an overridden table's too.
Added¶
- royalesim 0.1.40's Season 88 card table plays through RoyaleGym:
calibration_overrides={"cards.CARD_TABLE": "client160402017_20261019"}. It has four unit types the default table does not have:BarrelGoblin,ElectroGiant_EV1,IceWizardHeroandIceWizardHero_IceCube. A run that pins its unit vocabulary (SpatialObsBuilder(unit_names=...)) must add them to the end of the pin, so no old id moves;unit_aliasescan map one onto an old name, so both read as one id.
0.1.24 (2026-10-13)¶
Added¶
make_env(client="15.535.29")plays the older game client's measured setup: its mechanics and its card tables' own values, as royalesim 0.1.33'sclient_armsgives them (rust_engine.client_overrides). The mask follows the rules it reads.match.TICK_ORDER, which that setup selects, now goes to the engine as an override; othermatchandtimekeys stay refused, since RoyaleGym reads them itself.
Changed¶
- royalesim 0.1.33. Battles play slightly differently: the Environments page's example now prints a reward of 1.421. Game Values is stamped on royalesim 0.1.33: the same cards and forms.
0.1.23 (2026-10-10)¶
Changed¶
- royalesim 0.1.30 plays closer to the game in many small ways (how units pick and keep targets, how a drop is moved off a building, how a line of units is laid), so a battle with the same seed can end differently: the Environments page's example now ends 3-1. Game Values is stamped on royalesim 0.1.30: the same cards.
- A drop past your own side is now moved back along its column to the first tile it may
stand on, as the game does, instead of being refused: a troop (
placement.ILLEGAL_TROOP_TAP), and the Log, the Barbarian Barrel, the Royal Delivery or the Heal, also when dropped on the water (spells.ILLEGAL_SPELL_TAP). royalesim keeps both rules off by default; RoyaleGym turns them on (rust_engine.GYM_ARMS, recorded inRustEngine.config()asgym_arms). To keep the old refusals, passcalibration_overrides={"placement.ILLEGAL_TROOP_TAP": "refuse", "spells.ILLEGAL_SPELL_TAP": "refuse"}. A bot that follows the mask plays exactly as before: the mask still leaves those drops out, since a whole column of them lands on the one edge tile it already offers.mask_disagreementscounts such a moved drop as intended, and nothing else. Saved runs and bots load as before.
Added¶
- The viewer can name each unit by its own type as well as its card: the Witch's Skeletons
read "Skeleton" (
unit_dict'sextra["unit"],ViserPublisher.set_unit_types, which the env calls with the engine'sunit_types()). Frames without the names are unchanged. - In the game, a troop dropped on an enemy building (a hero's turret, a Cannon in a fallen
lane) is moved off it, as off your own buildings (
placement.ENEMY_BUILDING_TAPS). When royalesim runs that rule, the mask now offers those drops wherever the engine says the troop lands.SymmetricRustEngineturns it off, with five other rules of royalesim 0.1.30 (tie-breaks, and how a line of units is laid) that would treat the two sides differently.
Fixed¶
- MockEngine now states that it moves nothing off an enemy building and moves no drop back from past its side, whatever its rule file says, so a mask built on it matches what it does.
- On an engine moving troop drops back, RoyaleGym took every troop for one that may go anywhere, like the Miner, and the mask offered troops all over the board. Now each card keeps its own rule.
0.1.22 (2026-10-10)¶
Changed¶
- royalesim 0.1.27 plays cards at level 17, one past the old maximum (a Common's 450 %), and a Mirror of a level-16 card at 17; 18 is refused. No observation or mask reads a unit's level, so levels 1 to 16 observe exactly as before. royalelearn 0.5.18 can skip a scripted opponent's observation. Game Values is stamped on royalesim 0.1.27: the same cards.
Added¶
TileActionParser(ui_buttons=True)makes the mask follow the client's screen: while a hero's or champion's unit is on the board, its ability button covers two back corners of its owner's side, and a deploy tapped there places nothing in the game. The mask then refuses every card there (action.UI_BUTTON_TILES; one button on the right, two left then right). Off by default, so no existing mask changes.
0.1.21 (2026-10-09)¶
Changed¶
- royalesim 0.1.26, royalelearn 0.5.17 and royaleimitate 0.2.13. royalelearn trains on the processor, and says why, when the graphics card is too old for the installed PyTorch; a clone reads its shard's rows from memory or disk after the first epoch. Game Values is stamped on royalesim 0.1.26: the same cards.
Added¶
ClashParallelEnv.set_mask_only(agents)skips building those seats' observations from the next one on, for the rest of the episode: the reset optionmask_onlyfor a seat found to be scripted after the episode started. Seats only join, and the next reset builds every seat again.SpatialObsBuilder(unit_names=...)may pin more unit names than the engine says, in any order: each unit is numbered by its place in the pin, by name, and only a type the pin lacks is refused. Pinned to the names of two card tables, both give oneunit_idsvocabulary and one digest. A pin equal to the engine's list changes nothing.
0.1.20 (2026-10-09)¶
Added¶
reset(options={"mask_only": ["red"]})gives a seat whose player reads only legality, such as the scripted opponents, an observation of its masks and zeros instead of a full build: every key at its shape and dtype, for the whole episode. The other seat's observation is unchanged. A snapshot of such an episode, andstate()with Blue skipped, are refused.
Changed¶
- royalesim 0.1.24 loads every card of its table, the nine event cards included (a
145-card default catalogue). royalelearn 0.5.16 warm-starts across precision and device
(
actor_digest), and royaleimitate 0.2.12'scloneprints its progress, a line per epoch.pip install --upgrade "royalegym[all]"moves all three. - Random decks hold no event card:
DefaultStateMutatorwith no decks andDeckCurriculumStateMutatorwith no pool leave outstate_mutator.EVENT_CARDS, which no ladder deck holds. A seed deals the same decks as on royalesim 0.1.23.random_deck(..., events=True)draws them, and a deck that names one still plays it. - Game Values lists royalesim 0.1.24's nine event cards (
SuperWitchtoGoblinRocketSilo), and the building relocation example sets the Goblin Rocket Silo apart: it keeps its footprint five tiles off each side edge, a rule of its own on top of the footprint. - The spatial builder takes about a fifth less time per observation. The planes are counted once per entity and written once, and the card status fields avoid numpy scalar arithmetic. Every observation is byte-for-byte what it was: the test suite holds the new code to a frozen copy of the old one on real battles, for both seats.
Known issues¶
- The match memory does not count elixir that a unit pays: the Elixir Golem's to the opponent
when a piece of it dies, and the Elixir Collector's pump and its payment when it dies. After
one of those, the counted enemy elixir is an estimate (
MatchMemory.exactturns False). A test holds this as a known gap until the engine says what each unit pays.
Fixed¶
card_statusno longer reads a basic enemy play as evolved when a unit of an earlier evolved play appears on the same step, such as an Evo Wall Breaker's mini or an Evo Royal Ghost's summon, which royalesim 0.1.20 marks evolved. Once a card has shown its evolution, the form of each later play follows from the count of plays, as the engine's own rule says.
Changed¶
obs.SAME_UNIT_ALIASESmerges the evolved Goblin Cage's brawler into GoblinBrawler (eleven rows). royalesim 0.1.20 plays it at the plain brawler's hp, and its evolved status bit still says it is the evolved one. Withunit_aliases=SAME_UNIT_ALIASES,unit_ids_digestchanges.
0.1.19 (2026-10-07)¶
Fixed¶
- The hero planes (
heroes=True) andcard_status'senemy_seen_herono longer count a champion as a hero. royalesim up to 0.1.19 marks a champion's unit as a hero, and a champion's button is never spent, so an enemy Golden Knight or Archer Queen showed as an enemy hero with an unused charge for its whole life. Units of cards the catalogue calls champions are skipped. - A flier a Vines catch holds on the ground counts as a ground troop for the hold: in the
spatial troop channels and in the entity list's
flyingfeature. A player sees it on the ground, and ground attacks reach it. Up to royalesim 0.1.19 it stayed in the air channel. It needs royalesim 0.1.20, which setsSTATUS_GROUNDED(512) and lists its bits (Engine.status_bits()); with an older engine nothing changes.
Added¶
SpatialObsBuilder(enemy_queue=True)appendsenemy_queue_5_8: the enemy's next card and the three after it, in order, as a player who watched its plays works them out (its last plays, reaching further back while a played slot waits for its refill). A position no play has reached yet reads "not deduced". Off by default.CombinedReward.from_configrebuilds a combined reward from itsconfig(). A term from outsideroyalegym.rewardis now named in that record by its full dotted path, so a term of your own that shares a name with one of this package's comes back as yours. This package's terms keep their bare names, so existing records are unchanged.SpatialObsBuilder(effect_identity=True), withspell_identity:spell_idsgrows from 4 planes to 8. Spell cards' objects stay in the first four; the objects troops' and buildings' units leave (an Evo Cannon's bombs, a death bomb, an Evo Firecracker's fireworks) move to four more (obs.EFFECT_ID_PLANES). A player tells a cast Fireball from those. Off by default.
Changed¶
- The action mask follows royalesim 0.1.21's territory model when the engine runs it: a troop may stand on a bridge whose lane's enemy princess has fallen. Up to now both engines closed the whole river to troops, a rule with no source; replays and taps on the real client show troops on an open lane's bridge. A standing princess still closes its lane's bridge, and the rest of the river is water. With an older engine the river stays closed, as before.
obs.SAME_UNIT_ALIASESmerges three more pairs a player sees as one unit: the Goblins card's and the Goblin Gang's goblins with the Goblin Barrel's (as Goblin), the Goblin Hut's waves with Spear Goblins, and the second of the Three Musketeers with the first. Each differs from its base only in a timing no player reads off the unit, listed in the newobs.SAME_UNIT_ALIAS_DIFFERENCES. Withunit_aliases=SAME_UNIT_ALIASESthe vocabulary has three fewer names, andunit_ids_digestchanges.- The
spell_idsandSpellState.card_iddescriptions say what the engine reports: every live spell object, under the card that made it. That includes effects troops and buildings leave, such as the Evo Firecracker's fireworks or a Balloon's death bomb. docs/observation-spec.md gains aspell_idssection. - royalesim 0.1.20: a flier held on the ground reports
STATUS_GROUNDED, the evolved and hero bits follow the unit through its forms and leave champions, and the evolved Goblin Cage's brawler plays at the plain brawler's hp. royalelearn 0.5.12 and royaleimitate 0.2.10 saveenvironment.jsonbeside every bot, soLearner.load_envrebuilds its env.
0.1.18 (2026-10-06)¶
Fixed¶
- The action mask offers an ability button only when the engine would take the press. Some buttons wait on more than their row shows: the Hero Mega Minion's warp is ready only a while after the hero appears, and only while it has a target. The mask offered it from the first tick, and the engine refused it.
Added¶
SpatialObsBuilder(unit_identity=True)addsunit_ids: the type of each unit on the board, besidecard_ids, which names the card that produced it. A skeleton reads "Skeleton" whether the Witch or a Tombstone made it. Off by default, so existing observations and configs do not change. Needs royalesim 0.1.17, which says each unit's type (EntityState.unit_type,RustEngine.unit_types()); saved battles record the type list.unit_aliases: write a unit the game's data keeps on a row of its own as its base type, when the two are the same unit to a player.obs.SAME_UNIT_ALIASESlists seven such rows (the Graveyard's skeleton is a Skeleton, a Tri-Wizard a Wizard, ...); a test checks each pair still has identical stats.builder.unit_ids_digestnames the vocabulary the ids count in.SpatialObsBuilder(button_index=True)adds each own ability button's card and status by its INDEX (own_button_cardsand three*_by_indexfields), the index the action space presses. Which card a button is follows the deck order, and the card-keyed fields could not say it.
Changed¶
- royalesim 0.1.17 says each unit's own type (
EntityState.unit_type), whichunit_idsreads, and an ability button's ready flag is now the engine's own answer. - royalelearn 0.5.10 and royaleimitate 0.2.9 store and read
unit_ids.
0.1.17 (2026-10-05)¶
Fixed¶
- The action mask offers no play once a tied level overtime has run out. The engine accepts no play from that moment while the tiebreak decides the match, but the mask waited for the match to be over and kept offering every card, so each play in the tiebreak was refused. A training run that checks the engine accepted every play the mask allowed stopped there.
Changed¶
- royalesim 0.1.14: units a death spawns (a Golem's Golemites) plan their route from where they appear.
0.1.16 (2026-10-05)¶
Fixed¶
- A battle with an evolved card no longer crashes the viewer. The engine sends four values per evolution row and RoyaleGym's viewer feed read three, so watching such a battle live stopped with "too many values to unpack". royaleviser 0.1.2 fixes the same in playing back a saved battle.
Changed¶
- royalesim 0.1.13: a unit already doomed by the shots in flight is judged by homing shots only, and a ranged unit does not fire at a target that has moved well beyond its reach. Battles can end differently.
- royalelearn 0.5.9:
doctor.vram_fractionsets the GPU memory cap from a config.
0.1.15 (2026-10-04)¶
Fixed¶
- royalelearn 0.5.8: training on an NVIDIA card on Windows starts again. From 0.5.5 to 0.5.7 every
such run stopped at start-up.
pip install --upgrade "royalegym[all]"brings the fix. - An install from PyPI now records which card table its engine uses. The engine there carries its
table inside, and
RustEngine.card_table_stamp()(inconfig()and in every saved battle) said "unavailable". It now gives that table's hash and version, marked "embedded".
Changed¶
- royalesim 0.1.12: a Hunter's pellets reach a building's whole square, and the engine draws the Hunter's random delays the way the game does. Battles with a Hunter can end differently.
0.1.14 (2026-10-04)¶
Added¶
- Start episodes from saved moments of a battle.
ClashParallelEnv.snapshot()saves the engine's state and what each seat's observation remembers of the match (the cycle, the counted elixir, the cards seen, the enemy's forms). A reset from it shows each seat the observation it had, and the battle goes on exactly as the original would under the same actions. Snapshothas aseat, amax_ticksand atag.max_ticks(or the reset optionmax_ticks) ends an episode as a truncation once that many ticks have passed. The reset's info givesstart_seatand the episode's last info givesstart_tag.SnapshotStateMutatordraws from a bank by weight (one per snapshot, or one per tag) and by seat (seat="blue"draws only the starts made for Blue or for either seat). It reads a bank from a file:save_snapshotsandload_snapshots.
Changed¶
- A release reaches PyPI once it passes its install test on Windows, macOS and Linux with Python 3.12 to 3.14, and not before. That test also checks that pip installs the version under test.
Fixed¶
- royalesim 0.1.11: with
ShuffleMode.MIRROREDand per-cardlevels, each card now plays at its own level. Before, the levels stayed in setup order while the cards were shuffled, so a card could play at another card's level. A new test plays all eight cards on both sides and checks every unit's level.
0.1.13 (2026-10-04)¶
Changed¶
- Every package is on PyPI: install with plain
pip install "royalegym[all]". - royalelearn 0.5.5: on Windows a CUDA run uses at most 80% of the card by default
(
Learner(vram_fraction=...)), so training no longer slows down by spilling into system RAM.
0.1.12 (2026-10-03)¶
Changed¶
- royalesim 0.1.10: the Golden Knight's dash can be used once per deploy, as in the game. After it, his button stays off for the rest of his life. Battles with him can end differently.
0.1.11 (2026-10-03)¶
Changed¶
- royalesim 0.1.9: the engine reports each side's deck and each card's form, so
PlayerState.deck/PlayerState.forms, andSpatialObsBuilder(card_status=True), also work for a battle restored withload_state.
0.1.10 (2026-10-03)¶
Changed¶
- royalesim 0.1.8: units report their build-up, a tunneller's landing point and the ticks left in an ability, four more status bits (a Clone's copy, an ability winding up or running, fully charged), and the catalogue states each card's evolution cycle.
own_hp_frac/enemy_hp_frac(unit_status=True) are now in thousandths, so every spatial plane stores exactly as a whole number of thousandths.- MockEngine states no evolution cycle (
CardInfo.evo_cycleNone): it plays no evolutions.
Added¶
revealcan be given as a dict ofReveal's field names, so a JSON config can set it:"reveal": {"enemy_elixir": true}. Unknown names are refused.SpatialObsBuilder(card_status=True): every card's evolution and hero status, own and opponent. Your whole deck from the first frame, each card's form (per card and per hand slot), every evolved card's charge wherever it sits, and each ability button by its card. For the opponent, counted from the plays you have seen: which cards were played evolved or as heroes, each card's evolution charge, a hero's used charge and a champion's cooldown. Needs royalesim 0.1.8. Off by default.PlayerState.deckandPlayerState.forms: each side's deck and each card's form.SpatialObsBuilder(unit_actions=True): fourteen planes, own and opponent, of what units are doing: build-up (a Prince's charge, a Sparky's load, an Inferno's ramp), fully charged, winding up or running an ability and the ticks it has left, a Clone's copies, and where a tunneller will come up. Needs royalesim 0.1.8. Off by default.EntityStategets values forcharge,dest_x,dest_yandability_ticks, andCardInfo.evo_cyclegets its values, from royalesim 0.1.8.
0.1.9 (2026-10-03)¶
Changed¶
- royalesim 0.1.7: each side can play its own card and tower levels, and the engine reports which
waiting commands ran in each step. royalelearn 0.5.4 and royaleimitate 0.2.6 store the new
spell_idsobservation key. SpatialObsBuilder(spell_aim_after_ticks=0)now shows every opponent spell's target from the first tick the spell exists, a thrown spell still waiting to move included.
Fixed¶
- Under a command delay, the count of the opponent's elixir charged an ability press twice: once when the press was accepted, and again when its button flipped as it ran on a later step. With royalesim 0.1.7 the count charges exactly the presses that ran, so a press the engine refuses when it comes to run (its hero died while it waited) is never charged.
Added¶
MatchSetup(levels=[blue, red], tower_levels=[blue, red])and the same two arguments onDefaultStateMutator: each side's card levels (one per deck card, or empty for the engine's) and crown tower level. Needs royalesim 0.1.7; MockEngine, which has no levels, refuses them.SpatialObsBuilder(heroes=True): three planes,own_hero,enemy_heroandenemy_hero_unspent, where each side's hero units stand and which of the opponent's still have their one ability charge. Off by default.SpatialObsBuilder(spell_identity=True): aspell_idskey, uint8 [4, 32, 18], naming which card made each live spell object, a cast spell or an effect a troop or building left, in thecard_idsvocabulary: own and opponent spell objects at their centre tile, own ones at their aim tile, and the opponent's at their aim tile oncespell_aim_after_ticksallows. Needscard_identity=Trueandspell_aim_after_ticks. Off by default.SpatialObsBuilder(unit_status=True): eighteen planes, own and opponent: shield hp left, units under a Rage, units slowed by cold, units whose target is a crown tower or another building, the hp fraction of each tile's strongest unit, and invisible, tunnelling and hidden units. Off by default.EntityStategainscharge,dest_x,dest_yandability_ticks, andCardInfogainsevo_cycle, all "not reported" until an engine sends them; four more status bits (STATUS_CLONE,STATUS_WINDUP,STATUS_ABILITY_ACTIVE,STATUS_CHARGED).
0.1.8 (2026-10-03)¶
Changed¶
- royalesim 0.1.6: battle logic as measured in the game: crown-tower target ties, jump landings, Evo Musketeer snipes, a hooked unit's release, chase limits, death bombs and headings while casting. No change to installing or calling the engine; battles can end differently.
0.1.7 (2026-10-03)¶
Changed¶
- royalesim 0.1.5: every unit on the board reports the card whose play put it down. A Tombstone's skeletons report the Tombstone, a hut's goblins report the hut, the Tri Wizards' three wizards report the Tri Wizards. The tower-damage and elixir-trade rewards are unchanged: a unit is still priced only when it is the unit its card's row describes, and a play of the Tri Wizards now totals its own 7 elixir.
- Every piece in
[all](and in its own extra) names a minimum version, sopip install --upgrade "royalegym[all]" --find-links ...moves each one. Before, an upgrade from an older release page could keep the old engine.
0.1.6 (2026-10-03)¶
Added¶
- Clone human players:
[imitate]and[all]needroyaleimitate[replays]0.2.5, whosefrom_replaysturns human games from the public IL_Replay dataset into the rowsclonereads. It brings pyarrow and huggingface_hub with it.
0.1.5 (2026-10-02)¶
Changed¶
- A level overtime ends as the game ends it (royalesim 0.1.4): no card can be played from
overtime's end, two ticks later every troop, building and spell leaves the board, and from
3.35 s past the end every crown tower loses the same hp each tick until one falls; the crowns
then decide. Towers exactly level drain once and the match is a draw 4 s later. A match can
now run past tick 6000 (to about tick 6200).
MockEngineruns the same rule when its calibration selects it. [learn]and[all]need royalelearn 0.5.3, whose start-up check allows a match past tick 6000.
Added¶
SpellState.ticks_flown: how many ticks a thrown spell has flown (-1 from an engine before royalesim 0.1.4).SpatialObsBuilder(spell_aim_after_ticks=k)reads it when the engine reports it, so each spell object is timed exactly.
0.1.4 (2026-10-02)¶
Fixed¶
- A random deck (
DefaultStateMutatorwith no decks,make_env(deck="random"), a deck curriculum with no pool) holds at most one champion, as the ladder allows. It could hold four, and the engine refused the battle. A draw with two or more champions is drawn again, so about 8% of seeds now deal a different random deck than 0.1.3 did; every other seed deals the same. - Starting a bot from a saved one (RoyaleImitate's
warm_start) works from the install line:[learn]and[all]need royalelearn 0.5.2, which no longer refuses a package installed from a wheel. [imitate]and[all]need royaleimitate 0.2.3, whosepublic_logwaits for the engine's hand refill timer as royalesim 0.1.3 does.
Added¶
CardInfo.champion: whether a card is a champion, from the engine's catalogue (or, for royalesim 0.1.3 and before, its list of champions).play_battletakes the scripted bots by name ("first-affordable","defend","push","patient"), the names RoyaleImitate'srecordtakes for a teacher.
0.1.3 (2026-10-02)¶
Fixed¶
- The observation's next cards (positions 6 to 8) stay right while a played card's hand slot waits for its refill: the game refills one empty slot per period, so a slot can show no card for a few ticks after a quick second play.
Added¶
SpatialObsBuilder(spell_aim_after_ticks=k): the planeenemy_spell_aim_seen, an enemy spell's landing point once a player could read it off the screen. A thrown spell shows it after k ticks of flight (counted from when it starts moving); a rolling or area spell from the first sight. Off by default.
Changed¶
[imitate]and[all]need royaleimitate 0.2.1, which records battles, clones a bot from them, and saves the clone soLearner.load_policycan play it.- The release page carries royalesim 0.1.3, royalelearn 0.5.1 and royaleimitate 0.2.1.
0.1.2 (2026-10-02)¶
Fixed¶
- Every "the engine is not installed" message points at the install page, whose line works before
PyPI, instead of a
pip installline that does not;make_envuses the same words. MockEngine()in an installed engine (which carries no raw 2018 card tables) says so and names the real engine, instead of failing on a missing file.
Added¶
.github/workflows/pypi.yml: publishing to PyPI from a version tag, switched off until the PyPI side is ready.- The fresh-user test runs on Python 3.12, 3.13 and 3.14.
Changed¶
- The release page carries royaleviser 0.1.1, whose viewer uses pygame-ce (it installs on Python
3.14). If you installed an earlier release, run
pip uninstall pygamebefore upgrading.
0.1.1 (2026-10-02)¶
Fixed¶
Learner(viser=True)streams to the viewer on every OS:ROYALEVISER=1(ortrue,on,yes) now means the default address, 127.0.0.1:9870. It was read as port 1, which Linux and macOS refuse and where no viewer looks on Windows.- A viewer address that cannot be used says why; only a port already taken is reported as taken.
- The quickstart trains on macOS: the learner's shared memory names fit macOS's limit (royalelearn 0.4.2 is now required).
Added¶
tools/stage_release.pystages a release page, each package from its newest version tag.
0.1.0 (2026-10-02)¶
Added¶
pip install "royalegym[all]"installs every piece: the engine, the learner, the viewer and imitation. The extras[sim],[learn],[viser]and[imitate]install one each.make_env(): a two-seat battle in one call, with a starter deck and tower damage as the reward.play_battle(): play one battle with a trained bot and save it for the viewer.examples/quickstart.py: one file that names every piece of the env (engine, state mutator, obs builder, action parser, rewards, end conditions) and trains on the GPU. Watch it live withroyaleviser.SpatialObsBuilder(evolutions=True): which hand cards play evolved now, and the evolved units on the board.evolution_progress=Trueadds how far each counter has got.DefaultStateMutator(decks=...)takes card names.EntityKind,to_own,MatchSetup,deck_ids,WinnerandTowerSlotimport fromroyalegym, so every page can say everything does.royalegym.__version__, and type hints that type checkers read (py.typed).- The command delay (
command_delay_ticks): a play runs some ticks after the tap, as in the game. - Ability buttons for heroes and champions (
TileActionParser(ability_buttons=True)). - Recorded battles carry each side's evolution and ability-button state.
Changed¶
- The observation vector is 12n + 43 wide (was 12n + 37): a third elixir-rate slot for triple elixir late in overtime, and the seat's own waiting commands. Retrain or re-convert anything built on the old width.
- The engine's data is found through the installed engine, so no RoyaleSim clone is needed.