Skip to main content

Python tool to record PAD playback for Super Mario Galaxy 2

Project description

galaxypad

Custom Cosmic Spirit in Freezy Flake Galaxy

galaxypad is a Python command-line tool to record input playback files (PAD files) for Tip Networks and Cosmic Spirits in Super Mario Galaxy 2. The tool reads relevant information from Dolphin Emulator's emulated game memory and automatically produces a PAD file after recording stopped. The tool requires at least Python 3.10. It should also work with 3.11 and newer versions, but this hasn't been tested. Furthermore, it uses py-dolphin-memory-engine to interact with Dolphin's game memory. In order to record player input during gameplay, Syati's PadRecord code is required to supply the information from the game to this tool.

It is available on PyPI, meaning that you can easily install it with pip:

pip install galaxypad

Limitations

There are gameplay-related aspects that Tip Networks and Cosmic Spirits don't account for. Keep these in mind when you want to record and play inputs!

  • You should only record playback when playing as Mario. Both objects will be disabled when playing as Luigi.
  • Both objects disable the Star Pointer completely. Thus, Mario can't interact with objects that require the Star Pointer, for example Pull Stars and Grapple Flowers.

Usage

In this section, it is assumed that the game you want to record player input in already uses Syati's PadRecord code. The general usage is this:

usage: galaxypad [-h] [-address [ADDRESS]] output_folder_path

Record PAD playback in SMG2 from Dolphin memory.

positional arguments:
  output_folder_path  folder to save PAD files to

options:
  -h, --help          show this help message and exit
  -address [ADDRESS]  address from which the tool retrieves PadRecordInfo*

The -address option is not required, as the tool assumes PadRecordInfo* is supplied at 0x80003FFC by default.

Recording

Before you can record playback, you need to add the following things in your galaxy first:

  1. A player spawn point from which the recording should start. This spawn point should be used by Tip Networks and Cosmic Spirits too.
  2. A PadRecordHelper object in the same zone as the previously added spawn point. Its Obj_arg0 has to be set to the added spawn point's MarioNo value.

Now you are ready to use the tool:

  1. Launch the modded game in Dolphin and start this command-line tool like explained in previous sections.
  2. While the game is running, pay attention to the tool's console output to verify that everything is running correctly.
  3. Once you are in the desired galaxy, go to where you placed PadRecordHelper. It doesn't use a model, but an A button icon will be displayed on the screen when you are close to it.
  4. Once you press A, the scene will reset. After the scene has reloaded, the recording will start.
  5. If you desire to stop recording, press 2 on the first player's Wiimote.

The tool keeps you informed about its current state, and it should inform you when something goes wrong. Here's an example from one of my tests:

Waiting for Dolphin...
Hooked to Dolphin, game ID is SB4P!
Searching for PadRecorderInfo* at 0x80003FFC...
Waiting for PadRecordHelper...
Started recording for spawn ID 0 in RedBlueExGalaxy!
Stopped recording!
Dumped 3075 KPAD frames (approx. 51 seconds) to '.\RedBlueExGalaxy\Dreamer0.pad'.

After recording, you can build a Ghost.arc containing the PAD file. However, this is beyond the scope of this tool. In final releases of your levels, you don't want players to interact with PadRecordHelper objects, so make sure to remove them once they are not needed anymore.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

galaxypad-1.0.3-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file galaxypad-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: galaxypad-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for galaxypad-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 22e27ced0f016c1ac6c185ba9d4b651de1f3bcadeb7ea5d5446960d8ed4b67a2
MD5 262570a48c7fa939a98da07d007382a3
BLAKE2b-256 734800c120fee2d404a5ebd61606c391409184d1a51733e5103adadb4cbdc520

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page