-
Notifications
You must be signed in to change notification settings - Fork 6
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
Proposed RFC Feature Quality/Scalability Framework #57
Comments
Much needed feature finally getting added to O3de :) It will allow the content to be scaled based on device requirements which is critical. Also, I am against going back to LY system as an alternative as it was not as scalable and had other issues around the order in which the cfg files got loaded in memory. The design shown above looks good. My only comment is around debugibility for cvar values. Basically how do we track why a cvar has a value that it has. This will become critical when we want to figure out why a specific rendering feature is enabled or disabled on a specific device when it shouldnt be. Possible suggestion - Maybe we have a debug menu that shows the regex or Lua expression that was passed to assign a device a specific quality setting and then we could provide the name of the setting registry file that was used to pick up the actual value. |
IIRC, there was an initiative to being able to visually trace, with a UI, the values of all the keys in the registry. Maybe @lumberyard-employee-dm would know what's the status on that. |
Regarding this open question:
I think builders would get the ability for "free". Meaning, Asset Builders can also read the content of the settings registry and read the quality/scalability values. |
This is a much more complex problem and has significant repercussions. Remember we only have one asset folder per platform and not a folder per platform and per quality setting tier. So if we want to for example build the same asset with different compressions we will need to modify our asset building code to provide support for that at asset processing time, asset packaging time as well as as asset loading time when running the app. My recommendation is to not consider different tiers of assets at this time but keep it in mind for future. Building a general system would be harder to do but the best way forward. If that becomes too large of an effort you could revisit this problem per asset type and implement a custom solution (which is not ideal). |
We have the backend in place to traces the origin of all loades are coming from with the Settings Registry origin tracker. There is also a still functioning prototype of the SettingsRegistry Editor that is available in the DPE Debug View Stadnalone application: o3de/o3de#11404 But no work has been done to integrate the Settings Registry Editor with the Editor and properly Gemify it. |
There is also the possibility of user-defined asset processor platforms like |
Because the design uses CVars we should be able to always see the values of the group quality level and the actual cvars from the console, and for debugging device rules having additional console commands like
|
Since the levels can be mapped to enumerations in C++ code, I think it is better to avoid having spaces in the level. {
"O3DE": {
"Quality": {
"q_graphics": { // General Graphics settings that uses shadow and visibility quality group settings
"Levels": [ "Low", "Medium", "High", "Very high" ], Also for the DeviceAttribute inteface instead of exposing an I also recommend removing the struct IDeviceAttributeInterface
{
// get the name of the device attribute e.g. gpuMemory, gpuVendor, customAttribute42
virtual AZStd::string_view GetDeviceAttribute() const { return m_deviceAttribute; }
// get a description about this device attribute, used for help text and eventual UI
virtual AZStd::string_view GetDescription() const = 0;
// evaluate a rule and return true if there is a match for this device attribute
virtual bool Evaluate(AZStd::string_view rule) const = 0;
// get the value of this attribute
virtual AZStd::string GetValue() const = 0;
}; For how Lua is being used, I don't like the syntax for it. Looking at the example, I think it is easy for a user familiar with bash, powershell, perl or php to get confused. Therefore the example above becomes |
That's probably best, initially I was thinking it'd be great for users to be able to directly use the text version in their UI if desired, but in most games you'll need to translate to the correct language so it might as well be a single word.
Agreed! I came to the same conclusion when prototyping this.
I'd be OK with that. And another option we discussed would be to use an Object format like: {
"Lua example":{
"apiVersion":{
"Lua":"value > 1.0 and value < 2.5"
}
}
} or {
"LUA example":{
"apiVersion":{
"type":"Lua"
"rule":"value > 1.0 and value < 2.5"
}
}
} |
As a representative of @o3de/sig-core we are signing off on this RFC for implementing the proposed framework for configuring quality levels and scalability logic into O3DE. There are some logistical information I would like added in the RFC, such as the flavor of Regex supported(Basic, Extended, ECMAScript). It most likely is ECMAScript since that is default value for AZStd::regex. It could also be mentioned if level of character escaping that is needed for device rules since they will be written in JSON. Finally you may want to have a mention that all strings that don't trigger Lua execution are treated as Regular Expressions and never plain text. This is so that users know that if don't want to match a dollar sign, it would need to be escaped. |
Summary:
A quality/scalability framework should be created that gives developers the ability to apply settings based on the platform and device their application is running on.
What is the relevance of this feature?
Developers do not have a framework for specifying and automatically selecting settings presets based on hardware, capabilities and user preferences. The legacy system which used
CVarGroups
has been removed and is no longer supported.Developers typically use this kind of feature to specify
Low
/Medium
/High
/VeryHigh
quality settings for target platforms so a game or simulation will perform as intended with the expected quality.Feature design description:
A quality/scalability framework that satisfies the requirements can be built using CVARs and the Settings Registry.
r_shadows
q_graphics
could control all the graphics quality settings.Developers will be able to use the initial framework without any graphical tools or Editor menus, but those tools will be part of a future RFC.
Technical design description:
The technical design is mainly comprised of settings groups and levels, device attributes and device settings rules.
Settings groups and levels
Settings groups cvars can be defined (e.g.
q_general
,q_graphics
,q_physics
orGraphicsQuality
,GeneralQuality
etc.) and within each group, quality levels are defined (e.g.Low
,Medium
,High
).NOTE: the
r_
prefix denotes rendering/graphics CVARs and theq_
prefix denotes CVARs or CVAR groups that control quality. These largely follow a pre-existing set of prefixes listed here: https://github.com/o3de/o3de/blob/development/Code/Legacy/CrySystem/ConsoleHelpGen.cpp#L672Settings groups and quality levels are defined in .setreg files at the key
/O3DE/Quality/Groups/\<group\>/Levels
File:
O3DE/Registry/quality.setreg
Gems like Atom would define new settings groups and levels as needed.
File:
O3DE/Gems/Atom/Registry/quality.setreg
Settings
Each setting is a CVAR (e.g.
r_shadows
,p_gravity
etc.) and can be put in a group which denotes a cvar (e.g.q_graphics
,q_physics
,q_general
) within a .setreg file at the address/O3DE/Quality/Groups/<group>/Settings
CVARs can be configured with flags based on the game needs to restrict who can change their settings and when.
File:
O3DE/Gems/Atom/Registry/quality.setreg
These registry files would exist in the Gems that provide the cvars, but can be overridden in the active project.
Settings can be overridden for specific platforms (e.g. iOS, Android, Linux etc) by placing the overrides in .setreg files in the appropriate PAL folder.
File:
O3DE/Gems/Atom/Registry/Platform/Android/quality.setreg
Device attribute API
A
DeviceAttributeRegistrar
exists in AzFramework for registering device attributes and device attribute interfaces will be registered formodel
andRAM
.Device attribute names must be unique and are case-insensitive.
Initial device attributes will be created for:
Device-specific settings
Rules can be specified in Settings Registry files to set CVARs based on device attributes like the model, amount of RAM etc.
Rules are ECMAScript regular expressions or short LUA script that evaluates to true or false.
If a device matches multiple rules, the system will use the
/O3DE/DeviceRulesResolution
setting to determine how apply the rules. Possible values are:A
sys_print_device_rules
console command will output all matching rules and their settings to the console to help developers debug device rules.Warnings will be displayed in the console logs when a device matches multiple rules.
Custom rules can be written in LUA so developers can write rules that are difficult or impossible with regular expressions. LUA rules are enclosed within a dollar sign and open and closed parenthesis '$()'
Example:
"apiVersion":"$((value > 1.2 and value < 2.4 ) and value != 1.5)"
Alternately, a more verbose option is to use an object format like:
File:
Registry/devices.setreg
What are the advantages of the feature?
What are the disadvantages of the feature?
How will this be implemented or integrated into the O3DE environment?
The bulk of the implementation is explained in the technical description section. Developers with existing projects will need to copy and customize device rules and quality settings registry files from the default template into their own project and customize them.
Are there any alternatives to this feature?
How will users learn this feature?
Documentation will be available on the main website and in comments inside the Settings Registry files.
Are there any open questions?
The text was updated successfully, but these errors were encountered: