Opened 3 years ago

Last modified 7 months ago

#4126 new defect

[PATCH] Promotion by Technology

Reported by: fatherbushido Owned by:
Priority: Should Have Milestone: Backlog
Component: Simulation Keywords: simple
Cc: Patch:

Description (last modified by fatherbushido)

Promotion component have a RequiredXP element. That one is a non negative integer. Currently we can use a tech to replace it by 0.

The effect of setting RequiredXP to 0 is :

  1. promote the current units (see Promotion) (with entity mod)
  2. construct the (more) promoted unit instead of the original unit (ref r14388) (with template mod)

That is used to promote a unit with a tech (see for example mace_champion_infantry_a to mace_champion_infantry_e).

But that is not fully flexible : for example one can perhaps want :

  • that unit never promote with xp (see old ugly workaround with a 99999 requiredXP
  • allow a promotion only when a given tech is researched

Attachments (1)

promotion.diff (6.5 KB) - added by fatherbushido 3 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 3 years ago by fatherbushido

Description: modified (diff)

comment:2 Changed 3 years ago by fatherbushido

  • My first idea was :

"I suggest (for example), to separate 1. and 2. by letting use 0 requiredxp in template, adding an optional RequiredTechnology? in the Promotion template (which would be checked Promotion) and an optional boolean AllowPromotedUnitProduction? in the Promotion template (which would be checked in ProductionQueue?)" -> But i think it's not a good solution.

Last edited 3 years ago by fatherbushido (previous) (diff)

Changed 3 years ago by fatherbushido

Attachment: promotion.diff added

comment:3 Changed 3 years ago by fatherbushido

Keywords: rfc added
Summary: Promotion by Technology[PATCH] Promotion by Technology

The attached patch is a draft coded in a clumsy way. now :

  • we can put a 0 requiredXP (avoid ugly 99999 stuff)
  • but if a required tech is not searched, unit can't promote (or promoted template can't be produced)
  • when a tech set 0 to requiredXP, the unit are promoted and promoted template can't be produced

If the logic is ok, i will write some tests.

comment:4 Changed 3 years ago by Itms

The logic looks very good to me and the patch is not that clumsy, only a bit ;)

I agree the required tech and required XP solution looks better that this AllowPromotedUnitPromotion.

Do you need more feedback on this?

comment:5 Changed 3 years ago by fatherbushido

Milestone: Alpha 21Alpha 22

thx for the feedback. I will finish that in a22 so.

comment:6 Changed 3 years ago by wraitii

Keywords: rfc removed

comment:7 Changed 2 years ago by elexis

Milestone: Alpha 22Backlog

Backlogging due to lack of progress

comment:8 Changed 2 years ago by fatherbushido

Description: modified (diff)

lack of progress, lack of progress...

comment:9 Changed 2 years ago by wraitii

Actually there's been progress. D270, D266 would enable this but I'd need D281 (and possibly D274) first.

comment:10 Changed 7 months ago by Imarok

Component: UI & SimulationSimulation

Move tickets to Simulation as UI & Simulation got some sub components.

Note: See TracTickets for help on using tickets.