New experts for XCOM 3 Bugfix


  • Please log in to reply
18 replies to this topic

#1 Mutonbrain

Mutonbrain

    Squaddie

  • Members
  • Pip
  • 7 posts

Posted 27 June 2013 - 10:29 AM

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's
Keep 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 ?

#2 Mutonbrain

Mutonbrain

    Squaddie

  • Members
  • Pip
  • 7 posts

Posted 04 July 2013 - 11:36 AM

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 start
Offset 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.

#3 silencer_pl

silencer_pl

    Captain

  • Members
  • PipPipPipPipPip
  • 4,383 posts
  • Gender:Male
  • Location:Poland

Posted 04 July 2013 - 04:37 PM

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 :)
Posted ImagePosted ImagePosted Image

#4 Mutonbrain

Mutonbrain

    Squaddie

  • Members
  • Pip
  • 7 posts

Posted 06 July 2013 - 08:11 AM

Ok here is the fix:
http://d01.megashare...nt/Xcom3Fix.zip

It is scanning the Tacp.exe for the assembler intructions and should work with any language version out there.

#5 karadoc

karadoc

    Squaddie

  • Members
  • Pip
  • 44 posts

Posted 09 July 2013 - 08:50 AM

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.

#6 Space Voyager

Space Voyager

    I've got my eye on you!

  • Site Staff
  • PipPipPipPipPipPip
  • 5,343 posts
  • Gender:Male
  • Location:Slovenia

Posted 09 July 2013 - 02:59 PM

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.

#7 Mutonbrain

Mutonbrain

    Squaddie

  • Members
  • Pip
  • 7 posts

Posted 10 July 2013 - 08:31 AM

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.

#8 silencer_pl

silencer_pl

    Captain

  • Members
  • PipPipPipPipPip
  • 4,383 posts
  • Gender:Male
  • Location:Poland

Posted 10 July 2013 - 09:03 PM

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.
Posted ImagePosted ImagePosted Image

#9 Mutonbrain

Mutonbrain

    Squaddie

  • Members
  • Pip
  • 7 posts

Posted 12 July 2013 - 08:08 AM

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.

#10 silencer_pl

silencer_pl

    Captain

  • Members
  • PipPipPipPipPip
  • 4,383 posts
  • Gender:Male
  • Location:Poland

Posted 14 July 2013 - 04:54 PM

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.
Posted ImagePosted ImagePosted Image

#11 Mutonbrain

Mutonbrain

    Squaddie

  • Members
  • Pip
  • 7 posts

Posted 14 July 2013 - 05:46 PM

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.

#12 Zombie

Zombie

    Mr. Grognard of X-COM

  • Admin
  • PipPipPipPipPipPip
  • 5,474 posts
  • Gender:Male
  • Location:Wisconsin, USA

Posted 14 July 2013 - 10:43 PM

For times like this I wish we had the source code for the X-COM games... Posted Image

Thanks Mutonbrain. Posted Image

- Zombie

My X-COM Patch Kit For UFO Defense | Emergency XCOM Meeting spoof on YouTube




JellyfishGreen said:

Zombie: Empirical data's your only man, when formulating a research plan.
A soldier's death is never in vain if it makes the formula more plain.
A few dozen make a better case for refining that third decimal place.
They call me Zombie because I don't sleep, as I slowly struggle to climb this heap,
of corpses, data points, and trials, but from the top - I'll see for miles!

#13 j'ordos

j'ordos

    insidious one

  • Members
  • PipPipPipPip
  • 134 posts
  • Location:Belgium

Posted 12 January 2014 - 10:33 PM

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.

#14 Mutonbrain

Mutonbrain

    Squaddie

  • Members
  • Pip
  • 7 posts

Posted 13 July 2014 - 11:02 AM

Yes, of course. Permission granted.

#15 magic9mushroom

magic9mushroom

    Lieutenant

  • Members
  • PipPipPipPip
  • 258 posts

Posted 28 September 2018 - 07:56 AM

The link is dead. Can someone who has the file do a reupload, please?

#16 silencer_pl

silencer_pl

    Captain

  • Members
  • PipPipPipPipPip
  • 4,383 posts
  • Gender:Male
  • Location:Poland

Posted 11 October 2018 - 07:09 PM

PM Zombie, he might have it.
Posted ImagePosted ImagePosted Image

#17 Zombie

Zombie

    Mr. Grognard of X-COM

  • Admin
  • PipPipPipPipPipPip
  • 5,474 posts
  • Gender:Male
  • Location:Wisconsin, USA

Posted 12 October 2018 - 02:16 PM

Unfortunately I do not have it.

Dumb question, but did j'ordos incorporate the fix into apatcher and include that in Apoc'd? Posted Image

- Zombie

My X-COM Patch Kit For UFO Defense | Emergency XCOM Meeting spoof on YouTube




JellyfishGreen said:

Zombie: Empirical data's your only man, when formulating a research plan.
A soldier's death is never in vain if it makes the formula more plain.
A few dozen make a better case for refining that third decimal place.
They call me Zombie because I don't sleep, as I slowly struggle to climb this heap,
of corpses, data points, and trials, but from the top - I'll see for miles!

#18 magic9mushroom

magic9mushroom

    Lieutenant

  • Members
  • PipPipPipPip
  • 258 posts

Posted 16 October 2018 - 06:10 AM

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.

#19 Zombie

Zombie

    Mr. Grognard of X-COM

  • Admin
  • PipPipPipPipPipPip
  • 5,474 posts
  • Gender:Male
  • Location:Wisconsin, USA

Posted 18 October 2018 - 03:47 AM

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. Posted Image

- Zombie

My X-COM Patch Kit For UFO Defense | Emergency XCOM Meeting spoof on YouTube




JellyfishGreen said:

Zombie: Empirical data's your only man, when formulating a research plan.
A soldier's death is never in vain if it makes the formula more plain.
A few dozen make a better case for refining that third decimal place.
They call me Zombie because I don't sleep, as I slowly struggle to climb this heap,
of corpses, data points, and trials, but from the top - I'll see for miles!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users