Today I was chatting with @Mathias on Matrix/IRC about the current Minecraft situation and I had the following idea: what if protocol code used lua?
I have been playing with GroupButler, a lua telegram bot, and learning about openresty and non-blocking i/o libraries, like pgmoon.
The funny thing its, most of these libraries are written in lua, and since openresty uses luaJIT, there are situations where lua code outperforms C code: https://www.cryptobells.com/resty-core-t...the-jit-y/
Ok, so that could work on cuberite too, right? right??? ?
Reimplementing Minecraft Java protocol in lua should make it straight forward to support multiple (all?) protocol versions without problems that sometimes occur currently when cuberite is updated to support a newer protocol. Although this issue is not related to C++, decoupling game logic from protocol is what would fix that. Bonus: making forge mods or other protocol changing plugins would be as easy as building a Cuberite plugin. ?
For Java, LuaSocket TCP should be enough.
Minecraft PE on the other hand can be implemented in a number of ways: using this guy’s lua code https://github.com/pabloko/Lua-JIT-RakNet, using actual C++ raknet code and creating lua bindings, reimplementing raknet purely in luaJIT, etc.
For the protocol, our friends at MiNET have us covered: “As part of the project, I also deliver an up-to-date automatically generated MCPE Protocol Specification.”
Bonus: Cuberite would become a “generic voxel game server”, meaning it could allow for crossplaying not only minecraft java and pe but also minetest and whatever comes next.
Yeah, I know. Currently protocol and logic and tightly coupled so I would suggest doing this in the following order:
So, what do you guys think? Doable or suicidal?
I have been playing with GroupButler, a lua telegram bot, and learning about openresty and non-blocking i/o libraries, like pgmoon.
The funny thing its, most of these libraries are written in lua, and since openresty uses luaJIT, there are situations where lua code outperforms C code: https://www.cryptobells.com/resty-core-t...the-jit-y/
Ok, so that could work on cuberite too, right? right??? ?
Reimplementing Minecraft Java protocol in lua should make it straight forward to support multiple (all?) protocol versions without problems that sometimes occur currently when cuberite is updated to support a newer protocol. Although this issue is not related to C++, decoupling game logic from protocol is what would fix that. Bonus: making forge mods or other protocol changing plugins would be as easy as building a Cuberite plugin. ?
For Java, LuaSocket TCP should be enough.
Minecraft PE on the other hand can be implemented in a number of ways: using this guy’s lua code https://github.com/pabloko/Lua-JIT-RakNet, using actual C++ raknet code and creating lua bindings, reimplementing raknet purely in luaJIT, etc.
For the protocol, our friends at MiNET have us covered: “As part of the project, I also deliver an up-to-date automatically generated MCPE Protocol Specification.”
Bonus: Cuberite would become a “generic voxel game server”, meaning it could allow for crossplaying not only minecraft java and pe but also minetest and whatever comes next.
Yeah, I know. Currently protocol and logic and tightly coupled so I would suggest doing this in the following order:
- Implement Pocket Edition protocol, by creating lua bindings and de-coupling protocol code as needed;
- Reimplement Java Edition protocol, probably more difficult to do than PE, since Java has more features et al.
So, what do you guys think? Doable or suicidal?