After playing the tutorial subgame
Feedback about the Tutorial will be very much appreciated. There's also a German thread. I am especially interested what 8y has to say. This feedback will be invaluable for the quality of the tutorial.
3D point&click adventure.
Interesting idea. But it is not exactly what Minetest is built for. But I think with some trickery here and there it might be possible. But you definiately should gain more modding experience first.
The main problem with this idea would be that Minetest lacks native (!) support for static predefined worlds which are tied to a subgame, as opposed to procedurally generated worlds.
But I think the general idea seems possible, even if it breaks with a lot of Minetest's core assumptions. Hell, if the Tutorial would be a game, it is kinda like a prototype of an adventure.
If you would give more information about your general conceptual ideas of the gameplay of your planned game, I might tell you to what extent this idea is possible with Minetest.
Stenzl wrote:First, is there a tutorial on how to create own subgames? I already looked into the Minetest WIKI, but the one I found was the Minetest Modding Online Tutorial Book.
As far I know, there is no tutorial and I doubt there is a need for it.
Subgames are technically very simple:
Technically, a subgame is almost just a collection of mods which the subgame author decided they belong together to form a finished game/sandbox/whatever. What makes subgames special is that they can be launched from the main menu.
Theoretically, if you would just start with the plain Minetest without any mods, and then start to enable mods from the main menu, and then attempt to launch the world with these worlds, you have pretty much the same result as if you launched a subgame with these mods.
Subgames also have some metadata files for configuration, subgame name and the main menu imagery. A subgame is practically nothing
but mods.
And that's basically it. Mods in a subgame are no different than any other mods, which means you can theoretically collect mods from these forums and put them into the subgame.
Since the lion's share of a subgame is using mods with it, you first should definitely gain some experience with modding. Especially getting the mod dependencis right is very important. You might also want play some existing subgames, just to get a feel for what is possible. ;-)
Starting a subgame from scratch might be a bit too hard for newcomers, so I strongly suggest you first write some standalone mods to get a “feel” for the Lua API.
The file lua_api.txt contains some information about subgames in the section named “Games”.
Some hints for getting started with modding (and, to an extension, building subgames):
- Look in the forums for mods. Mods without any dependencies are an invaluable resource, since chances are high you can just blindly add them to your subgame and they work out of the box.
- http://dev.minetest.net/Mod_interoperability contains a list of mods with APIs
- The minimal possible subgame is just a directory with the file game.conf inside. Which means you can start with a literally empty subgame (no mods) and add more and more mods over time
- Some mods you might find useful: Player Model (adds a 3D model for the player. Without this you just have an ugly 2D sprite. If you included the mod “default” from Minetest Game, you don't need this). And basic_hud (starter pack of very basic default textures. For a proper game, you might want to replace or remove them later)
1) First I would like to model the world. The only way I know of is to play minetest in the creative mode. But isn't there an easier way?
I think you want to create a mostly static predefined world just like the tutorial. The sad news is, it is actually pretty hard to do so with the Minetest's core tools. At least when you want to strongly tie the world to your subgame. The tutorial uses a lot of dirty non-standard tricks to generate the world from a saved file. And the world generation code seems to be buggy, so I can't recommend it to re-use it at the moment. Maybe it is time to create a feature request to request native Minetest support for static worlds. Currently, Minetest is heavily focused on procedurally generated worlds practically no natice support for static worlds.
(Technically, Creative Mode is a very awkward thing in Minetest. Most of Creative Mode's changes actually come only from the subgame. There is only one change which comes from the engine, and that is that tools don't wear. I guess even this exception might be phased out sooner or later. Honestly, I don't like how Creative Mode works and some people have proposed ideas to change it.)
However, there is another way which definitely works, but it may not be so pretty to use:
First, force the singlenode mapgen in one of your mods. This leads to a world full of air. Then use the
WorldEdit mod to place the first block, and then either build everything by hand or continue to use the WorldEdit tools to build your awesome world. This of course assumes that your subgame is already far enough to have some nodes (blocks) registered you can place.
Then, when your world/game is finished, you
MUST backup your world. And then just share the world with the subgame and tell the players to use the subgame only with this world. Keep a copy of the original world in the initial stage (=before the game starts) at all costs, and keep it out of the worlds directory, since every time you visit it again, Minetest will immediately change the stage of the world (the world state is automatically saved all the time). Also, you should not include WorldEdit with the finished subgame (players can always install the mod themselves, if they really want to).
Sharing the subgame + world was the original approach of how I distributed the Tutorial. It worked, but it has downsides: First, it is flimsy to use. There is no easy way to “reset” the world. The user has to delete the world and obtain the original (unattended) world again. This is inconvenient since this can't be done in the main menu and the user is required to fiddle around with the file system. However, I definitely recommend for you to start off with this first approach because it is much simpler to get started with.
And maybe, just maybe, Minetest might inttroduce much better support for static worlds. Since this is a totally legit use case and would open the door for new genres.
2) Then I would like to specify and place the objects, the player will be able to interact with. How to place them (in principle similar question as in 1)?
I don't know what you mean by “object”. Dropped items? Then read answer to 3)
For other objects, you might want to look up the documentation on entities.
3) It seems that after this point, LUA is needed. Is it correct that I have to register my objects using minetest.register_craftitem but? How is this registration linked to a specific object I placed in the world?
Do you mean dropped items? Those are technically entities with the entity identifier __builtin:item. There's a function in the Lua API somewhere to spawn dropped items, but I am too lazy to look it up.
4) I understand how to specify recipes and smelting. But how can I specify the behavior of such an object when it is used? In classic adventures, when using an object without success, the protagonist is saying something, maybe giving a hint.
Already answered.
5) Is there a way to implement a "look at" function?
I don't know exactly what you mean. There are functions to set the viewing direction, something about pitch and yaw.
If you mean “look at” like “examine” like in many adventures, it is a bit tricky, but I guess it is probably possible. You probably want to overwrite the “on_rightclick” event on nodes and entities. When the player then points and rightclicks on a node or entity, the on_rightclick event is triggered which you can then use to call the examination-related functions. This is just one possible strategy I came up with ad hoc. It would be better if you gain more experience with modding yourselves so you can judge for yourselves which strategy would best fit your needs. Don't trust my word for it.
Oh, and before I forget: Obtain some modding skills, then most of your problems may solve themselves. ;-)