looping/wraparound/spherical/tiling world

For people working on the C++ code.
Post Reply
User avatar
emugod
Member
Posts: 33
Joined: Tue Aug 13, 2013 19:49

looping/wraparound/spherical/tiling world

by emugod » Post

Like a spherical world, where if you keep walking in a straight line you will eventually return to the starting point (and thus also the world is necessarily of a hard limited size). But of course not truly spherical, rather just a normal square map of limited size, that tiles with itself.

Would on-demand random generation of a tiling map even be possible? How effectively can you procedurally transition between two (and really far more) disparate blocks, to what effectiveness of looking natural? If it is possible that would probably solve the problem - just track general positioning and number of blocks generated, fake in the 'tiling' as needed (as player approaches the edges). Corners would be an additional necessary consideration.

How about the actual transition, when the player crosses one edge to another? It seems to me that you would have to do something like creating a false/falsely-positioned 'instance' of the edge chunks, and then really the whole world - but could this be a problem on very small map sizes where the original instance of the edge block is still loaded? Could it cause any internal logic problems (eg. liquids running into themselves)?
Last edited by emugod on Sat Jul 05, 2014 03:51, edited 1 time in total.

User avatar
RHR
Member
Posts: 215
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

Re: looping/spherical/tiling world

by RHR » Post

paramat already worked on a sphere mod:
viewtopic.php?f=11&t=7887

User avatar
emugod
Member
Posts: 33
Joined: Tue Aug 13, 2013 19:49

Re: looping/spherical/tiling world

by emugod » Post

RHR wrote:paramat already worked on a sphere mod:
viewtopic.php?f=11&t=7887
I've actually already spent some time browsing through all paramats posted topics, before making this one, and was hoping he might chime in here (might even send him a PM requesting his input, in a day or two). He definitely seems like probably the most knowledgeable contributor, on the topic of random terrain generation.

I've seen both that and the moon mod he's made, and while they're amazing, they're not at all what I'm talking about here.
paramat wrote:This question comes up a lot ... Minetest camera orientation and gravity are fixed (as far as i know it would be a major rewrite of the engine, perhaps someone will go on to make a new more universal space-capable game engine with 6 gravity directions).
Specifically what I'm talking about is an alternative to this, a fake on this. Because really I think the true cube-world thing he mentions there just couldn't be manageable or more importantly any fun in practice, is the biggest reason I doubt the success of 'Planets³'.

And you could still fake a spherical or cubic world mapped external view (identifiably unique as whatever planet, including signs of your modifications), with the simple tiling-map approach. if you wanted to do some kind of external interaction you could even set the map up as an unfolded cube collection of squares, with the same 'tiling' edge-alignment and player/entity 'teleportation'.

Which reminds me of another question I forgot, from the OP; what support does minetest already for a fixed horizon distance? That seems like it might be a pretty essential thing, on smaller worlds in this setup.

User avatar
rubenwardy
Moderator
Posts: 6271
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: looping/spherical/tiling world

by rubenwardy » Post

There have been threads on this.

User avatar
emugod
Member
Posts: 33
Joined: Tue Aug 13, 2013 19:49

Re: looping/spherical/tiling world

by emugod » Post

rubenwardy wrote:There have been threads on this.
I browsed through the entire engine development subforum and didn't see any, and searched the whole of the forums for relevant terms (like but not limited to the three in the thread subject). In any case, is that all you have to say on it? I'm not surprised it's been discussed before (i've seen it mentioned in other threads, like the 'infinite world size' thread), but this seems to be the first thread in the development forum.

I may have been making a pretty big assumption, in the first post, about the way mapgen works, which if wrong could completely wreck this idea (or at least my vague notions on implementation). Can you generate a random, discrete, disconnected block, based just on its coordinates? Without any intervening blocks yet generated, or considered at all? If you're using the same seed and the same generating algorithm, all the blocks already 'exist in waiting', right? Generation doesn't rely on data passed through from already generated blocks to ones in the process of being generated?

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

Re: looping/spherical/tiling world

by paramat » Post

emugod wrote:Can you generate a random, discrete, disconnected block, based just on its coordinates? Without any intervening blocks yet generated, or considered at all?
If you're using the same seed and the same generating algorithm, all the blocks already 'exist in waiting', right? Generation doesn't rely on data passed through from already generated blocks to ones in the process of being generated?
Yes, yes, correct, and correct it doesn't. This could be done in a lua mapgen, but i'm not interested in doing this. Simulating the 6 faces of a cube world is a good idea.

