User-preference based landscape generation + data collection

Post Reply
slemon
Member
Posts: 112
Joined: Sun Apr 27, 2014 03:56

User-preference based landscape generation + data collection

by slemon » Post

I think it is possible to make a landscape generator based on user preference. For example, one could track how often a particular location on the map is visited and use this to infer players preference towards that and hence generate more of the map using similar parameters. A direct collection of user response is also possible (for example, by asking them to rate the given location/building/etc...)

But to begin, we'd need to collect player data. The way this could be realized is by a bundle of a mod collecting data from single player instances and servers and a server that would collect and store the data.

I'd imagine that at the very least we would want to maintain a timely copy of the whole world database + change history + player position (and other info like look direction), so that player's view can be reconstructed. Additional metainfo can also be saved (for example if we have a direct player response collection in place on some servers or some world generators provide position-based generator parameters that can be used to generate similar landscapes).

I believe that saving rendering distance info can be a bit tricky with this approach since it depends on network and users hardware.

In addition, this data collecting server could work as a backup storage with complete world history.

The mod side can also ask users what they want to share and have a data delete feature to respect privacy.

There have been similar projects in the past: http://minerl.io/dataset/ (but I don't think this actually records player environment in format that is well suitable for world generation).

What do you think?

User avatar
Hume2
Member
Posts: 709
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2
Location: Czech Republic

Re: User-preference based landscape generation + data collec

by Hume2 » Post

Collecting the information is quite easy task. There is something way harder: Design a mapgen which accepts the changes of parameters. If you take an existing mapgen, generate some land, change parameters and generate more land, these two lands won't blend together.

Also, the parameters must be in a form so the mapgen can use them effectively. So you somehow need to transform the huge data obtained from player locations to something useful, like a short vector.

Also note that some players explore the map without settling there. So you might need to delete the blocks which aren't actually used and generate them again when the parameters change.

If you just want to obtain information where the players live, you can make a simple mod which prints the positions of each player once per while. And when the file gets too big, you just move it somewhere else.
If you lack the reality, go on a trip or find a job.

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: User-preference based landscape generation + data collec

by paramat » Post

Mapgen parameters do not vary from place to place in a world, the entire world is generated from one set of mapgen parameters. It is the randomness of the perlin noises that creates the variation of terrain.
I feel bad to write this but, your idea is based on a misunderstanding and cannot work.

User avatar
sorcerykid
Member
Posts: 1841
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: User-preference based landscape generation + data collec

by sorcerykid » Post

I'm confused O_o Is it really correct to say that perlin noise is random? I thought it was procedural? If I enter into a world with a given set of mapgen parameters and then delete the map.sqlite file and then re-enter the world, shouldn't the terrain look exactly the same? I was under the impression it was only the tree schematics, flowers, and ores that are randomly placed at least in the default game.

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: User-preference based landscape generation + data collec

by paramat » Post

Correct, it is deterministic, and almost all other aspects of mapgen are pseudorandom so also determined by world seed and repeatable. I meant 'random' in a non-technical non-strict way.

User avatar
Hume2
Member
Posts: 709
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2
Location: Czech Republic

Re: User-preference based landscape generation + data collec

by Hume2 » Post

I wouldn't say that it can't work. I agree that it can't work with any existing mapgen in Minetest. I think, there might be a way to do it but it would need a lot of hard work.
If you lack the reality, go on a trip or find a job.

slemon
Member
Posts: 112
Joined: Sun Apr 27, 2014 03:56

Re: User-preference based landscape generation + data collec

by slemon » Post

I didn't imply that existing minetest mapgen facilities should be used for this. As a simple solution, one can use a lua mapgen that would send network requests to a remote service to get the chunks generated. This would make sense if we want to use player data from other sources to generate landscape.

As an example for an actual mapgen of this type, we can simply get the probability of blocks being right next to each other for local features and to an average of other blocks in some larger area for non-local features. We then would generate the world in a Markovian way. To add user preference, we weight the resulting probability matrices to account for preference.

User avatar
Hume2
Member
Posts: 709
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2
Location: Czech Republic

Re: User-preference based landscape generation + data collec

by Hume2 » Post

If the world was one-dimensional, there would be no problem with using Markov chains. There would be always one block which was already generated and one block which is going to be generated. However, when there are more dimensions, there are more possibilities. There can be more generated blocks around the block which is going to be generated. So you can no longer use Markov chains here, at least in the common way.
If you lack the reality, go on a trip or find a job.

slemon
Member
Posts: 112
Joined: Sun Apr 27, 2014 03:56

Re: User-preference based landscape generation + data collec

by slemon » Post

I think it's a solved problem: https://weigert.vsos.ethz.ch/2019/10/30 ... buildings/

slemon
Member
Posts: 112
Joined: Sun Apr 27, 2014 03:56

Re: User-preference based landscape generation + data collec

by slemon » Post

But essentially one can generate the next node using surrounding nodes as input, and for the missing nodes, we simply contract the tensor. And if there is a collision, for example, by generating nodes in "C" path and then trying to turn it into an "O" path, one can connect the edges by choosing some N nodes between them by minimizing the function over several nodes at once.

slemon
Member
Posts: 112
Joined: Sun Apr 27, 2014 03:56

Re: User-preference based landscape generation + data collec

by slemon » Post

Or one can also generate the world in a shape of a convex polytope (i.e. like a box). Then there would be no problem with reconnecting the edges, but performance might be bad as the world becomes larger. But should be good enough for a prototype.

User avatar
Hume2
Member
Posts: 709
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2
Location: Czech Republic

Re: User-preference based landscape generation + data collec

by Hume2 » Post

slemon wrote:I think it's a solved problem: https://weigert.vsos.ethz.ch/2019/10/30 ... buildings/
So you mean it this way. Well, in this article, everything in the house may change in any iteration. The mapgen can't change the blocks which have been already generated. So you will somehow need to fix the features which are already present in the generated world.
slemon wrote:But essentially one can generate the next node using surrounding nodes as input, and for the missing nodes, we simply contract the tensor. And if there is a collision, for example, by generating nodes in "C" path and then trying to turn it into an "O" path, one can connect the edges by choosing some N nodes between them by minimizing the function over several nodes at once.
Terminology: One node is basically one of these little cubes you dig. One chunk is 16×16×16 nodes. One block is typically 5×5×5 chunks (can be changed in minetest.conf). You generate a whole block at once, not each node one by one.
If you fix the features which are already present in the world, i.e. they intersect with the generated region, you won't even need to solve this. You'll just need to remember the position of fixed features. If you don't fix them, they can move but the generated blocks won't change. And when you generate another block after such feature moves, a sharp edge will occur.
slemon wrote:Or one can also generate the world in a shape of a convex polytope (i.e. like a box). Then there would be no problem with reconnecting the edges, but performance might be bad as the world becomes larger. But should be good enough for a prototype.
It's even worse. If someone made a trip to the border of the world, he could make whole the world generate. The world size would grow by O(n³).
If you lack the reality, go on a trip or find a job.

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: User-preference based landscape generation + data collec

by paramat » Post

slemon, sorry i misunderstood. Your idea does seem possible in some form.

Exilyth
Member
Posts: 73
Joined: Sun Jul 28, 2013 18:46
Location: Earth

Re: User-preference based landscape generation + data collec

by Exilyth » Post

So, about the "generating maps from user behaviour" part: if I'm stuck in a valley with no way out (+2 height difference on all sides, no tools and only nodes made from a material which can not be dug by hand) and I go on a vacation (irl) for a month and accidentally leave the computer running while away (could happen) - would the algorithm infer that I like being stuck in valleys and start generating only valleys which are hard to get out of?

slemon
Member
Posts: 112
Joined: Sun Apr 27, 2014 03:56

Re: User-preference based landscape generation + data collec

by slemon » Post

There are two things that can be done:

1. Add an option to manually mark things as undesired
2. Automatically compare current preference to the average of preference of other users. If the difference is too large, filter out the irregular behavior.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 17 guests