Talk:Exercising The AI

From UFOpaedia
Revision as of 23:49, 29 May 2008 by Seb76 (talk | contribs)
Jump to navigation Jump to search

Looks like the developers left some debug code behind. The code is activated depending on a variable which of course, is always set to 0. However if you manage to change it to 1, you get full map disclosure at startup, every alien movement is visible, and as an added bonus you are able to select the alien units at the end of their turn to see their stats and equipment. And the icing on the cake: you can even control them with what's left of their TUs! Hope this'll help further analysis of the game ;-). Here is a patch for the CE edition to activate the sleeping code. At offset 025455h, replace:

C3 90 90 90 90 90 90 90

with

66 FF 05 D2 7B 47 00 C3

Have fun! Seb76 05:55, 2 May 2008 (PDT)

Interesting, standard technique for manually patching out code. -- Zaimoni 18:41, 2 May 2008 (CDT)
Another more extensive example is here if you want to play with patches: File:Ufo weight.zip. I hardly got any feedack from it so feel free to report problems ;-) Seb76 02:40, 3 May 2008 (PDT)
Finally reactivated the game in question, and used the patch to rectify some AI weirdness. And promptly got myself into a "transfer black hole" -- purchased soldiers never arrived at the target base. [Hex-edited my way out by setting the TRANSFER.DAT offset 0 to the target base, but that plausibly wasn't the correct way to do it.] -- Zaimoni 21:32, 26 May 2008 (CDT)
I only tested this in tactical mode so yeah, there may be other side effects in geograph. Isn't there a patch to mimic DOS and have 2 binaries for geo/tactical? Maybe you can get away with patching only the tactical exe... I'll have a look and see where exactly the flag is used. Seb76 04:56, 28 May 2008 (PDT)
I use XCOMUtil (need the graphical loader on W2K), so I did only patch tactical.exe. I'm in the middle of tracking down what's going on operationally; I think the transfer black hole was persistent even against complete closing and restarting, but vanished after the second debug-mode battlescape. I'll find out what happens after the third debug-mode battlescape shortly. -- Zaimoni 10:24, 28 May 2008 (CDT) [*EDIT*: it's not oscillating based on games played. Game 1: two soldiers killed, transfer blackout. Game 2: 3 soldiers killed (1 by AI override), no transfer blackout. Game 3: 1 soldier killed (by AI override), no transfer blackout.]
So the problem occured only once? I checked every occurence of the flag check, and it is only used in tactical mode. Maybe you had your savegame files screwed up for some other reason? Anyone else had the same bug? Seb76 09:08, 28 May 2008 (PDT)
So far; there are a couple of variables I haven't checked yet. If I do see the bug again, I'm going to run binary diffs against a before-combat Geoscape. What's annoying is that this bug doesn't show in the TRANSFER.DAT file (that is completely normal-looking); it fires when the items/soldiers arrive. You get the arrival message, but then the items/soldiers disappear from the game. -- Zaimoni 11:43, 29 May 2008 (CDT)
Also: the hex-edit I did to bypass it should not have worked if the usual TRANSFER.DAT spec was in effect. (Changing the source of the transfer, should not suddenly cause it to arrive. Countdown happened normally, so it's safe to say the bug was triggering a reinterpretation of TRANSFER.DAT.) -- Zaimoni 11:48, 29 May 2008 (CDT)
Does this patch means that you get to see the aliens move on their turn? If so, I'm completely out of water regarding patching things an so on, could someone tell how to do it or get me a patched version? Because it would be very very interesting to use to test the values on the .RMP files - Hobbes 13:24, 29 May 2008 (PDT)
Yep, you can see everything the aliens do :) I personnaly use hexworkshop (just google for it) to test my patches. You go to the indicated offset (it in hexadecimal btw) and replace the bytes there with the ones specified. You can also have a look at BB's page, there is a "Seb76 Patcher" he made already ^_^ Seb76 16:49, 29 May 2008 (PDT)