{"action":"created","issue":{"url":"https://api.github.com/repos/minetest/minetest/issues/4144","repository_url":"https://api.github.com/repos/minetest/minetest","labels_url":"https://api.github.com/repos/minetest/minetest/issues/4144/labels{/name}","comments_url":"https://api.github.com/repos/minetest/minetest/issues/4144/comments","events_url":"https://api.github.com/repos/minetest/minetest/issues/4144/events","html_url":"https://github.com/minetest/minetest/issues/4144","id":155922405,"number":4144,"title":"Mapgen API","user":{"login":"MarkuBu","id":16163058,"avatar_url":"https://avatars.githubusercontent.com/u/16163058?v=3","gravatar_id":"","url":"https://api.github.com/users/MarkuBu","html_url":"https://github.com/MarkuBu","followers_url":"https://api.github.com/users/MarkuBu/followers","following_url":"https://api.github.com/users/MarkuBu/following{/other_user}","gists_url":"https://api.github.com/users/MarkuBu/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkuBu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkuBu/subscriptions","organizations_url":"https://api.github.com/users/MarkuBu/orgs","repos_url":"https://api.github.com/users/MarkuBu/repos","events_url":"https://api.github.com/users/MarkuBu/events{/privacy}","received_events_url":"https://api.github.com/users/MarkuBu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/minetest/minetest/labels/@%20Mapgen","name":"@ Mapgen","color":"009800"},{"url":"https://api.github.com/repos/minetest/minetest/labels/Feature%20request","name":"Feature request","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-20T09:28:47Z","updated_at":"2016-05-21T07:16:40Z","closed_at":null,"body":"As far as I understand mapgens, lua mods are executed after the decoration from the default c++ mapgen, so lua mods have to deal with stuff that is already generated\r\n\r\nIn minetest caves are neglected. The default caves (v7) are not very pleasant and modders don't have a chance to change this without causing other issues like flying or destroyed nodes.\r\n\r\nI would suggest that generators are executed by priority, ordered by terrain, caves, dungeons, structures like buildings and plants last, independently if lua or c++\r\n\r\nI suggest something like register_terrain, register_biomes, register_caves, register_structures, register_plants and whatever I have forgot like ores or mods like 3D stone biomes, which should be executed after terrain to give cavegens the ability to use this information (e.g. don't dig)\r\n\r\nCurrently it would be necessary to write everything in lua and ignore the built in mapgens at all\r\n\r\nI know that this would be a lot of work and would cause incompatibility with existing mods, but it would provide more flexibility for the future"},"comment":{"url":"https://api.github.com/repos/minetest/minetest/issues/comments/220763335","html_url":"https://github.com/minetest/minetest/issues/4144#issuecomment-220763335","issue_url":"https://api.github.com/repos/minetest/minetest/issues/4144","id":220763335,"user":{"login":"MarkuBu","id":16163058,"avatar_url":"https://avatars.githubusercontent.com/u/16163058?v=3","gravatar_id":"","url":"https://api.github.com/users/MarkuBu","html_url":"https://github.com/MarkuBu","followers_url":"https://api.github.com/users/MarkuBu/followers","following_url":"https://api.github.com/users/MarkuBu/following{/other_user}","gists_url":"https://api.github.com/users/MarkuBu/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkuBu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkuBu/subscriptions","organizations_url":"https://api.github.com/users/MarkuBu/orgs","repos_url":"https://api.github.com/users/MarkuBu/repos","events_url":"https://api.github.com/users/MarkuBu/events{/privacy}","received_events_url":"https://api.github.com/users/MarkuBu/received_events","type":"User","site_admin":false},"created_at":"2016-05-21T07:16:40Z","updated_at":"2016-05-21T07:16:40Z","body":"I know that I can clear things and I know that I can disable things with flags. But it is ineficient to write and execute the same code twice, especially if I have to replace C++ code with lua.\r\n\r\nWhat I mean is exactly this part of code you linked to. The order is hard coded. You can disable single calls like caves and dungeons, but you can't replace them at the same position. \r\n\r\nReplace this hard coded part with a list of function calls, which can be replaced by a mod. Then you can use all C++ parts from the mapgen and replace single parts with a lua mod without changing the execution order.\r\n\r\n\r\nfor example:\r\nc++ terrain, c++ biome, lua cave, c++ decoration\r\n\r\ncurrently it would look like this\r\nc++ terrain, c++ biome, c++ decoration, lua cave\r\n\r\n> Dev Hmmmm is currently re-organising mapgen architecture, it will be more flexible and modular in future.\r\n\r\nWith the current concept it is easyer to write the whole mapgen in lua. Maybe the new architecture will look like my suggestion?\r\n"}}
{"actor":{"display_login":"MarkuBu"}}