Announcement

Collapse
No announcement yet.

Fixing SMACX Bugs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fixing SMACX Bugs

    Please report any bugs or problems with the game in this thread and I'll do my best to try and sort them. I plan on applying all applicable fixes to SMAC at some point since a lot of the issues are found in both games. If anyone can put me in contact with Brian Reynolds or Brad Oliver please let me know.

    If there is any of my fixes you feel I'm overstepping the definition of fix/exploit or disagree with my implementation please let me know in this topic. I'm trying to avoid making any changes that would be considered tweaking the game and to stay true to original mechanics. In some cases this is difficult to do and I try to make the best judgement as to what was originally intended based on other portions of the game. But I'm always open to hear arguments regarding any changes.


    Unoffiical SMAX Patch changelog:
    Fixes:
    • [BUG] If a faction's cumulative PROBE value is greater than 3 (SE morale, covert ops center) it is possible to "mind control" their bases when they should be immune. If the University uses SE Knowledge putting PROBE value down to -4, it would act as if it were 0 erroneously increasing "mind control" costs. After patch, PROBE values greater than 3 will always be immune to regular probes and values less than -2 will be treated as if they were -2.
    • [CRASH] It is possible usually on larger maps that scrambling air interceptors would cause the game to crash. Even when the game didn't crash incorrect altitude values were being used in checks. Both of these have been fixed.
    • [CRASH] If you open up Design Workshop as Caretakers/Usurpers and switching back and forth between colony pod and other "equipment" you can cause text in "special ability" to become overwritten and crash once you exit Design Workshop. Patch increases memory allocation used to manipulate the caviar animation files (cvr) and may fix other buffer related problems other than the one noted. (credit to WBird784 for original patch data)
    • [EXPLOIT] Using the right click menu to airdrop calls the "move to" code directly and bypasses all the checks such as if unit is in airbase/base or has already moved. Since the airdrop hotkey "i" correctly checks these restrictions, the patch makes the right click menu use the hotkey checks before directly moving the unit.
    • [BUG/EXPLOIT] Setting more than one patrol waypoint with spacebar causes the values to be stored incorrectly. If only two waypoints are set then it is just a display issue showing an incorrect amount of waypoints when clicking on unit. If three waypoints are set, it causes the unit's morale to be set as one of coordinates usually boosting it to demon boil / elite status. Also, with three waypoints the final waypoint gets set to some far off random location usually (0,0) breaking three point patrol completely.
    • [BUG] Transport unit's special ability "Repair Bay" is rendered useless due to an incorrect check that would only give the healing bonus to ground transports. Now, it will give bonus to all ground units except ground transports.
    • [BUG] Fixed a check that was ending the turn for certain air units (choppers/missiles/grav) when entering a base which had no adjacent enemy units. There is still a check which will end the unit's turn if when entering a base it has less then one turn remaining unless an enemy is adjacent to base.
    • [EXPLOIT] Inside base UI, after opening up the production queue window it is possible to then open the hurry command window, switch between bases and complete projects for less then their actual value. Patch fixes a clean up issue with queue panel preventing certain parts of UI from becoming clickable when they shouldn't.
    • [EXPLOIT] When clicking on an unexplored tile, the map recenters on that square. However, if the tile contains a base the map doesn't recenter. Patch fixes it so when an unexplored tile with a base is clicked, the game will recenter like the rest of the tiles.
    • [CRASH] When moving units near or at the poles, it is possible for y coord to exceed the map bounds and crash the game. Patch adds handling to prevent y coord from going over min/max.
    • [EXPLOIT] It is possible to change another faction's workers via Base Ops (F4) if you have that faction infiltrated. Patch fixes it so clicking citizens of another faction in Base Ops has no effect similar to garrisoned units.
    • [BUG] Using "Go to home base" (shift-g) command sends the unit to closest base rather than it's actual home. Patch retrieves unit's home base and sets a "go to" waypoint similar to how a unit is recalled from within base UI. If a home base cannot be found (independent) the unit will go to the nearest base.
    • [EXPLOIT] It is possible to give airdrop or artillery ability to an unit who didn't have it. This is done by using hotkey (I or F) on an unit that has the ability then switching units in bottom center window. The mouse cursor would still have airdrop/artillery up and it is then possible to use it with the new unit bypassing all the checks if unit can use ability. Patch resets the cursor when clicking unit selection window.
    • [BUG] Fixed an unit check to use the "Max artillery range" value defined in #Rules (alphax.txt) rather than a hardcoded value of 2. This fix is geared toward modders so players who use an unmodified version of alphax.txt will see no change.
    • [BUG] Enhanced probes (Algorithmic Enhancement) are now able to mind control bases/units normally immune due to high SE morale as stated in SMAX manual. For units it's purely the morale SE value so >=3 acts as if it were 2 (cost doubled). For bases, the value is calculated from morale SE and any base facility modifiers (Covert Ops: +2, Genejack: -1). If final value is >=3, it acts as if it were 2.
    • [BUG] Squares with both a borehole and nutrient bonus don't receive the nutrient bonus. If the "Borehole Square" nutrient value defined in #RESOURCEINFO (alphax.txt) is set to non-zero, a square with borehole will erroneously act as if it has a nutrient bonus. The patch fixes a check whether or not to give a borehole square a nutrient bonus from checking if borehole nutrient value is non-zero to checking if nutrient bonus is actually present in square.
    • [BUG] While loading the ambient sound file for game, there is a mistake in faction id check for Believers causing it to use SMAX default of "aset1.amb". Patch fixes check so Believers will now use their correct ambient sound file "bset1.amb".
    • [BUG] Enhanced probes don't receive a penalty to survival probability when target faction has built Hunter-Seeker Algorithm. Instead, the success probability is erroneously given the penalty for a second time after it has already been displayed in UI. This could cause diminished success rate when it should have been higher. Patch corrects check so survival rather than success probability is modified.
    • [UI] Removed a check that would while displaying probe success/survival probabilities drop one if they're both the same. For example, (50%, 50%) would just be (50%) which can be confusing.


    Misc:
    • Disabled cpu check which serves no purpose other than preventing the game from starting on newer cpu's. Patch enables ForceOldVoxelAlgorithm=1 in code by default and suppresses annoying warning.
    • Enabled debug output of internal commands, see logfile.txt in root SMAX folder after running the game. This log resets each time you start the exe. It's useful when running the game to look at what actions triggered certain functions.
    • Needlejet "DATA" edit window via scenario editor doesn't render properly making stats uneditable. This is fixed simply by adding "#itemlist" to "#EDITVEH2A" inside scripts.txt and xscripts.txt. This only affects scenario editor and can be easily applied manually.





    -----

    my original first post in thread:

    I'm looking into resolving this in exe but have some questions. It's been awhile since I've played AC(X) so I'm a bit rusty with UI.

    I've selected "Data Angels" as faction and set them to use "Fundamentalists" and "Thought Control" giving a +6 probe rating. Now, how do I actually see the bug? What steps can I take toggling between native +2 probe of "Data Angels" and extra +4 to see a roll over happen? I need to have some repeatable steps to be able to find code location in exe.

    edit: Ok, I kinda think I see the problem. It really isn't a "roll over" bug. This made me think that once PROBE was over +4 that new units would start out with +0 morale. So basically, any values above +4 do not give morale bonuses they should? Also, what is the "base" value of morale? "Very Green" or just "Green"? It seems to be based off "Green" but I'm not sure.

    So if you have Angels with +4 PROBE, a new probe unit should start out with "Veteran" morale, correct? Now, if you have +6 PROBE the probe unit should start out with "Elite" morale? But the problem is it doesn't, so +6 morale still sets the units to "Veteran"? I just want to clear this up before I go searching.
    Last edited by scient; April 7, 2009, 12:08.

  • #2
    At +3 probe, bases and units cannot be subverted by a normal probe team.

    At +4 probe, bases and units can be subverted by a normal probe team.

    These are the effects that I am sure about for the "roll over" bug.

    The manual lists these

    0 probe - normal
    +1 probe - + 1 probe team morale; +50% cost of enemy probe actions
    +2 probe - + 2 probe team morale; +100% cost of enemy probe actions
    +3 probe - + 3 probe team morale; bases and units cannot be subverted
    Unofficial SMAC/X Patches Version 1.0 @ Civilization Gaming Network

    Comment


    • #3
      Originally posted by vyeh View Post
      At +3 probe, bases and units cannot be subverted by a normal probe team.

      At +4 probe, bases and units can be subverted by a normal probe team.

      These are the effects that I am sure about for the "roll over" bug.

      The manual lists these

      0 probe - normal
      +1 probe - + 1 probe team morale; +50% cost of enemy probe actions
      +2 probe - + 2 probe team morale; +100% cost of enemy probe actions
      +3 probe - + 3 probe team morale; bases and units cannot be subverted
      Ah ok. So there seems to be two separate issues regarding PROBE value.

      The first being these effects regressing when PROBE value >= 4 as if PROBE value was set to 0. If PROBE is +3, does it follow the manual and prevent bases/units from being subverted?

      The second is that probe units do not gain the correct morale for high PROBE values? Am I correct in assuming that a +6 PROBE should produce an elite "Probe Team"?


      On another topic, is there any command to set in INI file to enable "logfile.txt" output? I couldn't see any setting string that would enable it. However, if I patch the game to force it enabled it does provide some useful info like:

      Reseed to 308378841 0 0
      LockBase 0 0 0
      BASE: hurried production 0 0 0
      UnlockBase 0 0 0
      Adding Vehicle (v,who,v2) 24 6 16
      Adding Vehicle (v,who,v2) 25 4 6
      Key: 0000 40012 0000
      Quit*********************************** 0 0 0
      It made tracking down where units are created so much easier (ie. "Adding Vehicle" function).

      Comment


      • #4
        Probe morale depends on

        (1) basic morale;
        (2) acquisition of certain techs; and
        (3) past success in certain, but not all, probe actions (stealing tech improves morale; infiltration does not).

        So morale may start at a level higher than "green" after certain techs are acquired or for probe teams that have succeeded and survived.

        Assuming a new unit and no tech and 0 morale, I think you would have

        0 probe = green
        + 1 probe = disciplined
        + 2 probe = hardened
        + 3 probe = veteran

        If you are getting veteran for + 4 probe and + 6 probe, it means that as far as morale goes, probe maxes out at +3.

        No one has a problem with that.

        The issue is that bases and units which could not be subverted by a standard probe team at + 3 can be subverted at +4.
        Unofficial SMAC/X Patches Version 1.0 @ Civilization Gaming Network

        Comment


        • #5
          Originally posted by vyeh View Post
          The issue is that bases and units which could not be subverted by a standard probe team at + 3 can be subverted at +4.
          Ah, ok. Thanks for clearing up the issue, I'll look into it.

          Comment


          • #6
            This thread has a discussion of Probe Team morale, which doesn't work quite the way you might think.

            And the initial discovery of the rollover bug may be found in this thread.

            Petek
            "The avalanche has already started. It is too late for the pebbles to vote."
            -- Kosh

            Comment


            • #7
              Does immunity to subversion mean probe cannot do anything to base like infiltrate data links? Or does it mean they can't do "mind control" to take over city?

              edit: I see that you can't mind control main bases no matter what which was confusing me. Nm.
              Last edited by scient; February 13, 2009, 17:19.

              Comment


              • #8
                According to Maniac, "green" probe teams are bumped up to "disciplined."

                The thread on probe team morale doesn't indicate that changing morale affects probe teams.

                In ACDG6, we made a SE change that bumped up morale by +2, while leaving probe the same.

                A commando probe team went to elite.
                Unofficial SMAC/X Patches Version 1.0 @ Civilization Gaming Network

                Comment


                • #9
                  At +3, you can still infiltrate data links, steal tech. You can't mind control.

                  You should still be able to mind control base at +1 probe.

                  Can you check again for +1, +4, +5, +6?

                  Edit: Asked for +6.

                  Edit: HQ bases cannot be subverted.

                  I looked at the threads Petek mentioned.

                  There is some mention that anything above +3 acts as 0 probe.

                  I think it would be interesting to test +5, +6, +7.
                  Last edited by vyeh; February 13, 2009, 17:36.
                  Unofficial SMAC/X Patches Version 1.0 @ Civilization Gaming Network

                  Comment


                  • #10
                    Originally posted by vyeh View Post
                    At +3, you can still infiltrate data links, steal tech. You can't mind control.

                    You should still be able to mind control base at +1 probe.

                    Can you check again for +1, +4, +5?
                    Ya, you can my bad. The problem was the base I was using to test was the capital which you can't mind control no matter what. This really confused me and messed up my analysis. Doh!

                    On bases OTHER than the capital you get the mind control menu no matter what. However, for the capital it doesn't show up at all.

                    If targets PROBE is +3 it will give the immune message. If PROBE is 0-2 or 4-6, it will let you attempt mind control. My guess is there is a check someplace where it sees if the PROBE value is 3 but instead of "3 or above" it just does "equal to 3".

                    Units work correctly with being immune if PROBE value is >= 3. So it's not a broad issue with PROBE value, only with bases. If PROBE was being set to 0 when >= 4, then units would be able to be bribed as well.

                    edit: Is it possible to get +7? Believers get +1, Angels get +2, Uni gets -2 base PROBE. Then there is Fundamentalist/Thought Control which can give a cumulative of +4. So max as far as I can tell is +6?

                    edit edit:
                    I also found the code where it checks if city is immune or not (units are in a separate code path). I also see why it is failing. There is a switch in code that assumes the max is 3 so anything above that say 4 will go to default code which is to allow mind control the same as if it were 0. This should be fairly easy to fix. I'll have to do some more analysis tho to make sure changes are safe to do. This actually took 5-10 mins to locate and assess. So much easier than figure out wtf the problem actually was.
                    Last edited by scient; February 13, 2009, 18:13.

                    Comment


                    • #11
                      Is it possible to get PROBE value less than -2? Say -3 or lower? If not, fixing this would be a one byte patch.

                      edit: Aww, well not one byte but I see how to fix this. Should only be a few op codes or so. Another thing that can cause mind control to work when it shouldn't is that "Covert Ops Center" which will add +2. So, the max you can get I believe is +8 (with Fund/Thought Control and Angels).

                      Comment


                      • #12
                        Knowledge = -2 probe
                        University = -2 probe (agenda is knowledge!)

                        So I would expect that you should see - 4 probe anytime there is a University AI in the game.
                        Unofficial SMAC/X Patches Version 1.0 @ Civilization Gaming Network

                        Comment


                        • #13
                          As far as I know, the following describes how Probe values work:
                          "Probe above 3 rolls over and is apparently treated as 0. Probe below -2 has no further effect."
                          So anything less than -2 works as -2. Does probe rating have a value less than that, I'm not sure. E.g. We are at Probe -4, we then change SE to -3. We did change SE rating, but the effect before and after is the same, since it's -2 or lower. It's possible.
                          I was thinking about it, like forcing all factions to start with -2 probe instead of 0.
                          SMAX, however, added few probe bonusses making it a bit difficult. There is SP giving +2 probe. Covert Ops give +2 to bases, social settings can give you +4. It's +8 already, so from -3 it goes to +6! Not even counting factional bonuses like DA +2.

                          If you can modify exe file, probably good change would be roll-over not to 0 but to +3, if we can call it roll-over.

                          I wish source code was released.
                          Mart
                          Map creation contest
                          WPC SMAC(X) Democracy Game - Morganities aspire to dominate Planet

                          Comment


                          • #14
                            Ya, I was going to add a check like this -> before it accesses the switch, if PROBE is greater than 3, set to 3.

                            Very easy to do. The problem is being able to find space to include the check. I really wish the ACX exe was debug version like AC because then there would be tons of junk code I could optimize to make room for my fixes. I can get it working 100%, it's just a matter of finding the space.

                            Also, I had a look at University + Knowledge which gives PROBE -4. This messes up as well and sets it to the default which is zero. So you actually "improve" your defenses against "mind control" if you get it to -3/-4 versus -2/-1. I'll have to look to see if this is the same for units. Not sure how to handle this. I'll have to see how -2/-1/0 differ to get an idea of how -4/-3 should be.

                            edit:
                            Units have PROBE range set for range of -6 to 9. I don't think it is possible to get above or below that. So it's just cities that are messed up.

                            edit edit:
                            Actually, I can just add a check into lower bounds if it's below -2, set to -2. This will prevent Uni from getting better protection with lower PROBE values. Now, I just need to find the room to put these two checks in. Sigh.
                            Last edited by scient; February 13, 2009, 19:23.

                            Comment


                            • #15
                              Scient, any chance, that your patches might be put on official Firaxis website for SMACX downloads?
                              It is all great, but many people will not use unofficial patches. And best is when more than 99% of users fix games to the latest patch. Then community won't split into those tweaking their exe more and those staying on the last official patch.
                              Mart
                              Map creation contest
                              WPC SMAC(X) Democracy Game - Morganities aspire to dominate Planet

                              Comment

                              Working...
                              X