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

Feature flags 2nd attempt #591

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

NQNStudios
Copy link
Collaborator

Here's a 2nd attempt at the feature flags system.

  • Scenarios contain a string map of feature flags. The flag names are the keys, and flag versions are the values, so a typical value might be "fixed" for bug fixes or for evolving features, "V1", "V2", etc.
  • The game has a map of flags to lists of supported versions. The game can therefore signal that it supports a legacy behavior for a given feature flag. The last version in the list is considered to be this build version's default behavior.
  • When launching a scenario, we check to make sure the game supports the scenario's required versions of its feature flags.
  • When launching a replay, we make sure the game supports the feature flags that the version of the game that made the recording did.

@CelticMinstrel
Copy link
Member

Okay… this still feels like something is missing, though that might be inevitable since currently no feature flags exist.

With this system, can the existing "legacy" flag be replaced by one or more feature flags? We don't have to actually replace it, but it seems like a good test of whether the feature flag system does what it needs to do.

@NQNStudios
Copy link
Collaborator Author

NQNStudios commented Feb 9, 2025

There's something I still need to fix here....

@NQNStudios
Copy link
Collaborator Author

Ok I had realized I made get_feature_version() less than useful.

I have clarified its purpose: The game will call get_feature_version() to find out which version of a feature should be active. So if a scenario requests an outdated feature, the game will be able to check and find that out easily. For flags that have nothing to do with scenarios, such as bugfixes, this function returns the behavior that the replay used.

@CelticMinstrel
Copy link
Member

Did you miss my previous comment in this thread? You commented at the exact same time, so maybe it slipped through your notice…

@NQNStudios
Copy link
Collaborator Author

I saw it. Yeah, I'm planning to write up a little example -- just also working on other issues and PRs.

@NQNStudios NQNStudios marked this pull request as draft February 10, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants