We have not yet decided how game-specific customization for the engine is going to work. One attempt was #16, but people found some problems with it. It is important to realize that there are some game-specific things in the engine that are more complicated than just replacing a string, such as:
One question is: Should one be able to run any Daemon game using the same Daemon binary, or should game details be baked into the engine's executable? Some people think that it is desirable to be able to use the same Daemon executable, but personally I don't see any tangible benefit from this. To share the same engine binary between installations of multiple games seems to be an obviously bad idea for many reasons (ping me if you disagree), so I am assuming that each game installation will have its own copy of daemon. Given that, game-independence has no benefit to the user or even to developers that I can see. Nevertheless, I am not opposed to loading configuration at runtime if it actually works the best from a technical point of view.
The obvious alternative that I see would be to have a configuration header file defined by each game, which is included into the engine when building it. This header would contain the definitions like #define PRODUCT_NAME "Xonotic" or const char* const bindTeams[] = {"spectators", "humans", "aliens"};. There could be a default definitions file for building daemon by itself for CI or whatever. Not a particularly pretty solution, but neither is having to write a parser for various types of constants.
Mods
It would be good idea to think about the design for mods too, since we might be able to reuse some configuration mechanisms between games and mods within a game. Some of the issues a mod system needs to address:
- Ensure that files downloaded by mods can never affect the main game.
- Decide which parts of the user's configuration (key bindings, cvars...) should have per-mod instances, versus be shared among all mods. In the case of key bindings, a mod may need its own configuration if it defines many new commands. On the other hand, if a mod uses exactly the same controls but mod-specific configuration is used (assumed to be generated on the first play by copying the base game's bindings), it would be annoying that a stale copy of the keybindings is used every time after the first time it is played.
- Be robust against mod developer cluelessness. Imagine a mod system where a mod identifies itself by simply declaring its name. And then mod "foo" is allowed to write packages in the "mods/foo" directory. But you know that some guy who wants to create a mod completely unrelated to the foo mod is going to start out by copying the foo source tree, modifying a lot, but neglecting to ever change the name of the mod. Then if the user visits servers hosting both kinds of "foo" mod, both mods are broken afterwards.
We have not yet decided how game-specific customization for the engine is going to work. One attempt was #16, but people found some problems with it. It is important to realize that there are some game-specific things in the engine that are more complicated than just replacing a string, such as:
One question is: Should one be able to run any Daemon game using the same Daemon binary, or should game details be baked into the engine's executable? Some people think that it is desirable to be able to use the same Daemon executable, but personally I don't see any tangible benefit from this. To share the same engine binary between installations of multiple games seems to be an obviously bad idea for many reasons (ping me if you disagree), so I am assuming that each game installation will have its own copy of daemon. Given that, game-independence has no benefit to the user or even to developers that I can see. Nevertheless, I am not opposed to loading configuration at runtime if it actually works the best from a technical point of view.
The obvious alternative that I see would be to have a configuration header file defined by each game, which is included into the engine when building it. This header would contain the definitions like
#define PRODUCT_NAME "Xonotic"orconst char* const bindTeams[] = {"spectators", "humans", "aliens"};. There could be a default definitions file for building daemon by itself for CI or whatever. Not a particularly pretty solution, but neither is having to write a parser for various types of constants.Mods
It would be good idea to think about the design for mods too, since we might be able to reuse some configuration mechanisms between games and mods within a game. Some of the issues a mod system needs to address: