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 Request: Implement the remaining countables #11621

Open
2 tasks done
PLynx01 opened this issue May 19, 2024 · 1 comment
Open
2 tasks done

Feature Request: Implement the remaining countables #11621

PLynx01 opened this issue May 19, 2024 · 1 comment
Labels

Comments

@PLynx01
Copy link
Contributor

PLynx01 commented May 19, 2024

Before creating

  • This is NOT a gameplay feature from Civ VI, BNW, or outside - see Roadmap
  • This is NOT a gameplay feature from Vanilla Civ V or from G&K - If so, it should be a comment in Missing features from Civ V - G&K #4697

Problem Description

Two months ago, I have introduced the countable comparison uniques. For now, they support only:

  • Stockpileable stats (Gold, Science, Culture, Faith)
  • Resources
  • Years
  • Numbers

I believe it's necessary to implement more countables, including these scope-bound

Related Issue Links

#11308 #11389 #11527

Desired Solution

My desired solution is to add countables with syntax like this:

[countableName] [filterCategory] [optionalfilterCategory]

Examples:
[GlobalUnits] [mapUnitFilter] - Gets the number of all units that met the filter

[CivUnits] [mapUnitFilter] [civFilter] - Gets the number of mapUnitFilter units owned by civFilter civilization. If civFilter is empty, it denotes a number of units owned by civilization which unique applies to.

[GlobalCities] [cityFilter] [buildingFilter] - Gets the number of all cities that fit the cityFilter and having a specified building

Alternative Approaches

If you have a better idea to implement this, tell me. We can discuss it.

Additional Context

No response

@SomeTroglodyte
Copy link
Collaborator

Look - Yes Definitely. But me personally, I have an unsatisfactory feeling, like there should be a well-designed framework making extension a clean and straightforward matter, and we haven't yet seen the best approach to that. So, I'm waiting for my eureka, or letting you do as you wish without much input from me, whichever moves faster. Also, that experiment with ANTLR where Gradle almost bricked my box by downloading or generating more than 30GB of chaff for that antlr-kotlin project was pretty de-motivating.

Idea behind the ANTLR experiment: Drop translatability as prerequisite, go for a formula/expression language. That would be free to express all and anything that results in a "Countable" in one Unique parameter. Scopes can be - whatever you decide as grammar. Academically generating the parser from a proven grammar file syntax - cool and assures quality.... And user display simply gets a separate source responsibility of the modder.

As I said, you're welcome to do some smaller vision, or maybe you want to see for yourself if you can get kotlin output from one of the publicly available "calculator" grammars before version 5 of ANTLR supports it officially? First steps: pip install antlr4-tools, get a calculator grammar, antlr4 -no-listener -visitor calculator.g4... gives Java.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants