Author Topic: Faulty Battle Allegiances  (Read 7948 times)

edgewater1364

  • Peasant
  • Posts: 2
    • View Profile
Faulty Battle Allegiances
« Topic Start: July 08, 2018, 11:17:03 PM »
Hey, I wanted to let you (the devs) know that during a battle in Winkamus, Highmarch incorrectly stayed Neutral due to faulty coding.

It's not working as intended, no it isn't, don't tell me it is, because I personally know better. I don't want to go in there and change it myself because I don't have permission, (and would likely just make things worse) but it should be looked at, at least, and honestly, I don't know why we still have issues like this after so many years and years of battles. Literally battles are the premise of the game. How can we trust we will properly enjoy them when the immersion is destroyed again and again by coding issues and other game-related meta accidents? Anyway.

Redhaven is at War with Vix Tiramora, but so is Highmarch. There's no diplomatic reason realms at peace wouldn't join in an attack against a realm that they're both at War with because of a pre-existing alliance. I'm sure the game only checks one relation to be at War and acts accordingly, but in this case, War status should supercede any supposed caution. Again, its two realms in alliance, and one at peace with both of those, but all three are at War with the other, there is no diplomatic reason for one party to not be involved. The whole point of us being there is to actually fight alongside Highmarch. Again, there is literally no reason beyond game code that we are not fighting together.

Is there anything I can do to help this fix along or are we just going to have to go to Alliance status with Highmarch for game reasons and pretend we're still at Peace Diplomatically?
« Last Edit: July 08, 2018, 11:20:48 PM by edgewater1364 »

Zakky

  • Mighty Duke
  • ****
  • Posts: 618
    • View Profile
Re: Faulty Battle Allegiances
« Reply #1: July 09, 2018, 07:07:31 AM »
It is working as intended actually. Peace is enforced. If you want to fight, don't be in peace.

Wimpie

  • Developer
  • Mighty Duke
  • ****
  • Posts: 1777
    • View Profile
Re: Faulty Battle Allegiances
« Reply #2: July 09, 2018, 08:19:31 AM »
It is working as intended actually. Peace is enforced. If you want to fight, don't be in peace.

^ This has always been the case and has forever not been treated as a bug.
Osgar (Thalmarkin, BT), Jeames (Perleone, EC)
PAUSED: Nasgar (Avernus, DWI), Jari (Outer Tilog, COL)

Attano

  • Noble Lord
  • ***
  • Posts: 171
  • Diplomacy! Violence! Pasta!
    • View Profile
Re: Faulty Battle Allegiances
« Reply #3: July 09, 2018, 04:04:09 PM »
The issue is that Highmarch didn’t fight Vix alongside Redhaven.
Once the Daleborn family, now the Attano family.

Vita`

  • BM Dev Team
  • Honourable King
  • *
  • Posts: 2558
    • View Profile
Re: Faulty Battle Allegiances
« Reply #4: July 09, 2018, 04:51:08 PM »
I've tried several times, but your message is all over the place. I'm trying to look into this, but in the future, it'd be better to clearly state what each realm's diplomatic relations to the other realms are, the battle region (which you did, thanks) and region owner.

Generally, if you want to support someone in a battle, you need to be allied or federated. If you want to war someone, you need to be at war with someone. If Keplerstan is at war with Evilstani and at peace with Goodstani who is also at war with Evilstani, and Evilstani is attacking Goodstani's region, Keplerstan moving into help defend Goodstani's region will not work, as I understand it. You must have an alliance.

Now the confusing sections...

Quote
There's no diplomatic reason realms at peace wouldn't join in an attack against a realm that they're both at War with because of a pre-existing alliance.
It seems you are referring to them as both at-peace and allied.

Quote
Again, its two realms in alliance, and one at peace with both of those, but all three are at War with the other
This was the most nonsensical. You refer to three realms, Highmarch, Vix Tiramora, Red Haven. You say two are allied, and one is at peace with both of those, but all three are at war? How can they be allied and at peace and at war with each other?

Quote
The whole point of us being there is to actually fight alongside Highmarch.
Then you need to be allied with them.

Quote
Is there anything I can do to help this fix along or are we just going to have to go to Alliance status with Highmarch for game reasons and pretend we're still at Peace Diplomatically?
There is no pretending. If the game says you are allied, then you are allied, not at peace. If the game says you are at peace, then you are at peace, not allied. No different than the placeholder rule (if you are elected/game says you hold a position, you hold that position, not temporarily holding it for someone else to return). If you were only at peace, not allied, then the only reason you were not fighting together is that you were not allies, which is your diplomacy decisions, not game code. You don't risk life and limb to fight with folks you are merely peaceful with against a mutual enemy, you let them weaken each other first.

Vita`

  • BM Dev Team
  • Honourable King
  • *
  • Posts: 2558
    • View Profile
