The City Trial Network

a script for automatically running City Trial CPU rounds in Kirby Air Ride
by invelica from 300g curry rice. last updated 2023/06/07.


What is The City Trial Network?


The City Trial Network is a LUA script (+ set of Action Replay codes) that enables a properly-configured copy of Kirby Air Ride to automatically and repeatedly run City Trial rounds with 4 CPU players.

I developed this because Kirby Air Ride has powerful debug tools, I like City Trial, and as a kid I would always set all the Smash CPUs to lv9 and watch them fight. It's my hope that you might also enjoy this light entertainment.

If you would like to see The City Trial Network in action, here's a link to a Youtube stream of it on my channel.


How do I run it?

You will need the following things: Due to the reliance on scripting to perform memory edits at timely moments, The City Trial Network currently only works in this branch of Dolphin.

Configure Dolphin by enabling the Action Replay codes listed in the section below, and disabling panic handlers in Dolphin's settings.

Prepare the save state in Dolphin by launching the game with the AR codes enabled, and navigating to the City Trial player entry screen. Create a save state in slot 1 here, when no players are entered. (Feel free to also edit the game settings, such as the CPU level and round length.)

Then, using the Scripts menu options in this Dolphin branch, run the City Trial Network LUA script.


Action Replay codes

Please enable all of these in order to ensure the script runs smoothly.

Many codes were sourced from this Pastebin - I'm grateful to the KAR hacking community.

The bottom four codes are my own creation, and feature such hacks as "overwriting the reset handler with custom assembly" and "attempting to force Kirbies to be both player and CPU at the same time". These sins are why panic handlers need to be disabled to prevent popup error spam in Dolphin.

$debug menu enabled
045DD630 00000003

$less restrictive crashes
044284B8 4E800020
04428514 4E800020

$boot to main menu
04047750 38600003

$skip tutorial / memory card
00535A02 000000FE
04452798 38600000

$hack cpu things (please disable panic handler)
0422C864 38600000
0418EEC8 38600001
0418FC70 38600001

$cameras on for all players
0402DF40 38600001

$when turning on p1 in player entry it secretly becomes a cpu
04032264 38000002

$automatically make p1 cpu when starting minigame
04012F1C 4BFED1E5
04000100 38C00000
04000104 3CC68053
04000108 38C664A0
0400010C 39C00000
04000110 3DCE0100
04000114 91C60000
04000118 38C00000
0400011C 4E800020


How does it work?

Starting from the City Trial player entry screen, the script begins a new round, with Action Replay codes changing the human players into CPU players with camera views enabled.

The City Trial round progresses as normal, with all 4 players being controlled by CPUs. The script detects (via the BGM playing) when the machine status screen is showing, and edits memory to temporarily turn player 1 back into a human, in order to advance the menu.

The stadium event begins, and a combination of memory edits and AR codes flip the P1 human/CPU bit back and forth to ensure the menus and gameplay work normally. There is also a decent amount of trickery to convince the game 4 humans are playing, so the stadium event does not terminate early.

Afterward, the game returns to the player entry screen, and the programming repeats.


Who is your favorite character?



No I mean in Kirby

egg


by invelica from 300g curry rice. last updated 2023/06/07.

stylesheet borrowed with permission from Sakurina.