User avatar
emugod
Member
Posts: 33
Joined: Tue Aug 13, 2013 19:49

Re: looping/spherical/tiling world

by emugod » Post

Thanks for the answers paramat. What do you think of procedurally bridging two far distant (technically, although for play purposes in this concept actually quite close, after whatever teleportation or 'treadmilling' effect is done) and very differently composed (presumably/possibly) blocks, to produce a natural-looking result?

When I think of it it seems like a pretty insurmountable task, but in looking over your work I've seen a few examples of similar-seeming (to my amateur eye) procedures, and your talk about random terrain generation as 3D music makes me wonder just what kind of magic could be possible. Could it just be a matter of progressively averaging out the values involved, or something equally 'trivial'? I really don't comprehend mapgen well enough to know if that's an absurd question or not.

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

Re: looping/spherical/tiling world

by paramat » Post

Hm i can now see problems with this, because essentially you need the 2 opposite edges to have identical terrain, and perlin noise doesn't do that. Perhaps easier to do what kilarin suggested in the other thread, where i guess you would add an XZ offset to each layer in the stack.
Last edited by paramat on Sat Jul 05, 2014 22:32, edited 2 times in total.

User avatar
emugod
Member
Posts: 33
Joined: Tue Aug 13, 2013 19:49

Re: looping/spherical/tiling world

by emugod » Post

paramat wrote:Hm i can now see problems with this, because essentially you need the 2 opposite edges to have identical terrain, and perlin noise doesn't do that. Perhaps easier to do what kilarin suggested in the other thread, where i guess you would add an XZ offset to each layer in the stack.
you mean this post viewtopic.php?p=147125#p147125? If so I don't understand the relation. The two ideas would be very similar in the required teleportation/treadmill effect (having blocks out of their 'proper' place), but I'm looking at using it to deliberately create limited worlds, with the 'spherical' effect.

Aside: I think this would be superior to 'infinite' worlds, for a lot of reasons, for most every type of play. Especially PVP or faction wars, where it would create real resource scarcity (newly infinite resources just by walking a few more meters is always the problem with those modes), but even casual building servers. The best times I've had with old minecraft was back in alpha web applet creative mode, with absolutely tiny (by modern standard) 'worlds' (not even worlds, definitively just 'maps') - because everyone strove to make the craziest and best works, and the worlds took on the appearance of insane art galleries. Whereas with massive worlds (and even minetests hard 64k limit is effectively infinite, far beyond peoples attention span and servers average lifetime), especially with decent-looking wilderness, people have this urge to spread out and incorporate the wild/pastoral scenery into their works, build massive roadways and such. Which has some value, of course, but at the same time tends to make for huge world sizes with not much interesting in them, and for really pretty boring and repetitive projects (how many times can you walk along the same sky-high fence+plank quasi-oriental bridges?).


I really hope you could give some insight on the questions in my previous post in this thread (procedurally bridging disparate blocks).

User avatar
rubenwardy
Moderator
Posts: 6271
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: looping/wraparound/spherical/tiling world

by rubenwardy » Post

The reason you didn't find it into the engine development forum is because the forum is only for patches and existing code. Talking about featured should be in feature discussion.

The forum search doesn't work correctly, use Google or equiv.

I posted all my opinions in previous posts. I am typing this by mobile, so it'd be a pain to find the link.

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

Re: looping/wraparound/spherical/tiling world

by paramat » Post

> Perhaps easier to do what kilarin suggested in the other thread, where i guess you would add an XZ offset to each layer in the stack.

emugod, ah that sentence has a double meaning, what i mean by that is: kilarin's idea seems easier for me to acheive in a lua mapgen, because it doesn't need 'circularly continuous' noise functions. Now consider how difficult things get at the corners of the world with 2 axes of conitinuity :P

User avatar
emugod
Member
Posts: 33
Joined: Tue Aug 13, 2013 19:49

Re: looping/wraparound/spherical/tiling world

by emugod » Post

paramat wrote:> Perhaps easier to do what kilarin suggested in the other thread, where i guess you would add an XZ offset to each layer in the stack.

