Custom Battle Phases
-
In part what I'm getting at is if we were to have custom battle phases I think it should overall be relatively generic. No phase should be defined in terms of specific units. If we have that, then we have combat logic that knows about specific unit types an their abilities. This couples unit types and abilities, specific games, to the generic battle flow. Instead I think the route is to define an interface, a set of parameters for each unit ability (which would be its own XML block), and then a way to configure the battle phases to configure and order those abilities within combat. The lack of any specific ability (either through having no special ability or all abilities negated), would be the general combat phase.
For example, this structure would support units that could attack multiple times per round with different attack types. Let's say we have something like a "Cleric" unit, could cast 'heal' at the start of a round but still then be able to participate in combat.
-
@LaFayette said in Custom Battle Phases:
Concern: we are making things more general but are still specific (in which case it's arguably just complex but not actually more generic). EG: rule names that mention "submarines" and that know about specific unit types. This seems to be the same problem where everything knows about AA rather than just being it's own combat phase.
Please don't get hung up on how I'm naming things. I'm giving rough examples to explain the idea. Here's the exact same XML using gibberous names but it still does the same thing:
<combatPhases> <phase name="first strike" order="1"> <ability name="cat"/> <ability name="dog"/> </phase> <phase name="general" order="2"> <ability name="general"/> <ability name="fish"/> </phase> </combatPhases> >><unitAbility name="cat" returnFire="false"> <targets>...</targets> </unitAbility> <unitAbility name="dog" returnFire="true"> <targets>...</targets> </unitAbility> <unitAbility name="general"> <targets>...</targets> </unitAbility> <unitAbility name="fish"> <targets> <target>destroyer</target> </targets> </unitAbility> <unitAbility name="turtle"> <abilityFrom>cat</abilityFrom> <abilityTo>dog</abilityTo> </unitAbility> <unitAbility name="horse"> <abilityFrom>fish</abilityFrom> <abilityTo>general</abilityTo> </unitAbility> <attachment name="unitAttachment" attachTo="destroyer" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <unitAbilities> <ability>general</ability> </unitAbilities> <antiAbilities> <ability side="enemy">turtle</ability> <ability side="ally">horse</ability> </antiAbilities> ... </attachment> <attachment name="unitAttachment" attachTo="submarine" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <unitAbilities> <ability>cat</ability> </unitAbilities> ... </attachment> <attachment name="unitAttachment" attachTo="fighter" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <unitAbilities> <ability>fish</ability> </unitAbilities> ... </attachment>@LaFayette said in Custom Battle Phases:
If we can design the unit abilities in such a way that an 'anti-ability' is a wholesale negation or (an effective) removal of the ability, I think that would make things quite a bit simpler and lend itself to generic abilities and anti-abilities
The ability for "anti-abilities" to not only negate an ability but to "convert" an ability is I think quite simple and it lends itself to generic abilities and anti-abilities. It also handles all the different permutations that the engine current provides.
@LaFayette said in Custom Battle Phases:
In part what I'm getting at is if we were to have custom battle phases I think it should overall be relatively generic. No phase should be defined in terms of specific units.
My example does do that. None of the abilities or phases are tied to any specific units. The ability "submarine" could be attached to a "fighter" unit without any problem. Then the "fighter" would have a first strike ability but a "destroyer" would still negate the "fighter".
-
Sorry, I didn't parse the example closely enough.
@Trevan , I think we are getting closer to consensus. I'm thinking two further examples would be useful at this point for more consideration:
-
An example of the default value that would be inferred if the combat phase XML block is not present. Presumably no map will be required to have such a block (WWII maps). In such cases there would be a default that would be effectively generated and used. What would this effective default block be?
-
An example of a map where the combat phase definition is particularly useful. This example would potentially be hypothetical and show what could be done to make an existing map less hacky and simpler. I'm thinking something like the WoW map or the map that has depth charges.
-
-
Here's a rough draft of what the inferred phases and abilities would look like in three possible property configurations:
<!-- WW2V2 = false, Defending Subs Sneak Attack = true --> <combatPhases> <phase name="AA"> <ability name="AA" /> </phase>. <phase name="bombardment"> <ability name="bombard" /> </phase> <!--phase name="land paratroopers" /--> <!--phase name="evade retreat" /--> <phase name="first strike"> <ability name="first strike" /> </phase> <phase name="general"> <ability name="general" /> <ability name="ignore evaders" /> </phase> <!--phase name="retreat" /--> </combatPhases> <unitAbilities> <unitAbility name="AA" type="combat" returnFire="false" dice="AA"> <!-- units with isAAforCombatOnly get this automatically --> <targets><!-- all air units --></targets> </unitAbility> <unitAbility name="bombard" type="combat" returnFire="false" dice="bombard"> <!-- units with canBombard get this automatically --> <targets><!-- all units --></targets> </unitAbility> <unitAbility name="first strike" type="combat" returnFire="false" dice="normal"> <!-- units with isFirstStrike get this automatically --> <targets><!-- all sea units --></targets> </unitAbility> <unitAbility name="anti-first strike" type="change" faction="enemy"> <!-- units with isDestroyer get this automatically --> <from>first strike</from> <to>general</to> </unitAbility> <unitAbility name="ignore evaders" type="combat" dice="normal"> <!-- units with isAir get this automatically --> <targets><!-- all non canEvade --></targets> </unitAbility> <unitAbility name="anti-evader" type="change" faction="allied"> <!-- units with isDestroyer get this automatically --> <from>ignore evaders</from> <to>general</to> </unitAbility> </unitAbilities> <!-- WW2V2 = false, Defending Subs Sneak Attack = false --> <combatPhases> <phase name="AA"> <ability name="AA" /> </phase>. <phase name="bombardment"> <ability name="bombard" /> </phase> <!--phase name="land paratroopers" /--> <!--phase name="evade retreat" /--> <phase name="first strike"> <ability name="first strike" /> </phase> <phase name="general"> <ability name="general" /> <ability name="ignore evaders" /> </phase> <!--phase name="retreat" /--> </combatPhases> <unitAbilities> <unitAbility name="AA" type="combat" returnFire="false" dice="AA"> <!-- units with isAAforCombatOnly get this automatically --> <targets><!-- all air units --></targets> </unitAbility> <unitAbility name="bombard" type="combat" returnFire="false" dice="bombard"> <!-- units with canBombard get this automatically --> <targets><!-- all units --></targets> </unitAbility> <unitAbility name="first strike" type="combat" side="offense" returnFire="false" dice="normal"> <!-- units with isFirstStrike get this automatically --> <targets><!-- all sea units --></targets> </unitAbility> <unitAbility name="anti-first strike" type="change" faction="enemy"> <!-- units with isDestroyer get this automatically --> <from>first strike</from> <to>general</to> </unitAbility> <unitAbility name="ignore evaders" type="combat" dice="normal"> <!-- units with isAir get this automatically --> <targets><!-- all non canEvade --></targets> </unitAbility> <unitAbility name="anti-evader" type="change" faction="allied"> <!-- units with isDestroyer get this automatically --> <from>ignore evaders</from> <to>general</to> </unitAbility> </unitAbilities> <!-- WW2V2 = true --> <combatPhases> <phase name="AA"> <ability name="AA" /> </phase>. <phase name="bombardment"> <ability name="bombard" /> </phase> <!--phase name="land paratroopers" /--> <!--phase name="evade retreat" /--> <phase name="first strike"> <ability name="first strike" /> <ability name="first strike with return fire" /> </phase> <phase name="general"> <ability name="general" /> <ability name="ignore evaders" /> </phase> <!--phase name="retreat" /--> </combatPhases> <unitAbilities> <unitAbility name="AA" type="combat" returnFire="false" dice="AA"> <!-- units with isAAforCombatOnly get this automatically --> <targets><!-- all air units --></targets> </unitAbility> <unitAbility name="bombard" type="combat" returnFire="false" dice="bombard"> <!-- units with canBombard get this automatically --> <targets><!-- all units --></targets> </unitAbility> <unitAbility name="first strike" type="combat" side="offense" returnFire="false" dice="normal"> <!-- units with isFirstStrike get this automatically --> <targets><!-- all sea units --></targets> </unitAbility> <unitAbility name="first strike with return fire" type="combat" side="offense" returnFire="false" dice="normal"> <!-- no units get this by default --> <targets><!-- all sea units --></targets> </unitAbility> <unitAbility name="anti-first strike" type="change" faction="enemy"> <!-- units with isDestroyer get this automatically --> <from>first strike</from> <to>first strike with return fire</to> </unitAbility> <unitAbility name="ignore evaders" type="combat" dice="normal"> <!-- units with isAir get this automatically --> <targets><!-- all non canEvade --></targets> </unitAbility> <unitAbility name="anti-evader" type="change" faction="allied"> <!-- units with isDestroyer get this automatically --> <from>ignore evaders</from> <to>general</to> </unitAbility> </unitAbilities> -
Here's some rough examples of how it could help some feature requests:
https://forums.triplea-game.org/topic/2463/bombers-single-round-attack
<unitAbility name="bomber" type="combat" dice="normal" rounds="1"> <targets>...</targets> </unitAbility> <phase name="general"> ... <ability name="bomber" /> </phase>https://forums.triplea-game.org/topic/2344/cannottarget-cannotbetargetedby-on-attack-defense
<unitAbility name="defending against bombers" type="combat" dice="normal" side="defense"> <targets><!-- all unit types other than bombers --></targets> </unitAbility> <unitAbility name="attacking against bombers" type="combat" dice="normal" side="offense"> <targets><!-- all unit types --></targets> </unitAbility> <phase name="general"> ... <ability name="defending against bombers" /> <ability name="attacking against bombers" /> </phase>As for WoW, I think I'd need some help from @Frostion. WoW is heavily using AA and I think there are aspects of it that were hacked around, but I'm not positive.
-
This is a good examle. I notice that the bomber defense and attack are part of the 'general' phase. Are there multiple phases specified, or the elements within a phase different phases? If that is just one phase as it just appears, what would multiple phases look like?
Another question, does 'dice=normal' control the number of dice sides, where normal means use the default defined for the game?
-
@LaFayette said in Custom Battle Phases:
This is a good examle. I notice that the bomber defense and attack are part of the 'general' phase. Are there multiple phases specified, or the elements within a phase different phases?
I only showed what would need to be changed to the general phase. There would be the AA, bombardment, first strike phase as well but they wouldn't need a change.
If that is just one phase as it just appears, what would multiple phases look like?
I think my previous example shows this.
Another question, does 'dice=normal' control the number of dice sides, where normal means use the default defined for the game?
There are three types of dice that are definable on a unit: AA dice (attackAA, offensiveAttackAA, and related), bombardment dice (bombard or attack), and normal/other/general/somename dice (attack and defense). So there needs a way to indicate which of the type of dice will be used by a unitAbility. My examples used
dice. -
I just noticed that there is a property
unitAbilitiesGainedthat is a part of thetechAbilityAttachment. This currently allows units to gain thecanBombardandcanBlitzabilities. And since this is tech, it means that players can have different settings per unit.I was envisioning that the unitAbilities that each unitType would be the same for all players. But because of
unitAbilitiesGained, the units that would participate in the bombard phase can be different for each player.My question is, should the mapping of unitAbilities <-> unitType be dependent on the player?
-
@Trevan said in Custom Battle Phases:
Right now, the battle has roughly 4 different phases:
AA/Targeted attacks
Bombardment
First Strike/Sneak Attack
All other unitsIs it intentional that you didnt state air battles as another extra phase?
-
@TorpedoA said in Custom Battle Phases:
@Trevan said in Custom Battle Phases:
Right now, the battle has roughly 4 different phases:
AA/Targeted attacks
Bombardment
First Strike/Sneak Attack
All other unitsIs it intentional that you didnt state air battles as another extra phase?
In the engine, air battle is a completely separate battle, not a phase. The air battle has generally the AA phase and the All other units phase.
-
@Trevan Ok, thanks.
I know that you are thinking about custom battle phases. I read that. And i am very intrigued.
What do you think about this: https://forums.triplea-game.org/topic/2657/bombard-option-not-restricting-to-amphibious-assaults -
@Trevan One goal of mine atm is to use all possible battles in my mod.
But i only want those who allow the casualties to fire back.
That means i can use all of them except AA.
So i have 3 types:
Air Battle
First Strike (v2 + Destroyer present)
normalonly bombard i cannot generally use because its only for isSea. Thats why did a request for bombard to be a general use.
-
@Trevan said in Custom Battle Phases:
The air battle has generally the AA phase and the All other units phase.
I guess you talk about air battle in conjuction with AA phase because you imagine AA as a related action to aircraft encounters with AAGun-like units?
Because we can have non-isAir, non-aircraft units with canAirBattle, fortunately, and additionally have AA ability.
I now tested, just to clarify for myself, that AA is not related to air battle per se. I just want to avoid missunderstanding on my side, which is quite possible. Because i thought i can have AA at the start of air battles too.
I try my best to conclude as good as i can. Please correct me:Basicaly AA is after air battle phase and before normal battle phase so to say.
So we can state that there are indeed 2 seperated Battles. (ignoring the non-fighting phases)
1. Air Battle (no support)
- phase
2. Normal Battle (support)
- Bombardment phase (the only still hard restricted one -> amphibious assault)
- First Strike phase (v2 vs v3 destroyer)
- phase
In terms of order of phases (at minimum 1)
- air battle phase
- aa phase
- bombard phase
- first strike phase
- normal phase
The main reason why i lay it out so much, is that i want to be sure about the order of phases in general at the most basic if i use all battle options whether or not i then modify further.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login