-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Choosing a scripting language #19379
Comments
Honestly the reason why everyone know lua in the modding community is because it was popularized by games like for example WOW and many others then became adapted to cheat engine where it's used for everything from custom searches that standard CE UI might not include up to paid trainer stuff. IMO there are two most important factors:
Within those two any scripting language will be fine, they aren't that hard nor different from each other, just need a wiki page with ppsspp specific syntax and like a one simple example like "Hello world!", everything else will be easy to find over the net. Writing a right analog support for example isn't just remapping keys like some plugins do, but having to find where game translates input to effect in-game like camera movement and then make it react to analog stick. A lot of that work would be the same with scripting system as it's with cwcheat/asm script injection, however much simpler if we didn't had to read value of analog from PSP input and write asm function to translate it to usable values to do what we want, but directly read analog value, write all the math in high level and just inject what we want where we want. |
While I don't really like Lua as a language I would prefer it over a not well maintained JS. The last thing I want are bugs in the interpreter tbh. That being said if the JS library is solid enough I kinda like the idea of having some metaprogramming stuff like decorators and so on. That could be useful to make some complicated and repetitive stuff hidden to the user, or just to specify when a function should be called. Not sure if this is possible with Lua tbh. Python I have a bad feeling about Android/iOS support. But beside that I share the same feeling about JS. |
Lua is pretty nice, but here's a shot in the dark, which somewhat sidesteps the question: would WebAssembly be viable ? If it's easy and light enough to embed and has the ability for any supported language to produce a binary to execute, this could be nice. I've heard good things about it, but never embedded it. |
Does it need to be a full-feature general purpose language? I would favor something simple that people with little-to-no real development experience can easily pick up and learn on the fly. |
There are 2 things I can say...
|
Python is very heavy and slow, and I'm not confident it'll build on all our supported platforms, I wouldn't want to break Switch for example even though it's not very actively updated. I'm currently leaning towards lua / luau due to it being well maintained and very easy to embed, and guaranteed to compile anywhere due to its simplicity. I want to enable live-editing and add a development console that you can use to poke around in memory with, so something like WebAssembly would require an additional compiler from a textual language, making it less interesting. |
What does live-editing mean? Next... I remember you saying this: #17661 (comment) |
Live-editing means editing various scripts that can affect games without restarting the game or PPSSPP. And yeah, it would be a convenient way to implement such a console. |
I think we've reached the point now when we really need to add a proper scripting language.
The following uses are obvious, but there may be more:
It's just pretty hard to choose. We've discussed this previously in #15626 , but didn't reach any conclusion. So let's list the option:
Other alternatives:
Any other ideas?
The text was updated successfully, but these errors were encountered: