yairm210 / Unciv

Open-source Android/Desktop remake of Civ V
Mozilla Public License 2.0
8.54k stars 1.58k forks source link

Feature Request: Support for Civ4-like non-permanent civics #11635

Closed PLynx01 closed 2 months ago

PLynx01 commented 6 months ago

Before creating

Problem Description

The Civ IV mod currently lacks the non-permanent civics present in the original Civ 4. Making the policy categories for non-permanent policies is a relatively easy task. It requires the cancellation of other policies from the same category after adopting one.

The biggest problem is the AI support for these mechanic.

Related Issue Links

No response

Desired Solution

I would like to add a new Policies.json attribute. The Policy Type.

The allowed values would be: "Civ5" (Default value) "Civ4" (Denotes Civ4-like non-permanent radio button policy branch) "Civ6" (Denotes the Civ6-like idea tree)

The Civ4 policies must be accompanied with upkeep costs and AI priorities.

The Civ6 idea tree must contain AI priorities for each element. The governments and policy cards can be implemented as buildings.

Alternative Approaches

Make a separate ruleset .json files for Civ4 and Civ6-like policies.

Additional Context

For mods based on classic Civilization games, which used the government systems, Civ4 system can be used.

yairm210 commented 6 months ago

This should all be done with uniques. AI priority for policies should be independent of the type of policy, and that can certainly be modified by personality

PLynx01 commented 6 months ago

This should all be done with uniques. AI priority for policies should be independent of the type of policy, and that can certainly be modified by personality

What do you exactly have on your mind? Radio Button Policies can be done this way:

Remove [Government branch] Adopt [Universal Suffrage]

What about AI priorities? Can you write some pseudocode to explain me your idea?

yairm210 commented 6 months ago

I'm saying that "policy type" doesn't help us at all, and is unnecessary, and if we want special treatment it should be behind a unique

What's really needed is AI value judgement which is independent of "what type of unique"

PLynx01 commented 6 months ago

I'm saying that "policy type" doesn't help us at all, and is unnecessary, and if we want special treatment it should be behind a unique

What's really needed is AI value judgement which is independent of "what type of unique"

The "Policy Type" attribute applies to policy branches, not individual policies.

yairm210 commented 6 months ago

So what? Policy branches also have uniques, same thing We need to think in terms of what functionality things have, not in terms of what game is this similar to Maybe Civ IV is comprised of several different things, and so is VI? Then we can mix and match elements

PLynx01 commented 6 months ago

So what? Policy branches also have uniques, same thing

So, in that case, can I mark a policy branch as exclusive (or radio button), either using attribute or unique?

That would be useful for making Civ4-like civics, or a single government selection, like in Civ 1, 2 and 3

PLynx01 commented 6 months ago

@yairm210 @SomeTroglodyte

Can I try to implement this by myself?

I need to alter Policy Manager and Next Turn automation.

SomeTroglodyte commented 6 months ago

How about this mod:

Policies.json ```json [ { "name": "Governments", "era": "Ancient era", "priorities": { "Neutral": 5, "Cultural": 0, "Diplomatic": 10, "Domination": 5, "Scientific": 5 }, "uniques": [ "Comment [Only one can be active, choosing another removes the previous one.]" ], "policies": [ { "name": "Despotism!", "uniques": [ "Remove [Feudalism!] and refund [90]% of its cost ", "Remove [Republic!] and refund [90]% of its cost ", "Remove [Democracy!] and refund [90]% of its cost ", "[+12 Gold] [in capital]" ], "row": 1, "column": 2 }, { "name": "Feudalism!", "uniques": [ "Remove [Despotism!] and refund [90]% of its cost ", "Remove [Republic!] and refund [90]% of its cost ", "Remove [Democracy!] and refund [90]% of its cost ", "[-1 Happiness]", "[+1 Production] [in all cities]" ], "row": 1, "column": 4 }, { "name": "Republic!", "uniques": [ "Remove [Despotism!] and refund [90]% of its cost ", "Remove [Feudalism!] and refund [90]% of its cost ", "Remove [Democracy!] and refund [90]% of its cost ", "[+20]% Strength decreasing with distance from the capital", ], "row": 2, "column": 2 }, { "name": "Democracy!", "uniques": [ "Remove [Despotism!] and refund [90]% of its cost ", "Remove [Feudalism!] and refund [90]% of its cost ", "Remove [Republic!] and refund [90]% of its cost ", "[+2 Happiness]", "[+1 Science] [in all cities]" ], "row": 2, "column": 4 }, { "name": "Governments Complete", "uniques": [ "Will not be displayed in Civilopedia", ] } ] }, ] ```

...what would that be missing to behave like you want? Then go step by step...

PLynx01 commented 5 months ago

@SomeTroglodyte

These are my suggestions:

  1. The policy branch should have an attribute or unique, denoting that only one policy can be active at the same time. This would eliminate the need for writing the uniques removing other policies than the adopted one.
  2. We need to provide each policy additional info about the AI priorities. That would enable AI to choose policies that reflect their values and ideology. For example, peaceful leaders will more often choose democratic governments when possible, whereas more militant ones will opt for dictatorship instead.
  3. We need to specify the policy maintenance costs, which must be taken into consideration by AI, when evaluating the policy options.
  4. It's also necessary to specify the prerequisites for adopting the policy. It can be a technology, built building, other policy or any other conditionals, including countables.

I think that's all I want to say for now.

yairm210 commented 5 months ago

3 sounds like "[-1 Gold]" unique on policy 4 sounds like "only available when" 2 sounds like a generally useful unique, "[relativeAmount] weight for AI, modified by [personality] personality" - @tuvus is the expert here

SomeTroglodyte commented 5 months ago

eliminate the need for writing the uniques removing other policies than the adopted one

Yes but as you say that's convenience and prettier, so optional and can come later.

That (actually playable) demo mod up there does show some more points, however:

So - again - go for it, small steps sticking as close as possible to the Uniques system. Once we see it works but could use prettifying/optimizing, that's later PR's.

PLynx01 commented 5 months ago

3 sounds like "[-1 Gold]" unique on policy 4 sounds like "only available when" 2 sounds like a generally useful unique, "[relativeAmount] weight for AI, modified by [personality] personality" - @tuvus is the expert here

My remarks:

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] commented 2 months ago

This issue was closed because it has been stalled for 5 days with no activity.