Re: Faulty Battle Allegiances
« Reply #5: July 09, 2018, 05:13:52 PM »
So looking into this, here is what it looks like to me. Correct any errors of understanding, please.

Redhaven was in Winkamus, Highmarch's region. Highmarch and Vix Tiramora were moving into Winkamus. Vix is at war with both Redhaven and Highmarch. Redhaven and Highmarch are at peace with each other.

The first part of setting up battle sides is choosing the defender. In this case, no one from Highmarch or any of its allies/federations were in Winkamus. So for defenders, the game selected Redhaven for having troops in the region (a bit more complicated process, but simplified explanation). Once the game selects defenders, it begins adding allies/federations and enemies. Since Highmarch and Redhaven were only at peace with each other, Highmarch didn't join the battle as Redhaven's allies/federation.

So in the end, Highmarch got Redhaven to defend Highmarch's region from their mutual enemy while Highmarch watched.

Zakky

  • Mighty Duke
  • ****
  • Posts: 618
    • View Profile
Re: Faulty Battle Allegiances
« Reply #6: July 09, 2018, 10:01:10 PM »
Makes a lot of sense to me. If you are only at peace with your future allies, then yeah no wonder they didn't join you. They might be your future allies but they were not during the battle. It seems edgewater1364 just did not know how BM diplomacy worked.

Gildre

  • Mighty Duke
  • ****
  • Posts: 1165
  • If you can't keep up, don't step up.
    • View Profile
Re: Faulty Battle Allegiances
« Reply #7: July 10, 2018, 11:07:22 PM »
I like to think I have a decent grasp on game mechanics these days, but I was surprised by this one. I thought that the fact that Highmarch was at war with Vix Tiramora would mean they would be going into battle for themselves, not just supporting Redhaven.

It would have made sense to me if Highmarch and Vix were neutral, but since they are at war it seems like they should be a definitive enemy...

Regardless, I think all involved are tracking that now :)
Admit nothing, deny everything, make counter-accusations.

Zakky

  • Mighty Duke
  • ****
  • Posts: 618
    • View Profile
Re: Faulty Battle Allegiances
« Reply #8: July 11, 2018, 12:37:23 AM »
Peace is prioritized over almost everything I believe. Try to sort your diplomatic relations before going to war. Otherwise you will suffer  8)

Gabanus family

  • Board Moderator
  • Mighty Duke
  • *
  • Posts: 1340
    • View Profile
Re: Faulty Battle Allegiances
« Reply #9: July 12, 2018, 12:00:32 AM »
Well I think it has more to do with the fact that defenders get chosen first and attackers second. If Redhaven was defending, then Highmarch is not allied with them and won't help. Then whoever wants a piece of Redhaven (at war or super aggressive settings etc) will have it and join in on the attack.
New account active chars:
Garas: First Oligarch - Goriad: Astrum - Goriad II: Obia'Syela

Chenier

  • Exalted Emperor
  • ******
  • Posts: 8120
    • View Profile
Re: Faulty Battle Allegiances
« Reply #10: July 12, 2018, 04:22:42 PM »
So looking into this, here is what it looks like to me. Correct any errors of understanding, please.

Redhaven was in Winkamus, Highmarch's region. Highmarch and Vix Tiramora were moving into Winkamus. Vix is at war with both Redhaven and Highmarch. Redhaven and Highmarch are at peace with each other.

The first part of setting up battle sides is choosing the defender. In this case, no one from Highmarch or any of its allies/federations were in Winkamus. So for defenders, the game selected Redhaven for having troops in the region (a bit more complicated process, but simplified explanation). Once the game selects defenders, it begins adding allies/federations and enemies. Since Highmarch and Redhaven were only at peace with each other, Highmarch didn't join the battle as Redhaven's allies/federation.

So in the end, Highmarch got Redhaven to defend Highmarch's region from their mutual enemy while Highmarch watched.

Yea, I don't think it's a bug, it's always been like this.

However, I do think it's pretty silly that "lack of alliance" trumps "being at war". It'd be only natural for realms at peace with each other to unit against a realm they are both at war with.
Dit donc camarade soleil / Ne trouves-tu ça pas plutôt con / De donner une journée pareil / À un patron

GoldPanda

  • Mighty Duke
  • ****
  • Posts: 561
    • View Profile
Re: Faulty Battle Allegiances
« Reply #11: July 12, 2018, 09:44:52 PM »
You don't risk life and limb to fight with folks you are merely peaceful with against a mutual enemy, you let them weaken each other first.

So that you can both get defeated in detail? That seems like faulty tactical reasoning.

But I concede that this is how the game has always worked.

So looking into this, here is what it looks like to me. Correct any errors of understanding, please.

Redhaven was in Winkamus, Highmarch's region. Highmarch and Vix Tiramora were moving into Winkamus. Vix is at war with both Redhaven and Highmarch. Redhaven and Highmarch are at peace with each other.

I went back and checked the order of events. I believe Winkamus was empty the turn before the battle. In other words, everyone moved in on that turn.

Vix Tiramora was the region owner at the time, and the region defected to Highmarch soon after the battle. At no time was Redhaven the region owner.

So I'm wondering why Redhaven was the defenders. My understanding is that the game has a strong preference for choosing the region owner as the defenders? I've had cases where we defeated the region owners and forced them to retreat, and then dug in, and then knights from the region owner marched back in and instantly became the defenders again.
------
qui audet vincit

Andrew

  • M&F's Anaris
  • Administrator
  • Noble Lord
  • *
  • Posts: 324
  • Sometimes, With A Bopping Stick
    • View Profile
