From dd4d0ddbb1b8b7f8e6ebdafee69dc06be716094a Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Fri, 14 Sep 2018 15:44:16 +0100 Subject: [PATCH] Creating Games: Add chapter --- _en/games/games.md | 93 ++++++++++++++++++++++++++++++++++ _en/quality/clean_arch.md | 2 +- _en/quality/common_mistakes.md | 2 +- _en/quality/luacheck.md | 2 +- _en/quality/readmore.md | 2 +- _en/quality/releasing.md | 2 +- _en/quality/security.md | 2 +- _en/quality/unit_testing.md | 2 +- 8 files changed, 100 insertions(+), 7 deletions(-) create mode 100644 _en/games/games.md diff --git a/_en/games/games.md b/_en/games/games.md new file mode 100644 index 0000000..fbfda49 --- /dev/null +++ b/_en/games/games.md @@ -0,0 +1,93 @@ +--- +title: Creating Games +layout: default +root: ../.. +idx: 6.1 +--- + +## Introduction + +The power of Minetest is the ability to easily create games without the need +to write your own voxel graphics and algorithms or fancy networking. + +* [What is a Game?](#what-is-a-game) +* [Game Directory](#game-directory) +* [Inter-game Compatibility](#inter-game-compatibility) + * [API Compatibility](#api-compatibility) + * [Groups and Aliases](#groups-and-aliases) +* [Your Turn](#your-turn) + +## What is a Game? + +Games are a collection of mods which work together to make a cohesive game. +A good game has a consistent underlying theme and a direction, for example +maybe it's a classic crafter miner with hard survival elements, or maybe +it's a space simulation game with a steam punk automation ascetic. + +Game design is a complex topic, and is actually a whole field of expertise. +It's beyond the scope of the book to more than briefly touch on it. + +## Game Directory + +The structure and location of a game will seem rather familiar after working +with mods. +Games are found in a game location such as `minetest/games/`. + + foo_game + ├── game.conf + ├── menu + │   ├── header.png + │   ├── background.png + │   └── icon.png + ├── minetest.conf + ├── mods + │   └── ... mods + ├── README.txt + └── settingtypes.txt + +The only thing that is required is a mods folder, but `game.conf` and `menu/icon.png` +are recommended. + +## Inter-game Compatibility + +### API Compatibility + +It's a good idea to try to keep as much API compatibility with Minetest Game as +convenient, as it'll make porting mods to another game much easier. + +API compatibility is the sum of the following things: + +* Lua API table - All documented/advertised functions in the global table which shares the same name. + For example, `mobs.register_mob`. +* Registered Nodes/Items - The presence of items. + +It's probably fine to have partial breakages as long as 90% of dependency +usecases still works. For example, not having a random utility function that was +only actually used internally is ok, but not having `mobs.register_mobs` is bad. + +The best way to keep compatibility with another game is to keep API compatibility +with any mods which have the same name. +That is, if a mod uses the same name as another mod even if third party, +then it should have a compatible API. +For example, if a game includes a mod called `doors` then it should have the +same API as `doors` in Minetest Game. + +It's difficult to maintain API compatibility with a disgusting God mega-mod like +*default* in Minetest Game, in which case the game shouldn't include a mod named +default. + +API compatibility also applies to other third-party mods and games, +so try to make sure that any new mods have a unique mod name. +To check whether a mod name has been taken, search for it on +[content.minetest.net](https://content.minetest.net/). + +### Groups and Aliases + +Groups and Aliases are both massive tools in keeping compatibility between games, +as it allows item names to be different between different games. Common nodes +like stone and wood should have groups to indicate the material. It's also a +good idea to provide aliases from default nodes to any direct replacements. + +## Your Turn + +* Make a game - It can be simple, if you like. diff --git a/_en/quality/clean_arch.md b/_en/quality/clean_arch.md index 27b3af7..9339322 100644 --- a/_en/quality/clean_arch.md +++ b/_en/quality/clean_arch.md @@ -2,7 +2,7 @@ title: Intro to Clean Architectures layout: default root: ../.. -idx: 6.3 +idx: 7.3 --- ## Introduction diff --git a/_en/quality/common_mistakes.md b/_en/quality/common_mistakes.md index 575a482..e0af8e1 100644 --- a/_en/quality/common_mistakes.md +++ b/_en/quality/common_mistakes.md @@ -2,7 +2,7 @@ title: Common Mistakes layout: default root: ../.. -idx: 6.1 +idx: 7.1 redirect_from: /en/chapters/common_mistakes.html --- diff --git a/_en/quality/luacheck.md b/_en/quality/luacheck.md index 3e9104f..a7428af 100644 --- a/_en/quality/luacheck.md +++ b/_en/quality/luacheck.md @@ -2,7 +2,7 @@ title: Automatic Error Checking layout: default root: ../.. -idx: 6.2 +idx: 7.2 description: Use LuaCheck to find errors redirect_from: /en/chapters/luacheck.html --- diff --git a/_en/quality/readmore.md b/_en/quality/readmore.md index 4350a51..94b6648 100644 --- a/_en/quality/readmore.md +++ b/_en/quality/readmore.md @@ -2,7 +2,7 @@ title: Read More layout: default root: ../.. -idx: 6.6 +idx: 7.6 redirect_from: /en/chapters/readmore.html --- diff --git a/_en/quality/releasing.md b/_en/quality/releasing.md index 73f55ad..eff99a8 100644 --- a/_en/quality/releasing.md +++ b/_en/quality/releasing.md @@ -2,7 +2,7 @@ title: Releasing a Mod layout: default root: ../.. -idx: 6.5 +idx: 7.5 redirect_from: /en/chapters/releasing.html --- diff --git a/_en/quality/security.md b/_en/quality/security.md index b12bfa8..685a0b6 100644 --- a/_en/quality/security.md +++ b/_en/quality/security.md @@ -2,7 +2,7 @@ title: Security layout: default root: ../.. -idx: 6.25 +idx: 7.25 description: Use LuaCheck to find errors redirect_from: /en/chapters/luacheck.html --- diff --git a/_en/quality/unit_testing.md b/_en/quality/unit_testing.md index 56da6d6..63d32ca 100644 --- a/_en/quality/unit_testing.md +++ b/_en/quality/unit_testing.md @@ -2,7 +2,7 @@ title: Automatic Unit Testing layout: default root: ../.. -idx: 6.4 +idx: 7.4 --- ## Introduction