Opened 4 years ago

Last modified 17 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 4 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by fatherbushido, 4 years ago

Description: modified (diff)

comment:2 by fatherbushido, 4 years ago

  • 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.

  • Another option is to allow 0 requiredXP in template and add a disable option in Promotion template which can be set to true or false by tech.
Version 2, edited 4 years ago by fatherbushido (previous) (next) (diff)

by fatherbushido, 4 years ago

Attachment: promotion.diff added

comment:3 by fatherbushido, 4 years ago

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 by Itms, 4 years ago

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 by fatherbushido, 4 years ago

Milestone: Alpha 21Alpha 22

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

comment:6 by wraitii, 4 years ago

Keywords: rfc removed

comment:7 by elexis, 3 years ago

Milestone: Alpha 22Backlog

Backlogging due to lack of progress

comment:8 by fatherbushido, 3 years ago

Description: modified (diff)

lack of progress, lack of progress...

comment:9 by wraitii, 3 years ago

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

comment:10 by Imarok, 17 months ago

Component: UI & SimulationSimulation

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

Note: See TracTickets for help on using tickets.