Promotions Expansion and other SDK stuff

Deliverator

Graphical Hackificator
Joined
Feb 12, 2008
Messages
4,806
Location
London, UK
More adventures in SDK-Land...

Promotion Effects Bonanza

While looking for Modcomps that might be useful for Dune Wars I came across Conqueror's Delight by Dom Pedro II. Unfortunately, this mod seems pretty much abandoned, but it has some great stuff in it. It consists of a number of different modcomps some of which have no been released separately as far as I can tell. I have merged in the first and most interesting component which is simply called Promotions Mod which adds a long list of new effects for promotions.

I previously added the TLOTags modcomp by TheLadiesOgre which added several new abilities for Promotions. So altogether we now have a pretty handsome list of new Promotion tags which I hope we can use to make Dune Wars combat more varied and interesting. Here's a list:
Spoiler :
Mostly taken from Dom Pedro II's Promotions Mod and TheLadiesOgre's TLOTags with a little bit of Fall Further/Fall From Heaven II:

<PrereqCivics>: One of these Civics is required in order to acquire this promotion.
<PrereqCivilizations>: Only these Civilizations can acquire this promotion.
<BonusPrereq> - promotion requires this bonus e.g. Ginaz Training
<BuildingClassPrereq> - requires the player to have built at least one of this building class.

<bAutoAcquire>: If a unit possesses all of the prereqs for a promotion tagged with this, the unit will automatically recieve this promotion (however, they will not recieve the promotion until they have enough experience unless the promotion is also tagged <bNoXP> (i.e. the choice is forced unless also tagged <bNoXP>))
<bNoXP>: This promotion is free (so long as the prereqs are met).
<bStackEffect>: This promotion may be purchased as many times as the player sees fit.
<bMustMaintain>: If for any reason the prereqs for this promotion are no longer met, the unit will lose it.
<iGoldCost> - substracts the specified amount directly from the treasury when the unit is given this promotion. If there is not enough gold in the treasury, the unit cannot get the promotion.

<ObsoleteTech> - Removes this Promotion from all player units on Discovery of this Tech
<FreePromotionTech> &#8211; Adds this Promotion to all eligible player units on Discovery of Tech

<bCannotAcquire> - this promotion cannot be acquired via conventional means (useful for promotions that are given free to certain units).
<bCannotConvert> - ???

<iCombatChange> - provides a base change in strength points that will appear on the units interface (unlike the strength modifiers which do not and are based on percentage).
<iAttackPercent> - changes the combat strength of a unit when attacking
<iDefensePercent> - changes the combat strength of a unit when defending

(I have hijacked these so that they provide advantages on Mesa tiles)
<iHillsAttack> - changes the combat strength of a unit when attacking into Mesa
<iHillsDefense> - changes the combat strength of a unit when defending Mesa
<iHillsDoubleMove> - allows the unit double movement through Mesa tiles
<iHillsFirstStrikesChange> - unit gets additional first strikes when attacking into or from Mesa
<iHillsWithdrawalChange> - unit gets additional withdrawal chance when attacking into or from Mesa
<iHillsHealChange> - unit heals by this percentage per turn in Mesa

<TerrainWithdrawalChanges> - units get additional withdrawal when attacking into or from this terrain
<TerrainFirstStrikesChanges> - units get additional first strikes when attacking into or from this terrain
<TerrainHealChanges> - unit heals by this percentage per turn in this terrain

<FeatureWithdrawalChanges> - units get additional withdrawal when attacking into or from this feature
<FeatureFirstStrikesChanges> - units get additional first strikes when attacking into or from this feature
<FeatureHealChanges> - unit heals by this percentage per turn on this feature

<UnitClassMods> - increases the combat strength against particular unit classes
<UnitCombatFirstStrikeChanges> - changes the first strikes given against a unit with a particular Unit Combat Type
<UnitCombatWithdrawalChanges> - changes the chance for withdrawal against a unit with a particular Unit Combat Type

<iCityFirstStrikesChange> - unit gets additional first strikes chance when defending in cities

<iForeignCityModifier> - changes the combat strength of a unit when fighting in a captured city with more than a certain percentage of enemy culture
<iForeignPlotModifier> - changes the combat strength of a unit when fighting a foreign enemy plot

<iUnitStackModifier> - changes the combat strength of a unit when fighting with a certain number of units above a set threshold (<iUnitThreshold>) on the particular tile

