[SDK] Dale's Combat Mod!

Dale, great ideas and mods, I really liked what I've herd, so I'm trying to incorporate this into a collection of mods I have going, total realism, regiments, and hopefully Dales combat mod, so far I've basically copied and pasted your .dll file, located all the changes you made in the interface, unitinfos, schema, missions, applied those values to the corresponding values in my total realism mod folder, and created a few like the bombard.

When I tried to reload my game, it won't let me, really bummed about this cause I was far into the game, so I tried a fresh start and loaded a new game, and it works, well the field bombardment, which is what I'm really after, I used world builder to test it out, and it seemed to be working. The only changes I made to it was I increased the bombard distances, ie, catuplts can bombard the next 2 squares, to clear friendly units, cannon's can now bombard 3 tiles up, and arty I gave a hefty 4 value to. Arty is rarely very near the combat these days, and this also gives a sec to bombard your targets well before closeing with combat arms troops.

I'm not sure why I can't use my old game, maybe because I simply copied and pasted the .dll, or schema? I got lazy there, but on the schema I think it was only 4 new lines added, nothing taken away. So I'm betting it's the .dll.

Second, and more importantly, I'd love to add this feature to most ranged units, giving archer units the ability to reign arrows down on adjacent squares would be amazing, so I was wondering if you think this would work with ranged units, or would it be cheesy explosions from arrows?

One more thing,
"Counter-battery fire (bombard vs bombard & ranged vs ranged)"
Is this right, if so, bravo, so you're telling me when I'm fired on by enemy arty I automatically get counter battery fire back at em. Nice work.


Other than that sounds like you've got a great mod here, thanks for sharing.
 
Everything seems to be fine, only if the unit in question had a bombard icon to begin with, I've tried to add it to galley's, carvells, and others, but if it didn't already have the bombard icon it doesnt give me a button to initiate the bombardment.

Could it be that when adding your files, I searched for this line...

<Type>MISSION_BOMBARD</Type>

and replaced it completely with your tag here...


<MissionInfo>
<Type>MISSION_BOMBARD</Type>
<Description>TXT_KEY_MISSION_BOMBARD</Description>
<Help>TXT_KEY_MISSION_BOMBARD_HELP</Help>
<Waypoint>NONE</Waypoint>
<EntityEventType>ENTEVENT_BOMBARD</EntityEventType>
<iTime>16</iTime>
<bTarget>0</bTarget>
<bBuild>0</bBuild>
<bSound>1</bSound>
<Button>,Art/Interface/Buttons/Actions/Bombard.dds,Art/Interface/Buttons/Actions_Builds_LeaderHeads_Specialists_Atlas.dds,2,1</Button>
</MissionInfo>

Should I have just added this under the other bombard tag as a new mission? Or am I just stumbleing on getting the icon on the actions tab in game?
 
Crashed when I ended my turn at the point in time on the save file included. Not sure why it crashed.
 
Can't get it to play in Warlords. When I select load mod, the game never launches...
 
gunnergoz:

It's not Warlords compatible yet. :)
 
gunnergoz said:
Can't get it to play in Warlords. When I select load mod, the game never launches...
It's not Warlords compatible yet. Gotta pick whether to play vanilla Civ with this, or play Warlords.

EDIT: Got beat to it.

Oh and this:
Warlords version will be a couple of days after 1.01, which is a couple of days off.

makes me very happy on a number of levels.

Until then, I have to drop back to Vanilla. Now, in a few days, I have to get used to Combined arms AND Warlords. Besides that, I have school.

EDIT: Another movement problem. I invade Greece with a force of three cats, 2 horse archers, and 4 Praets. Alex sends a single Chariot through the border, obviously to pilliage. As I still need to bombard the city and units, I send my HA's back to bring down the chariot before it pillages. My HA's can't get there in one turn and end the turn right next to the chariot. The chariot decides to turn and fight rather than get trapped on both sides, and charges my two HA's. They are the defender of the combat. However, when they win, one of them MOVES to where Alex's Chariot was, while the other does what it should and returns to the tile it was on.

Sorry for the nitpicky bugs and all. Just figure a mod as good as this deserves to be completley bug free.

EDIT2: You say the AI knows how to use this. Do they know how NOT to use this?
Same force as above, minus one HA (healing) sitting next to Sparta, which has one chariot, 2 archers. They proceed to attack with ALL their units. This is either really smart (if this is the best results they can get, I AM bombarding and weakening them) or really stupid (little chance of victory, leaving their city completley undefended if they lose). It just seems odd for the AI to just leave the city undefended for my army to just walk in.
 
Thanks Dale, I very much look forward to the WL version since that's all I play any more. Great work, BTW! I really admire the labor and effort you've put in, and the value that you've added to the game with this mod.
 
Dale???

I really like your mod, I hope you can help me.

This is my problem, this unit doesn't have a bombard feature built in, I've added all the values I think I should have to activate the bombard feature, but I have no bombard Icon in the game it initiate bombardment. Have I missed something here to add the icon, or is it in a different xml file?



<Class>UNITCLASS_GALLEY</Class>
<Type>UNIT_GALLEY</Type>
<UniqueNames />
<Special>NONE</Special>
<Capture>NONE</Capture>
<Combat>UNITCOMBAT_NAVAL</Combat>
<Domain>DOMAIN_SEA</Domain>
<DefaultUnitAI>UNITAI_ATTACK_SEA</DefaultUnitAI>
<Invisible>NONE</Invisible>
<SeeInvisible>NONE</SeeInvisible>
<Description>TXT_KEY_UNIT_GALLEY</Description>
<Civilopedia>TXT_KEY_UNIT_GALLEY_PEDIA</Civilopedia>
<Strategy>TXT_KEY_UNIT_GALLEY_STRATEGY</Strategy>
<Advisor>ADVISOR_MILITARY</Advisor>
<bAnimal>0</bAnimal>
<bFood>0</bFood>
<bNoBadGoodies>0</bNoBadGoodies>
<bOnlyDefensive>0</bOnlyDefensive>
<bNoCapture>0</bNoCapture>
<bRivalTerritory>0</bRivalTerritory>
<bMilitaryHappiness>0</bMilitaryHappiness>
<bMilitarySupport>1</bMilitarySupport>
<bMilitaryProduction>1</bMilitaryProduction>
<bPillage>1</bPillage>
<bSabotage>0</bSabotage>
<bDestroy>0</bDestroy>
<bStealPlans>0</bStealPlans>
<bInvestigate>0</bInvestigate>
<bCounterSpy>0</bCounterSpy>
<bFound>0</bFound>
<bGoldenAge>0</bGoldenAge>
<bInvisible>0</bInvisible>
<bFirstStrikeImmune>0</bFirstStrikeImmune>
<bNoDefensiveBonus>0</bNoDefensiveBonus>
<bIgnoreBuildingDefense>0</bIgnoreBuildingDefense>
<bCanMoveImpassable>0</bCanMoveImpassable>
<bFlatMovementCost>0</bFlatMovementCost>
<bIgnoreTerrainCost>0</bIgnoreTerrainCost>
<bNukeImmune>0</bNukeImmune>
<bPrereqBonuses>0</bPrereqBonuses>
<bPrereqReligion>0</bPrereqReligion>
<bMechanized>1</bMechanized>
<bRenderBelowWater>1</bRenderBelowWater>
<UnitClassUpgrades>
<UnitClassUpgrade>
<UnitClassUpgradeType>UNITCLASS_GALLEON</UnitClassUpgradeType>
<bUnitClassUpgrade>1</bUnitClassUpgrade>
</UnitClassUpgrade>
<UnitClassUpgrade>
<UnitClassUpgradeType>UNITCLASS_FRIGATE</UnitClassUpgradeType>
<bUnitClassUpgrade>1</bUnitClassUpgrade>
</UnitClassUpgrade>
</UnitClassUpgrades>
<UnitAIs>
<UnitAI>
<UnitAIType>UNITAI_ASSAULT_SEA</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
<UnitAI>
<UnitAIType>UNITAI_ATTACK_SEA</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
<UnitAI>
<UnitAIType>UNITAI_SETTLER_SEA</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
</UnitAIs>
<NotUnitAIs />
<Builds />
<ReligionSpreads />
<GreatPeoples />
<Buildings />
<ForceBuildings />
<HolyCity>NONE</HolyCity>
<ReligionType>NONE</ReligionType>
<StateReligion>NONE</StateReligion>
<PrereqReligion>NONE</PrereqReligion>
<PrereqBuilding>NONE</PrereqBuilding>
<PrereqTech>TECH_SAILING</PrereqTech>
<TechTypes />
<BonusType>NONE</BonusType>
<PrereqBonuses>
<PrereqBonuses>BONUS_COAL</PrereqBonuses>
<PrereqBonuses>BONUS_COPPER</PrereqBonuses>
<PrereqBonuses>BONUS_IRON</PrereqBonuses>
<PrereqBonuses>BONUS_OIL</PrereqBonuses>
</PrereqBonuses>
<ProductionTraits />
<Flavors />
<iAIWeight>0</iAIWeight>
<iCost>50</iCost>
<iHurryCostModifier>0</iHurryCostModifier>
<iMinAreaSize>20</iMinAreaSize>
<iMoves>4</iMoves>
<iAirRange>0</iAirRange>
<iNukeRange>-1</iNukeRange>
<iWorkRate>0</iWorkRate>
<iBaseDiscover>0</iBaseDiscover>
<iDiscoverMultiplier>0</iDiscoverMultiplier>
<iBaseHurry>0</iBaseHurry>
<iHurryMultiplier>0</iHurryMultiplier>
<iBaseTrade>0</iBaseTrade>
<iTradeMultiplier>0</iTradeMultiplier>
<iGreatWorkCulture>0</iGreatWorkCulture>
<TerrainImpassables>
<TerrainImpassable>
<TerrainType>TERRAIN_OCEAN</TerrainType>
<bTerrainImpassable>1</bTerrainImpassable>
</TerrainImpassable>
</TerrainImpassables>
<FeatureImpassables />
<iCombat>2</iCombat>
<iAirCombat>0</iAirCombat>
<iAirCombatLimit>0</iAirCombatLimit>
<iXPValueAttack>4</iXPValueAttack>
<iXPValueDefense>2</iXPValueDefense>
<iFirstStrikes>0</iFirstStrikes>
<iChanceFirstStrikes>0</iChanceFirstStrikes>
<iInterceptionProbability>0</iInterceptionProbability>
<iEvasionProbability>0</iEvasionProbability>
<iWithdrawalProb>0</iWithdrawalProb>
<iCollateralDamage>50</iCollateralDamage>
<iCollateralDamageLimit>50</iCollateralDamageLimit>
<iCollateralDamageMaxUnits>5</iCollateralDamageMaxUnits>
<iCityAttack>0</iCityAttack>
<iCityDefense>0</iCityDefense>
<iAnimalCombat>0</iAnimalCombat>
<iHillsDefense>0</iHillsDefense>
<TerrainNatives />
<FeatureNatives />
<TerrainDefenses />
<FeatureDefenses />
<UnitClassAttackMods />
<UnitClassDefenseMods />
<UnitCombatMods />
<DomainMods />
<BonusProductionModifiers />
<iBombRate>0</iBombRate>
<iBombardRate>10</iBombardRate>
<SpecialCargo>NONE</SpecialCargo>
<DomainCargo>DOMAIN_LAND</DomainCargo>
<iCargo>2</iCargo>
<iConscription>0</iConscription>
<iCultureGarrison>0</iCultureGarrison>
<iExtraCost>0</iExtraCost>
<iAsset>1</iAsset>
<iPower>2</iPower>
<UnitMeshGroups>
<iGroupSize>3</iGroupSize>
<fMaxSpeed>2.25</fMaxSpeed>
<iMeleeWaveSize>3</iMeleeWaveSize>
<iRangedWaveSize>3</iRangedWaveSize>
<UnitMeshGroup>
<iRequired>3</iRequired>
<EarlyArtDefineTag>ART_DEF_UNIT_GALLEY</EarlyArtDefineTag>
</UnitMeshGroup>
</UnitMeshGroups>
<Button>,Art/Interface/Buttons/Units/Galley.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,3,9</Button>
<HotKey />
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<FreePromotions />
<bDCMBombard>1</bDCMBombard>
<iDCMBombRange>1</iDCMBombRange>
</UnitInfo>



I was thinking...

<Button>,Art/Interface/Buttons/Actions/Bombard.dds,Art/Interface/Buttons/Actions_Builds_LeaderHeads_Specialists_Atlas.dds,2,1</Button>

this is the bombard icon tag right? where can I put it to add it to other units?


I had an idea here is a line from the unit info above...

<UnitMeshGroup>
<iRequired>3</iRequired>
<EarlyArtDefineTag>ART_DEF_UNIT_GALLEY</EarlyArtDefineTag>
</UnitMeshGroup>
</UnitMeshGroups>
<Button>,Art/Interface/Buttons/Units/Galley.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,3,9</Button>
**** Adding here **** <Button>,Art/Interface/Buttons/Actions/Bombard.dds,Art/Interface/Buttons/Actions_Builds_LeaderHeads_Specialists_Atlas.dds,2,1</Button> <HotKey />


sure that's not it, but I'm trying. Please your help would be greatly apprieciated
 
work with warlords?
 
I wonder how you can play civilization 4 blind? Otherwise, how can you miss that Dale answered "It's not Warlords compatible yet. " on the exact same page :) Soon.
 
Hello Dale,

This really sounds and looks awesome!!! I haven't had time to try out but will do so asap! One question though, does this mod work with other mods and scenarios out there? Or do mod and scenario makers need to incoorporate this mod in their mods and scenarios so we can have stack combat and normal bombardement there? I really like a few scenarios out there, like the cold war ones...

The question may be too obvious for you, but I am an enthusiastic user with little knowledge of programming,

Cheers, and thanks for the hard work!
 
Okay, going to catch up with heaps of replies, right back to post 359. :)

Roland:
1. The actual method used is close to what you describe, but here it is fully detailed:
a. Attacker stack broken into 4 lines (air, bombard, ranged, melee + flanking). Note, as of 1.01 which'll be out soon that non-combat units (worker, settler, GP's) will sit on the bombard line.
b. Defender stack broken into 4 lines.
c. Missile units of attacker airstrike the defending stack.
d. Units on both sides go through a shuffler which fills any gaps between units to properly form the armies up.
-- END OF SETUP PHASE --
e. Defender airstrikes: dog fights with attacking air units occurs first and if defender gets through it's a airstrike against a selected unit (chosen from backline to frontline).
f. Defender bombards: defender bombard units get a single free shot at the attackers. Unit selected from the area in front of the bombard unit (reality = actual rank +- 2 ranks each side) working from backline to frontline.
g. Defender arrows: defender ranged units get a single free shot at the attackers. Unit selected calculated the same as bombard units above, except preference given to attacker ranged units.
-- END OF DEFENSE PHASE --
h. Attacker airstrikes: air units perform dogfights with remaining defending air units first, then select a defending ground unit based on same area search as defense uses.
i. Attacker bombards: attacking bombard unit will firstly search for a bombard or ranged in the area in front of it and perform counter-battery fire first with preference to defending bombard units. This is a full combat with a winner and loser. If no CB unit found a single strike at defending melee/flank units will occur (this could result in a "miss").
j. Attacker arrows: attacking ranged unit will perform the same function as the bombard units except preference given to defending arrows first. If none found a single strike at the defending frontline will occur (this could result in a "miss").
k. Attacker melee: attacking frontline troops will line up against the defending unit facing it (could be in the 2nd, 3rd or 4th row of the defenders) and perform a standard melee combat (the old vanilla civ4 style). There will be a winner and a loser (or a withdrawer).
l. Any surviving units are retained in their original plot, or if no defenders remain the attacking stack moves if possible.

As you can see, the actual process is not a many-vs-many conflict, but a many-vs-one conflict. One single defender could be bombarded, ranged and meleed in the one battle. This mod is a wrapper of the original 1-vs-1 method. It still uses the vanilla method, but is almost how CTP2 performs combat.

2. As seen from above process, withdraws are calculated during attacker melee on a per unit basis. Standard vanilla withdraw method used (including promotions).
3. Sort of. Depends on the makeup of the attacking forces. 1 defender could be hit by bombarders, ranged and melee units. The only restriction is that only ONE melee combat will occur for each defender. This is unfortunately a limitation of the graphics engine and how it works. :( I'd love it to be multiple melee battles for 1 defender.
4. As explained above, there's only one combat round (broken into different phases). Originally the mod was multiple rounds resulting in one stack being destroyed and one surviving, but the call was for survivors possible from both sides, hence why it was changed. :)
5. Each unit looks to the area "in front of it". It will select an opponent based on what phase of the battle it is in, and possible targets. In reality the area in front of a unit is the column it is in plus the 2 columns either side of it (total 5 columns). If there's nothing directly in front of it, it looks in the other columns of its area. Thus proper area tactical combat was achieved. :) EG: an attacking catapult looks through its combat area. The catapult is in rank 3, column 4 so its combat area is columns 2-6. It will select an opponent based on phase. In the bombard phase it will look for CB units first with preference to bombard units then ranged units. If none in any of the columns it looks for a frontline unit to strike. Hope that helps to clear that up. :)
6. Both are correct. When attacking melee units are marching forward the defending ranged can fire. But when no defending ranged units exist the attacker gains the benefit of the charge through standard civ4 bonuses.
7. Yes. First strikes are still used. Especially during CB fire and melee combat. While not as important for bombard or ranged, it's critical for melee. So promos for bombards ranged should focus on accuracy and bombardment (collatoral still used in field/city bombardment).
8. Correct.
9. Defenders cannot withdraw. They are still only.... defenders. ;) Standard rules apply in this regard.

Immacolata:
Tanks are flanking units. They will target defending backline troops first (if they can breakthrough the defending frontline). This will decimate the enemy arty as they retain their first strikes over the defending arty. Blitzkreig is still reliant on breaking through the enemy lines first. :)

WRL:
Old saves will not work with this mod as I changed the save format for the extra variables stored. New games have to be started. :)
It's possible to have arrow units as ranged, haven't tried it, but it could work. That won't be in this mod, but I'd like to see it done by someone.
Counter-battery fire is only during stack combat. Field bombard does not have CB fire. You can do that manually if you want. :)
With the bombard mission, you did the correct thing. Replace the existing one, not add.
For your galley try giving it some withdraw prob: < iWithdrawalProb >0< /iWithdrawalProb >
Or change to UNITCOMBAT_SIEGE: < Combat >UNITCOMBAT_NAVAL< /Combat >

smooth operator:
Other mod makers will have to intergrate it into their mods. With all the required XML changes it's best to hassle them to do it if you're unsure how to edit the XML files. :)

Dale
 
rockinroger:

I know about that crash and it'll be fixed in 1.01. It's to do with AI catapults.

Usually I just need the save file from the turn before the crash (IE: so I just click End Turn).

Dale
 
DCM Announcement!

Version 1.01 has been uploaded! :)

Fixes those nasty crash bugs.

Please see the first post for all the details.

Dale
 
Dale, great work (but I guess you know that already!)
I'm just dropping this line to tell you I'd like to include you mod in Sevomod (of course, you'll get the credits!!!)
 
Wow, thank you for the extensive answer, Dale. Especially the part about only one hit or a full combat were very interesting and the part about how units designate their opponents. The picture about how this stack combat works has become much clearer. However, three tiny questions remain. :blush:
1) Can defending ranged units hit attacking bombard units (archers attacking catapults) in the defensive fase? (I know they prefer other ranged units.)
2) If one catapult/archer would attack a stack of swordsman, I guess nothing happens in the defending fase and in the attacking fase, the catapult/archer gets one free shot and combat ends. Correct? But if archers or catapults were present in the defending tile, then a full (counterbattery) combat with those would occur.
3) Can flanking units reach the artillery/ranged units if there is a path to these units in their 5 column area?

I really hope that Firaxis will base civ5 combat on your combat model. A graphical representation might be good though to help people like me understand what is happening. ;)
 
First off Dale, needless to say, excellent work here.

But I have to report some strange happenings with version 1.01, downloaded right away to counter that nasty catapult bug that literally froze my game for some days.

The game plays wonderfully, but at a certain point (and I don't know what is that triggers this strange event), another strange bug arose: at the end of the turn, the thing that says something like "Waiting for other civs..." stood there forever, the mouse pointer was busy, though I was able to load the various menus like Religion, Technology, and even the game menu itself, letting me to do the normal stuff like reloading or saving. Reloading some turn before is of no avail.

Have you got any thoughts on this?

EDIT: Downloads hit 1001 by the way :)
 
Top Bottom