Proposal: world configuration dialog. #2147

Open
opened 2022-04-27 17:49:38 +02:00 by kabou · 13 comments
Contributor

Minetest does not provide us with the means to set per world custom configuration options when a new world is created in minetest's main menu. In order to be able to set mineclone related world options, we need to find an alternative solution for this that works at or near world initialization. Additionally, this needs to be compatible with existing worlds.

Here is a sketched outline of a tentative configuration mechanism for setting initial parameters for new worlds and for setting dynamic parameters for existing worlds. Comments, criticisms and alternative approaches are welcome.

Upon startup of the game, we first thing we do is check for the presence of mcl_world.conf in the world directory. If this file is present, we read the world's settings and continue as usual. If this file is not present, we check if the world is a newly created world.

  • If it is not a new world, we create a new mcl_world.conf with defaults for "old world" and continue the game with configuration settings for an "old world".
  • If it is a new world, we suspend lua mapgen operations and wait for an initial user to join the game. When that happens, we temporarily block additional users from joining, and prompt the initial user with the world configuration dialog. Once the user has finished the configuration, we write those settings to mcl_world.conf and resume the suspended loa mapgen operations with the new settings. Finally we spawn the initial user in the newly created world and re-enable other users to join.

While the game runs, a user with sufficient privileges can recall the world configuration dialog and alter dynamically configurable settings. Even without the "old world" versus "new world" aspect, having in-game configurability would be a really nice enhancement of usability.

Minetest does not provide us with the means to set per world custom configuration options when a new world is created in minetest's main menu. In order to be able to set mineclone related world options, we need to find an alternative solution for this that works at or near world initialization. Additionally, this needs to be compatible with existing worlds. Here is a sketched outline of a tentative configuration mechanism for setting initial parameters for new worlds and for setting dynamic parameters for existing worlds. Comments, criticisms and alternative approaches are welcome. Upon startup of the game, we first thing we do is check for the presence of `mcl_world.conf` in the world directory. If this file is present, we read the world's settings and continue as usual. If this file is not present, we check if the world is a newly created world. * If it is not a new world, we create a new `mcl_world.conf` with defaults for "old world" and continue the game with configuration settings for an "old world". * If it is a new world, we suspend lua mapgen operations and wait for an initial user to join the game. When that happens, we temporarily block additional users from joining, and prompt the initial user with the world configuration dialog. Once the user has finished the configuration, we write those settings to `mcl_world.conf` and resume the suspended loa mapgen operations with the new settings. Finally we spawn the initial user in the newly created world and re-enable other users to join. While the game runs, a user with sufficient privileges can recall the world configuration dialog and alter dynamically configurable settings. Even without the "old world" versus "new world" aspect, having in-game configurability would be a really nice enhancement of usability.
kabou added the
needs research
needs discussion
configurability
enhancement
labels 2022-04-27 17:49:38 +02:00
Contributor

Please do some experiments before putting serious work in. It sounds like you do not fully understand how mapgen works. The terrain generation in the overworld is not lua mapgen. (Or only rather small parts of it are).

I think to prevent mapgen from going you might have to spawn the player high up in the sky or or something - not even sure that would work but its the only way I can imagine.

Please do some experiments before putting serious work in. It sounds like you do not fully understand how mapgen works. The terrain generation in the overworld is not lua mapgen. (Or only rather small parts of it are). I think to prevent mapgen from going you might have to spawn the player high up in the sky or or something - not even sure that would work but its the only way I can imagine.
Contributor

I think to prevent mapgen from going you might have to spawn the player high up in the sky or or something - not even sure that would work but its the only way I can imagine.

I'm not sure how Minetest does it, but Minecraft has a feature of keeping the world spawn chunks always loaded, which I assume has some technical advantages. It also helps players who want non-stop working farms and contraptions.

> I think to prevent mapgen from going you might have to spawn the player high up in the sky or or something - not even sure that would work but its the only way I can imagine. I'm not sure how Minetest does it, but Minecraft has a feature of keeping the [world spawn chunks always loaded](https://minecraft.fandom.com/wiki/Spawn_chunk), which I assume has some technical advantages. It also helps players who want non-stop working farms and contraptions.
Contributor

Yeah I think minetest might have something similar which is why i said i'm not sure it would even work.

Yeah I think minetest might have something similar which is why i said i'm not sure it would even work.
Author
Contributor

Please do some experiments before putting serious work in. It sounds like you do not fully understand how mapgen works. The terrain generation in the overworld is not lua mapgen. (Or only rather small parts of it are).

I think to prevent mapgen from going you might have to spawn the player high up in the sky or or something - not even sure that would work but its the only way I can imagine.

Correct me if I'm wrong, but I assume that upon game start in a new world, minetest mapgen generates a limited number of blocks around the world spawn, which mineclone2 lua mapgen can then reprocess. It is the lua reprocessing that I want to suspend and then later, after the initial configuration is finished, reactivate with the options that were set during configuration.

> Please do some experiments before putting serious work in. It sounds like you do not fully understand how mapgen works. The terrain generation in the overworld is not lua mapgen. (Or only rather small parts of it are). > > I think to prevent mapgen from going you might have to spawn the player high up in the sky or or something - not even sure that would work but its the only way I can imagine. Correct me if I'm wrong, but I assume that upon game start in a new world, minetest mapgen generates a limited number of blocks around the world spawn, which mineclone2 lua mapgen can then reprocess. It is the lua reprocessing that I want to suspend and then later, after the initial configuration is finished, reactivate with the options that were set during configuration.
Contributor

you could maybe do that yeah but idk it would be pretty hacky. I don't say this often but it should prob be provided by minetest.

If it works and we do this we really need to think it through though

you could maybe do that yeah but idk it would be pretty hacky. I don't say this often but it should prob be provided by minetest. If it works and we do this we really need to think it through though
Author
Contributor

you could maybe do that yeah but idk it would be pretty hacky. I don't say this often but it should prob be provided by minetest.

Agreed, but minetest doesn't, that is essentially why we need to hack around it.

If it works and we do this we really need to think it through though

Agreed and it is the reason why I added the needs discussion and needs research tags to this issue. I hope to soon have a POC WIP: PR to evaluate, but I'd like the main discussion to stay with this issue.

> you could maybe do that yeah but idk it would be pretty hacky. I don't say this often but it should prob be provided by minetest. Agreed, but minetest doesn't, that is essentially why we need to hack around it. > If it works and we do this we really need to think it through though Agreed and it is the reason why I added the `needs discussion` and `needs research` tags to this issue. I hope to soon have a POC WIP: PR to evaluate, but I'd like the main discussion to stay with this issue.
Contributor

If it's just a few chunks around spawn that get generated by the engine, it doesn't seem awfully hacky to deal with them. But this should be brought up in the Minetest issue tracker, so they can give it some thought.

The UI could be revamped to allow pre-configuration for new worlds, or the engine could wait for the game to give it the "go" if the game implements "new world" settings. The second option feels easier to implement, considering it would place the responsibility on the game makers to do their own UIs as they see fit. And it would probably be better too, because it's easier for the game maker to change anything in their own UI.

If it's just a few chunks around spawn that get generated by the engine, it doesn't seem awfully hacky to deal with them. But this should be brought up in the Minetest issue tracker, so they can give it some thought. The UI could be revamped to allow pre-configuration for new worlds, or the engine could wait for the game to give it the "go" if the game implements "new world" settings. The second option feels easier to implement, considering it would place the responsibility on the game makers to do their own UIs as they see fit. And it would probably be better too, because it's easier for the game maker to change anything in their own UI.
Author
Contributor

If it's just a few chunks around spawn that get generated by the engine, it doesn't seem awfully hacky to deal with them. But this should be brought up in the Minetest issue tracker, so they can give it some thought.

