-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wasm modding #7
Open
alec-deason
wants to merge
16
commits into
heroiclabs:master
Choose a base branch
from
alec-deason:wasm_modding
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Wasm modding #7
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…et right. We can come back to that.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.