Mapgens as mods ?

Post Reply
Sires
Member
Posts: 190
Joined: Mon Jan 02, 2017 21:00
GitHub: Sires0
IRC: Sires
In-game: Sires Sores Siri Seris or anything ppl call me
Location: :noitacoL

Mapgens as mods ?

by Sires » Post

I got an idea of like adding an extra folder to .minetest called "mapgens", there you could have lua-based mapgens(for this an entire api must be created and must be really light weight I guess, so it may be the worst part of my idea) or cpp mapgens, like you download.. I dunno, you download "carpathian.zip", extract it in the mapgens folder and ta-da when you open minetest you'll have "carpathian" to select at your world creation button idk the name.

When a mapgen is removed, well the world should starting using some "default" mapgen or just singlenode with air, that is a nice way to tell you "hey install dat mapgen again"
It would be cool to see what people could do as mapgens, many good ideas would be there.

(I have low knowgledge of cpp, I just learned a bit and tried to understand what is happening at the 65416854 files related to mapgen, but I really don't understand nothing, many types of variables that I don't get what they are, if they are a vector or maybe a mapblock or something)
I don't have anything important to say.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Mapgens as mods ?

by sofar » Post

lua mapgens already exist. They are normal mods. There is no need to make them special. Example: https://github.com/minetest-mods/mg

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Mapgens as mods ?

by Krock » Post

Additionally, mapgens can be horribly slow and memory-consuming when they're programmed in Lua. If you plan to make a nice looking mapgen that you want to use much, I heavily recommend using at least LuaJIT or program them with C(++) to gain speed.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

Sires
Member
Posts: 190
Joined: Mon Jan 02, 2017 21:00
GitHub: Sires0
IRC: Sires
In-game: Sires Sores Siri Seris or anything ppl call me
Location: :noitacoL

Re: Mapgens as mods ?

by Sires » Post

What do I mean is like letting us to enable and disable new mapgens without the need of recompiling the game and without having to hardcode it in the engine, I don't really want lua mapgens
I don't have anything important to say.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Mapgens as mods ?

by sofar » Post

Sires wrote:What do I mean is like letting us to enable and disable new mapgens without the need of recompiling the game and without having to hardcode it in the engine, I don't really want lua mapgens
Those two things are not compatible. Either its a mod, or you will need to recompile.

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: Mapgens as mods ?

by duane » Post

sofar wrote:
Sires wrote:What do I mean is like letting us to enable and disable new mapgens without the need of recompiling the game and without having to hardcode it in the engine, I don't really want lua mapgens
Those two things are not compatible. Either its a mod, or you will need to recompile.
I suppose that if somebody really wanted to, they could make the mapgens dynamically linked libraries. Of course, you'd still have to have a library compiled for every system, but you could just drop the right one in and it'd work. I'd never use it, but in theory...
Believe in people and you don't need to believe anything else.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Mapgens as mods ?

by sofar » Post

duane wrote:I suppose that if somebody really wanted to, they could make the mapgens dynamically linked libraries. Of course, you'd still have to have a library compiled for every system, but you could just drop the right one in and it'd work. I'd never use it, but in theory...
It could, but remember that minetest can link against various libraries, such as zlib, sqlite, SSL, curl, and if the mapgen plugins aren't linked against the same versions, bad things may happen, or it just won't work. If you have an Ubuntu build, but you download a mapgen DSO from duane who hates ubuntu and uses puppy linux(everyone loves puppies, right?), it's quite possible that your minetest takes you for a ride to the Segmentation of Fault (crashes, and corrupts your map).

Sires
Member
Posts: 190
Joined: Mon Jan 02, 2017 21:00
GitHub: Sires0
IRC: Sires
In-game: Sires Sores Siri Seris or anything ppl call me
Location: :noitacoL

Re: Mapgens as mods ?

by Sires » Post

sofar wrote:
duane wrote:I suppose that if somebody really wanted to, they could make the mapgens dynamically linked libraries. Of course, you'd still have to have a library compiled for every system, but you could just drop the right one in and it'd work. I'd never use it, but in theory...
It could, but remember that minetest can link against various libraries, such as zlib, sqlite, SSL, curl, and if the mapgen plugins aren't linked against the same versions, bad things may happen, or it just won't work. If you have an Ubuntu build, but you download a mapgen DSO from duane who hates ubuntu and uses puppy linux(everyone loves puppies, right?), it's quite possible that your minetest takes you for a ride to the Segmentation of Fault (crashes, and corrupts your map).
Ok but kittens linux is better
I don't have anything important to say.

Post Reply

Who is online

Users browsing this forum: rubenwardy and 9 guests