<Invisible>- gives the unit that Invisible Type. Units can now have multiple Invisible Types
<SeeInvisible>- will be able to see all units with that Invisible Type. Units can see multiple Invisible Types

<iPromotionCombatMod> &#8211; change in combat strength for any unit with a particular promotion (<PromotionCombatType>) (i.e. Anti-Promotion Promotions)

<bOneUp>: If this is set to 1, a unit that is given this promotion will get an "extra life".

<iSurvivorChance>: Whatever number is entered here will be the chance that the unit has to survive a combat loss.

<iRequiredBattleCount> - requires that the unit has to have fought a particular number of battles (battles ending in withdrawal count).
<iRequiredVictoryCount> - requires that the unit actually win a particular number of battles.
<iRequiredCapturedSlaveCount> - relates to DPII's Slavery Mod - not yet implemented.

<iAirBombRateChange> - changes the air bomb rate
<iSameTileAirRangeChange> - increases the air range of all units on the tile (air units will only take the best air range boost)
<iSameTileInterceptChange> - increases the interception rate of all units on the tile (intercepting units will only take the highest interception boost)
<iAirCombatLimitChange>: Whatever number is entered here will be applied to the units Air Combat Limit.

<iCollateralDamageLimitChange>: Whatever number is entered here will be applied to the units Collateral Damage Limit.
<iCollateralDamageMaxUnitsChange>: Whatever number is entered here will be applied to the units Collateral Damage Max Units Limit.
<iCombatLimitChange>: Whatever number is entered here will be applied to the units Combat Limit (thus making it possible to kill with collateral damage if the % goes over 100%).

<iCargoHealRateChange> - increases the rate at which other units in this unit's cargo will heal

<iExtraFortifyModifierPerTurn> - ???

<bDefensiveVictoryMove>: If this is set to 1, whenever the unit wins while defending, they will gain one point of movement. Max 1 movement point per turn.
<bOffensiveVictoryMove>: If this is set to 1, whenever the unit wins while attacking, they will gain one point of movement. Max 1 movement point per turn.

<iExtraDropRange>: Whatever number is entered here will be applied to the units drop range (thus giving units previously unable to paradrop the ability to do so).
<bFreeDrop>: If this is set to 1, paradropping does not act as an attack or cost any movement and the unit can drop onto FoW tiles.

<bIsMechOnly>: If this is set to 1, this promotion will only be offered to units which are <bMechanized>.
<bIsNoMechs>: If this is set to 1, this promotion will not be offered to units which are <bMechanized>.

<bPillageCulture>: If this is set to 1, the unit will pillage culture (ala IDW) whenever they pillage a tile.
<bPillageEspionage>: If this is set to 1, the unit will recieve espionage points (vs. the owner of the tile) whenever they pillage a tile.
<bPillageMarauder>: If this is set to 1, the unit will pillage twice (if possible) whenever they pillage a tile.
<bPillageOnMove>: If this is set to 1, the unit will pillage (free of charge concerning attack/movement) whenever they move to a new tile that is applicable.
<bPillageOnVictory>: If this is set to 1, the unit will recieve the profits of pillaging (though with no tile improvement loss) on a combat victory.
<bPillageResearch>: If this is set to 1, the unit will pillage research (toward their current research tech) whenever they pillage a tile.

