Difference between revisions of "Engine/Basic data structures"

From Minetest Developer Wiki
Jump to navigation Jump to search
Line 1: Line 1:
[[Category:Core]]
 
 
== IRC logs on this subject ==
 
== IRC logs on this subject ==
  
http://logs.2pktfkt.de/irc/minetest-delta/2011-11-07.html
+
http://logs.2pktfkt.de/minetest-delta/2011-11-07.html
http://logs.2pktfkt.de/irc/minetest-delta/2011-11-08.html
+
http://logs.2pktfkt.de/minetest-delta/2011-11-08.html
  
 
For the log dating 2011-11-07, the subject discussion starts at the end.
 
For the log dating 2011-11-07, the subject discussion starts at the end.
  
 
== Node ==
 
== Node ==
 +
 
A node in Minetest is the equivalent of a block in Minecraft. They are the cubes that make up the world.
 
A node in Minetest is the equivalent of a block in Minecraft. They are the cubes that make up the world.
  
Line 15: Line 15:
  
 
== Block ==
 
== Block ==
 +
 
A block (MapBlock) in Minetest, is a collection of 16x16x16 nodes (described above), and they are the pieces that together make the world/map.
 
A block (MapBlock) in Minetest, is a collection of 16x16x16 nodes (described above), and they are the pieces that together make the world/map.
  
Line 20: Line 21:
  
 
== Map ==
 
== Map ==
 +
 
The Map (class Map) stores MapBlocks and works as an abstraction layer for the MapBlocks, allowing the users of Map to see the world as a consistent bunch of MapNodes.
 
The Map (class Map) stores MapBlocks and works as an abstraction layer for the MapBlocks, allowing the users of Map to see the world as a consistent bunch of MapNodes.
  
Line 27: Line 29:
  
 
== VoxelManipulator ==
 
== VoxelManipulator ==
 +
 
The [[VoxelManipulator]] is an object that stores arbitary areas from the Map, for transferring into other threads and allowing faster node access than the Map does.
 
The [[VoxelManipulator]] is an object that stores arbitary areas from the Map, for transferring into other threads and allowing faster node access than the Map does.
 +
 +
 +
[[Category:Core]]

Revision as of 18:26, 21 September 2014

IRC logs on this subject

http://logs.2pktfkt.de/minetest-delta/2011-11-07.html http://logs.2pktfkt.de/minetest-delta/2011-11-08.html

For the log dating 2011-11-07, the subject discussion starts at the end.

Node

A node in Minetest is the equivalent of a block in Minecraft. They are the cubes that make up the world.

In code, a node (represented by the class MapNode) contains only a small amount of data that can be transferred easily between the client and the server. This data includes what type of node it is, eg. Dirt node or Sand node, and some other data for lighting and miscellaneous parameters.

Nodes don't have any interactive functionality, this is done by the client and the client knows what to do depending on what type of node it is.

Block

A block (MapBlock) in Minetest, is a collection of 16x16x16 nodes (described above), and they are the pieces that together make the world/map.

In code, the block (represented by the class MapBlock) contains one mesh (only client-side) for all 16x16x16 nodes. A mesh is the geometry of an object, in this case the block. A mesh contains a collection of materials aka. textures, which is how each node is represented visually.

Map

The Map (class Map) stores MapBlocks and works as an abstraction layer for the MapBlocks, allowing the users of Map to see the world as a consistent bunch of MapNodes.

Map also knows how to load and save MapBlocks.

It also contains functionality for lighting and liquid updates.

VoxelManipulator

The VoxelManipulator is an object that stores arbitary areas from the Map, for transferring into other threads and allowing faster node access than the Map does.