Author Topic: AI does not withdraw units when pact is renounced  (Read 648 times)

0 Members and 1 Guest are viewing this topic.

AI does not withdraw units when pact is renounced
« on: July 30, 2020, 04:32:15 AM »
I've just stumbled across exceptionally weird bug. Tried to debug it but gave up. It is buried too deep somewhere. I think I'll post it here in case anyone want to fix it.

Here is what supposedly happens.
Two AIs (AI1 and AI2) are in pact. Due to the pact AI1 Sealurk is in AI2 coastal base. Then AI2 cancels pact with AI1 and then declares vendetta. I am not sure how it happened - maybe surprise attack by bombardment? Whatever. The interesting thing, though is that after vendetta is declared AI2 tries to attack AI1 Sealurk in AI2 own base by bombardment. Even though both units are in the same time the attack is delivered on an adjacent tile exactly below the base (0, +2). There is nobody there. Due to the fact that there is nobody there the combat computation crashes.

Few investigation directions here if anybody wants to spend time on that.

1. I don't know why other faction unit wasn't removed when pact war renounced. Could be two reasons.
a) AI-to-AI do not pull their units back when pact is renounced.
b) Surprise attack caused renouncing of a pact but the unit pull is delayed until combat is resolved.

2. Looks like unit found an enemy to attack in the same tile, then initiated the attack, then somewhere down the line there is a check or it is just programmed this way to not attack on same tile and resolved in some random adjacent tile instead.

3. Combat is not cancelled if there is nobody in target tile and continues calculations with wrong values.

That happens very rarely.
Two AI need to go from pact to vendetta right away. One AI unit should be in other AI base. AI does sneak attack on this exactly unit. The attack type is bombardment. The AI should have inherent bonuses and one of the bonuses should be a free unit ability like Pirates with their marine detachment. The nature of the ability doesn't matter. The last condition is where actually game crashes. So you see the combination is very rare. Yet it happened to me.
« Last Edit: July 31, 2020, 03:03:38 PM by Alpha Centauri Bear »

Offline bvanevery

  • Emperor of the Tanks
  • Thinker
  • *
  • Posts: 6370
  • €659
  • View Inventory
  • Send /Gift
  • Allows access to AC2's quiz & chess sections for 144 hours from time of use.  You can't do without Leadship  Must. have. caffeine. -Ahhhhh; good.  Premium environmentally-responsible coffee, grown with love and care by Gaian experts.  
  • Planning for the next 20 years of SMACX.
  • AC2 Hall Of Fame AC Text modder Author of at least one AAR
    • View Profile
    • Awards
Re: AI does not withdraw units when pact is renounced
« Reply #1 on: July 31, 2020, 02:13:42 AM »
Well I have had a game crash on me because an AI faction had another AI faction unit in its base which didn't belong there.  I actually did a post on that, maybe in the Bugs forum.  It's definitely a genre of bug, I just don't know how it occurs.  Moreover, when we're talking about a sea base, the wrong unit probably won't ever leave the base.  So I don't know when the failure to switch sides happened.  The unit may have sat there like a bug time bomb for quite awhile before finally crashing my game due to an errant attack.

I have seen these "wrong base" bugs often enough in my play, to know to look for them now, if my game crashes.  I don't get such crashes very often.  They're far more likely in the late game for some reason.

Re: AI does not withdraw units when pact is renounced
« Reply #2 on: July 31, 2020, 03:50:12 PM »
When I started playing it long time ago it crashed almost every 5th game. That was very frustrating. With more patches from the developers and community it becomes so stable I never experienced crash in like 10 years. Who knew there are still bugs out there. 😞

Offline bvanevery

  • Emperor of the Tanks
  • Thinker
  • *
  • Posts: 6370
  • €659
  • View Inventory
  • Send /Gift
  • Allows access to AC2's quiz & chess sections for 144 hours from time of use.  You can't do without Leadship  Must. have. caffeine. -Ahhhhh; good.  Premium environmentally-responsible coffee, grown with love and care by Gaian experts.  
  • Planning for the next 20 years of SMACX.
  • AC2 Hall Of Fame AC Text modder Author of at least one AAR
    • View Profile
    • Awards
Re: AI does not withdraw units when pact is renounced
« Reply #3 on: July 31, 2020, 05:21:28 PM »
How do you know it isn't increasing stability of Windows emulation layers, or device drivers included in the OS ?  I used to get the "interceptor bug" and for some reason, now I don't.  I've been mostly playing the stock GOG binary for 4 years or so.  There was a brief period when I may have been playing Yitzi's patch for awhile, before I started modding.  Did it give me more of the interceptor bug?  It may be that some bugs have a graphical component to them, and others don't.

I also used to play on much larger maps.  Maybe that had something to do with it.

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

Remember, genes are NOT blueprints. This means you can't, for example, insert the genes for an elephant's trunk into a giraffe and get a giraffe with a trunk. There are no genes for trunks. What you CAN do with genes is chemistry, since DNA codes for chemicals. For instance, we can in theory splice the native plants' talent for nitrogen fixation into a terran plant.
~Academician Prokhor Zakharov 'Nonlinear Genetics'

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 47 - 1280KB. (show)
Queries used: 40.

[Show Queries]