[modding] Buggy/Surprising behavior of Effect MODIFY_TECH + ATTR_SET_STATE

:arrow_forward: GAME INFORMATION

  • GAME BUILD #: 11179620
  • GAME PLATFORM: Steam
  • OPERATING SYSTEM: Windows 10

:arrow_forward: ISSUE EXPERIENCED

Behavior of Effect MODIFY_TECH (8) + ATTR_SET_STATE (12) is surprising/buggy.

  • Effect: MODIFY_TECH / ATTR_SET_STATE / ATTR_RESEARCH (3)
    This Effect applies target Tech’s Effect everytime, even if Tech.Repeatable=0 and already researched.
    This Effect ignores RequiredTechs, so it had better be named ATTR_FORCE or ATTR_FORCE_RESEARCH.
  • Effect: MODIFY_TECH / ATTR_SET_STATE / ATTR_FORCE (2)
    This Effect does not make target Tech’s Effect researched. What does it do?

:arrow_forward: FREQUENCY OF ISSUE

  • 100% of the time / matches I play (ALWAYS)

:arrow_forward: REPRODUCTION STEPS

Here’s the steps to reproduce the issue:

  1. In Advance Gene Editor, add two new Techs: TechA, TechB; and two corresponding Effects
  2. TechA.ResearchTime=2, RequiredTechs=None, Repeatable=0; TechA-Effect= “anything to +/ unit attributes, e.g. Civillian armor +1”
  3. TechB-Effect= MODIFY_TECH / TechA-ID / ATTR_SET_STATE / ATTR_RESEARCH; twice
  4. Start Game, research TechB.

:arrow_forward: EXPECTED RESULT

TechA-Effect is applied once.

:arrow_forward: ACTUAL RESULT

TechA-Effect is applied twice.

Notes:

Since ATTR_RESEARCH (3) is already ignoring RequiredTechs and apply TechEffect repeatedly, this had better be kept. But rename it and add new ATTRs:
ATTR_FORCE_RESEARCH_REPEAT = 3 (ignoring RequiredTechs and apply TechEffect repeatedly)
ATTR_FORCE_RESEARCH = 5 (ignoring RequiredTechs; horor Tech.Repeatable)
ATTR_RESEARCH_WITH_DEPS = 6 (honor RequiredTechs; honor Tech.Repeatable)

It seems that ATTR_RESEARCH’s repeating behavior can be worked around by inserting another Tech as deps.