Recipes to learn the realm system - ubc-minetest-classroom/minetest_classroom GitHub Wiki
- Realm: A distinct map where select players and simulations take place.
- Schematic: A pre-made realm blueprint defining area, node placement, any special functionality, and a spawn location.
- Spawn-realm: The realm in which new players start.
- Instanced realm: An instanced realm is pre-defined and instantiated new for each player or group of players.
- Temporary realm: A temporary realm gets deleted when its owner travels to another realm.
- Realm Category: A tag that can be assigned to a realm to limit the ability for players to view and/or join the realm and to describe how it is to be used.
Hello! This step-by-step "recipe" book will help you learn how to configure and use the Minetest Classroom realm system. You can use this resource in two ways. You can either start from the beginning of this page and work your way through each successive tutorial, or, if you already what you'd like to do, you can follow that section.
Commands are executed by typing and sending them into the chat box. Most commands start with a forward slash to differentiate them from regular messages.
Most commands in the realm system require the 'teacher' privilege (among others). If you do not have the required privilege for a command, it will outline which privilege you are missing. If you are playing on an online server, please ask an appropriate server administrator to help you with this. If you are playing single player, you should execute the command /grantme teacher and /grantme teleport or /grantme all
To get started, let's first look at all available commands.
To see all commands available on the server, execute the command /help.
To see all available realm sub-commands, execute the command /realm help. To see parameters for any realm sub-command, execute the command /realm help <sub-command>.
To create a new realm, you can either use the "controller for teachers", "new" command, or load realm command. We will cover all three in this section.
Find the "controller for teachers" from your inventory in your hot bar. Left click anywhere to pull up the selection menu. Press the button that says "manage classrooms". Enter your information and press "create a new classroom".
Take note of the access code in the "your classrooms" dialogue box. You will provide this to students.
To create a new realm via command, execute /realm new [name] [sizeX] [sizeY] [sizeZ]. Name and size parameters are optional.
Firstly, determine and confirm the code of the schematic you'd like to import. To list all installed schematics, execute /realm schematic list. Each schematic has a code listed on the left side of the chat print-out. For this example, we will use the schematic with code shack.
Next, execute the command /realm schematic load <code> where is the code of the schematic you'd like to import.
Sometimes it's useful to know which realms exist and their IDs. To retrieve a list of all realms, execute /realm list. The name of each realm is listed on the left, and its ID is on the right.
To teleport to a realm, you can either execute the command /realm tp <realmID> or /teleport <realmID>.
Note: Both commands require the teleport privilege. Please see the introduction section of this guide if the command says that you do not have the required privilege.
The spawn point is the location which players start when moving into a realm or after dying while in that realm. While standing in a realm, you can execute /realm setspawn to change the spawn point to where you are currently standing
NOTE: This should only be changed by/with permission from the server administrator.
To change the main hub where players start, you can execute the command /realm setspawnrealm <realmID>, where realmID is the ID of the new spawn realm.
We first need a realm that we can use. If you already have one, double-check its ID by executing /realm list. Otherwise, you can quickly create a new realm by executing /realm new <name> where is the name or the ID of your realm.
The terrain is generated by specifying a heightmap generator and heightmap decorator. The generator is the algorithm that calculates where on the grid a node (block) should be solid, air, or water. The decorator is the algorithm that determines what type of block should be at any given location, as well as where non-terrain elements like trees and ravines should exist.
To get a list of all currently installed generators and decorators, execute /realm gen list.
Once a generator and decorator have been chosen, execute /realm gen <realmID> <generator> <decorator> where is the ID of the realm, and and are both keys listed under their respective lists from /realm gen list.
For example, a simple terrain can be generated with /realm gen <realmID> v2 v2.
You can also specify the seed and sea level that is used when generating the terrain. For example, /realm gen <realmID> v2 v2 20 or /realm gen <realmID> v2 v2 20 9999 where 20 is the sea level and 9999 is the seed.
Digital twin worlds can be generated in realms using our fork of the realterrain mod. You can use real-world geospatial data to generate the realm such as a Digital Elevation Model (DEM), a Canopy Height Model (CHM), an urban map of buildings (with heights), a land cover layer, and even a symbology layer. The format of these layers are specified below and only a DEM is needed to actually create a realm with this method (CHM, urban, cover, and symbology are all optional).
File specification:
- An 8-bit RGB bitmap image with values rescaled and/or stretched between 0-255. Consequently, with this method, you can only create a realm with a maximum of 256 range in elevation values. The elevation values need not be exactly between 0-255, but the total range cannot exceed 256. For example, you could store a DEM with elevation ranging from 100 to 355 m, but the values need to be rescaled to 0-255 and stored as an 8-bit RGB bitmap. For the DEM, CHM and urban layers, the values encoded into the bitmap pixels will represent heights and elevations in Minetest, so the assumed units are meters. For the symbology layer, you are also limited to 256 unique values, but these can be any units/values that you want to symbolize (discussed later).
- Each pixel in the bitmap image will represent a single Minetest node, so the spatial resolution or cell size should be set to 1 m x 1 m if creating the bitmaps from GIS software
- All images must be the same dimension as the DEM
- All layers (DEM, CHM, urban, cover, symbology) must share the same filename
- Each layer should be stored in the correct directory (i.e.,
\dem,\chm,\urban,\cover, or\symbology) in~\Minetest_Classroom\mods\realterrain\rasters\
The standard use of the realterrain sub-command is:
/realm realterrain load <DEM key> (symbolize <colorbrewer palette name> <layer to apply symbology to: dem | chm | urban | cover>)
Where:
-
<DEM key>is the file basename of the bitmaps that you created without the bmp extension (e.g.,my_digital_twin). -
(symbolize)is an optional sub-command to apply a colorbrewer symbology onto one of the existing layers. -
<colorbrewer palette name>is the short name of the colorbrewer palette that you want to use.Minetest_Classroomcomes with thecolorbrewermod pre-installed, so you can use the/palettescommand to see a list of all available palettes that are available. You can view examples of the palettes here. -
<layer to apply symbology to>defines which of the four layers that you want to change the colour of
Unlike the randomly generated terrain discussed in the previous section, a realm is automatically created at the command execution, so you can load a digital twin from a single command. If you only want to load a digital twin using the bitmaps that you named my_digital_twin and have added to the folders specified above, then the command would be /realm realterrain load my_digital_twin. The mod will automatically use all the layers, if they are available and correctly named.
If you want to symbolize the DEM layer using the DEM elevation values, then you could simply copy the DEM into the \symbology folder and run the following command to visualize it using the Spectral colorbrewer palette:
/realm realterrain load my_digital_twin symbolize Spectral dem
The very last argument dem specifies that we want to use the values in the symbology bitmap to change the color of the nodes of the DEM.
We have forked and integrated the biomegen mod as an optional decorator that can be accessed when running the /realm gen sub-command. You can access any of the registered biomes when you generate terrain in a realm using the following command: /realm gen <realmID> <generator> biomegen <sea level> <seed> <biome>. For example, to create a rainforest biome with the v2 terrain generator in the realm ID of 2, with a sea level of 20 you might use: /realm gen 2 v2 biomegen 20 24353 rainforest, where 24353 is any random number (seed).
The command to create a new teleporter block is: /realm blocks teleporter <count> (<instanced: true | false> | <realmID>) <temporary: true | false> <realmName> <schematic>. The new block will be added to your inventory and can then be placed wherever you'd like.
Note A useful feature of the teleporter block is that it can be configured to create a new realm if it doesn't exist.
If the realm name is set to spawn when creating a teleporter, it will always link to the most current spawn realm regardless of whether it gets changed. This means that we can create a new teleporter to spawn by executing the following command: /realm blocks teleporter 1 false false spawn.
Creating a teleporter block linked with temporary, instanced copies of a schematic (E.g., tutorials).
It can be useful to reset tutorials after a player completes them. Likewise, tutorials often require the realm to be in the same initial state each time that it is started.
To meet these two requirements, instanced and temporary modifiers were created for realms. They can be applied to realms that the teleporter creates under the instanced and temporary parameters.
Let's first determine which schematic we will link to the teleporter. Execute the /realm schematic list command to get a list of registered schematics. For this recipe, I have chosen to use the punchablockschematic key as it defines custom tutorial behaviour.
Next, we will create the teleporter block. Execute /realm blocks teleporter 1 true true tutorial punchablockschematic.
Let's break down what we just executed:
- The 1 specifies the number of blocks that should be added to your inventory.
- The first true specifies that the resulting realm should be instanced -- meaning that the teleporter should create a new copy of this schematic for each player.
- The second true specifies that the resulting realm should be temporary -- meaning that the realm should delete itself after the player moves to a new realm.
- The "tutorial" value is the name of the new realm. It can be anything you'd like other than "spawn". See the section "Creating a teleporter block linked with spawn" for more info.
- The "punchablockschematic" value is the schematic that you'd like the teleporter to instantiate in the new realm.
It can be useful to tag realms based on their common use. Because of this, the concept of realm categories has been introduced. Each realm can be assigned a category which impacts its visibility, joinability, and soon behaviour. Usually, this process is automatic if the realm is created through another tool, but there are some cases where it can be useful to assign categories manually.
To start, let's list all valid categories by executing /realm categories list.
Now let's set the category of the realm. To do this, execute the command /realm category set <realmID> <category> where is the ID of the realm you'd like to categorize, and is the category you'd like to use.
For example, to set the realm with ID 1 to have no category, execute /realm category set 1 default.
The actions that players can make are based on a system called privilege. For example, players can only fly if they have the 'fly' privilege, sprint if they have the 'fast' privilege, or perform administrative tasks if they have the 'teacher' privilege.
Privileges can be attached to realms. These are called realm privileges. When a player moves into a realm, they will be granted any realm privileges assigned to a realm, if they don't already have it, for the duration that they are in that realm.
To attach a privilege to a realm, we can execute the command /realm privs grant <realmID> <Priv>; To remove a privilege to a realm, we can execute the command /realm privs revoke <realmID> <Priv>. For both commands, is the ID of the realm that you want to add the privilege and is the privilege.
To see all the privileges that have been added to a realm, we can execute /realm privs list <realmID>.
Note: As a security precaution, you are only able to assign privileges to a realm that you hold. Likewise, not all privileges are available to be added as a realm privilege. If you are trying to add a privilege that is not on the whitelist, but should be on the whitelist, please speak to a server administrator to have it added to the realmPrivilegeWhitelist.conf file in the world folder.