Closed hrydgard closed 2 weeks ago
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:
PPSSPP specific functions, it doesn't matter much what scripting language we get, important is what PPSSPP specific stuff we will be able to do with it, which preferably should be open for updates to increase it's power like cwcheat which got rumble and shader specific cheats that most people don't know are a thing.
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. Also being able to write a some simple GUI to make tweaks available also for end users without telling them to hex edit stuff and maybe some easy hotkeys, maybe even some texture support for GUI to for example allow for pretty HP bars in games which never had HP displayed etc..
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... 1) All hail to Python 2) https://github.com/hrydgard/ppsspp/pull/13804
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.
I want to enable live-editing and add a development console that you can use to poke around in memory with
What does live-editing mean?
Next... I remember you saying this: https://github.com/hrydgard/ppsspp/pull/17661#issuecomment-1640224324 Is that the same console you mean here?
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.
lua it is.
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?