Page 1 of 1

LUA port of mg v7?

PostPosted: Fri Dec 30, 2016 15:31
by burli
Hi,
has anyone ported mg v7 to lua yet?

Re: LUA port of mg v7?

PostPosted: Fri Dec 30, 2016 15:33
by red-001
Why would you want that? Mapgens written in c++ are a lot faster then ones written in lua.

Re: LUA port of mg v7?

PostPosted: Fri Dec 30, 2016 15:54
by burli
Because it's difficult or impossible to add new features or modify specific parts of a c++ mg in lua. I want to modify the mg and maybe port it back to c++ later

Re: LUA port of mg v7?

PostPosted: Fri Dec 30, 2016 16:36
by red-001
Well I'm pretty sure that no-one ported it. You will have to do it yourself or make your modifications in C++.

Re: LUA port of mg v7?

PostPosted: Sat Dec 31, 2016 15:43
by fishyWET
There is a simple api for making biomes in v7/v5/valleys mapgen
https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L3947-L4077
Of which is used by mods such as ethereal.

Re: LUA port of mg v7?

PostPosted: Sat Dec 31, 2016 17:46
by burli
I know, but I think it is pretty useless to write a c++ mapgen and than dump most of it and replace it with lua. And still there are things I can't add without lots of issues, for example I can't add caves without flying plants

The current mapgen system is damage by design and it's easier to write the mapgen completely in lua, which is a problem because of the memory limit of luajit

Re: LUA port of mg v7?

PostPosted: Mon Jan 02, 2017 16:31
by paramat
> I know, but I think it is pretty useless to write a c++ mapgen and than dump most of it and replace it with lua

? The biome API is accessed from Lua but is engine C++ code so is very fast.

Flying plants? What is the specific problem?

> The current mapgen system is damage by design

In what way?

You can use normal Lua instead of LuaJIT if you want to write complex Lua mapgens, i use normal Lua (i have to).
See my mods for good examples of Lua mapgen.
I could write a Lua mgv7 but am not interested.

Re: LUA port of mg v7?

PostPosted: Mon Jan 02, 2017 18:30
by burli
paramat wrote:> I know, but I think it is pretty useless to write a c++ mapgen and than dump most of it and replace it with lua

? The biome API is accessed from Lua but is engine C++ code so is very fast.

Flying plants? What is the specific problem?


Any mod I tried or I have written by myself that adds some kind of caves has the same problem. Any time, the caves hit the surface I have flying plants over that hole, even if I removed all the decoration and placed it again

paramat wrote:> The current mapgen system is damage by design

In what way?

You can use it "as is", maybe add/modify some decoration. But larger modifications are slow, have ugly glitches or are just impossible.

paramat wrote:You can use normal Lua instead of LuaJIT if you want to write complex Lua mapgens, i use normal Lua (i have to).
See my mods for good examples of Lua mapgen.

I know that I can use Lua instead of LuaJIT, but do I want that? I know that I can write the whole mapgen in Lua like the valleys mg. But more than a proof of concept is pointless.