Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#3208 closed enhancement (fixed)

[PATCH] Letting technologies replace other technologies

Reported by: sanderd17 Owned by: sanderd17
Priority: Should Have Milestone: Alpha 19
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

Sometimes, different civs want to have different techs that unlock the same things.

Think about a civ in a mod wanting to have an alternative town phase.

For that, it would be handy if a tech can "provide" a different tech. So unlock the same things. F.e., if a tech has the following line

{
  "replaces": ["phase_town_generic"]
}

then everything that depends on the "phase_town_generic" tech will be unlocked. This includes units, buildings and other techs. But the effects defined in the "phase_town_generic" won't be applied.

Attachments (4)

TechnologyReplace.patch (751 bytes ) - added by Niek 9 years ago.
Patch that allows technologies to mark other technologies as 'researched' using the example json block
TechnologyReplaceWithTechnologies.patch (8.8 KB ) - added by Niek 9 years ago.
Now with modified technologies
structreeFix.patch (1.5 KB ) - added by s0600204 9 years ago.
The proposed change breaks the structree. This patch addresses that particular problem.
TechnologyReplaceWithTechnologiesAIAndCheats.patch (10.2 KB ) - added by Niek 9 years ago.
Includes the AI and cheat fixes

Download all attachments as: .zip

Change History (9)

by Niek, 9 years ago

Attachment: TechnologyReplace.patch added

Patch that allows technologies to mark other technologies as 'researched' using the example json block

by Niek, 9 years ago

Now with modified technologies

comment:1 by Niek, 9 years ago

Keywords: patch review added
Milestone: BacklogAlpha 19
Summary: Letting technologies replace other technologies[Patch] Letting technologies replace other technologies

comment:2 by sanderd17, 9 years ago

The default gameplay works nice. But there are two remaining issues:

  • The "back to the future" cheat is broken now. Shouldn't be too hard to fix it.
  • The AI can't research the regular town phase anymore (there's no problem with the athen town phase). This is also most likely a simple fix. And this will likely also be the case for the city phase.

The code looks good on first sight (though I should check if the AI actually understands the stat changes correctly, the stat changes in the simulation seem to be correct).

by s0600204, 9 years ago

Attachment: structreeFix.patch added

The proposed change breaks the structree. This patch addresses that particular problem.

by Niek, 9 years ago

Includes the AI and cheat fixes

comment:3 by sanderd17, 9 years ago

Owner: set to sanderd17
Resolution: fixed
Status: newclosed

In 16678:

Let technologies replace other technologies, and use this for the town and city phase. Main implementation by niektb, structree fix by s0600204. Fixes #3208

comment:4 by sanderd17, 9 years ago

Keywords: simple review removed

comment:5 by Palaxin, 8 years ago

Summary: [Patch] Letting technologies replace other technologies[PATCH] Letting technologies replace other technologies
Note: See TracTickets for help on using tickets.