Is there are thread that explains the Chunks blocks. I am looking to get a concept and definition of the physical space of an area.
Chunks Blocks Positional Space Explanation
-
- English
- angriff
- Thread is marked as Resolved.
-
-
well the world is comprised of chunks and each chunk is comprised of blocks. The size of a chunk is: 20 x 68 x 20 (X x Y x Z)
What exactly do you need as more information?
-
I was looking at an area db and did not understand how it was storing area information. The information was in chunks and blocks.. was trying to understand the concept of size in this information.
-
ooooh no then it is something completely different. The area protection database is storing areas based on the start and end point by using these four methods:
- Vector3i getStartBlockPosition()
- Vector3i getStartChunkPosition()
- Vector3i getEndBlockPosition()
- Vector3i getEndChunkPosition()
Each of the Vector3i objects consist of 3 int values the X, Y, and Z positions. The database is storing these 12 values in total to be able to recreate the areas once the server restarts.
Edit: These methods are under the Area class: net.risingworld.api.utils.Area
-
Well that is what is confusing. If positional coordinates are found int large numbers like 4658.49166.81 -1664.58. How does an area stored in small numbers relate If a size of a chunk is 20 x 20 blocks and 68 blocks high. Is this position 232 chunks away from the origin?
-
Would be nice to have a visual.. but it appears that chunks are big blocks. Each chunk is broken into an array of blocks. So if something starts in Chunk x and block 1 and ends in chunk x+1 and block 1 it is 20 (mas o minus)blocks in that direction. Correct?
So how are chunks numbered in blocks top to bottom or left to right.
-
If positional coordinates are found int large numbers like 4658.49166.81 -1664.58. How does an area stored in small numbers relate If a size of a chunk is 20 x 20 blocks and 68 blocks high. Is this position 232 chunks away from the origin?
My bad the chunk is 16x64x16 not 20x68x20 so this position is approximately 291 chunks away from the origin.
ok let me try to clarify this further. The game has 2 coordinate systems, the global one and the chunk one.
The Global coordinate system is using float values. The values in it are the number of blocks you are away from the origin (0,0) including decimals for when you are between block positions.
The Chunk coordinate system is using int values. The values are the block position within the chunk and the chunk position within the world. e.g. in chunk 1 walking straight in the x-direction I can go from a block position of 0 to 15 at which point I will cross into chunk 2 and start walking again from the chunk 2's 0th to 15th block.
@red51 I just noticed something in the Javadoc, in the Chunk information net.risingworld.api.utils.Chunk it says a chunk is 16x64x16 while in the same page under the blockData() and terrainData() methods it says they are 20x68x20 why the difference by 4 in each value?
-
So how are chunks numbered in blocks top to bottom or left to right.
always bottom to top left to right
-
ok I have it now. Thanks
-
@red51 I just noticed something in the Javadoc, in the Chunk information net.risingworld.api.utils.Chunk it says a chunk is 16x64x16 while in the same page under the blockData() and terrainData() methods it says they are 20x68x20 why the difference by 4 in each value?
Basically a chunk is 16x64x16 (XYZ), however, every chunk contains information about the adjacent blocks of the neighbour chunks, that's why the actual array has a size of 20x68x20. The functions getTerrainID() and getBlockID() treats the data as a 16x64x16 array, so you don't have to care about these "neighbour" blocks (but when working with the raw data, you have to keep these neighbour blocks in mind)
Participate now!
Don’t have an account yet? Create a new account now and be part of our community!