Page 1 of 2

fixed size world

PostPosted: Tue Mar 17, 2015 14:49
by minetestcr
Hello!
I've been browsing the forum but cannot find a way to make a world with specific limited dimensions. For example, make a world tha is only a 1000 nodes in each direction. I am supposing that a limited world will consume less memory and run better!!! I also want to create a world in wich my students don't get so distracted. Thanks!

Re: fixed size world

PostPosted: Tue Mar 17, 2015 16:11
by 12Me21
you could make a wall of cloud or something, if there isn't any better way (IDK though)

Re: fixed size world

PostPosted: Tue Mar 17, 2015 16:13
by Calinou
Try using the Map Tools mod. You can place unbreakable nodes.

To create large walls quickly, use WorldEdit.

Re: fixed size world

PostPosted: Tue Mar 17, 2015 16:29
by Don
You could use world edge and set the edges to the size you want.viewtopic.php?f=9&t=10753

Re: fixed size world

PostPosted: Tue Mar 17, 2015 19:02
by minetestcr
Ok. Thanks for all the answers, I'm gonna try and see wich one works better for this case.

Wuzzy helped me understand my own question, all the worlds have the same size, what I need is to use singlenode mapgen, and then generate a limited square of land, the rest of the world would be air.

Re: fixed size world

PostPosted: Thu Mar 19, 2015 04:49
by Sokomine
minetestcr wrote:Wuzzy helped me understand my own question, all the worlds have the same size, what I need is to use singlenode mapgen, and then generate a limited square of land, the rest of the world would be air.

That's right. I once started a mod that'd build the world based on 100x100 nodes big "platforms". I never got around to sort out some issues that would be needed for realeasing it, but it does work in general. You can choose how you want the next 100x100 area to be. The bottom of each area is indestructable cloud. There are, however, no borders, and anyone can expand.

Multiple platforms of diffrent type. Note that mapgen has not been disabled (which would have been better):
Image

Some pre-defined platform types. They're all based on one common schematic:
Image

Side view of one unchanged platform. The materials get replaced by whatever is suitable for the type you choosed.
Image

The mod so far just has the most basic features and no polish at all. If you choose the ocean type, water will start flowing out of it until you add more solid platforms at the sides. There's no border. And the build chests need to be digged in order to update their formspecs. Plus it might get a bit difficult to get the first chest placed. I can put it on Github if someone's intrested.

Re: fixed size world

PostPosted: Thu Mar 19, 2015 08:21
by Amaz
That looks very interesting Sokomine! If you would be able to put it on github, that would be great.

Re: fixed size world

PostPosted: Thu Mar 19, 2015 10:24
by TenPlus1
Here is a simple and quick solution to your problem, create a mod and add the following code. It will hard-limit any player from crossing over a set boundary and return them to spawn area...

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local timer = 0
minetest.register_globalstep(function(dtime)
   timer = timer + dtime
   
   -- every 2 seconds
   if timer < 2 then return end
   timer = 0
   
   for _,player in ipairs(minetest.get_connected_players()) do

   -- where am I?
   local pos = player:getpos()

   -- map limits (5000 blocks either way and 500 up/down)

   if pos.x < -5000 or pos.x > 5000
   or pos.y < -500 or pos.y > 500
   or pos.z < -5000 or pos.z > 5000 then
      local statspawn = (minetest.setting_get_pos("static_spawnpoint") or {x = 0, y = 2, z = 0})
      player:setpos(statspawn)
      minetest.chat_send_player(player:get_player_name(), "You Passed the map limits, returning to Spawn")
   end

   end
end)

Re: fixed size world

PostPosted: Thu Mar 19, 2015 13:34
by minetestcr
Thank you Sokomine and TenPlus1!

Sokomine, please post your mod, I would like to try it, thanks.

TenPlus1, interesting solution, I think it may help with another project of mine.

Re: fixed size world

