Mutonbrain Posted June 27, 2013 Share Posted June 27, 2013 Hello ! I found a serious bug in the XCOM 3 ( Apocalypse ) turn based engine and need your help to fix it. The bug kills reaction fire in TB mode, as it maxes out TU's on turn end by 25%. Looking at a savegame at the very first turn of any mission, an Alien should have 100% TU's.Using "Apoc'd" I've seen value "unknown32" is holding the TU's at turn start.It is used for calcing TU cost for actions during that turn.The current TU's are maxed out at "unknown32" / 4. Example: Having 60 TU'sKeep 15 fine - keep 30 -> have only 15 for reaction fire.The excess is wasted. This means you will never be able to reaction fire a gun that needs > 25% TU for a shot.This does not apply to new born hyperworms, so it must be done at the end of a turn. There must be a "divide by 4" somewhere in the turn end routine, but my ASM is not good enough to find it.If that can be replaced with "divide by 1" the bug will be fixed. I tried IDA yesterday, but I'm too stupid to figure out the location of that process. The old XCOM3 DEMO does work just fine, not maxing out remaining TU's. So how to fix it ? Edit: My IDA does not display the entire code. I read that I have to remove the 32 bit extender from the exe. Can someone tell me how to do that ? Link to comment Share on other sites More sharing options...
Mutonbrain Posted July 4, 2013 Author Share Posted July 4, 2013 OK, bug fixed ! Thanks to info by J'ordos posted somewhere else, I got IDA to open the Tacp.exe.It needs to be stripped by PMWBIND.exe to remove the 32 bit extender. The fix:Offset 112 8249 points to truncating TU's at mission startOffset 113 9101 points to truncating TU's at turn end I just set the pointer 5A (90) to store the value in one of the "unused xx" locations and now all units have full TU for reactions.Depending on how many you kept at turn end. Was very interesting to see, once renewing TU's was stopped, that units start out with 1/4 TU's the next turn.Reaction fire is now intense, as it should be. Units are fireing back at each other. I may make a tool for fixing the bug, if there is any desire for it. Link to comment Share on other sites More sharing options...
silencer_pl Posted July 4, 2013 Share Posted July 4, 2013 I think any fix would be nice to be put in in the files section. It's always good to know that people fix those old games Link to comment Share on other sites More sharing options...
Mutonbrain Posted July 6, 2013 Author Share Posted July 6, 2013 Ok here is the fix:https://d01.megashares.com/dl/7kQTmnt/Xcom3Fix.zip It is scanning the Tacp.exe for the assembler intructions and should work with any language version out there. Link to comment Share on other sites More sharing options...
karadoc Posted July 9, 2013 Share Posted July 9, 2013 Thanks for this. I haven't been playing the game for awhile, and I just found this thread by chance, but I'm very interested to try this next time I play the game. It might have a large effect on tactics and balance, and I might have to readjust my balance mode if I include this fix. I wonder if this was actually a 'bug' (as in unintended behaviour), or whether it was a deliberate design decision by the developers - perhaps they thought it would be a good idea to encourage people to use their TUs each turn, or thought it would be unfair if stationary units could have a full turn worth of reaction fire or something like that... In any case, I think it's definitely a bad thing that weapons with > 25% TU cost can never be used in reaction fire; and reaction fire in general is weak in this game compared to in XCom 1 and 2. Anyway, as I said, thanks for the fix - and I look forward to trying it next time I get back into the game. Link to comment Share on other sites More sharing options...
Space Voyager Posted July 9, 2013 Share Posted July 9, 2013 Interesting. I never knew of this bug but that may be because I moved to RT very fast. As Silencer said, it is nice to see people still find solutions for the games of old. Link to comment Share on other sites More sharing options...
Mutonbrain Posted July 10, 2013 Author Share Posted July 10, 2013 I do not think it was intended. The bug also cuts down stamina regain at turn end. Now all TU's left give stamina back.5 to 6 points for saving all TU's in a turn. Previously I did always only get 1 to 2 points back at most per turn. IIRC, security stations where only doing reaction fire in TB. So this should also be boosted.Yet it would need an attack on my base to confirm that. And I already had to change tactics a bit. If you try to use a teleport to gun down a group'o hostiles the very first turn you tend to get ripped up. Also got butchered by a pair of cultists I tried to dice up with the powersword. Seemed they saved most of their turn for reaction fire. Charging enemies to fire at point blank does still work most of the time, but sometimes they give you a surprisingly warm welcome. Given the other side effects mentioned, I think this was a "debugging feature" to test unknown parts of the engine rather than intention. Link to comment Share on other sites More sharing options...
silencer_pl Posted July 10, 2013 Share Posted July 10, 2013 While you are at it - can you check what causes when in TB mode if you leave soldier in running animation at end of the turn his whole stamina is gone on the next turn ? It probably only happens where there are no TU's left to finish the move - if you cancel the move the stamina is still there. Link to comment Share on other sites More sharing options...
Mutonbrain Posted July 12, 2013 Author Share Posted July 12, 2013 It looks like it is caused by the routine that moves the hostiles during their turn.All of them move at the same time. It seems the movement system is just looping through all units and deducts stamina for being in run animation.So the cause may be a missing check for the team of the unit currently calculated, leading to stamina being deducted every loop even if it's not the units turn. Link to comment Share on other sites More sharing options...
silencer_pl Posted July 14, 2013 Share Posted July 14, 2013 Is it fixable? Because then it also affects aliens too, who then later run out of stamina and are dead meat when caught in that state. Link to comment Share on other sites More sharing options...
Mutonbrain Posted July 14, 2013 Author Share Posted July 14, 2013 Fixing this one is above my skill. I just started with ASM to fix that TU bug. I think it would need a compare of the unit team to the current team in charge and a jump to skip the unit if false. Inserting new instructions is very tricky, as it would shift all function, data and jump locations.I wont be much of a help here, sorry. Link to comment Share on other sites More sharing options...
Zombie Posted July 14, 2013 Share Posted July 14, 2013 For times like this I wish we had the source code for the X-COM games... Thanks Mutonbrain. - Zombie Link to comment Share on other sites More sharing options...
j'ordos Posted January 12, 2014 Share Posted January 12, 2014 Hey Mutonbrain, great work! With your permission I'd like to add your fix to apatcher, giving full credit ofcourse. Let me know what you think. Link to comment Share on other sites More sharing options...
Mutonbrain Posted July 13, 2014 Author Share Posted July 13, 2014 Yes, of course. Permission granted. Link to comment Share on other sites More sharing options...
magic9mushroom Posted September 28, 2018 Share Posted September 28, 2018 The link is dead. Can someone who has the file do a reupload, please? Link to comment Share on other sites More sharing options...
silencer_pl Posted October 11, 2018 Share Posted October 11, 2018 PM Zombie, he might have it. Link to comment Share on other sites More sharing options...
Zombie Posted October 12, 2018 Share Posted October 12, 2018 Unfortunately I do not have it. Dumb question, but did j'ordos incorporate the fix into apatcher and include that in Apoc'd? - Zombie Link to comment Share on other sites More sharing options...
magic9mushroom Posted October 16, 2018 Share Posted October 16, 2018 Might be in apatcher. I don't think apatcher is included in Apoc'd, though. Apoc'd edits data tables, not the actual code, and there isn't any option for "apply patches" that I can see. Link to comment Share on other sites More sharing options...
Zombie Posted October 18, 2018 Share Posted October 18, 2018 I just checked our local copy of A Patcher and the latest date stamp is from 4/25/2010 so that means the patch was not incorporated. I tried looking for a newer copy somewhere, but there's nothing out there as far as I can see. Maybe j'ordos still has it, or possibly the OP. - Zombie Link to comment Share on other sites More sharing options...
Skin36 Posted September 7, 2020 Share Posted September 7, 2020 OG turret bug fix In OG turret does not fire. The game just doesn't give it a go.It only has a quarter point return fire at the start of the first turn.This is because the turn function is:start_turn(AI_control_FULL, side). The game gives a move only for alien whose AI = 99 and XCOM AI = 0, but the turret has AI = 1 and never call.I was able to fix this by simply removing the AI condition, leaving only the side in the function to restore turn points. The turret now restores turn points on an XCOM turn.As for the aliens, they also set the full turn points, but at the end of the hidden turn they are divided by 4 (for return fire during the xcom turn). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now