User Tools

Site Tools


tutorial:dimensionconcepts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tutorial:dimensionconcepts [2019/06/01 21:38] – created draylartutorial:dimensionconcepts [2022/12/19 05:23] (current) – basically everything on this page was wrong lmao miir
Line 1: Line 1:
 ====== Dimension Concepts ====== ====== Dimension Concepts ======
-Creating a dimension is an advanced concept that takes quite a bit of work to fully understand. A simple dimension can be created fairly easy, but as soon as you dive deeper in you'll be bombarded with tons of new classes that can be hard to grasp at timesThis tutorial acts as an overview of the main concepts you'll be using when creating dimension. Categories are titled with relevant class names.+Creating a new dimension using vanilla datapack functionality is easy! However, if your want finer control over your dimension, you'll need to implement it in codeHere'few useful concepts for this process:
  
-=== Dimension === +=== World === 
-The Dimension class is the core of your new dimension. It handles the overarching logic surrounding your dimensionCan player sleep in bed here? Does it have a world border? Can the player see the sky? It also is responsible for creating your ChunkGenerator to generate land.+The ''World'' class is the in-game representation of a world. It's what is mutated when you place or destroy blocksIt's not used during worldgen. Instead, dimension is made of few parts, as shown here:
  
 === DimensionType === === DimensionType ===
-DimensionType is the registry wrapper around your dimension. It has an ID and is what you register to add your Dimension. It's also responsible for saving and loading your dimension from a file.+''DimensionType'' handles the overarching logic surrounding your dimension. Can a player sleep in a bed here? How high does the world extend? How dark does it need to be for mobs to spawn? Can the player see the sky? It's also responsible for saving and loading your dimension from a file
 + 
 +=== Biome === 
 +A biome is a container for Features-- things like structures, trees, flower patches, ores-- and a set of monster spawn rules, as well as temperature and precipitation information. It also contains some clientside effects like the sky, water, and fog colors, particles, and ambient sounds
  
 === ChunkGenerator === === ChunkGenerator ===
-Responsible for using noise functions to place blocks in the world. It is not (or should not beresponsible for actually decorating and choosing separate blocks-- in most casesyou will only be placing stone or another base block of your choice. If we didn't have decoration or any extra steps after thisthe overworld would theoretically just be a landscape entirely made of stone and nothing else.+Responsible for placing all the naturally-generated blocks in the world, as well as biome placementIn vanilla implementations, especially ''NoiseChunkGenerator'', biome placement is outsourced to a BiomeSource, (somecave generation is outsourced to a Carver, and placement of "painted-on" blocks like grassbedrock, and deepslate is outsourced to a SurfaceRuleThese are elaborated on below, but are not strictly necessary for a dimension implementation:
  
-=== ChunkGeneratorType === +== BiomeSource == 
-Again, the registry wrapper around your ChunkGeneratorCan't be registered and requires hacks to use-- a fix is //majorly// needed for this.+A ''BiomeSource'' places the biomes over the world. Note that according to ''MultiNoiseBiomeSource''which is vanilla's implementation, where biomes are placed is independent of the terrain features at that point. ''MultiNoiseBiomeSource'' makes sure that biomes spawn where they should by, for example, making the noise values that correspond to high terrain as dictated by the ''NoiseChunkGenerator'' also correspond to mountain biomes. If you're confused, generate a world with the "Single Biome" preset and choose an ocean biome-- the world will still have mountains and valleys and rivers, but everything will be an ocean biome.
  
-=== Biome === +== Surface Rule == 
-Biome is a section of your dimension that chooses how that area looks. It is responsible for mob spawns, plants, lakes and rivers, caves, grass color, and much moreIn a proper setup, it is also responsible for replacing already generated stone with proper blocks, such as top grass/dirt and ores.+Surface rules "paint" blocks like dirt and grass onto the worldI use the word "paint" because they don't actually generate any new blocks; they just modify that which is already there. The vanilla surface rule is basically a giant chained if statement: ''if (desert) placeSand(); else if (plains) placeGrass();'' et cetera.
  
-=== BiomeSource === +== Carver == 
-When creating a dimensionyou can either choose to use a single biome everywhere or use BiomeSourceBiomeSource is used to pick randomly from several different biomes.+Carvers are responsible for generating non-noise caves, or, more accurately, "carved caves". The difference is nuanced, but as rule of thumb, all pre-Caves and Cliffs caves are carved caves, and the cave types that were added in that update are so-called "noise caves." Keep in mind that this name is a misnomer, as all caves are generated using noise.
  
-=== SurfaceBuilder === +=== World Preset === 
-A SurfaceBuilder is responsible for replacing the stone we mentioned earlier with other blocksEach biome has SurfaceBuilder attached to itAs an examplePlains & Forest both use the DEFAULT SurfaceBuilderbecause they both want grass and dirt as their top block. They are different because the biome can still choose to set trees or different height scaling-- in other words, a SurfaceBuilder is semi-reusable depending on the situation.+The World Preset is the option the player is presented when starting a new worldIt's mainly wrapper for your ChunkGeneratorAMPLIFIEDLarge Biomes, Default, and Superflat are examples of vanilla world presets.
  
tutorial/dimensionconcepts.1559425114.txt.gz · Last modified: 2019/06/01 21:38 by draylar