LordNed/Winditor

Dolphin Playtesting

Closed this issue · 2 comments

Manually compiling resources output by Winditor and manually opening up Dolphin to test changes slows down iteration time when developing maps. A faster approach would be to allow the user to test changes on-the-fly, similar to Unreal Engine 4's Play in Viewport. This can be simulated by interfacing with Dolphin via CLI upon the user pressing a "Play" button in Winditor's UI.

Assuming that the user has an ISO root extracted, the process would proceed like so:

  • The user edits a map.
  • The user presses the "Play" button, which saves the current map state to file and places the files in the user's specified ISO root directory.
  • Winditor generates an AR code to force the game to load the edited map once Dolphin is started using the game ID 00000000, the ID for games running directly from a directory. (Alternatively, if it is found to be possible, a patch is applied to the game's executable to do the same thing.)
  • Winditor forks a child process and starts Dolphin with several command line parameters.
  • The user finishes testing their changes and exits Dolphin.

Dolphin has three CLI options that will be useful for this:

  • **-b, --batch **. Makes Dolphin close the main GUI when emulation is stopped.
  • -e, --exec=. Makes Dolphin run the specified file when the emulator is opened. In this use-case, the file would be ISO's executable.
  • -C, --config=.
    .=. This is used to set config options at runtime.

Additionally, Dolphin can be run in a "portable" mode by putting a file called portable.txt in the directory containing Dolphin's executable. This will force Dolphin to put its user directories there, allowing us to have a Dolphin configuration independent from the user's own configuration.

@LagoLunatic investigated the idea of patching the game to allow for faster play-testing. He has provided us with ASM describing the patch and a diff of the patch in YAML.

To summarize, when patched the game will start normally, running through the opening logos as it loads 31 entities into memory. Once this is done, the game loads save file 1 and switches to the gameplay state. The map, room, spawn number, and layer index used to start the game will be configurable by the user.

Feature has been implemented.