When I added GOM_UNITCOMBAT, I sneaked in a hasCombatType method that works similar to hasSubCombatType but considers main combat type and sub combat types equally.
I spent a lot of time today musing over this issue and there's only one place where I think I might need the separation still and that's probably just due to not knowing all the tricks and tools: the Text Manager. I'd like you to review the code there for displaying all unit combats on unit help popup and see what you can make of how to adjust it if we abandon the old hasSubCombatType entirely.
Otherwise, after much thought, I don't think there would be any other problem with what you proposed and instead using the tag you worked out on hasCombatType. I assume that's in the Unit.cpp? I also presume its using an improved vector combination method? It sounds extremely helpful either way.
@Thunderbrd
I have another question ...
So lineages like the Law Enforcement, Medic, Recon and Criminal line cover many types. Are you saying that we can have combos such as ...
- Medevac Helicopter = Healer + Helicopter
- Police Car = Law Enforcement + Wheeled
- Adventurer = Recon + Mounted
- Medical Ship = Healer + Diesel Ships
- Mobster Car = Criminal + Wheeled
- Pirate Ship = Criminal + Wooden Ship
I knew you would be quick to 'see the light' Hydro! Yes, this is very much intended.
@Thunderbrd:
*head hurts* man this is a lot of new ideas for one mechanic in the Combat Mod. I can hardly imagine how much XML will be needed just to clean up references in Units and Promotions to unitcombats for this. For instance, if we made Cavalry units UNITCOMBAT_CAVALRY and UNITCOMBAT_MELEE, then Axemen would get +50% against them, Shock would apply against them, and so on and so forth. Ditto for almost any other combination of combats that I can think of.
The other nightmare I see from this is the AI. It is already not good at unit selection, and I can't imagine that it will get better now that we are giving units arbitrarily high quantities of unitcombats. I know that much of the Unit selection logic is handled by UNITAIs, but I think that if all that the AI sees is the unitai, then it will be oblivious to the opportunities presented by the subcombats. I think that before implementing any of the features of the Combat Mod into the XML that we should make sure that the AI will not be inconvienenced by them.
True, but why would you ever flag cavalry as melee???
I actually don' think this will be too bad for the AI. It already takes into account all the combat modifiers, and this won't change that (just changes where they come from). As far as evaluating stuff it's really just more promotions, and with a few tweaks the existing promotion evaluation should cope fine. The existing code for building-based unitCombat modifiers should also work fine (it's just more unitCombats that a unit can have)
1. That was just an example, I was actually thinking of giving Horse Archers the Archer unitcombat, and then realized all of the implications of that.
2. OK, That makes sense.
Ok, I take your point. I guess there would probably be a need for some rebalancing. The horse archer example is worth thinking about - it might be a significant disadvantage because the unit would be counterable by many more unit types than either a simple archer or mounted unit would (spears and javelins for example would both get big plusses against it). Of course, it would also be eligible for a wider variety of promotions, and bonuses from buildings...I'm not sure where the balance woud lie, hit there's a good chance it will change things around enough that well need to do some unit rebalancing.
Maybe the bonuses shouldn't stack between unitcombats. For instance, if a unit has +50% vs Archers and +20% vs Horse Units only gets +50% vs Horse archers.
Of course, I gave all these thoughts a lot of consideration when setting this up. I'm not going to purport to have all the balance figured out in my head but I have a few things to say on these matters:
1) Unit AI really wouldn't be impacted much for all the same reasons Koshling brought up. The existing system should handle it 'ok' but that's just as well as its handling pretty much everything else and we're wanting to make a lot of improvements there anyhow so why not do them with the combat mod features in mind first rather than let them be adjusted then have to be readjusted further to account for the combat mod features later? Yes, there are some issues the ai should be considering further, but outside of its basic evaluation routines it already has in mind along with a few tweaks as we see them doing things they shouldn't be doing, it should work fairly alright under this part of the combat mod already.
2) MOST subcombat definitions on a unit will stem from their original unit info definition and only special cases will make promos add new subcombats for as long as those promos continue to qualify on that unit type (will generally outdate on upgrades and such.) So this means that just about any overlap of truly core vanilla combat classes would not only bring some pretty big potential for being effectively countered by one or a few units with well placed promos, it also means they get an exorbitant amount of bonus xp from buildings that are giving their bonuses to those specific Combat Classes, and free promos doing the same.
3) A unit can still only have so many promos at once right? What they earn is limited to what they have achieved and this means that even if I've got an archery and mounted unit, one opponent would still usually be hard pressed to have capped out its possible promo benefits against even one of those combat classes. There's also going to be SO many new promo lines and types after the combat mod is said and done that it will distill these kinds of 'anti-specific combat class' promotions a great deal... it won't always be the most effective promotion styles anymore.
4) This simply means that there's a big tradeoff between the benefits and penalties of a unit with multiple core combat classes, a tradeoff that the ai will naturally work with rather well based on the current ai methods but should be factored into future ai tweaks of course.
5) We should not underestimate the promotion access issue. I'm about to post on promotion types and promotion lines so I'll say more there. But the current system of designing promo access should be greatly adjusted for the combat mod so that combat classes govern these even more directly. Thus, Archers, by default would no longer have City Defense (why not have some archery units have a focus on City Attack instead? Camel Archers make poor city defense even with the promo line being accessible etc...) thus you'd have 'City Garrison' as a combat class in and of itself and if you wanted the Archer unit to have this by default, list City Garrison as one of its SubCombats. Again... more on this in the next discussion. I've been considering what makes the defining of Combat Class Promo access a pain in the arse and I'm looking to use SubCombats and Promo Lines to simplify the process a great deal. (It might mean gutting the current unit xml extensively but for the sake of ease of future modding and rationalizing Promo access chains easier.)
6) Overlapping CORE (by this I generally mean the currently existing Combat Classes) combat classes too much is probably best to be avoided if possible. Few, special, units sure, but its not a good idea to now say, ok, since Knights fight in melee, they should automatically be Melee and Mounted. It might not be a bad idea to do so but the decision to should not be taken too lightly either. I was originally thinking the Javelineer units should be archery and melee but I now feel it would be best to just be a Throwing unit. The Knight should be a Heavy Mounted (to suggest the dual role), as opposed to Light Mounted (the hit and run, surround and destroy raider style) as a sub-definition for Mounted, which should remain its primary Unit Combat.
7)We should put the original vs Melee, vs Archery, vs etc... promo lines to shame with all the forms of promo lines we can develop towards all the many types of Sub Combats we'll have defined. Therefore they begin to blend into the fabric rather than standing out as an easy way to isolate your enemy's strengths and target it or as an easy way to cross defend your stacks. In general, the more common a Combat Class definition is, the lower the combat vs benefit a promo line should offer. For example, Shock is generally +25 per step vs Melee (fairly common... about a third to a fifth of all units tend to be Melee) which is quite a bit stronger than the standard balanced minimum Combat line which is +10 against all. A bonus vs Humans should probably be a +15 due to how common Humans units are... etc...
With all these in play, each being roughly equivalent in value, we confuse the player as much as the ai as to the wisest course of promoting and thus bring the ai closer to our level. It's a bit counter intuitive on the method but in many ways, the AI should benefit from the vastness of options as it will rely on the power of semi-guided chaos in its selections to make the player always second guess his strategy as it won't always work repeatedly. It forces us to abandon 'standard practices' and start really paying attention to what we're likely to be up against instead.
Wait this is just the first part
wow I must say great job on this thunderbird
Thanks GiuseppeIII!
More to come tonight. And there's still a lot of polishing and recoding to make the mod more processing effective still...
Well I was thinking of the Horse Archer. We have a Horse Archer and A Horse Crossbowman. What if it worked like this?
- Archer = Archer + Human + Bow
- Crossbowman = Archer + Human + Crossbow
- Horse Archer = Mounted + Horse + Bow
- Horse Crossbowman = Mounted + Horse + Crossbow
- Camel Archer = Mounted + Camel + Bow
- Llama Archer = Mounted + Llama + Bow
Thus you can have specific bonuses vs Bows but not Crossbows. Likewise you can have a bonus vs Horses but not Camels.
Again... you see the light! There'd be more definitions than these but this perfectly highlights the intention.