Tycho Posted January 17, 2013 Report Share Posted January 17, 2013 I think I have the solution for the crashes that happen when aliens attempt to attack an area in the base. It not only stops the crashes but allows alien to successfully attack these areas. The problem is that the algorithm used to decide to attack a node references an incorrect global variable. I am curious did this bug exist in the DOS version or only the CE version? Link to comment Share on other sites More sharing options...
Zombie Posted January 18, 2013 Report Share Posted January 18, 2013 I'm not sure about DOS, but it exists in CE and Playstation versions, that's for sure. What's the algorithm? (I was always curious about this crash ever since helping to identify that the aliens can attack nodes via a mention from Stewart over at the xcomufo.com forums). - Zombie Link to comment Share on other sites More sharing options...
NKF Posted January 18, 2013 Report Share Posted January 18, 2013 I'm fairly certain it did as I have had similar crashes in the Dos version. However the actual crash may not have occurred as often. Perhaps because the Dos version isn't as pedantic about halting at general protection faults as the Windows version? -NKF Link to comment Share on other sites More sharing options...
Bomb Bloke Posted January 18, 2013 Report Share Posted January 18, 2013 The particular crash bug when aliens try to attack base tiles should not occur in the DOS version, at least, it hasn't in any of my tests... They reach a suitably flagged node, they fire at nearby flagged tiles for a while, then they seem to get bored and move on to the next (they may or may not finish trashing the current module first). Under CE, the crash occurs (without fail) after the first shot. Link to comment Share on other sites More sharing options...
Tycho Posted January 18, 2013 Author Report Share Posted January 18, 2013 (edited) I'm not sure about DOS, but it exists in CE and Playstation versions, that's for sure. What's the algorithm? (I was always curious about this crash ever since helping to identify that the aliens can attack nodes via a mention from Stewart over at the xcomufo.com forums). - ZombieIt's in the subroutine sub_402D70, which I think is one of the routines for the Alien AI. There are two instances with the same problem lines: mov ecx, dword_4BA3C8test byte ptr [ecx+0Ah], 2 I think that the variable at 4BA3C8h is the variable that holds the UNITPOS offset for the current unit being evaluated by the AI routine as a target. Usually when this variable is referenced there is always a check to see if it holds data. In three instances in this subroutine, this variable is called but there is no check, so the next command to reference the 0A byte of the unit crashes the game. I replaced that variable with the variable that holds the current active unit's UNITPOS offset. update: It turns out that the variable reference is not wrong but that the entire end of this routine is mangled. It checks to see whether or not the alien is attacking a unit or an area but all the pointers go to the same checkpoints so when the alien attacks a base location, the AI routine still wants to check whether the target unit is active. Since there is no valid target unit when attacking a base location, the game crashes. I reworked this section and replaced the old fix. Edited September 5, 2013 by Tycho 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