[DLL] (7-NS) Upgrading to unique unit with free promotion gives back one promotion

Status
Not open for further replies.

Anarcomu

King
Joined
Oct 4, 2022
Messages
613
Proposal :
As the title say, upgrading a unit to another with a free, pickable promotion your unit already have, reduce the unit's level by one, allowing you to pick another promotion.

Example :
Playing Venice, you built and level up two Liburna.
One of them get Targeting I, II and III, the other get Bombardment I, II and III.
You upgrade them both to the Great Galleass.
The Galleass with Targeting get the Bombardment I promotion.
The Galleass with Bombardment, as of now, get nothing because it already have Bombardment I.
With this proposal, the Galleass with Bombardment get to choose one new promotion of its choice.

Rational :
There is a weird incentive, when you have a UU of this kind, to avoid the line which you UU improve, before you get your UU, because is would waste one promotion.
Paradoxically, new trained UUs are very proficient in the line they provide, since they require one less level to reach 4th-tier promotion.
 
I think long ago we had this in VP, where you would compensatory XP in this case.

Also adding a free promotion =/= reducing level by one. You mean no extra XP but an extra promotion - that could be challenging to code.
 
We had arguments for compensatory XP before.

1. Give XP equal to 10x promotion tier (Shock I = 10XP, March = 40XP)
2. Give XP enough for level up (50XP for a level 5 unit, etc.)

Both have their own problems.
 
Is it technically possible to reduce a unit's level by one ?
Yes, allowing you to pick a promotion the next turn. But only one free promotion if the XP only reaches the level that you reduced.
I would say this could be a good idea. Promotion XP refund can create an unfair advantage/disadvantage for the unit.

Give XP equal to 10x promotion tier (Shock I = 10XP, March = 40XP)
But what is a "promotion tier" to the game? The game reads all of them the same thing, a promotion. A promotion can be made tier 3, tier 2, or even instantly selectable.
Oh, please don't tell me this is yet another influence of the Promotion Tree mod.
 
But what is a "promotion tier" to the game? The game reads all of them the same thing, a promotion. A promotion can be made tier 3, tier 2, or even instantly selectable.
Oh, please don't tell me this is yet another influence of the Promotion Tree mod.
Extra column on the UnitPromotions table, obviously. That may or may not be auto/semi-auto-populated using SQL.
Yes, allowing you to pick a promotion the next turn. But only one free promotion if the XP only reaches the level that you reduced.
I would say this could be a good idea. Promotion XP refund can create an unfair advantage/disadvantage for the unit.
This seems to be the best, if possible.
 
Does this only apply to upgraded units? What if a wonder gives Barrage I to all units and you make a Horse Archer?
 
Does this only apply to upgraded units? What if a wonder gives Barrage I to all units and you make a Horse Archer?
Such a thing doesn't exists in base VP. However, I guess it should work for all instance where it happens, including that kind of free promotion.
The kind of Wonder you propose would be absurdly broken btw.
 
Also adding a free promotion =/= reducing level by one. You mean no extra XP but an extra promotion - that could be challenging to code.
Doesn't levels rule how much xp you need to gain a new promotion ?
I assumed the xp prerequisite was defined by the level, and whenever you pick a promotion, your level also increase by one, updating the new xp prerequisite.
Otherwise, what are levels good for ?
 
Doesn't levels rule how much xp you need to gain a new promotion ?
I assumed the xp prerequisite was defined by the level, and whenever you pick a promotion, your level also increase by one, updating the new xp prerequisite.
Otherwise, what are levels good for ?
Maybe I'm not understanding what you're proposing.

A Warrior with 33 XP (Level 3) with Drill I and Shock I upgrades into a unique Spearman which already has Drill I. What happens?
 
Maybe I'm not understanding what you're proposing.

A Warrior with 33 XP (Level 3) with Drill I and Shock I upgrades into a unique Spearman which already has Drill I. What happens?
The new Spearman keep its promotions (Drill I and Shock I). It also keeps its 33XP. However, its level is reduced to 2.
This means that it now needs 30xp to the next level, again, and can choose a new promotion.
 
The new Spearmen keep its promotions (Drill I and Shoch I). It also keeps its xp. However, its level is reduced to 2.
This means that it now needs 30xp to the next level, again, and can choose a new promotion.
If its level is reduced to 2, it would need 20 XP to the next level.

Level 1: 0 -> 10 XP (0 promotions)
Level 2: 10 -> 30 XP (1 promotion)
Level 3: 30 -> 60 XP (2 promotions)
 
Doesn't the game only check for accumulated XP ?
When you gain a new promotion, the accumulated XP is never lost. Instead, the total required xp is increased to account for that.
I don't think that reducing level will suddenly require the unit to reach 50 XP to up one level.

In your example, it is the desired behavior that the unit immediately get its new promotion at 30XP, and the next at 60XP, like normal.
If you confirm that it would not work that way, then I'll need to figure out another way to design it. Probably just withdraw at this point.
 
You can reduce a unit's level without changing the unit's XP. Doing so results in the unit immediately leveling again (when it next checks), and getting to choose a promotion.

The new Spearman keep its promotions (Drill I and Shock I). It also keeps its 33XP. However, its level is reduced to 2.
This means that it now needs 30xp to the next level, again, and can choose a new promotion.
It has 33 XP, which is over the 30 XP threshold, meaning that it immediately chooses a new promotion and increases its level back to 3.
 
You can reduce a unit's level without changing the unit's XP. Doing so results in the unit immediately leveling again (when it next checks), and getting to choose a promotion.
Okay, now that I think about it, if a unit starts with 60 free XP it immediately gets to pick three promotions.

Is there existing code to reduce level like this?

EDIT: Also, what if a civ has two unique units, both of which start with Drill I, and one upgrades into the other? And what about a promotion given by a building or something?
 
Okay, now that I think about it, if a unit starts with 60 free XP it immediately gets to pick three promotions.

Is there existing code to reduce level like this?
use CvUnit::setLevel(CvUnit::getLevel() - 1), followed by CvUnit::testPromotionReady().
 
EDIT: Also, what if a civ has two unique units, both of which start with Drill I, and one upgrades into the other? And what about a promotion given by a building or something?
This could be solved by adding a memory value to promotions specifying if they were obtained for free.
 
This could be solved by adding a memory value to promotions specifying if they were obtained for free.
If this is possible and not too complex, it's good. I was coming with something a lot more complex. I just assumed promotions couldn't be altered to receive specific property outside their effects.
 
Status
Not open for further replies.
Top Bottom