PostPosted: Fri Mar 20, 2015 11:51
by Sokomine
I've added some walls around the skyplatforms so that you won't fall down (at least not as long as you don't deliberately climb up the wall and jump out). The mod is called skyplatform.

Re: fixed size world

PostPosted: Mon Mar 23, 2015 14:16
by minetestcr
thanks!!! I'll try it now...

Re: fixed size world

PostPosted: Mon Apr 13, 2015 23:26
by wcwyes
I noticed that the world is fixed to -30912 to 30927, but you can teleport anywhere from -214748 to 214748. is there a way to utilize this extra space via realms or something else?

Re: fixed size world

PostPosted: Tue Apr 14, 2015 05:56
by Krock
wcwyes wrote:I noticed that the world is fixed to -30912 to 30927, but you can teleport anywhere from -214748 to 214748. is there a way to utilize this extra space via realms or something else?

All worlds are limited to that size, the type s16 (16-bit signed integer) used in the database does not allow bigger dimensions.

Re: fixed size world

PostPosted: Tue Apr 14, 2015 07:15
by wcwyes
Krock wrote:
wcwyes wrote:I noticed that the world is fixed to -30912 to 30927, but you can teleport anywhere from -214748 to 214748. is there a way to utilize this extra space via realms or something else?

All worlds are limited to that size, the type s16 (16-bit signed integer) used in the database does not allow bigger dimensions.

What I don't get is why is the area there? Why is the area usable in some respects but not others?
The actual buildable(and able to be travelewithout noclip) area is (30,912+30,927+1)^3=236,487,637,504,000 While the area you can place non-coision entities(and they will stay) is (32,767*2+1)^3=281,462,092,005,375 or where the map will remove them (32,784*2+1)^3=281,900,392,615,009. You can teleport within the area of (214,748*2+1)^3=79,228,312,154,346,473.
You can travel over 250,000 at least in 3 directions. Why different restrictions for different amounts of space? The program removes/allows entities after the area, programmatically it already shows a larger dimension.

Re: fixed size world

PostPosted: Tue Apr 14, 2015 07:19
by wcwyes
I'm mainly hoping to use the area for Pocket realms, which already proves slightly promising, but not very with the program removing things shortly after

Re: fixed size world

PostPosted: Tue Apr 14, 2015 07:39
by rubenwardy
The player position is stored using floating point numbers. It's like scientific notation: 1.12345 * 10^3. Floats can handle larger ranges, but when the number is too big then errors begin to occur due to precision. For example, it might be able to store 5 decimal places like 1.12345 * 10^3. If 0.00001 starts to represent a large unit, for example a metre, because of the 10^x scale, you will notice juttering (it can only be precise to a metre then).

Blocks are stored using integers. You don't get these errors with them, but you're limited to a range depending on how big the int is.

Re: fixed size world

PostPosted: Wed Apr 15, 2015 05:17
by wcwyes
rubenwardy wrote:The player position is stored using floating point numbers. It's like scientific notation: 1.12345 * 10^3. Floats can handle larger ranges, but when the number is too big then errors begin to occur due to precision. For example, it might be able to store 5 decimal places like 1.12345 * 10^3. If 0.00001 starts to represent a large unit, for example a metre, because of the 10^x scale, you will notice juttering (it can only be precise to a metre then).

Blocks are stored using integers. You don't get these errors with them, but you're limited to a range depending on how big the int is.

I think I already proved that to be untrue with my statement about entities(I wasn't talking about players either, hence my statement about teleporting and traveling) which brings me back to the why different restrictions for different funtions? Maybe you a point on the traveling, so why the strange restriction level on teleporting?
Updatate: The traveling(with noclip) restrictions are 617,721 in all directions with no juttering either, just an invisible wall on all sides which is (617,721*2+1)^3=1,885,680,626,214,483,307

Re: fixed size world

PostPosted: Wed Apr 15, 2015 07:50
by rubenwardy
Players are entities. And I was talking about being able to teleport outside of the map range.

The maximum possible limits of the map are 2^16 / 2 = 32,768 due to chunks using 16 bit positions per axis (it's slightly more complicated than that, because they use serials rather than x, y, z). The map stops generating, however, at 31,000ish (it's a multiple of 16, iirc) to stop bugs, or something like that, so all the blocks from 31,000 to 32,768 are invisible ignore nodes.
As for teleporting, it's probably not checked. By jittering I mean shaking whilst moving, and you won't be able to tell if there's no blocks. Player positions are stored using floats, but there will be something else that limits the range to 617,721. 600,000 probably isn't far enough for jittering to happen, you'd need at least 1,000,000 at a guess.

Re: fixed size world

PostPosted: Wed Apr 15, 2015 19:39
by wcwyes
rubenwardy wrote:Players are entities. And I was talking about being able to teleport outside of the map range.

The maximum possible limits of the map are 2^16 / 2 = 32,768 due to chunks using 16 bit positions per axis (it's slightly more complicated than that, because they use serials rather than x, y, z). The map stops generating, however, at 31,000ish (it's a multiple of 16, iirc) to stop bugs, or something like that, so all the blocks from 31,000 to 32,768 are invisible ignore nodes.
As for teleporting, it's probably not checked. By jittering I mean shaking whilst moving, and you won't be able to tell if there's no blocks. Player positions are stored using floats, but there will be something else that limits the range to 617,721. 600,000 probably isn't far enough for jittering to happen, you'd need at least 1,000,000 at a guess.

It still stands why the the different limits? It does me no good to have a telephone limit of 214,748 if I can walk 617,721. It does me no good for the map to remove all entities except player after 32,767 if it won't let me even place them past 32,784. It does no good allow me to place entities at all past 30,927 if I can't place nodes. It's literally redundant programming that could be summed up with a single number.
As for jittering I can tell if I keep my eyes on the sun/moon(on slow servers I've experienced jittering and the sky moves).There's an invisible wall at 617,721.

Re: fixed size world

PostPosted: Wed Apr 15, 2015 19:58
by rubenwardy
It's due to there being different technical limits, the 31000 stops this being an issue. The teleport command not validating input is an issue in terms of a user interface - it shouldn't be possible to teleport outside of the map. The sun and moon don't move except across the sky, they're relative to the player, so they won't be effected by jittering Also, I said movement jittering not rotation. Rotation is unaffected. When i say jittering, I don't mean low fps.

And it's not redundant at all, the only programmed limit is the map gen at 31000 the rest are a result of technical details. As for what exactly the technical details relating to player position are, it'll have to be researched.

Re: fixed size world

PostPosted: Thu Apr 16, 2015 05:30
by wcwyes
rubenwardy wrote:It's due to there being different technical limits, the 31000 stops this being an issue. The teleport command not validating input is an issue in terms of a user interface - it shouldn't be possible to teleport outside of the map. The sun and moon don't move except across the sky, they're relative to the player, so they won't be effected by jittering Also, I said movement jittering not rotation. Rotation is unaffected. When i say jittering, I don't mean low fps.

And it's not redundant at all, the only programmed limit is the map gen at 31000 the rest are a result of technical details. As for what exactly the technical details relating to player position are, it'll have to be researched.

Any limit that's not the result of a program failure is programmed that way, and you do have a point on the jittering except for the fact you said 617,721 wouldn't cause jittering anyways since I hit a wall(that would have been programmed also).
each limit would have to be programmed separately unless there was a central reference. There should be a central reference, instead of making several separate references to different limits(that's what I mean by redundant).

Re: fixed size world

PostPosted: Thu Apr 16, 2015 05:52
by rubenwardy
The technical limits are caused by, for example, how big the number they use is, compared to "stop the map at this point".
The different limits are made into one by the map gen stopping at 31,000.

Re: fixed size world

PostPosted: Thu Apr 16, 2015 08:45
by prestidigitator
wcwyes wrote:Any limit that's not the result of a program failure is programmed that way....

You make it sound like the entire game was developed very consciously, with a single set of completely consistent intentions, by a single neigh-omniscient programmer. Hell, even relatively small projects by a single developer don't always work that way, let alone open-source projects with multiple developers. Welcome to the world of software.

This is almost certainly a bug. You can debate all day over whether it should be made a feature somehow, and how much effort it would take to make it work. But there's not much point in arguing over whether it was done this way for some nefarious and elusive reason to allow some kind of interesting functionality that none of us know about.

Re: fixed size world

PostPosted: Thu Apr 16, 2015 20:45
by paramat
There are probably good reasons for different limits we are not aware of, or if not, that's just the way MT chaotically evolved and it's too much of a rewrite to alter it. This is all just something to be accepted.

Re: fixed size world

PostPosted: Thu Apr 16, 2015 20:57
by Don
paramat wrote:There are probably good reasons for different limits we are not aware of, or if not, that's just the way MT chaotically evolved and it's too much of a rewrite to alter it. This is all just something to be accepted.

I agree. I have been playing minetest for a couple years now and never was bothered by it.

Re: fixed size world

PostPosted: Fri Apr 17, 2015 03:20
by wcwyes
prestidigitator wrote:
wcwyes wrote:Any limit that's not the result of a program failure is programmed that way....

You make it sound like the entire game was developed very consciously, with a single set of completely consistent intentions, by a single neigh-omniscient programmer. Hell, even relatively small projects by a single developer don't always work that way, let alone open-source projects with multiple developers. Welcome to the world of software.

This is almost certainly a bug. You can debate all day over whether it should be made a feature somehow, and how much effort it would take to make it work. But there's not much point in arguing over whether it was done this way for some nefarious and elusive reason to allow some kind of interesting functionality that none of us know about.

I'm not saying reasons why it was programmed this way only that it was.
I'm not saying that it should be a feature, but more that the limits should be unified.
For my projects it would be nice to see this added as a feature, but if it can't be done I'd like to see the limits unified down to the world limits seems they are the smallest limits.

Re: fixed size world

PostPosted: Fri Apr 17, 2015 07:22
by prestidigitator
wcwyes wrote:For my projects it would be nice to see this added as a feature, but if it can't be done I'd like to see the limits unified down to the world limits seems they are the smallest limits.

Fair enough. That does seem like the most likely resolution, given that the fixed-type storage of node positions is most likely sprinkled all throughout the engine code and the database. I suggest filing a bug report using GitHub.

Re: fixed size world

PostPosted: Thu May 14, 2015 00:13
by hjvl
What about creating 6 glass walls (worldedit) and protect them with areas protection?
Like a hollow cube.

I mean, what are the down sides of doing this?

Re: fixed size world

PostPosted: Thu May 14, 2015 07:41
by rubenwardy
Glass walls break easily, so on laggy servers you'd be able to break free before the server notices. Would be better to add an immortal node.

Re: fixed size world

PostPosted: Thu May 14, 2015 13:43
by twoelk
rubenwardy wrote:Glass walls break easily, so on laggy servers you'd be able to break free before the server notices. Would be better to add an immortal node.


clouds?