Bring back CivIII Armies?

LuvToBuild

Prince
Joined
Mar 9, 2006
Messages
564
Location
Evansville, IN
Question for you Lua guys: I always loved the army unit in CivIII. It's been a long time since I've played CivIII so my recollection may be fuzzy on some things. If you aren't familiar with them, check out this page. I tried doing a search to see if this has been discussed before but nothing popped out at me in the initial results. Maybe I was too lazy to find it. :)

Basically, the CivIII army acted like a land carrier unit but the units inside them actually contributed to it's combat strength. I know that in Civ5 you can have a land carrier type unit, or at least I think you can. I've seen mods like the base commander unit that carries around aircraft and missiles but I haven't actually played it yet. I think there is also a mod which has a modern armor carrier unit. It's my understanding that just making it a carrier unit means that any units it carries will be destroyed if the unit is destroyed. This means that you would either have to have an uber unit to act like the carrier, or you would need some Lua code that would somehow add the combat strength of the loaded units to the overall strength of the army carrier unit. I would think this is possible but you Lua guys would know better than me.

What I would like is a Great General type unit in the late game that uses the Civ4 mech infantry model (Bradley IFV). You would be able to load 3 or 4 civ5 mech inf and or modern armor to create an uber unit kind of like the CivIII armies were. IIRC, they were pretty weak when not loaded but really strong when loaded up. Perhaps they could also take on the promotions of the loaded units? It seems like this kind of unit would be much more handy in Civ5 with 1UPT and the elimination of the SOD. It might take some serious AI retraining though for them to use it properly.

Anyway, it's just a thought I've had before. I saw in the tut section that I wasn't the only one. :)

...Last comment, I really do miss the general from civ 3 where you could stack 4-5 units in it and move it in a single click,...
 
While not being technically "armies", I plan to use 2-3 units stacks in my next mod, with mechanisms like those of the WWII mod, where one combat from tile to tile could look like that:

7577ab5e4201fa51d43c1fcc5957cc44edd3b643.jpg

(the screenshot miss the last line, when the infantry finally attacks the city)
 
Assuming you can load any combat unit into a custom carrier type (e.g. troop transport) then the calculation on the transports relative defensive/offensive strength should be the easy part (in lua).

See Transport Armor Tank. I downloaded this mod a while back but haven't gotten around to trying it out. It might not even work. I assume it does what it says it does. I think the "issue" with any carrier unit is the loss of all units it is carrying, although I think this is actually the way CivIII armies worked too. If you lost the army, you lost all of the units that were loaded. I think loading them would be the "easy" part :), getting the loaded units to act "together" as a single unit is the hard part. I think it would need to be something abstract in Lua that basically looks at which units are loaded and then somehow adds them to the base strength of the carrier unit. This way you don't have an uber Great General type unit running around without any loaded units. He would be really weak without any support. Ideally, when a GG is generated, you get an option to convert him to an army instead of hurrying production, starting a golden age, etc. The army unit would then be the carrier unit which you load other normal units into. Each unit loaded would contribute to the strength of the army unit so that they themselves wouldn't be fighting directly but would "fight" as part of the army unit. They could be unloaded to attack enemy units like normal and then reloaded. I think the really tricky part might be factoring in promotions. Might have to go with something abstract like simply applying the benefit of the loaded unit's promotions to the carrier unit as long as it is loaded.
 
Ok, so I've finally gotten as far as getting an infantry unit to load into a Combat Command (CC) unit. However, it only works if the CC unit is embarked.

First, here is how it is supposed to work:

  1. Select an Infantry unit
  2. Right click hex with CC unit, or
  3. Select Move Mode and left click on CC unit
  4. Unit should load into CC the same way aircraft load onto an AC with rebase
  5. However, it doesn't if both are on land
Instead, the infantry unit teleports to the CC unit's hex and you get the "Move Stacked Unit". You then have to move the CC unit out of the hex to continue your turn.

However, if you embark the CC unit on a coastal hex, and then move the infantry unit to the same hex, it will load into the CC unit. You can then disembark the CC unit onto land and transport the infantry unit around. Obviously, this isn't exactly the way it should work if it's going to be useful. I have borrowed Lua code from Redox's Amphibious Assault Ship mod but it doesn't seem to work too well with a DOMAIN_LAND carrier unit when that unit is on land. Anybody have any ideas as to how I can get this working properly for a DOMAIN_LAND cargo unit and a DOMAIN_LAND carrier unit? My understanding of Lua in Civ5 is very limited right now. I'm guessing I will have to add some kind of new mission to allow this which I was hoping to avoid.

Attached is what I have currently. It allows a Great General to be upgraded to a Combat Command with a cargo capacity of one. My intent is for the unit to gain more and more cargo capacity with the cargo promotions as it gains experience. This would allow the unit to simulate the promotion of the commanding general from brigade level (1 :c5capital:) to full army level (4 :c5capital:). Eventually, I would like to create a more specific formation for this unit that would change with the types of units loaded. The unit's combat strength and abilities would also change.
 

Attachments

I'll be honest and suggest this probably requires C++ source code modifications. Probably slight, as you might need to add exceptions to the code that already allows carrier transports.

You'll need to do this for the AI to understand how it works.
 