<iVictoryAdjacentHeal>: Whatever number is entered here will be the chance that the unit has to give one turn's worth of healing to all friendly units on an adjacent tile on a combat victory (offensive or defensive).
<iVictoryHeal>: Whatever number is entered here will be the chance that the unit has to heal (one turn's worth) on a combat victory.
<iVictoryStackHeal>: Whatever number is entered here will be the chance that the unit has to give one turn's worth of healing to all units on the same tile on a combat victory (offensive or defensive).

Here's a little image showing some test promotions I have created to prove this is all working. (Don't worry these aren't serious ideas for promotions).



A lot to digest, I know, but there is a lot of potential here, particular when you start thinking about using combinations of these.

For example, if I set PrereqCivilization to Atreides, UnitCombat to Melee, iCombatChange to 1 and set bAutoAcquire and bNoXP to True then every Atreides Melee unit would start with the promotion and would have a base combat strength 1 higher than other Civs.

Other very early ideas:
Zeal promotion that gives +10% Attack, -10% Defense. Could be something to go at the Fanaticism tech. Perhaps have Zeal II and Zeal III with differing effects only available if your State Religion is Mahdi.

Orbital Insertion promotion that uses iExtraDropRange to give Paradrop ability to units.

Instead of Infantry unit having 1 First Strike we can give them a free City Watch promotion that uses the iCityFirstStrikesChange instead. This would give them First Strikes when defending cities, but more vulnerable when outside.

After Promotions Mod the next bit of Conquerer's Delight I am most interested in is Slavery Mod which seems to be a more expanded version of our Harkonnen Slave capture mechanic. It doesn't seem to be documented too much, but it seems you can get slaves from capturing cities and pillaging as well as combat. I'm going to understand what it does more, before decided whether we can use it.

Giving Mesa Tactical Value

As well as getting the promotion effects for Mesa working, I've added a new tag to Units to control whether or not they can enter Mesa. This means I can now stop Vehicles and Siege Weapons (and maybe Suspensors?) from being able to enter Mesa. Mesa can represent more the really craggy rocks of Dune - Thopters and Carryalls can fly over it and foot units can pick their way over it, but you can't drive over it. I think this will help the terrain of the planet play more of strategic role in the mod, which is appropriate since in Dune the planet is one of the main characters.

The underground caverns and tunnels of Dune are not really represented much in the mod yet, and I would like to have Mesa represent areas where there are caves and tunnels to hide in. We have talked before about having graphical caves visible on Mesa, but I would like to expand that further by having promotions that give advantages on Mesa. For example, you could have Cave/Tunnel related promotions that give extra withdraw chance when defending or attacking from Mesa or allows double movement through Mesa since the unit knows the secret passageways and short-cuts.

Promotions Mod adds different invisibility types as well. So we could have an Underground invisibility type, for higher Cave related promos that means that units cannot be seen by most units. We can then create/change some scanner type promo that can see underground units. The Cave promotions could go on a new Guerilla Tactics promo after Jihad perhaps (with the Razzia Command +100% War Weariness wonder idea).

Mahdi Shrine Effect

Finally, I have got the requested Mahdi Shrine effect of +X% Military Production per City with the Mahdi Religion working. I have added a tag to Religion infos called iShrineGlobalMilitaryProduction so that the value of X called be tweaked.

One thing is that Mahdi is a bit one-dimensional right now. We now have the Temple, the Jihad Veterans Barracks and now the Shrine all boosting Military Production. A later version of the Mahdi Zealot has been suggested, but perhaps we can also use the new promotion effects for some Mahdi State Religion specific promos as well.
 

Attachments

  • promos.jpg
    promos.jpg
    102.1 KB · Views: 387
Interesting. Dom's mod is for 3.17; did you have trouble merging it? The combat strength change is something I would like to borrow, but I would need to build "damage types" onto it as well.

We had discussed preventing unit types from moving on mesa before. I am still worried about this. Assuming it is wired into pathfinding correctly, then units which are unable to move on mesa may have to take a very long path to reach a target. In fact, I have seen cases where a substantial area is entirely enclosed by mesa. These areas would be unreachable to these units, and a unit built there would be unable to leave. Do you think that may be a problem?
 
Interesting.... I will think about this.

Biggest problem is that we would need to understand the code that the AI uses for selecting promotions, or develop a hack that worked.

A few random possibilities:
Sandrider as a selectable promotion for Fremen guardsmen.
Thopters and/or vehicles getting a large withdraw chance against melee units.

I'm inclined against blocking units from moving on mesa, that might mess up pathing too much.
But I could see vehicles getting a penalty on mesa and a bonus or withdraw chance on non-rugged flatland tiles.

iVictoryheal could represent Fremen water-reclamation?

We could make zealot weak but with an iSurvivor chance.

We could reduce the power of the Ginaz training promotions, but make them auto-acquired at level 4, so the the player doesn't need to worry about missing them accidentally or by following the wrong upgrade path.
 
Wow!!! If I had 10% of your creativity Deliverator, I'd own some tropical paradise island somewhere. I look forward to trying some of these ideas out in the next incremental patch.:cool:
 
Planetfall has the Light promotion (no maintenance, plus another effect that isn't relevant to Dune Wars.), which seems an effect that would fit somewhat. Perhaps in addition to, or in a replacement of, the zealot unit, some Mahdi Buildings could provide promotions, or have a chance to provide promotions, that reduce/eliminate maintenance costs and/or war unhappiness for units built in a city.


On hills: Artillery not allowed on hills would be a bit strange, coming from a regular civilization perspective, since in the actual world, hills are good places to set up artillery (as far as I know, at least.)


The caves seem like a cool idea to include as well. Perhaps hills reduce bombardment damage as well (Assuming this is possible) as a further representation of hiding in caves?
 
Planetfall has the Light promotion (no maintenance, plus another effect that isn't relevant to Dune Wars.),

The zealot's no-maintenance cost feature would be much more transparent to the human player if rather than having no maintenance as a core, it started with a non-selectable promotion (fanatic) that gave it zero upkeep.

I think caves would be hard to get across. I think we're better off just leaving mesa as mesa.

It would be very confusing if mesa were both good for ranged units (high ground, long visibility) and good for melee units (close fighting in caves).
 
Some other Mahdi Building diversification/promotion thoughts:

Promotion that provides a combat bonus against non-Mahdi units. This one might be a bit difficult to fully work out in balance/"realism" terms, since someone might conceivably create a bunch of units with this promotion, than switch to a second religion to get benefits, which doesn't make sense in terms of religions. (Assuming it could be manipulated to only work when Mahdi was a state religion, it might be something to consider as a Mahdi temple effect, or a choosable promotion. I know this is an effect in planetfall, and forget if it was an effect in Regular Civ 4, though am not sure if it could be moved to promotions.)

Happiness while at war with other civilizations. The idea here is for temples, or Galactic barracks, where it would work effectively as a reverse war unhappiness, to encourage and provide extra bonuses while at war. (I'm thinking of this as a temple effect, rather than a shrine effect, but it could be applied there as well.)
 
Interesting. Dom's mod is for 3.17; did you have trouble merging it? The combat strength change is something I would like to borrow, but I would need to build "damage types" onto it as well.

There were a few issues, but not really related to 3.17 vs 3.19. It was more that bits and pieces were slightly incomplete. Since some of the stuff was from FFH2/Fall Further it was possible to get the source from there and fix things up. Another issue is that this mod pre-dates Advanced Combat Odds, but it is fairly easy to add in the relevant code so that Advanced Combat Odds shows the correct info.

Combat Strength is in both TLOTags (as iExtraStrength) and DPII's Promotions Mod (as iCombatChange). I've removed the iExtraStrength version as DPII's seemed like a much nicer implementation. In general his implementations seem quite elegant and nicely done.

Before I release the source, I'll go through am make sure I comment the bits that are Promotions Mod related.

We had discussed preventing unit types from moving on mesa before. I am still worried about this. Assuming it is wired into pathfinding correctly, then units which are unable to move on mesa may have to take a very long path to reach a target. In fact, I have seen cases where a substantial area is entirely enclosed by mesa. These areas would be unreachable to these units, and a unit built there would be unable to leave. Do you think that may be a problem?

Possibly. From looking at the code it looks like pathfinding will certainly take this into account. All we can do is try it and see whether strange/undesirable things happen. The terrain does feel a bit flat and uninteresting at the moment - gameplay-wise I mean.

Ahriman said:
Biggest problem is that we would need to understand the code that the AI uses for selecting promotions, or develop a hack that worked.

Actually, both TheLadiesOgre and Dom Pedro II have updated the code where the AI evaluates promotions to add their new promotions. It usually has a fairly simple formula
for each effect or just a constant value per effect which is then totally to give the promotion a value. There is no need to hack - if we feel that certain promotions are over/under valued by the AI we can look at changing the procedure in the code.

iVictoryheal could represent Fremen water-reclamation?

I was actually think of doing a variant on DPII's Food from Animals modcomp which is also part of Conqueror's Delight. Instead, of a Unit having a <YieldsFromKill> tag that specifies how much food/hammers/commerce the nearest city gets from a kill, you could have a <YieldsFromBeingKilled> tag. This way each unit can have an amount of water specified that can go to the victorious player. That's the most accurate representation of taking water from the dead that I can think up - whether its the most fun I'm not sure.

Also, thinking of reimplementing Thumper as giving a 100% Withdraw chance versus the Worm unitclass (or 90% or whatever).

I think caves would be hard to get across. I think we're better off just leaving mesa as mesa.

You may be right. I was thinking perhaps a fairly common Caves Feature on Mesa might be better. It would be dependent on getting a good graphic to go with it.
 
From looking at the code it looks like pathfinding will certainly take this into account. All we can do is try it and see whether strange/undesirable things happen

The big risk is in messing up stacks. The AI puts a whole bunch of units in a stack, which might include vehicles with a no-mesa entry. It moves this stack to a city and invades. How will this work if the stack has to pass a mesa barrier? What if there is a single vehicle in the stack and a ton of infantry - will the whole stack end up going the "long way around", delaying the attack?

IMO the only units I would consider making no-mesa-access would be suspensors. This seems logical to me (hover vehicles in many scifi settings have difficulty with steep slopes/cliffs) and probably wouldn't mess up gameplay.

Actually, both TheLadiesOgre and Dom Pedro II have updated the code where the AI evaluates promotions to add their new promotions. It usually has a fairly simple formula
for each effect or just a constant value per effect which is then totally to give the promotion a value.
So how would you deal with, say, a selectable thumper promotion that protected the stack from worms? Its very hard to get the AI to understand something like "you need 1 unit in the stack with a thumpter, but only 1".
Which is part of why I think se should make thumpers non-selectable and just tie them into specific Fremen units, or remove thumpers entirely and make sandrider units immune to worms.

I was actually think of doing a variant on DPII's Food from Animals modcomp which is also part of Conqueror's Delight. Instead, of a Unit having a <YieldsFromKill> tag that specifies how much food/hammers/commerce the nearest city gets from a kill, you could have a <YieldsFromBeingKilled> tag. This way each unit can have an amount of water specified that can go to the victorious player. That's the most accurate representation of taking water from the dead that I can think up - whether its the most fun I'm not sure.
Fremen render water both from their own and from killed enemies. But other factions won't ever take water from the dead. I'm not sure I understand how the tags work, but I think these are the features we'd want preserved.

Also, thinking of reimplementing Thumper as giving a 100% Withdraw chance versus the Worm unitclass (or 90% or whatever).
Unless we add a system where withdraw works defensively (like in FFH) then I'm not sure how this would help. We don't want to encourage people to start attacking worms, and withdraw does nothnig defensively.
 
make sandrider units immune to worms

I think this is probably more realistic anyway. I can't imagine a human riding a worm would get attacked by another worm - it doesn't happen in the books...
 
Unless we add a system where withdraw works defensively (like in FFH)

I had a look at the code and it looks fairly easy to add this. I quite like feature in FFH2. Should we add it?

Also, I thought it could be interesting to have a National Limit for promotions. For example, we could make Ducal Guard into an Atreides promotion rather than a unit but give it a National Limit so that only a certain number of your units can be Ducal Guard at any one time.
 
Sandrider getting immunity bundled into it would be so awesome, and fix the frustration of using fremen scouts.

I lose more missionaries that way...
(I send them somewhere, forget that the unit will be shortcutting across sand, and soon discover that worms don't want me spreadin no 'ligion nowheres, nohow)

I really like the ducal guard idea. If it were a free promotion for master guardsmen, you could have a master in each town, then quickly promote a specific couple of guys based on enemy troop movement.
 
I don't think I understand what you're trying to model here.

It's meant to represent the religious zeal of the unit/army in question leading the units to fight harder against heathen/enemy religions.


Sandriders immune to worms would be quite nice, for all the reasons mentioned above.
 
I had a look at the code and it looks fairly easy to add this. I quite like feature in FFH2. Should we add it?

It would make skirmisher-type units much more interesting. If we add it though, I would make sure that we use a mechanism (like in Orbis) where a unit can only withdraw defensively once per turn. Otherwise it gets frustrating.
Orbis has a mechanism where when it withdraws it gets a "fatigued" promotion or something, which gives -100% withdraw chance and wears off with probability 100% at the start of your next turn.

Also, I thought it could be interesting to have a National Limit for promotions. For example, we could make Ducal Guard into an Atreides promotion rather than a unit but give it a National Limit so that only a certain number of your units can be Ducal Guard at any one time.
I like this, but I also really like the idea of having some Atreides guards with greek ceremonial armor. We could I guess change the unit appearance based on the promotion, but then that could get confusing when one ducal guard was a melee unit and another was a guardsmen, but they both had the same graphics.
I could go either way here.

It's meant to represent the religious zeal of the unit/army in question leading the units to fight harder against heathen/enemy religions.
I think they'll fight equally hard against anyone. If two factions with mahdi are at war with each other, its probably over some significant doctrinal difference that would get them equally mad.
Thanks for the suggestion, but I'd vote no on this one.
 
Top Bottom