Skip to content
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

In-game lua computer #49

Open
tatjam opened this issue Jan 19, 2023 · 2 comments
Open

In-game lua computer #49

tatjam opened this issue Jan 19, 2023 · 2 comments

Comments

@tatjam
Copy link
Collaborator

tatjam commented Jan 19, 2023

This needs a way to serialize a running lua state, including local variables and similar. This may not be possible with LuaJIT. In that case, we are left with three alternatives:

  • Have in-game computers require serialization code, which doesn't make much sense and is bad for players
  • Implement a lua version that's compatible with this: https://github.com/fnuecke/eris This would mean that computers would truly be isolated from the lua world and would interact with machines and such through APIs. Seems like a good option but may be "bloaty"
  • Don't have in-game lua computers. This means that any kind of computer would have to be an emulated architecture / interpreted language. Easiest option :P

Mods could later on implement, for example, emulators for other architectures, as this can easily be done in lua (with reasonable performance thanks to LuaJIT) so that's outside the scope of the engine.

@tatjam
Copy link
Collaborator Author

tatjam commented Jan 19, 2023

Obviously restoring userdata and such is pretty much imposible, the objective is to save and restore a "virtual lua environment" that's actually quite isolated from the game.

@tigercoding56
Copy link

tigercoding56 commented Jul 5, 2024

can we make it have the texture of the minetest mesecons mod lua controller ? (if licensing allows since i am not a lawyer ) https://github.com/minetest-mods/mesecons
image
also check out https://github.com/joe7575/safer_lua/tree/master for simple lua sandbox (idk if that is what you are looking for maybe it is a bit too simple )

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

No branches or pull requests

2 participants