Subgames

From Minetest Developer Wiki
Jump to: navigation, search

In Minetest, “subgame” is basically just a fancy term for “game”, but it does not have to be. It is intended to be a complete gameplay experience which you can run in Minetest. It is not a mod, but an independent game. Each subgame is different, sometimes even wildly different. As Minetest is a game engine, the support for subgames is one of the core features of Minetest.

This page focuses on subgame information for developers. For more general information about subgames, go to [1].

Contents

Creating subgames

Minetest subgames are in the games/ subdirectory. To create a new subgame, create a new folder in this directory which has a name without spaces (use "_" in place of a space if you want). Within this folder create two more folders and two files.

  • The mods/ folder is where the subgame's mods, the actual content, will go.
  • The menu/ folder holds some details needed by Minetest's main menu.
  • The game.conf file is used to define the subgame's name which is displayed in the Minetest main menu. Open this file with a text editor and add a single line: "name = your subgame's name here"
  • Optionally you can add a minetest.conf file which allows you to set the options Minetest will use. This file can override a number of default options.

Any other files and folders are ignored by Minetest. It is suggested that at least a readme.txt should be added to describe the subgame and give its author(s) and version.

Menu folder

The menu folder allows you to provide images that will be used on the main menu.

  • background.png, if present, will be used as a background replacing the default clouds animation. This image will be re-sized to fully fill the Minetest window.
  • header.png, if present, will show the header image, usually some stylized text, in-front of the background.
  • icon.png is a 48×48 pixels image that will be used in the game selection list to identify the game.

Mods folder

Any mods and mod packs needed by the game should be added to this folder. Make sure each mod's dependencies are met or the game will crash.

Minetest will look for texture files with specific names. If these are not found in any of the mod texture folders, an error will be raised and dummy images will be created.

  • crack_anylength.png
  • heart.png
  • player.png
  • player_back.png

Details of file and folder structures within a subgame

This example has the default subgames Minetest Game (directory name “minetest_game”) and Minimal development test (directory name “minimal”) installed and shows a possible structure of an own subgame in “my_game”:

    games/
    ├── minetest_game/
    │   ├── game.conf
    │   ├── README.txt
    │   ├── menu/
    │   │   ├── header.png
    │   │   └── icon.png
    │   └── mods/
    │       ├── some_mod
    │       ├── some_other_mod 
    │       └── …
    ├── minimal/
    │   ├── game.conf
    │   ├── menu/
    │   │   ├── background.png
    │   │   ├── icon.png
    │   │   └── …
    │   └── mods/
    │       ├── some_mod
    │       ├── some_other_mod
    │       └── …
    ├── my_game/
    │   ├── game.conf
    │   ├── minetest.conf
    │   ├── README.txt
    │   ├── LICENSE.txt
    │   ├── menu/
    │   │   ├── background.png
    │   │   ├── footer.png
    │   │   ├── header.png
    │   │   ├── icon.png
    │   │   ├── overlay.png
    │   │   └── …
    │   └── mods/
    │       ├── LICENSE.txt
    │       ├── some_mod
    │       ├── some_other_mod
    │       └── …
    └── some more subgames
Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox