How to make a game that loads a prebuilt map with each created world?

Post Reply
User avatar
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?

by PolySaken » Post

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?

Sokomine
Member
Posts: 4184
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: How to make a game that loads a prebuilt map with each created world?

by Sokomine » Post

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.

User avatar
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?

by PolySaken » Post

Sokomine wrote:
Sat Jan 02, 2021 23:18
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...
I tried building everything with voxelmanip and such but it takes ages so the player falling out of the world is the main issue.
Also they can see otherwise hidden areas during generation

User avatar
Festus1965
Member
Posts: 1572
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?

by Festus1965 » Post

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 ?
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)

User avatar
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?

by PolySaken » Post

I wan to make a game where the map is handmade like most actual games, instead of generating a new one each time.

User avatar
Zughy
Member
Posts: 272
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?

by Zughy » Post

The author wants to use prefabs, i.e. schematics. Sokomine solution is the closest one to what you want, I think

User avatar
LibraSubtilis
Member
Posts: 31
Joined: Fri Jul 17, 2020 18:57

Re: How to make a game that loads a prebuilt map with each created world?

by LibraSubtilis » Post

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.

User avatar
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?

by PolySaken » Post

LibraSubtilis wrote:
Sun Jan 03, 2021 20:15
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.
I want to build everything myself.

User avatar
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?

by Hume2 » Post

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.
If you lack the reality, go on a trip or find a job.

User avatar
Zughy
Member
Posts: 272
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?

by Zughy » Post

Or you could load new blocks asynchronously like Skywars do when it regenerates a map

User avatar
orwell
Member
Posts: 859
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?

by orwell » Post

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.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

User avatar
rubenwardy
Moderator
Posts: 6389
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?

by rubenwardy » Post

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

bzt
Member
Posts: 109
Joined: Tue Sep 24, 2019 14:26

Re: How to make a game that loads a prebuilt map with each created world?

by bzt » Post

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

User avatar
LibraSubtilis
Member
Posts: 31
Joined: Fri Jul 17, 2020 18:57

Re: How to make a game that loads a prebuilt map with each created world?

by LibraSubtilis » Post

PolySaken wrote:
Mon Jan 04, 2021 08:21
LibraSubtilis wrote:
Sun Jan 03, 2021 20:15
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.
I want to build everything myself.
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.

User avatar
hex
Member
Posts: 47
Joined: Sun Dec 06, 2020 04:22
IRC: hecks
In-game: hex hhhehehe

Re: How to make a game that loads a prebuilt map with each created world?

by hex » Post

Try writing to the map DB *after* all mods are loaded, and it should be fine.

User avatar
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?

by PolySaken » Post

I think I'll wait for custom main menus so I can make the 'new world' button just copy a premade file.

User avatar
hex
Member
Posts: 47
Joined: Sun Dec 06, 2020 04:22
IRC: hecks
In-game: hex hhhehehe

Re: How to make a game that loads a prebuilt map with each created world?

by hex » Post

Wasn't there a thing that worked in reverse, allowing you to bundle the game in the world folder?

User avatar
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?

by PolySaken » Post

hex wrote:
Wed Jan 06, 2021 16:45
Wasn't there a thing that worked in reverse, allowing you to bundle the game in the world folder?
there is for mods, but since worlds only show up in the correct game menu world-specific games would be impossible.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests