Page 1 of 1

New c++ mods

PostPosted: Sun Jun 05, 2016 15:51
by Diamond knight
I have been thinking about how the old minetest c55 was less laggy when it came to mobs, and the lua api is limited, so there should be a second way to make mods, c++ mods, they would work like lua mods but would have more customization and enabling a c++ mod would "bind it to the core c++" for that world, (they can be unenabled to "unbind"), this api would not replace the old api, it would be a second api

Re: New c++ mods

PostPosted: Sun Jun 05, 2016 18:34
by Krock
This idea is already discussed on GitHub.
Using C++ would mean that you need to compile the mod before you can use it. Shipping a compiler with Minetest is quite exaggerated. Also, LuaJIT is already quite fast - so don't expect a huge performance gain.

Re: New c++ mods

PostPosted: Sun Jun 05, 2016 19:26
by kaeza
Most people that request native (C++, C, whatever) mods generally do so because they somehow think that using C++ will allow them to do things you can't do with Lua.

This is wrong.

The only real benefit of adding a C++ modding API would be performance, and that is kinda moot with LuaJit.

Minetest uses a client-server architecture, even in single player, where the client sends commands to the server ("I moved to this position", "Dig this node", "Give me the contents of this map block", etc.), and the server responds appropriately ("OK", "I'm afraid I can't do that, Dave", "Here, have this data...", etc).

Client and server are two different things and communicate only via the network. Adding a C++ API won't lift that restriction.

I'd like to hear what you specifically need.

Re: New c++ mods

PostPosted: Sun Jun 05, 2016 19:56
by ShadMOrdre
The only real benefit of adding a C++ modding API would be performance, and that is kinda moot with LuaJit.


I disagree. A C++ API could also open up the minetest core logic to be used by third party tools, which has immeasurable usefulness.

I've considered trying to use minetest logic to generate worlds in the Opensim environment. The Opensimulator uses a distributed architecture that could more efficiently serve up minetest generated areas. I also believe that its graphics capabilites would elevate what minetest currently offers.

I've been salivating over this project merge since I first heard of the Rift, and dreaming of worlds that could be more efficiently created and shared amongst users. I have generated 'block' type environments in Opensim that look really interesting. If anyone is interested, I'll grab some screenshots for various comparisons.

Re: New c++ mods

PostPosted: Sun Jun 05, 2016 20:23
by burli
Instead of adding c++ mods you could extend the lua api to make the functions you miss availible for lua mods

Distribute c++ mods would be a mess

Re: New c++ mods

PostPosted: Mon Jun 06, 2016 05:00
by xeranas
Krock wrote:Also, LuaJIT is already quite fast - so don't expect a huge performance gain.

Forget that LuaJIT, due memory limitation it's useless in many mods (e.g. OOM for generating relative simple structures).