Replies: 3 comments 4 replies
-
What does it mean? Could you please describe it in more detail? |
Beta Was this translation helpful? Give feedback.
-
So the configuration file(settings.json for now) could be modified by |
Beta Was this translation helpful? Give feedback.
-
For non-building period settings, I think we should also distinguish clearly what is a config and what is a API.
Affect engine initialization and are not something that can be determined at build time, and is now often hard coded in main.js. For example, environment information (SUPPORT_TEXTURE_FORMATS), resource information (paths、data version), various APP IDs.
Any setting that can be dynamically modified should exist as an API (of corresponding module). For example:
|
Beta Was this translation helpful? Give feedback.
-
Motivation
macros
andsettings
Macro
All options determined at compiling time. Considering which macros need to be provided to developers, the following dimensions need to be considered。
Functionality Control
Ideally, all optional modules need to be provided with macros to control whether they are on or off
For example. The spine module is optional, and a marco should be provided to control whether it's on or off.
or when a module(such as Physics Module) has multiple implement backend. A macro should be provided to control which backend should be used.
Performance impacted
When a part of the function code has a performance impact, we need to define a macro to control whether it is on or off。
Granularity and learning costs
When there are features that have little impact for most developers, but do make some difference for a very small percentage of developers, we retain the ability to control the macro, but in order not to increase the learning cost for most developers, the macro will not be displayed in the editor. Developers who need to control can do so by customizing the compiling configuration file.
Settings
All options can be changed in runtime or maybe take effect after restarting the game
Read/Write Configuration
The corresponding module needs to provide the settings that can be read or write by user and needs to handle the logic of changing the options.
For example.
ReadOnly Configuration
This option cannot be changed dynamically during game playing, but can be changed by passing additional parameters in the command line tool or by modifying the configuration file to take effect the next time the game is restarted.
The corresponding module only provide the readonly interface. for example.
Introduce BuildSettings Module
settings.json
for now) at Engine initialization time,and initialize all settings.Introduce UserData(or other better name?) Module
Provide a module to help developer to save some information for current game state, and can be load any time.
To do list
Beta Was this translation helpful? Give feedback.
All reactions