This looks like largely an xml issue rather than a lua one, but I am honestly not 100% sure on that. I am basing this on Whoward's Airfield improvement and especially the xml file LandCarriers.xml and LandCarriers.sql

For what that improvement does, the lua is pretty thin. It's heavy on xml.

I downloaded it and compared it to his latest one, Improvement - Airbases. I had already looked through the airbase one but didn't see anything that would help with a land based carrier for land units. It doesn't look like the Improvement - Airfield is really much different. There is a key difference between his mods and what I am trying to accomplish. The game has native code for dealing with air unit rebasing which whoward69 and others have modified to allow rebasing to an improvement and/or land based air unit carrier. It seems that the Transport Armor Tank mod is the only attempt made so far to replicate this with a land based carrier unit that can carry DOMAIN_LAND units. The upside with that mod is that it doesn't require any Lua code or a DLL mod. It is strictly XML. The downside to that mod, at least IMHO, is that it uses the paradrop functionality to load the unit. You have to embark the carrier unit and then paradrop the unit to be carried into the same hex as the embarked carrier unit. My mod works basically the same way except that it doesn't use paradrop so you don't get the paradrop animation when you are just trying to attach a unit to a combat command. The Lua code provides the method for loading the unit instead of paradropping. Unfortunately, it still requires the carrier unit to be embarked for some reason. I don't really understand that since there are mods for rebasing air units to a land based air unit carrier. I think it has to do with 1UPT and the fact that when you embark the unit to be carried onto the same hex as the CC unit, something "magical" :) happens which allows the CC unit to be recognized as a carrier and not just another embarked combat unit. All very strange. :crazyeye:

I'll be honest and suggest this probably requires C++ source code modifications. Probably slight, as you might need to add exceptions to the code that already allows carrier transports.

You'll need to do this for the AI to understand how it works.

Yeah, I'll probably have to put this on the back burner for now, crossing my fingers that whoward69 will be persuaded to add some functionality for this to his next DLL release :D. I may try a couple more things first, but I'm not optimistic about any success.
 
While "Improvement - Airbases" and "Improvement - Airfield" solve the same problem, they come at it from completely different directions, so don't try and compare them!

To implement "carriers" for land units you'll need to create a new type of SPECIALUNIT_ (the easy bit) and a corresponding UNITAI_CARRIER_ (the hard bit, probably requires a DLL mod)
 
To implement "carriers" for land units you'll need to create a new type of SPECIALUNIT_ (the easy bit)...

Yeah, I already did all of that but it doesn't help. I'm pretty sure the problem lies with trying to load a DOMAIN_LAND unit onto a DOMAIN_LAND carrier. There is no underlying code to allow this type of game mechanic . You can load a DOMAIN_AIR unit onto a DOMAIN_LAND carrier using a REBASE mission. I'm thinking I might try something really hokey like changing the domain of the unit to be loaded from DOMAIN_LAND to DOMAIN_AIR, push the REBASE mission, and then switching it back to DOMAIN_LAND after it has loaded successfully. :crazyeye: It's a stretch, but it might work.

Code:
<SpecialUnits>
     <Row>
          [B]<Type>SPECIALUNIT_COMBAT_COMMAND</Type>[/B]
          <Description>TXT_KEY_SPECIALUNIT_COMBAT_COMMAND</Description>
          <Valid>true</Valid>
          <CityLoad>true</CityLoad>
     </Row>
</SpecialUnits>
<Units>
     <Row>
          <Class>UNITCLASS_COMBAT_COMMAND</Class>
          <Type>UNIT_COMBAT_COMMAND</Type>
          <Domain>DOMAIN_LAND</Domain>
          [B]<DomainCargo>DOMAIN_LAND</DomainCargo>[/B]
          [B]<SpecialCargo>SPECIALUNIT_COMBAT_COMMAND</SpecialCargo>[/B]
          ...
     </Row>
     <Update>
          <Where Class="UNITCLASS_INFANTRY"/>
          [B]<Set Special="SPECIALUNIT_COMBAT_COMMAND"/>[/B]
     </Update>
</Units>

...and a corresponding UNITAI_CARRIER_ (the hard bit, probably requires a DLL mod)

I haven't even gotten that far and I'm not sure yet if I can get it to where the AI will be able to use it. My current Lua code is dependent upon human input in order to load the unit. I'm not sure how to implement the equivalent when the AI wants to load the unit.
 
Well, I'm not sure how it's changed in GaK (I haven't played a whole lot of lategame since the expansion came out) but in Vanilla, AI would actually never build a carrier.
 
Well, I'm not sure how it's changed in GaK (I haven't played a whole lot of lategame since the expansion came out) but in Vanilla, AI would actually never build a carrier.

I can assure you from several of my late game experiences that Japan will build, and use carriers. As for others my memory is less clear.
 
Ok, so I am trying to revisit this and come up with something workable. The plan is to create some kind of multi-unit formation that will be dependent upon the type of command the player selects (example: tanks, mech infantry, and self-propelled artillery for an armor/mechanized command). Unfortunately, I haven't gotten that far since I am having trouble just getting snafusmith's halftrack to show up correctly alone. It seems the drivers are so fed up with combat that they are literally sticking their heads in the sand. :)



I can't imagine that I could possibly have done anything wrong, ;) but just in case, can anyone offer any suggestions as to what I'm missing? Latest version attached.
 

Attachments

Back
Top Bottom