Re: Faulty Battle Allegiances
« Reply #12: July 13, 2018, 02:54:12 PM »
Alright, since I was kind of working on modernizing the combat code anyways, I sat down and took a look. This is exactly how the game figures out who is on what side of a battle, and any later step includes all factoring from earlier steps (1 comes before 2, 9 comes after 1-8, etc.), taking into account ~260 lines of code. For the purposes of rogue forces, those without realms, they are treated as their own realm, rather than being realm-less. The process for regular battles (not rebellion related):
  • Determines Region ownership.
  • Ignores any Units that have no combat capable men and declares those units 'Neutral'
  • Figures out whether any Units set to 'Evade' do so or not. If they do, they are declared 'Neutral'. If not, they're left in the calculation.
  • Figures out what Realms still have forces left.
  • If only a single realm is present (rogue forces, in this case), it looks for any non-human (Monsters, Undead, or Daimons), and assigns all human forces to attack them. The already present larger force controls the battlefield. If no force was already present, non-humans control the battlefield.
  • If no non-humans, looks for any ongoing TakeOver. TakeOver forces controls defenses.
  • If no TakeOver running, looks for any Realm allied or federated with the region owner that are already present or dug-in and are not peasants. These realms control the battlefield.
  • If no allied or federated realms of region owner, looks to see if only peasants of the owning realm or allies are already present. If only peasants of owning or allied realms are present, they take control of the battlefield.
  • If no allied or federated realms are present whatsoever, looks to see who else was already present in the region. If someone was already present (that is, someone who didn't arrive to the region this turn), the realm with the largest strength controls the battlefield.
  • If no realm was already here, the realm arriving with the strongest army controls the battlefield.
  • By this point, the battlefield controller (henceforth: Defender A) should be determined. If not, no battle happens.
  • All remaining realms (those not assigned a role in battle yet) in a federation with Defender A are Defenders.
  • All remaining realms at War or Hatred with ALL Defenders (A and Confederates) are determined to be Attackers.
  • All remaining realms at War/Hatred with some Defenders (A and Confederates) and Allied with other Defenders (A and Confederates) remain neutral, and the game questions what their ruler was thinking.
  • Units not assigned a role with Murderous settings not Allied to any Defenders (A and Confederates) ignore Peace and are determined to be Attackers.
  • If for some reason no attackers have been determined (that is, no non-Defenders/non-Neutral realms present), no battle happens.
  • All remaining realms in a federation with Attackers are determined to be Attackers.
  • All remaining realms allied to an Attacker and NOT allied or peace with any Defender are determined to be Attackers.
  • All remaining realms allied to a Defender and NOT allied or Peace with an Attacker are determined to be Defenders.
  • All remaining realms that are both allied/peace with any Defender AND allied/peace with any Attacker are determined to be Neutral.
  • All remaining realms "don't know what to do" and are determined to be Neutral.
Shorter version:
  • Units not combat capable are ignored.
  • Units that are Evading attempt to do so, and are ignored if they do.
  • Monsters, Undead, and Daimons will always be the opponent for humans when only rogues are present. If more than a single realm is present, this is skipped. Larger present force controls battlefield. If all forces just arrived, larger force controls battlefield.
  • No non-humans? Any Realm running a takeover controls battlefield.
  • No TakeOver? Owern, Allies, and Federation partners of region owner control battlefield if present, even if just with Peasants.
  • Still no defender? Whoever was already present with the largest force controls the battlefield.
  • Still no one? Realm arriving with the strongest force controls battle.
  • If we have a defender, figure out attackers. If not, no battle.
So, what does this mean:
  • Step 1: Highmarch owns region.
  • Steps 2-6: Not noteworthy, as Highmarch, the owner, has no already present forces.
  • Step 7: Redhaven takes up defense of region as the only already present force. Forces arriving this turn do not count, only those previously present.
  • Steps 8-12: We already have a defender.
  • Step 13: Vix Tiramora is determined to be an attacker.
  • Steps 14-18: No change.
  • Step 19: No change. As Highmarch is not allied to Redhaven, they do not join the Defense.
  • Step 20: No change.
  • Step 21: Highmarch, having not yet found a role, is assigned Neutral.
I suspect this was setup the way it was, so if you and an enemy are traveling through a third, neutral country, you don't just start murdering each other in their capital, as said third country would safely be assumed to have some token militia force in their regions that'd grant them battlefield control and stop the other two from being fighting as they'd not be assigned as attackers.
« Last Edit: July 13, 2018, 03:43:44 PM by Andrew »
Like my programming? Become my patron!

Bluelake

  • BM Dev Team
  • Noble Lord
  • *
  • Posts: 244
  • Ta|i - Bluelake Family since 2007
    • View Profile
    • Family Tree
Re: Faulty Battle Allegiances
« Reply #13: July 13, 2018, 03:16:21 PM »
Step #3 doesn't explain two battles in Nascot where in one, Perdan and Perleone (allies) fought alongside monsters against Highmarch, and another where Perdan just watched as monsters fought against Highmarch.

Highmarch was peasants. Perdan and Perleone are allies, Perleone is at Neutral with Highmarch, and I think Perdan is at Neutral too. Perleone was looting the region and probably had attack orders.
Today is Thank Wimpie for Being an Awesome Dev Day. Give Wimpie some gratitude for his constant bugfixing, pestering of admins to get things done, and general Wimpieness.

Andrew

  • M&F's Anaris
  • Administrator
  • Noble Lord
  • *
  • Posts: 324
  • Sometimes, With A Bopping Stick
    • View Profile
Re: Faulty Battle Allegiances
« Reply #14: July 13, 2018, 03:36:30 PM »
Sorry, Vita pointed out something I missed. Step 3 only factors in when only rogues are present. For the rest of it, rogues themselves count as a realm.

I've updated Step 3 and will update it again to explain how rogues work in regards to this.
Like my programming? Become my patron!