amethyst / bracket-lib

The Roguelike Toolkit (RLTK), implemented for Rust.
MIT License
1.53k stars 109 forks source link

Support a script language #74

Open rodrigocam opened 4 years ago

rodrigocam commented 4 years ago

A scripting system allows game customization without recompile rust code, improving speed on the game testing.

It would be good if:

rodrigocam commented 4 years ago

I and @pablodiegoss are working in a scripting system that can be customized to accept multiple languages for Amethyst Game Engine as our undergraduate thesis. Maybe the solution we are developing can be used here, we definitely can try to implement this!

rodrigocam commented 4 years ago

Our first POC can be found here we managed to run lua and python scripts. We started to work on an Amethyst fork too, that already has a specs system that runs lua and python scripts, can be found here

thebracket commented 4 years ago

That's definitely an interesting idea. I think I need to consider the best approach; offering it as an option at the bracket-lib level makes it available to projects that use it, which is great - but I also need to avoid constraining the choices made available to the user too rigidly (I have users going with Specs, Legion, and various other setups - don't want to make them miserable!).

erlend-sh commented 4 years ago

but I also need to avoid constraining the choices made available to the user too rigidly (I have users going with Specs, Legion, and various other setups - don't want to make them miserable!).

Sure, but it also doesn't seem unreasonable to just concede that scripting utilities (which is just an added bonus after all, not critical to use bracket-lib) will only work with a certain type of setup. As long as scripting is guaranteed to work with the default setup that 50-80% of users will want, it'll serve the majority of bracket devs well.

thebracket commented 4 years ago

Absolutely! The question in my mind is more "where does it go in the stack". It needs to retain some platform abstraction, or be tied to a back-end; the former is much nicer to work with, but much harder to write scripts for. In an ideal world, some kind of hook to the actual back-end would be really nice to have (I'm working on a generalized, non-scripted form of that right now).

Zireael07 commented 4 years ago

I just found someone's toy language: https://github.com/JohnBSmith/moss Not 100% sure if it works in WASM target, but I like the simple syntax.

oubiwann commented 4 years ago

Being a Lisper, I am (of course) quite partial to https://github.com/murarth/ketos (written in Rust; installable with cargo ;-) ).

Zireael07 commented 4 years ago

Since I last wrote, we have two candidates that apparently work in WASM too: https://gamelisp.rs/ and Rhai https://github.com/jonathandturner/rhai