emugod, ah that sentence has a double meaning, what i mean by that is: kilarin's idea seems easier for me to acheive in a lua mapgen, because it doesn't need 'circularly continuous' noise functions. Now consider how difficult things get at the corners of the world with 2 axes of conitinuity :P
Oh, I hadn't ever seriously considered just generating a tiling map from "go". I did look into 2D tiling image maths and computer generation, just a bit, but the former is a all presented a bit over my head, and would require huge additions to anyway, and for the latter there's a dearth of material on the subject.

What I was hoping to get your opinion on is the idea of generating a randomized map as normal, and then faking the continuity in as the designated edges are generated, by blending between the two distant edge blocks. You seem to have done something like what I imagine being necessary in your flatten mods (to a much lesser degree of course, there you already had one fixed height and biome, and all the other blocks were in direct contact, here you'd be blending anything to anything...). I know corners would be a further special condition, requiring several times the work as any other normal block, depending on how many blocks you stretched the normal case blending over (which I just assume would be more than one, for good results).

What I was really hoping is that you might know, or come up with, some trick for very automatic value-based blending, based on your intimate knowledge of the values that go into the generation (something probably not quite as simple as progressively averaging key values referenced in generation, but something like that in being purely mathematical, and still resulting in merely a different set of data you feed the base generator, rather than a whole new generation algorithm which exhaustively analyzes and modifies what's already there). But like I said before, I don't know anywhere near enough about the generation process to know if that's just a total absurdity or what.

edit: Oh, and anyway I think you've either misunderstand what kilarin was proposing, or I've massively misunderstood what lua mapgen is capable of. Because his idea would still need significant engine-level work (the same teleportation/treadmill effect as my proposal).

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

Re: looping/wraparound/spherical/tiling world

by paramat » Post

Blending sounds like a good idea, i have a feeling it's possible in a clean mathy way, or at least wrapping in one direction only, like a tube world. If i start thinking about this i might get more interested and try a quick x-wrapping lua mapgen on a small scale, which i think would create a repeating world which would actually be interesting on a small scale (instead of travelling 32km for 'nothing to happen' heh).

User avatar
emugod
Member
Posts: 33
Joined: Tue Aug 13, 2013 19:49

Re: looping/wraparound/spherical/tiling world

by emugod » Post

paramat wrote:Blending sounds like a good idea, i have a feeling it's possible in a clean mathy way, or at least wrapping in one direction only, like a tube world.
Great! And something to remember, except for the corners it's all going to be in just one direction, either left/right(x) or top/bottom(y) edges being blended together. Then at the corners it seems like a mess, and is far more complex than the edge cases, but it's still always each corner being blended into two others (and always the same two others). At least as long as the edge blends aren't being done over multiple blocks (which may be desirable for good appearance?), in that case the corner blends would get far more complex (fanning out into each other, many blend blocks not even in direct contact with an original, non-blend block).

When I was first thinking of this spherical world as a minecraft mod, a couple years back at least, I had imagined making the alternate 'dimensions' such as the nether (and I had my own ideas for a few others) into nested interior planets, as some 'hollow earth' theories propose, accessible only by finding the rare holes in the bedrock - OR through the special dungeons you would find at these troubling corner spots (which would also serve as teasers of what the next level down would be like), massive structures extending all the way down through the bedrock. This could still be the solution, if the corners are still unmanageable.

User avatar
HeroOfTheWinds
Member
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero
Location: Hawaii

Re: looping/wraparound/spherical/tiling world

by HeroOfTheWinds » Post

If someone really wanted a quick, dirty, and easy way to make the world "wrap" around the edges, you can just artificially place a mountain range of sorts around the edge, or really just a very steep slope. Have regularly occurring tunnels at ground level then that meet at the same x/z coordinates on the opposite side of the world, and then at the very edge place "teleport" blocks that warp you to the other side.

The only drawback to this is that there is still a visible "edge" to the world, and a moment of standing in the void until the opposite side of the world generates around you. Of course, the other way to go about this is to have a geometrically generated hill pattern around the edge, with the opposite end hitting the ground at the world's edge, but put the warp blocks at the very center vertical plane of the hill thus allowing some view ahead. There's still a moment of unloaded area, but there isn't a view of the void beforehand either.
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest