Alpha Centauri 2

Sid Meier's Alpha Centauri & Alien Crossfire => Modding => Bug/Patch Discussion => Topic started by: bvanevery on May 19, 2019, 07:49:41 PM

Title: Maritime Control Center reduces movement to 2
Post by: bvanevery on May 19, 2019, 07:49:41 PM
Maritime Control Center reduces ship movement to 2
Maritime Control Center reduces ship movement to 2

Late game in my SMAC AI Growth mod version 1.31 (not yet released).  I dominate technologically.  I've got Quantum reactors and of course orbital insertion.  I've been pursuing a policy of taking 1 city that contains a Secret Project from anyone who declares war on me, then giving them a Truce, so that they'll stop bothering me.  They'll bother me a little bit with Conventional Missile hits, although they're not scratching me much lately because of my beefy AAA defenses.  The bother is mainly having to produce more such AAA units and Flechette defenses.

I took UN Headquarters from the Peacekeepers.  I signed a Truce with them.  However the University was allied with the Peacekeepers and immediately attacked my thinly held city, since they had full rail access and a pile of adequately destructive mindworms.  They took the city, so I vowed to come back with a better garrison force later.

Finally did so.  Took UN Headquarters again this year.  Suddenly all of my ships only have movement 2!  It's not just one ship, it kept happening and I was like, huh.  So something between Quantum reactors and this SP changing hands, has a bug.  I wonder if it'll go away next turn.

Title: Re: Maritime Control Center reduces movement to 2
Post by: scient on May 22, 2019, 04:12:26 AM
I've actually decompiled the portion of code related to this. I couldn't reproduce the issue loading saved game into vanilla SMACX so there might be changes related to alpha/x.ini?

It may be an issue where speed_proto() is returning 0 for everything, then it gets maritime control bonus.

DWORD __cdecl speed(int vehID, BOOL skipMorale) {
   ...
   DWORD speedVal = speed_proto(protoID);
   BYTE triad = Chassis[VehPrototype[protoID].chassisID].triad;
   if (triad == TRIAD_SEA && has_project(SP_MARITIME_CONTROL_CENTER, Veh[vehID].factionID)) {
      speedVal += Rules->MoveRateRoads * 2;
   }
   ...
   return speedVal;
}

Full code is on GitHub > veh.cpp.

Edit:
I wonder if something got bugged thinking your units were fungal towers?

DWORD __cdecl speed_proto(int protoID) {
   if (protoID == BSC_FUNGAL_TOWER) {
      return 0; // cannot move
   }
   ...
   return range(speedVal, 1, 99) * Rules->MoveRateRoads;
}
Title: Re: Maritime Control Center reduces movement to 2
Post by: bvanevery on May 22, 2019, 04:42:58 AM
I've changed some flags related to what ships can have.  Like for instance, drop pods are possible on my ships.  This isn't as useful as one might hope, because if a ship stops its movement on coastal land, it'll die by next turn.  Unless it drops on a port city, the one time this is actually useful, and why I've left it in there for now.  Sort of a poor man's Psi Gate.  If I believed it was causing a bug, I might get rid of it, but none of my ships actually had drop pods.  Any kind of change over vanilla could theoretically trigger some dormant bug in the code somewhere though.  Not like such scenarios were ever tested.

Right now I'm in "watch and see" mode.  Since I've never seen this bug before, I'm guessing that capturing and retaking the city the Maritime Control Center was in, has the most to do with the problem.
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 5: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default), Aeva.english (default).
Style sheets: 0: .
Files included: 36 - 1181KB. (show)
Queries used: 19.

[Show Queries]