Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New game API for Minetest #6823

Closed
MarkuBu opened this issue Dec 23, 2017 · 7 comments
Closed

New game API for Minetest #6823

MarkuBu opened this issue Dec 23, 2017 · 7 comments
Labels
Request / Suggestion The issue makes a suggestion for something that should be done but isn't a new feature Won't add The feature request was rejected and will not be added.

Comments

@MarkuBu
Copy link
Contributor

MarkuBu commented Dec 23, 2017

I first created this issue in Minetest Game, but I changed my mind and I think this should be in Minetest core (builtin)

This topic was discussed for a long time now, but no one really wants to touch it, for example:

luanti-org/minetest_game#1771
luanti-org/minetest_game#726
luanti-org/minetest_game#515

I thought about how to solve this and I want to share my thoughts for discussion.

What is the major problem with MTG? It is mixing game functions and game content and it is sometimes difficult or impossible to remove the game content and add own things without editing MTG itself.

Just one example: the beds mod. This mod adds an API for beds, but at the same time it registers two beds. If you want different beds you have to override them. And the API is not common enough to register for example a mesh node bed.

A lot of mods make the same mistake, like 3d armor or the bonemeal mod from @tenplus1 (no offense, just an example to get the point). They mix API functions with game content.

So here is the idea: Minetest should become a game API, that defines the game mechanics and have functions to add game content, but doesn't add any type of game content itself. The API should be as common as possible and transparent to Minetest core that it will be possible to move functions to the engine for performance reason. That's why I moved this issue to Minetest.

A new game mechanic should be as common as possible and only provide an API, but should not add any content like nodes or formspecs.

A subgame only adds game content on top of this API.

This adds the dependency to Minetest itself, but this is ok because Minetest is always available and it is not necessary to deal with unwanted game content. The API could be also implemented as a mod like default, but implementing it in the core will have some advantages over a mod: it is always available and it is possible to move functions from Lua to C++ or vice versa without changing anything above the API

Even if this solution is part of Minetest, a separate repository should be created for it.

@rubenwardy
Copy link
Contributor

rubenwardy commented Dec 23, 2017

👎 I really don't see this as a problem, and it'll make the engine more bloated than it needs to be

@MarkuBu
Copy link
Contributor Author

MarkuBu commented Dec 23, 2017

So it is better to make a bloated subgame everybody blames about it's bloatness?

And why does this bloat the engine? It just moves functions where they should be

@sfan5
Copy link
Collaborator

sfan5 commented Dec 23, 2017

So you want to move registration of beds, bonemeal, armor and everything else imagineable into the engine?

@MarkuBu
Copy link
Contributor Author

MarkuBu commented Dec 23, 2017

Not everything imagineable, but a wide base to build a game.

@paramat
Copy link
Contributor

paramat commented Dec 23, 2017

Minetest should become a game API, that defines the game mechanics and have functions to add game content, but doesn't add any type of game content itself.

I guess you mean the Minetest engine will contain game APIs.

A subgame only adds game content on top of this API.

👎 The game API always has to be in the game, not the engine. Otherwise the engine would bloat with everyone's requested APIs, it would be too much variety to satisfy and would drive engine devs crazy from all the requests from game creators, we wouldn't have time to code everyone's desired APIs. The APIs would become generic and inflexible so would make games worse. Game creators would have to then depend on and wait for engine changes, which would greatly harm game creation and drive game creators crazy.

Surely what you mean is games should separate game APIs and content into different mods? That's a valid idea but is not an engine issue.

@paramat paramat closed this as completed Dec 23, 2017
@paramat paramat added Request / Suggestion The issue makes a suggestion for something that should be done but isn't a new feature Won't add The feature request was rejected and will not be added. labels Dec 23, 2017
@MarkuBu
Copy link
Contributor Author

MarkuBu commented Dec 23, 2017

and would drive engine devs crazy from all the requests from game creators

Even if this solution is part of Minetest, a separate repository should be created for it.

I never said, the core devs should maintain this. And I never said, EVERYTHING should be added to the engine.

I knew no one would understand. But that's ok, I don't care

@MarkuBu
Copy link
Contributor Author

MarkuBu commented Dec 25, 2017

The game API always has to be in the game, not the engine.

Can you please explain me, why? Maybe I misunderstand something. There are many things that are needed by any game like the player, spawning, sounds and more. Why should they be in the (sub)game?

I think, this is one of the biggest problems of Minetest. These important functions are "cemented" to Minetest Game. Game have to use the whole cement block or they need a chisel and a hammer to carve them out of the block. There is no reliable base for games.

But this base shouldn't be in the game, it has to be in the engine.

Minetest is a game engine, but in my opinion, it doesn't do it's job very well. It provides some function that are not really necessary for all games like craft recipes, things like fall damage are hard coded and common functions like player spawning and animations are not available.

What Minetest (the engine) needs is a clean API for games, that includes all functions to create a game. Maybe not necessarily beds, but it should be complete enough to write a game just by add game content like nodes, items, tools and biomes.

Then you can call it a game engine. Currently it is an incomplete collection of random functions that accidentally can run a game.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request / Suggestion The issue makes a suggestion for something that should be done but isn't a new feature Won't add The feature request was rejected and will not be added.
Projects
None yet
Development

No branches or pull requests

4 participants