Rules for unit combat

vanier

Chieftain
Joined
Oct 24, 2011
Messages
2
I may be missing it, but have yet to see a good guide to what can be changed other than UI, icons, maps, scenarios etc.

For example - would really like to modify some behaviors, for example, always frustrated when a SAM attacks and destroys tanks. Or a mobile rocket launched sinks a nuclear submarine.

Are these kind of behaviors and or rules modifiable?

Thanks

Moderator Action: Moved to the main forum.
Because the tutorials subforum is only for tutorials ;).
 
I may be missing it, but have yet to see a good guide to what can be changed other than UI, icons, maps, scenarios etc.

Kael's modding guide, stickied in the References section, is a good place to start.

For example - would really like to modify some behaviors, for example, always frustrated when a SAM attacks and destroys tanks. Or a mobile rocket launched sinks a nuclear submarine.

Here's the thing: behaviors themselves aren't modifiable, in that we can't just arbitrarily tell the AI "don't do that!". What you CAN do is change the units' stats so that they SHOULDN'T do that, and the AI is smart enough to see the change and account for it.

So let's take your two examples.

1> SAMs vs. Tanks.
It's not that the AI is stupidly doing this, it's that in the vanilla game, there's no reason not to use SAMs as resourceless tanks, since they can do basically everything a tank can do and also have the extra anti-aircraft abilities. A smart player would do the same thing the AI does.
SOLUTION: In my mod, I added a "Melee Penalty" promotion that gives a unit -50% vs. infantry, armor units, etc. and Cities, but NOT vs. siege, aircraft, or naval units. I then gave that to the AA gun and the SAM launcher. Now, SAMs are no longer able to easily attack tanks or cities, but can still do their air defense role just fine. Alternatively, you can use a promotion that gives a generic penalty to attacks (or disables them entirely).

2> Artillery (especially rocket artillery) vs. naval vessels.
The game has an inherent power imbalance. Naval units' stats are WEAK compared to artillery units. The counterbalance is that air units (especially Bombers) have an inherent "Naval Penalty" promotion (-50% vs. naval units), so air units kill artillery much more easily than they kill battleships.
SOLUTIONS: There are many.
A> Increase the power of naval units across the board, but remove the Naval Penalty promotion from the air units.
B> Give artillery the Naval Penalty promotion as well.
C> Find some other useful ability to give naval units. For instance, I mentioned over in another thread that in my mod I'd created a "Damage Reduction" promotion (your unit takes 1 less damage in every combat) for some sci-fi and fantasy units, and then realized that I could give it to Ironclads and Battleships to make them much stronger when facing multiple weak bombardment attacks (Fighters, outdated artillery, leftover crossbows, etc.)

Now, if you only want to address the submarine thing, then you're missing one point: that submarine was invisible until it was detected, presumably through an enemy sub or destroyer. So that sub should never have been near the shoreline in the FIRST place, since it can't attack land units, and out in the deep water it should have been far superior to artillery in terms of killing enemy ships or sinking transports. Your scenario, then, assumes that two unusual things have already broken in your favor; it's not a fair comparison.

---------
Bottom line: we can't directly alter behavior. But we CAN change an awful lot just using the current XML/Lua setup, and as you get a better idea of what can be done, you'll think of dozens of ways to fix each issue you come across.
 
Spatzimaus

Thanks for your thoughts. Should have looked at unit abilities closer. When I saw SAM, I naturally figured soft skinned wheeled or tracked vehicle dedicated to anti-air defence. Useless against armor. Wasteful against other targets unless in dire need, if even possible based on guidance used. Should have looked at the unit information closer.

As for a MRL hitting a nuclear sub, whether it is close to shore or not is a little unrealistic unless the sub commander decided to beach the sub. The rockets fired from an MRL generally explode on contact depending on type, in this case the surface of the water - just a little unexpected they could affect a submerged sub

Will look at Kael's mod guide, thanks
 
When I saw SAM, I naturally figured soft skinned wheeled or tracked vehicle dedicated to anti-air defence.

I know. You SHOULD be able to do exactly what you described, but unfortunately the vanilla game just isn't structured that way. Quite a few things have stats that don't really match what their real-world equivalents would have. But since they don't, we get to the problem I mentioned: changing the AI behavior isn't really possible, but the only reason the AI is doing those ridiculous things in the first place is because it's not ACTUALLY ridiculous in practice. So fixing the underlying balance issue will fix the AI behavior as a byproduct;

whether it is close to shore or not is a little unrealistic unless the sub commander decided to beach the sub.

Well, there are anti-submarine rocket systems used by destroyers and such, which don't explode on impact with the surface. But the bigger issue is that while nuclear submarines are deep-sea vessels and won't come close to the surface unless they're in the act of firing missiles, the non-nuclear subs they replaced weren't. "Submersible Boats" only submerged when they had to, and stayed on the surface most of the time (making them vulnerable to air attacks, for instance). So if you were to try to change the rules to better reflect the reality of nuke subs, you'd be putting in an exception that ONLY applies to a single unit type. And since air units already have a penalty against naval vessels, you'd only be giving it to a single group of units; fighters are already penalized against naval units, but they shouldn't be penalized further because they CAN carry torpedoes and such.

That's just a waste, in general. It'd be easy enough to do; there IS a table in the promotions file allowing units to have bonuses or penalties against a single unit type (mainly used for the anti-air promotion), so all you'd need to do is add a custom promotion that gave -50% versus nuclear subs, and give it to all artillery units. (If you gave it to bombers as well, then it'd stack with the -50% they already have and make it -100%.)

---------
The point is, if you fix these balance issues through XML mechanics, the AI's behaviors will automatically adjust towards what you think the correct styles should be.
 
Back
Top Bottom