The UI could be revamped to allow pre-configuration for new worlds, or the engine could wait for the game to give it the "go" if the game implements "new world" settings. The second option feels easier to implement, considering it would place the responsibility on the game makers to do their own UIs as they see fit. And it would probably be better too, because it's easier for the game maker to change anything in their own UI.

That would mean that a minetest PR has to be made, approved and merged. Then it will take some time before a new version of minetest that incorporates this functionality is released and even more time before that version is widely distributed.

I think it is a good idea, but not to wait for.

> If it's just a few chunks around spawn that get generated by the engine, it doesn't seem awfully hacky to deal with them. But this should be brought up in the Minetest issue tracker, so they can give it some thought. > > The UI could be revamped to allow pre-configuration for new worlds, or the engine could wait for the game to give it the "go" if the game implements "new world" settings. The second option feels easier to implement, considering it would place the responsibility on the game makers to do their own UIs as they see fit. And it would probably be better too, because it's easier for the game maker to change anything in their own UI. That would mean that a minetest PR has to be made, approved and merged. Then it will take some time before a new version of minetest that incorporates this functionality is released and even more time before that version is widely distributed. I think it is a good idea, but not to wait for.
Contributor

Ok, I hope I did a good case for what we need. If I missed something, join the conversation.

Request in the Minetest issue tracker: Allow games to have a settings UI before entering a world

Ok, I hope I did a good case for what we need. If I missed something, join the conversation. Request in the Minetest issue tracker: [Allow games to have a settings UI before entering a world](https://github.com/minetest/minetest/issues/12246)
Contributor

The above issue was marked as duplicate (and closed), but as there's interest for it, I was recommended to open a related issue - which I have. Please join the discussion if you have anything to add. I'm not sure how to best approach the world detection issue and any input on that would be welcome.

Mainmenu: Add a configure menu that games can customize, replacing Select Mods

The above issue was marked as duplicate (and closed), but as there's interest for it, I was recommended to open a related issue - which I have. Please join the discussion if you have anything to add. I'm not sure how to best approach the world detection issue and any input on that would be welcome. [Mainmenu: Add a configure menu that games can customize, replacing Select Mods](https://github.com/minetest/minetest/issues/12273)
Author
Contributor

Added a comment to the (already closed) minetest issue.

Added [a comment](https://github.com/minetest/minetest/issues/12273#issuecomment-1119066247) to the (already closed) minetest issue.
Contributor

(please watch it when you have some time)

Here's a great video about stuff we can use as inspiration:
Video Settings & Accessibility! - Caves & Cliffs Update 1.18, by Pixlriffs

I won't transcribe the details, but include 2 screenshots for reference.

Accessibility settings (also talked about in #864 and in the Minetest issue tracker)
Accessibility Settings menu

Video Settings
Video Settings menu

*(please watch it when you have some time)* Here's a great video about stuff we can use as inspiration: [Video Settings & Accessibility! - Caves & Cliffs Update 1.18](https://youtu.be/W6eYr9lkK_s), *by Pixlriffs* I won't transcribe the details, but include 2 screenshots for reference. Accessibility settings (also talked about in #864 and in the [Minetest issue tracker](https://github.com/minetest/minetest/issues/10666#issuecomment-733826284)) ![Accessibility Settings menu](https://i.imgur.com/DdyBFsh.jpg) Video Settings ![Video Settings menu](https://i.imgur.com/XWWsZow.jpg)
Contributor

Also of interest, Pixlriffs explains the game rules, and there's quite a list there.

Depending on what our engine allows and what we allow ourselves to customize on the fly or at world creation, it would be nice to have some more important settings in our configuration dialog.

Also of interest, Pixlriffs [explains the game rules](https://youtu.be/RiF7Ub7AOlI?t=1042), and there's quite a list there. Depending on what our engine allows and what we allow ourselves to customize on the fly or at world creation, it would be nice to have some more important settings in our configuration dialog.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#2147
No description provided.