psvmgd is a Godot 4 GDExtension addon that uses smogon's Pokémon Showdown Simulator provided by psvm.
Install the addon from the Godot Asset Library (todo submit and document here). Enable the plugin and reload your
project, then interact with the simulator via the ShowdownService
autoload scene. For example:
func on_sim_output(message: String):
print(message)
# Create a new battle
var battle_id := ShowdownService.create_battle()
# Register an output callback function
ShowdownService.register_callback(battle_id, on_sim_output)
# Write input to the simulator
var sim_input = [ "..." ]
for line in sim_input:
ShowdownService.write_message(battle_id, line)
To build psvmgd, you will need the following:
- CMake v3.22+
- C++ Compiler with at least C++17 support (any recent compiler)
- For Windows builds, use MinGW to cross-compile on a Linux host.
- Node.js, (build-time dependency, not required at runtime)
git clone https://github.com/ethanl21/psvmgd.git
cd psvmgd
meson setup builddir --buildtype debug # or release
meson compile -C builddir
git clone https://github.com/ethanl21/psvmgd.git
cd psvmgd
meson setup --cross-file cross/x86_64-w64-mingw32.txt builddir --buildtype debug # or release
meson compile -C builddir
- Compile the project with Meson (see above)
- Copy the
psvmgd.gdextension
file from the output of the previous step toaddons/psvmgd
. - Copy the shared library files to the corresponding directories in
addons/psvmgd/bin
To use the demo project, copy the addon/psmvgd
folder to demo/addons
.
psvmgd is distributed under the MIT license.
psvmgd uses the following open-source libraries:
- ethanl21/psvm, which is licensed under the MIT license.
- godotengine/godot-cpp, which is licensed under the MIT license.