Announcement

Collapse
No announcement yet.

Fixing SMACX Bugs

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

  • #91
    Originally posted by Petek View Post
    ...whether the damaged unit is in fungus? Some quick testing indicates that under those conditions, the unit heals 20% per turn (unless other conditions increase healing even more).
    Originally posted by vyeh View Post
    Do native units normally heal at 20% per turn in fungus (unless other conditions increased healing even more; it would be odd if xenoempathy dome gave advantage that native units did not already have)?
    Ah good catch. You don't need Xenoempathy Dome, just have a native unit in either sea or land fungus and they'll start with 20% base healing value. Otherwise, if they're not in fungus they'll start with base of 10% like all other units.

    Originally posted by vyeh View Post
    One other thing to consider about healing: there is normally a cap of 80% health unless the unit meets certain conditions (e.g. it is in base). Have you located that code?
    Yep, there is a small section of code after the last check (#8: Nano Factory) that I haven't really looked at. It's right before it modifies the current unit's health value with new one and does indeed cap it at 20% if say unit is in enemy territory. Why? Are there any problems with it?
    Last edited by scient; February 17, 2009, 10:48.

    Comment


    • #92
      No problems with it yet. My concern is that the repair bay would restore damaged unit in one year to 100% health while transport without repair bay would restore damaged unit to only 80% over time unless it was in a base.

      That is the way I think repair bay should work.

      Not that it really matters with so few newbies reading the General Forum, but technically (and this is for Illuminatus) doesn't this thread (or the portion after scient entered) sort of belong in AC (Re-)Creation subforum.

      Although the discovery that native units heal at 20% rate in fungus is the type of information that belongs in the general forum. So maybe this thread is so broad that putting it in the creation subforum is incorrect.

      Regarding someone to contact about ACX design, maybe Brad Oliver might be sympathetic. Although he worked on the mac side, I've noticed that I do not have the multiple airdrop bug. Perhaps some things were fixed in the mac port.
      Last edited by vyeh; February 17, 2009, 11:32.
      Unofficial SMAC/X Patches Version 1.0 @ Civilization Gaming Network

      Comment


      • #93
        Originally posted by vyeh View Post
        No problems with it yet. My concern is that the repair bay would restore damaged unit in one year to 100% health while transport without repair bay would restore damaged unit to only 80% over time unless it was in a base.

        That is the way I think repair bay should work.
        Well, I did a test. I have a unit damaged at 20% on a repair transport in enemy territory and the same setup but the unit is on a normal transport. If I force the repair bay code to bypass an initial check that seems to be erroneously failing for the repair transport, the unit will heal to 100% even in enemy territory (2 * 10%). It seems to bypass the restriction cap. Now, the normal transport will still be subject to 20% restriction and unit won't heal. It seems the majority of the code for repair bay is working because if I try to force it say using a normal transport or an unit on land, it will fail (ie. it's checking Repair Bay special ability flag). So, is this the correct expected behavior?

        As for splitting the thread, that might be useful. Maybe from my first post onward and move it to a new topic since this has expanded to more than just a fix to Data Angels bug.

        Originally posted by vyeh View Post
        Regarding someone to contact about ACX design, maybe Brad Oliver might be sympathetic. Although he worked on the mac side, I've noticed that I do not have the multiple airdrop bug. Perhaps some things were fixed in the mac port.
        Well, if anyone happens to know his email please PM it to me.

        Comment


        • #94
          It is the behavior I expect.

          This is Brad's last post at Apolyton. This is his public profile.

          It has been many years.

          I suspect that if you post on his blog, he will see it. His last blog entry was January 2 of this year.

          Remember, any post is public. I would say that you would like to talk with him about ACX and could you send him a private message via Apolyton.

          He rejoined Aspyr (the company that makes the Mac port) last May. Maybe he might be interested in your discoveries. (It would be the height of irony if Aspyr posted a Mac patch before an official Windows patch was released.)
          Last edited by vyeh; February 17, 2009, 12:34.
          Unofficial SMAC/X Patches Version 1.0 @ Civilization Gaming Network

          Comment


          • #95
            scient,

            I think this post by Illuminatus means that you can post your terranx.exe files as long as you don't bypass copy protection.

            I would recommend you do so (it allows other people to help in testing).

            According to message tracking, Illuminatus got the message requesting the thread be split (it is probably why he posted).
            Unofficial SMAC/X Patches Version 1.0 @ Civilization Gaming Network

            Comment


            • #96
              My previous post wasn't as clear as it could have been. Non-native damaged units in fungus heal at a base rate of 20% if you have the Xenoempathy Dome. Also, I didn't mention it before (because I forgot), but under those conditions, the non-native unit will heal completely (instead of stopping at 80% healed). This behavior isn't documented in either the manual or the datalinks
              "The avalanche has already started. It is too late for the pebbles to vote."
              -- Kosh

              Comment


              • #97
                Originally posted by vyeh View Post
                scient,

                I think this post by Illuminatus means that you can post your terranx.exe files as long as you don't bypass copy protection.
                You are correct sir.
                SMAC/X FAQ | Chiron Archives
                The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. --G.B.Shaw

                Comment


                • #98
                  Originally posted by vyeh View Post
                  I think this post by Illuminatus means that you can post your terranx.exe files as long as you don't bypass copy protection.
                  The problem is, this is impossible to do because I have to use safedisc removed copy of ACX exe. There is no way really to inline patch it and even if there was I wouldn't go there. Too much work and I hate dealing with packers/protectors. Doing a loader and patching it in memory just begs to cause new issues. I could add in a cd check to unpacked exe that wouldn't start the game unless it can find ACX cd. There is already an existing check like this however it still lets you start the game. I dunno if this is really a good idea tho. I think the best thing would be to get Firaxis's ok but I dunno if that's possible.

                  The AC exe has zero protection after the 2000/xp compatibility patch. I'm still a bit baffled why they removed it on one but not the other when this old version of safedisc causes so many problems. On XP Pro SP3 I can't even start the original protected ACX v2 exe, it just CTD. I think there are ways around it by setting windows compatibility mode but I find it pointless to accommodate long out dated copy protection.

                  So, I dunno.

                  Comment


                  • #99
                    I think I've identified the cause of Repair Bay bug and fixed it. One byte patch ftw!

                    The function causing Repair Bay to fail obtains the unit type of current unit and it looks like a conditional check was incorrectly set (not equal rather than equals). It fails if unit type is 0 (ground unit) but passes for all other types. I believe it was intended so only ground units progress to next bit of code like it states in the manual. It doesn't make sense for non-ground units to progress. If I edit it to check if unit type is "equal" to 0 rather than not equal, boom it's working! I did a test with two ground units, one on land and another in Repair Bay transport. Only the one in transport got x2 bonus. I also tested it with a needlejet repair bay transport, working 100%.

                    Now that's working, I found another bug. If a damaged ground unit is currently in a regular transport and shares a tile with another empty transport that has repair bay, the ground unit will get the RB bonus. It doesn't matter if the transport unit with RP is a different unit type so a RP needlejet can transfer bonus to a unit on a regular ship. I'll have to look at it more but I think it just cycles through all the units in current tile and sees if one has RP. You can also get RP transfer across factions if you have a pact (the only way to have different faction transports in same tile?). This is only when an unit is inside a transport. So if you say have a ground unit on an airbase that also has a RP needlejet, if unit isn't inside a transport it doesn't get the bonus. I'll have to look at it more and see what the best solution is.

                    Ideally I could obtain information about which transport the ground unit is actually in and go from there but it may not store that info. If it doesn't, I could atleast make it so RP transfer only happens between units of the same type which is a bit more logical.

                    edit: I should also state that in RP code there is already a check if unit is a ground unit so there was never instance of non-ground units even getting to function that is failing. I'm not sure why it checks it twice, I'll have to look at it some more but for now fixing that condition check works.
                    Last edited by scient; February 17, 2009, 19:46.

                    Comment


                    • Er, I was kinda wrong in above post about how repair bay (RB) is working. Now, I'm not sure best solution. Here is break down.

                      1. Check if current unit is a ground unit, if so continue on
                      2. Check if current unit is a transport, if so continue on. This is main part of bug. In vanilla game the only unit that will get by this is a ground transport but there is a check further down that prevents the RB transports from giving themselves their own bonus.
                      3. Check if unit is in sentry mode, if so continue on. If not, check if unit is on a sea title, if so continue on.
                      4. Unknown check regarding transports in transports (I think). It's a small loop, got to look into it some more.
                      5. Loop through all units in tile except the current unit (preventing units from giving themselves RB bonus). Check to see if selected unit has Repair Bay special ability flag set. If it finds one (doesn't matter diff faction or whether current unit is actually inside it), apply the x2 bonus to current unit.

                      And that's it. I doubt #4 will greatly change it overall since it almost always gets skipped. The only time I saw it accessed was a few mins ago when I put a ground transport into a ship transport. It may be useful if it shows me how units are "stored" inside a transport. I'll have to think how to go about sorting this. I'm hoping there are some flags/variables set that will link a particular transport to units that are inside it. If that's the case, I can easily revise the code. As it stands, even if it doesn't fail (ie. check #2 is removed) there are a ton of issues with check #5.

                      edit:
                      Actually, you can get RB to work in vanilla game. Stick a ground transport inside another transport with RB. Wow, thanks guys that's so useful.
                      Last edited by scient; February 18, 2009, 00:19.

                      Comment


                      • It is possible for a transport to carry an air unit if the transport has carrier deck ability.

                        So if a transport has both repair bay and carrier deck, does that mean the repair bay does work with a damaged needlejet.

                        So I have two questions:
                        (1) Did repair bay work on a carrier?
                        (2) If so, does your fix disable the ability to repair a damaged needlejet.

                        Could the problem have been that repair bay was inaccurately described in the documentation?

                        There is a problem that I have to address in playing games. If I move a transport with a ground unit into a square with another transport and then move that transport, sometimes the ground unit moves with the second transport.

                        I'm not too concerned with a situation where the unit is repaired if there is one transport in the square that has repair bay. I can interpret it as the unit transferred to the repair bay between years, was repaired and then transferred back to the first transport.

                        Maybe the check should have been:

                        If it is a ground unit, it is repaired.
                        If it is an air unit and there is a carrier deck, it is repaired.

                        That would prevent naval units from being repaired by a transport with a repair bay in the same square and prevent an air unit that is in the air above the transport from being repaired while allowing air units that are on the carrier deck to be repaired.

                        My experience is that transport foils cannot transport ground transports. I tried that once.

                        I think the order should be:

                        1. Are we dealing with a ground unit (if not, exit routine; only ground units can be repaired)?

                        2. Are we dealing with a transport (if so, exit the routine; a transport can't be loaded on another transport so it can't be repaired by that another transport's repair bay; I think this is where the error is)?

                        3. Is the unit loaded on the transport in a base (in which case it will be in sentry/board transport mode) or on a transport at sea (the only way a ground unit can be in a sea tile is if it is in a transport)? (If not, exit the routine.)

                        4. (Unknown)

                        5. Is there a transport in the tile that has a repair bay? If so, apply the x2 bonus.

                        The only way I can see a ground transport and a sea transport in the same square is if they are both in a base.
                        Unofficial SMAC/X Patches Version 1.0 @ Civilization Gaming Network

                        Comment


                        • Originally posted by vyeh View Post
                          It is possible for a transport to carry an air unit if the transport has carrier deck ability.
                          Yes

                          Originally posted by vyeh View Post
                          So if a transport has both repair bay and carrier deck, does that mean the repair bay does work with a damaged needlejet.
                          No, it will fail on checking if unit is ground or not.

                          Originally posted by vyeh View Post
                          So I have two questions:
                          (1) Did repair bay work on a carrier?
                          (2) If so, does your fix disable the ability to repair a damaged needlejet.
                          Yes, the carrier/RB flags use the same bit field but are independent of each other. So modifying RB code will have no baring on carrier special ability.

                          Originally posted by vyeh View Post
                          Could the problem have been that repair bay was inaccurately described in the documentation?
                          I don't think so since it follows it so closely. I think the issue is like I originally thought, a mistake with a conditional jump. I think the idea was to prevent ground transports from getting RB bonus however it turned into all units BUT ground transports wouldn't get the bonus.

                          Originally posted by vyeh View Post
                          I'm not too concerned with a situation where the unit is repaired if there is one transport in the square that has repair bay. I can interpret it as the unit transferred to the repair bay between years, was repaired and then transferred back to the first transport.
                          That makes sense. I forgot that each turn is a number of years. I'm all for changing the least amount of code possible.

                          Originally posted by vyeh View Post
                          My experience is that transport foils cannot transport ground transports. I tried that once.
                          If you try to put a ground transport (rover) onto a ship transport (foil/destroyer), it will let you however when you move the ship the rover stays in place on sea tile (lol?). You're then required to move it back onto a land square. So it looks like transports shouldn't be carrying transports. This kind of makes sense otherwise you could end up with one unit carrying an infinite amount of units. I think a simple solution to this would be to check units flags to see if it's a transport and refuse it from being added to another transport. This really is only a problem for ground transports to sea transports and by extension air transports with carrier sea units. From what I can tell Land/Air transports won't carry other transports. Anyway, this is another issue back to RB.

                          The check in #4 is solely to do with multiple units inside transports. It's meant to make sure the "current" unit is correctly selected for check #5.

                          Now, with the acceptance that RB can transfer healing bonuses to units in the same tile like it was originally coded I think the only change has to be #2. I think the idea was if two ground transports are in the same tile with one of them having RB, it shouldn't apply bonus to other. So patching it to "not equal" to transport would resolve the bug and be as close to intended as I can see.

                          In regards to "carrier deck" special ability, it does not give any healing bonus like an airfield does. It does say to "carry and refuel units" like for terraforming airbase. Now, I could emulate the RB check with regards to CD unit flag however that's getting into territory "is this a bug or a feature". I could add it in my notes as something to include as "unfinished business" or the like for some of the more questionable fixes. I personally think carrier should give air units the 10% boost that a normal airfield does.

                          @Mart: Here are a few more minor bugs I've noticed to add to list. If anyone has comments about any of em let me know. Nothing I'd consider major, so add em to bottom of list.

                          potential problems:
                          - From manual: "Probe teams are now “unflagged”, meaning you cannot easily tell who controls the team." However, moving cursor over a tile with will display faction probe belongs to. Bug? Maybe more of MP issue.
                          - "Assemble group" at cursor broken. All units are set to "go to" but they don't move.
                          - Incorrect display of "go to" waypoints when clicking unit which had points set with spacebar.
                          - Clicking a unit in "go to" mode on one of its waypoints will cancel action without warning dialog (bug?)
                          - Needlejet scenario editor bug -> right click unit, "edit unit", data button -> display all messed up and uneditable
                          - sometimes mouse wheel stops working for menus it normally should
                          - add a check to prevent moving a ground transport onto a sea transport. Look into air transports / carrier flag (kinda works for one move).

                          Comment


                          • I didn't mean for carrier deck to give healing ability.

                            I was just speculating that repair bay should work on carriers by repairing aircraft and only based on your original formulation that the check was for a ground unit.

                            So if we fix check #2, then only ground units can get repair bay bonus and only if (1) it is not a transport; (2) it is in sentry mode or at sea; (3) (unknown; can you identify what check #4 currently does) and (4) there is a repair bay in the current square.
                            Unofficial SMAC/X Patches Version 1.0 @ Civilization Gaming Network

                            Comment


                            • Originally posted by vyeh View Post
                              So if we fix check #2, then only ground units can get repair bay bonus and only if (1) it is not a transport; (2) it is in sentry mode or at sea; (3) (unknown; can you identify what check #4 currently does) and (4) there is a repair bay in the current square.
                              That is correct. As for #4, it really should be lumped into part #5 since it isn't a separate check. Rather it deals with making sure a part in #5 is using correct unit id. Do you think fixing #2 is sufficient?

                              Comment


                              • So, are you comfortable with what is going on in #4 and #5?

                                I believe that if you change the sign in #2, that fixes the error. Then the repair bay will follow the manual.
                                Unofficial SMAC/X Patches Version 1.0 @ Civilization Gaming Network

                                Comment

                                Working...
                                X