Transport units

TC01

Deity
Joined
Jun 28, 2009
Messages
2,216
Location
Irregularly Online
It has come to my attention that the AI does not understand how to use a land transport. What does this have to do with Star Wars, you ask?

Well, (on my suggestion) all terrain in Star Wars, space and planetary, is "Land" to solve another issue- "landlocked" cities (founding a city in the center of a planet). However, that means that the AI will never, ever leave it's home planet since it doesn't understand. To it, all terrain is "Land". It understands units only crossing space fine, just not transports.

At least, I think.


So I had an idea, short of doing the impossible (no one has been able to get AI to use land transports to my knowledge). If you've played Star Wars Empire At War you know that when you have ground units in a space battle, those units are represented by a transport.

So I propose we do that. "Land units" will be allowed into space. Once they are in space, we give them a promotion via python (I can do this) called "Loaded" or something like that. This promotion changes the unit's art to make them look like a transport, or at least a land unit with a transport out in front of them. Kind of the way Planetfall works (land units can cross ocean tiles under your control and look like a land unit and a boat).

I'm not an art person, so I don't know how feasible this is to do graphically. Kael describes it vaguely in his Modder's Guide to BTS:

I am going to apologize beforehand for the lack of detail in this section. I’m not a graphics guy and I haven’t used this feature myself. But I have toyed with some of the units that use it. Basically it is possible to have a model changed based on the promotions it has.

For example, you could make a bomber model that, if it has the correct promotion, shows a bomb strapped to its bottom. Then if the promotion is removed, say by a bombing action, the model would be changed so the bomb is no longer visible. The same could be done in showing swords and axes in units hands, armor they are wearing, units surrounded in clouds of putrid gas, radiation, etc.

I will stress that this isn’t as simple as making a promotion, pointing it to model art and having everything work. The model has to be made with the “attachment” built into it. By default it isn’t displayed, but with the promotion it shows up. So it will be significant modeling work to use this function, but I have no doubt the amazing artists here at CivFanatcis will have a lot of fun with this feature.

The only issue is that the AI will go exploring with ground units. But there may also be a workaround to that. If we make the Loaded promotion significantly weaken the land unit the AI might not decide to go exploring with it. If that doesn't work, I can script it in python not to, I think.

Is this feasible graphically? Are there issues with my suggestion? Are there better ideas?
 
No this is a great idea could you make three different loaded python promotions. One when the unit is in space weakens the most, Two when the unit is in orbit medium weakener, and Three one for when its in the ocean. I will write up the promotions. What should they be called? Make it change the unit graphic to a transport for ocean and space/orbit become cruiser.
 
Ocean? You mean for an ocean planet?

I'd call the promotions "Crossing Deep Space" (PROMOTION_DEEP_SPACE), and "Crossing Planetary Orbit" (PROMOTION_PLANET_ORBIT), and for "ocean" "Crossing Ocean" (PROMOTION_OCEAN).
 
That'll work I'll add them in in a second
 
Well, it seems that by curious coincidence, TheLadiesOgre has come up with a way to teach the AI how to use land transports, just now. We could use his DLL in our mod (it's for unmodded BTS 3.19), or we could use the units-becoming-transports.

Do we still want to do this? I don't really care which system we use, it's up to you and the rest of the mod team.
 
Teach the AI to use land transports
 
I'll update the first post then.

Anyway, we can use the modcomp:

I doubt much would need to be changed (other than units it was applied to). You could even break it up more if you wanted, make several specific SPECIALUNIT_BLAH_BLAH's and apply them to different units you want to be transportable and then plug them into the units you want to use as transports for those units (thinking CIS Units can't use a Republic ship and vice versa so on and so forth).

So we would need to add the DLL from that modcomp (drop it into Assets folder of our mod), then add in UNITAI_ASSAULT_LAND from his XML.

Then we would need to add SPECIALUNIT tags like SPECIALUNIT_INFANTRY or SPECIALUNIT_VEHICLE, give these SPECIALUNIT tags to the particular units we wanted to be able to be loaded. And then we would give UNITAI_ASSAULT_LAND to transport units, and finally define a SpecialUnit as the specific cargo of such a transport. For instance:

-AT-AT Transport: UNITAI_ASSAULT_LAND, carries 2 SPECIALUNIT_VEHICLE.

SPECIALUNIT_VEHICLE: Given to AT-AT, AT-ST, etc.

Or:

-Droid Transport: UNITAI_ASSAULT_LAND, carries 4 SPECIALUNIT_DROID.

SPECIALUNIT_DROID: Given to units like Battle Droid, etc.

Do you understand? After you add the DLL and the UnitAI it's all doable via XML in CIV4UnitInfos.xml and CIV4SpecialUnitInfos.xml. (You don't have to use the specific examples above, but it's basically how this would work).
 
I'll start adding those in in a second
 
Top Bottom