How to make a game that loads a prebuilt map with each created world?
- PolySaken
- Member
- Posts: 696
- Joined: Thu Nov 09, 2017 05:18
- GitHub: PolySaken-I-Am
- In-game: PolySaken
- Location: Wānaka, Aotearoa
- Contact:
How to make a game that loads a prebuilt map with each created world?
Is there a reliable way to make a game where each newly created world is a handmade map, rather than a generated world? I tried overwriting the world database during mod loading but it corrupted every time. Will I have to wait for rubenwardy's custom main menus?
Re: How to make a game that loads a prebuilt map with each created world?
In theory, you might start with a singlenode map and place everything there by using place_schematic. That might be pretty slow and impractical for large maps. There's also sometimes trouble with players falling down through the non-existing floor when using singlenode and placing things manually. So perhaps there's really only waiting...
A list of my mods can be found here.
- PolySaken
- Member
- Posts: 696
- Joined: Thu Nov 09, 2017 05:18
- GitHub: PolySaken-I-Am
- In-game: PolySaken
- Location: Wānaka, Aotearoa
- Contact:
Re: How to make a game that loads a prebuilt map with each created world?
I tried building everything with voxelmanip and such but it takes ages so the player falling out of the world is the main issue.Sokomine wrote: ↑Sat Jan 02, 2021 23:18In theory, you might start with a singlenode map and place everything there by using place_schematic. That might be pretty slow and impractical for large maps. There's also sometimes trouble with players falling down through the non-existing floor when using singlenode and placing things manually. So perhaps there's really only waiting...
Also they can see otherwise hidden areas during generation
- Festus1965
- Member
- Posts: 1568
- Joined: Sun Jan 03, 2016 11:58
- In-game: Thomas Thailand Explorer
- Location: Thailand ChiangMai
- Contact:
Re: How to make a game that loads a prebuilt map with each created world?
Can you enlarge why you want to have like this ?
A moment I thought like, every new gamer might get a copy same start area as the others,
on the other side, every -older/used- server IS loading a handmade map, as most of former generated Mapblock might not be the same as beginning anymore.
May, if I/we ? understand more clear what you want, we might find a solution ?
A moment I thought like, every new gamer might get a copy same start area as the others,
on the other side, every -older/used- server IS loading a handmade map, as most of former generated Mapblock might not be the same as beginning anymore.
May, if I/we ? understand more clear what you want, we might find a solution ?
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)
If urgend, you find me in Roblox (as CNXThomas)
- PolySaken
- Member
- Posts: 696
- Joined: Thu Nov 09, 2017 05:18
- GitHub: PolySaken-I-Am
- In-game: PolySaken
- Location: Wānaka, Aotearoa
- Contact:
Re: How to make a game that loads a prebuilt map with each created world?
I wan to make a game where the map is handmade like most actual games, instead of generating a new one each time.
- Zughy
- Member
- Posts: 269
- Joined: Thu Mar 26, 2020 18:23
- GitHub: belongs_to_microsoft
- In-game: Zughy
- Location: Italy
- Contact:
Re: How to make a game that loads a prebuilt map with each created world?
The author wants to use prefabs, i.e. schematics. Sokomine solution is the closest one to what you want, I think
- LibraSubtilis
- Member
- Posts: 29
- Joined: Fri Jul 17, 2020 18:57
Re: How to make a game that loads a prebuilt map with each created world?
You don't have to place everything yourself, if you use a specific seed. It is possible to set the seed with minetest.set_mapgen_setting.
- PolySaken
- Member
- Posts: 696
- Joined: Thu Nov 09, 2017 05:18
- GitHub: PolySaken-I-Am
- In-game: PolySaken
- Location: Wānaka, Aotearoa
- Contact:
Re: How to make a game that loads a prebuilt map with each created world?
I want to build everything myself.LibraSubtilis wrote: ↑Sun Jan 03, 2021 20:15You don't have to place everything yourself, if you use a specific seed. It is possible to set the seed with minetest.set_mapgen_setting.
- Hume2
- Member
- Posts: 630
- Joined: Tue Jun 19, 2018 08:24
- GitHub: Hume2
- In-game: Hume2
- Location: Czech Republic
Re: How to make a game that loads a prebuilt map with each created world?
I made a mod for that purpose: viewtopic.php?f=9&t=24214 (exaple usage)
It places a map when the world is created and it can place the map there any time after, restart it, etc.. However, it is effective only for smaller maps and it starts to be slow for maps which are bigger than 80×80×80. It's a shame that Minetest doesn't support such operations in the core. There is a theoretical solution: Redirect the mapchunks to the sample map as long as they aren't modified. And when one mapchunk is modified, copy it to the world file and modify it there.
It places a map when the world is created and it can place the map there any time after, restart it, etc.. However, it is effective only for smaller maps and it starts to be slow for maps which are bigger than 80×80×80. It's a shame that Minetest doesn't support such operations in the core. There is a theoretical solution: Redirect the mapchunks to the sample map as long as they aren't modified. And when one mapchunk is modified, copy it to the world file and modify it there.
If you lack the reality, go on a trip or find a job.
- Zughy
- Member
- Posts: 269
- Joined: Thu Mar 26, 2020 18:23
- GitHub: belongs_to_microsoft
- In-game: Zughy
- Location: Italy
- Contact:
Re: How to make a game that loads a prebuilt map with each created world?
Or you could load new blocks asynchronously like Skywars do when it regenerates a map
- orwell
- Member
- Posts: 858
- Joined: Wed Jun 24, 2015 18:45
- GitHub: orwell96
- IRC: orwell96_mt
- In-game: orwell
- Location: Raxacoricofallapatorius
Re: How to make a game that loads a prebuilt map with each created world?
IMO support for this should be somehow implemented in the engine. There could be an option in the game.conf to pre-initialize any world created with this game by copying a world directory supplied with the game (in sqlite format). It would probably be sufficient to restrict this to sqlite database backends as it targets inexperienced users (servers using another backend would need to "migrate" this world afterwards)
The "tutorial" subgame could also profit from this.
Alternatively, it is possible to place a complete subgame into the <world dir>/game/ directory. Minetest then uses the game provided there. The main menu does not display this properly, but a PR exists. You could provide your game as a packaged world with the game in the game/ directory and instruct users to unpack it for a new world.
The "tutorial" subgame could also profit from this.
Alternatively, it is possible to place a complete subgame into the <world dir>/game/ directory. Minetest then uses the game provided there. The main menu does not display this properly, but a PR exists. You could provide your game as a packaged world with the game in the game/ directory and instruct users to unpack it for a new world.
- rubenwardy
- Moderator
- Posts: 6379
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: United Kingdom
- Contact:
Re: How to make a game that loads a prebuilt map with each created world?
The way I do this with Craft the Web, Qiskit Blocks, and CTF is to place a schematic as a custom map generator.
See https://github.com/CERN/CTW/blob/develo ... ge.lua#L34 for example code
See https://github.com/CERN/CTW/blob/develo ... ge.lua#L34 for example code
Core Developer | Donate | My Twitter | Mods | Mods 4 Android | Minetest Modding Book
Hello profile reader
Hello profile reader
Re: How to make a game that loads a prebuilt map with each created world?
You could also take a look at Wuzzy's "Tutorial" game.
https://content.minetest.net/packages/Wuzzy/tutorial/
It loads a pretty big castle as map quickly without the user seeing the hidden parts.
Cheers,
bzt
https://content.minetest.net/packages/Wuzzy/tutorial/
It loads a pretty big castle as map quickly without the user seeing the hidden parts.
Cheers,
bzt
- LibraSubtilis
- Member
- Posts: 29
- Joined: Fri Jul 17, 2020 18:57
Re: How to make a game that loads a prebuilt map with each created world?
Yes, that was obvious. I was just suggesting an alternative. I think there are many good seeds that could be used as a base for a good map.PolySaken wrote: ↑Mon Jan 04, 2021 08:21I want to build everything myself.LibraSubtilis wrote: ↑Sun Jan 03, 2021 20:15You don't have to place everything yourself, if you use a specific seed. It is possible to set the seed with minetest.set_mapgen_setting.
Re: How to make a game that loads a prebuilt map with each created world?
Try writing to the map DB *after* all mods are loaded, and it should be fine.
- PolySaken
- Member
- Posts: 696
- Joined: Thu Nov 09, 2017 05:18
- GitHub: PolySaken-I-Am
- In-game: PolySaken
- Location: Wānaka, Aotearoa
- Contact:
Re: How to make a game that loads a prebuilt map with each created world?
I think I'll wait for custom main menus so I can make the 'new world' button just copy a premade file.
Re: How to make a game that loads a prebuilt map with each created world?
Wasn't there a thing that worked in reverse, allowing you to bundle the game in the world folder?
- PolySaken
- Member
- Posts: 696
- Joined: Thu Nov 09, 2017 05:18
- GitHub: PolySaken-I-Am
- In-game: PolySaken
- Location: Wānaka, Aotearoa
- Contact:
Re: How to make a game that loads a prebuilt map with each created world?
there is for mods, but since worlds only show up in the correct game menu world-specific games would be impossible.
Who is online
Users browsing this forum: No registered users and 4 guests