Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Wasm modding #7

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Conversation

alec-deason
Copy link

@alec-deason alec-deason commented May 1, 2021

Original spec

This implements a modding system that is adequate to handle the existing weapons (along with similar things) and which should be reasonably easy to extend to more exotic weapons and items and potentially even things like AI agents.

The mods are written in WASM and hosted using https://crates.io/crates/wasm_plugin_host

This PR includes an implementation of the existing weapons in core_plugin as a rust project. It should be possible to write plugins in other examples though I haven't included any here. There is a generic example of a wasm_plugin compatible plugin written in assemblyscript that could be a starting point for a non-rust Fish Game mod: https://github.com/alec-deason/wasm_plugin/tree/main/example/example_assemblyscript_host/assemblyscript_plugin

Limitations:

This currently does not compile to the wasm target. Some additional work is needed in wasm_plugin to support WASM hosts (alec-deason/wasm_plugin#3). Because of that I'm marking this PR as draft. I'm not currently sure what's the quickest route to getting a working WASM version of Fish Game using these changes. I'll need to look more closely at how much work getting WASM host support in wasm_plugin is, it may end up being pretty easy.

These changes are currently blocked by not-fl3/macroquad#217 for audio support.

@CLAassistant
Copy link

CLAassistant commented May 1, 2021

CLA assistant check
All committers have signed the CLA.

@alec-deason alec-deason marked this pull request as draft May 1, 2021 20:41
@alec-deason alec-deason marked this pull request as ready for review May 5, 2021 21:10
@alec-deason
Copy link
Author

This now compiles and runs in WASM by inlining the core_plugin. With that change I believe this code is ready for review.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants