Coder Social home page Coder Social logo

ethanl21 / psvm Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 11.42 MB

Embeddable Pokemon Showdown Simulator

Home Page: https://psvm.rtfd.io

License: MIT License

JavaScript 3.56% TypeScript 10.08% C++ 59.65% Meson 22.64% Python 2.91% C 1.16%
esbuild pokemon pokemon-showdown quickjs

psvm's Introduction

PSVM

Documentation Status

PSVM is Pokémon Showdown's simulator compiled to native code with no runtime Javascript engine dependency.

Warning
PSVM is still under construction. Implementation details are likely to change.

Details

PSVM consists of Smogon's Pokémon Showdown battle engine bundled by esbuild for QuickJS.

PSVM is intended to be used as a battle engine for Pokémon fangames, similar to Essentials' PBS. It has no runtime Javascript engine dependency and isn't made for a specific game engine, so it should be easy enough to add to any game engine that supports native C++ modules. An example Godot 4 integration is planned.

Building

To build PSVM, Node.js and Meson are required. To compile for Windows, use the provided cross/x86_64-w64-mingw32.txt to cross compile on a Linux machine.

Instructions

git clone https://github.com/ethanl21/psvm.git
cd psvm
meson setup builddir --buildtype debug # or release
meson compile -C builddir

For Windows

git clone https://github.com/ethanl21/psvm.git
cd psvm
meson setup --cross-file cross/x86_64-w64-mingw32.txt builddir --buildtype debug # or release
meson compile -C builddir

PSVM is built as a static library by default. To build as a shared library:

# build psvm
# (in the root directory)
meson setup builddir -Ddefault_library=shared
meson compile -C builddir

A compiled test driver executable will be located at builddir/psvm_test_driver.

Usage

To use PSVM in a Meson project, add psvm.wrap to the subprojects directory in your project's root with the following contents:

[wrap-git]
directory = psvm-1.0.0
url = https://github.com/ethanl21/psvm.git
revision = v1.0.0
wrapdb_version = '1.0.0'
depth = 1

[provide]

psvm = psvm_dep

(Replace head with a commit hash to use a specific version.)

Then you can link to PSVM in your build.meson file.

psvm_dep = dependency('psvm')

executable('my_program', sources: ['...'], dependencies: ['psvm_dep'])

Attribution

PSVM uses pkmn/ps (a modular version of smogon/pokemon-showdown) to simulate battles. Both are distributed under the MIT license.

bellard/quickjs is distributed under the MIT license.

mariusbancila/stduuid is distributed under the MIT license.

PSVM itself is distributed under the MIT license.

psvm's People

Contributors

ethanl21 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.