User talk:Seb76

From UFOpaedia
Jump to: navigation, search

Contents

Seb76 INACTIVE

Seb has been inactive for some time so a new page for UFO Extender has been created. Please refer to this page for the latest information and use this page's discussion to report any issues and leave feedback. UFOextender

Tycho 09:29, 26 September 2012 (EDT)

Feedback and suggestions

Hey, sorry to pester you again. :) I've gotten access to IDA, as you suggested, and with it I'm making some slow progress toward my mod. I wanted to ask, though, do you know of any sort of tutorial or useful intro for it? The user interface is pretty obtuse, the built-in help has nothing useful, and I've been struggling just to make comments go where I want them to.

(I mean, I understand that it's meant for very advanced users, but Jesus, who writes an enterprise-grade utility and doesn't bother to implement an Undo function?!?)

Thanks again for your help! Phasma Felis 23:15, 16 June 2008 (PDT)


Okay, a little more progress since I discovered anterior comments. Couple of more specific questions: what's the difference between a "comment" and a "repeatable comment"? Or any of the several other types of comments, for that matter.

What exactly does "mov cs:word_102F9, ax" do? At first I thought it was just copying the accumulator into the data word at 02F9, but the "cs:" part is confusing. word_102F9 is 0, I think ("seg000:02F9 word_102F9 dw 0"). Does that mean it's copying AX into the current code segment, offset 0, modifying the code in progress? That seems odd.

Okay, one more and then I'll go to bed: what does "jmp short $+2" do? It looks like it just means "jump to next instruction", which is kinda redundant, but it could be "jump over next instruction", which...still seems unnecessarily verbose. I dunno. Phasma Felis 00:51, 17 June 2008 (PDT)

The last two questions are actually general Intel 16-bit assembly ;)
The cs in "mov cs:word_102F9, ax" is the 16-bit code segment base, yes. It *might* be self-modifying code, but more likely there is a C global or static variable that was implemented there and being updated. The "seg000:02F9 word_102F9 dw 0" is probably from C default initialization, but could be from an explicit initialization to 0.
Back in the 16bit days, there were several memory models. My knowledge on this is quite rusty, but IIRC COM executables were using the "tiny" one which means that the code and data use the same segment (I assume you're working on the music TSR?). Modification of data via the CS segment is not necessarily self-modifying code. Also TSRs were usually signaled using software interruptions so the code most likely sets up an interrupt vector and bails out. e.g.:
seg000:0140 mov     dx, 157h
seg000:0143 push    ds
seg000:0144 push    cs
seg000:0145 pop     ds
seg000:0146 mov     ax, 2566h
seg000:0149 int     21h                             ; DOS - SET INTERRUPT VECTOR
seg000:0149                                         ; AL = interrupt number
seg000:0149                                         ; DS:DX = new vector to be used for specified interrupt
seg000:014B pop     ds
seg000:014C call    sub_1067A
seg000:014F mov     dx, ax
seg000:0151 mov     ax, 3100h
seg000:0154 int     21h                             ; DOS - DOS 2+ - TERMINATE BUT STAY RESIDENT
seg000:0154 start endp                              ; AL = exit code, DX = program size, in paragraphs
In this example (from music.com), there is code at 157h but IDA does not detect it. You can get there, type 'C' and create a new function. The code there is the most important. HTH Seb76 12:10, 17 June 2008 (PDT)
There were at least six common memory models. *.COM not only assumed a single code and single data segment, it assumed their base addresses were the same. You get four more (with one segment of static data) by 1 or more than 1 of each of code and data segments [near and far pointer distinctions]. The last allowed more than 64K of static data.
XCOM most likely used one of the double-far memory models. -- Zaimoni, 9:31 Jun 19 2008 CDT
"jmp short $+2" is jump over the next instruction, if the next instruction is 2 bytes. This probably came from an if-then-else in C (it's a common idiom in translating C to assembly). -- Zaimoni, 12:36 Jun 17 2008 CDT
I can see several instances of this in music.com for simple "return value" functions. Most likely a "feature" of the compiler. If used for padding, it is equivalent to 2 nop instructions, but takes only one cycle to execute. This was before deeply pipelined processors though ;-) Seb76 12:10, 17 June 2008 (PDT)

Yeah, I sidelined off IDA onto general assembly there :) Probably a good thing, means I'm getting used to it. Sort of.

(Holy crap. I just discovered that hitting "P" (Create Function) in the right place is all it takes to enable graph display mode and give me a vast, improbably pretty flowchart of, well, a lot of stuff. I'd been wondering how to make that work.)

Anyway! Seb, you're correct, I'm working on the music TSR. I've pretty much figured out how the entry code works, setting up an interrupt vector and terminating, which I think is decent progress for three days' experience with x86 assembler. I did find a web reference to "jmp short $+2" here, which suggests that it's "used to clear the cache, before going in or out of protected mode". Not entirely sure what clearing the cache does, but it's good to know.

Thanks to the both of you for your help. Seb, do you mind if I continue to ask questions here? I don't know where else it should go. Maybe we need a "ridiculous hacking ideas" section of the wiki... ;) Phasma Felis 01:10, 18 June 2008 (PDT)

Hehe, sounds like fun. When I can find time to write a dll injector, I may add some stuff to it ;-) I'd start with increasing the max number of smoke entries. (Not possible right off the bat because it's using a static array instead of malloc-ed data :( ). Other ideas: fix the proxmine bugs, or maybe the disjoint base bug. I found the piece of code and it is not a simple "off by one" issue so it cannot just be patched in place... Seb76 12:22, 18 June 2008 (PDT)
Yeah, there's a lot of bugs and odd behaviors that could be fixed by just using larger arrays somehow. The 80-item limit causes all sorts of problems, the smoke limit, the 20-armed-proxmine limit...I wouldn't mind having more than 8 bases in the late game...stuff like that. Phasma Felis 12:42, 18 June 2008 (PDT)


Hmm. The loader thing looks wonderful, but as I'm using a dos version in dosbox I'm guessing I'm out of luck for now? Or are you a dos wizard as well? :) Knan 12:35, 9 July 2008 (PDT)

Using a loader coupled with dll injection, there is no limit to the size of what you want to patch. You can also use higher level languages instead of plain assembler. However it is windows specific (won't work on anything pre-XP because of CreateRemoteThread usage BTW). For CD music in DOS, Phasma Felis may be your ticket. I'm willing to help but as I said before, my knowledge of DOS is quite rusty. Seb76 12:49, 9 July 2008 (PDT)
It's really the equipment screen hack that looks compelling. Figure it might be unreasonably hard to do that in dos. But I can't seem to get the windows version to run at a reasonable speed these days, always far too fast. That's why I'm using dosbox. Ah well, have fun modding :) Knan 14:14, 9 July 2008 (PDT)
Well, actually I have the speed issue too. It's just that setting the laptop to max battery and scroll speed to one is enough to work around the problem ^^. The geoscape has a sleep routine to prevent too fast updates. The mecanism is not present in the tactical part. Seb76 14:45, 9 July 2008 (PDT)
Edit: might be your lucky day. I made a modification, it should slow down the scroll now. Can you check? Seb76 15:42, 9 July 2008 (PDT)


Seb76, since you appear to be on a roll with the findings lately, I thought I'd mention this as something to look out for if you haven't already found it. Can you track down the tables that determine a few other object properties that aren't stored in obdata.dat? I mean for properties like if it can cast light, what bullet image to use if the object is fired, whether its melee attack/mind probe/psi attacks are available for that item, etc. This would certainly allow for much more robust equipment modding. I'm guessing it'll be a part of the tactical.exe portion of the game. - NKF 19:56, 11 July 2008 (PDT)

Only flares can cast light currently. It is not a property in obdata, but a hardcoded "objectType=0x1B" check. I can hack in a piece of code to enable light for some other object types, but we'll need a way to say which ones do (can be done in the ini file but it would not be clean. Maybe we can find an unused bit in obdata.dat and arrange that...). Seb76 14:12, 12 July 2008 (PDT)
Edit: the routine that populates the item menu has everything almost hardcoded too: stun, mind probe, psi-amp actions, scanner and medkit are all hardcoded by object type. The rest uses known flags from obdata. Seb76 15:18, 12 July 2008 (PDT)
Edit2: playing with the heavy laser mod, I found the data for bullet image/sound. It is located at offset 0x6D1F8. Each entry is organized like that:
struct {
	short bulletVisual;
	short shootSound;
	short impactSound; 
	short impactAnimation;
}

Entries are sorted per OBDATA.DAT ID (i.e. the first entry is for pistol, the 0x12th for heavy laser, etc.) Seb76 15:31, 2 August 2008 (PDT)

Ah, that'll help with some modding. Although I just remembered something that I was going to ask at the time - but completely forgot about. What controls how the weapon is displayed while in the soldier's hands? I mean, the pistols are displayed with the weapon extended in the firing position while most other weapons are held across in both hands (mimicking one/two handed items). Would this be hard coded as well in addition to the unique item actions? -NKF 17:43, 2 August 2008 (PDT)

Game Crashes when researching 'Sectoid Medic'

Hey, not sure where to put this since you aren't providing any means of contacting you but I have a save where in the event I research a 'Sectoid Medic' it crashes along with this error:

XCOM crashed at 0x440057 with error 0xC0000005 trying to access 0x0000012B

Error running UFOExtender

Hi Seb76. I've tried running your UFOExtender as I want to slow down the scrolling in the tactical view. However I get the following error message:

C:\Games\X-com\UFO Defense\UFOLoader.exe
This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

Any ideas what's going wrong? I'm on Win XP running Collector's Edition of UFO. --col_w 05:34, 12 July 2008 (PDT)

Hum, looks like the error you get when there is a missing DLL. I compiled using Visual Studio 9.0 Express Edition, maybe you don't have the runtime installed? You can get it here. Tools like dependency walker can help identify missing DLLs. Also what OS are you using (service pack number)? I don't have Vista here to test so it may only be running in XP SP2. Anybody can report it running on Vista? For sure it won't work on Win9x. Seb76 09:02, 12 July 2008 (PDT)
Yeah, visual xyz runtime dlls need to be included with things you compile with visual xyz. A common complaint when running small hacks under Wine on Linux as well, since you usually install just a very few programs on each virtual windows install, so it's unlikely some other program installs the dlls for you. Knan 17:08, 12 July 2008 (PDT)
Especially since they made up that manifest stuff. Supposed to solved DLL hell... Well, so far it caused me more trouble than it solved issues. The funny part is when you install a new VS service pack on your build servers and have half the development team freak out because their target system won't boot the latest piece of code... Seb76 18:04, 12 July 2008 (PDT)

Awesome, that fixed it! Now I can enjoy this classic game once again. Love the language screen joke too :) Many thanks --col_w 11:08, 12 July 2008 (PDT)

My pleasure man. Glad you enjoyed it ;-) Seb76 12:07, 12 July 2008 (PDT)

My problem is the following: if I try to run the loader normally, a console window pops up for a few seconds then I get an "illegal instruction" error from NTVDM (and the window disappears, yet it's button remains on the taskbar until I kill the process). If I try to run it with DosBox however, I get "illegal command: UFOLOADER.EXE". Point is, I can't run this at all.--amitakartok 11:27, 13 October 2009 (EDT)

Looks like you're trying to use the DOS version here. Only the CE (windows) version is supported. Seb76 13:48, 13 October 2009 (EDT)

Hi, is it in any way possilbe to run the Extender in Win98? I just set up an old machine with it and wanted to give it a try but as you said above, it won't work with Win9x. But is there a way to manually mod the game? I am asking becaus on my WinXP Machine the game often crahes in battlescape and that really sucks =(--Skaw847 19:28, 21 May 2010 (EDT)

UFOloader and Xcomutil

Hey Seb76 awesome work with this patch! Just wondering though if it would be possible to run this together with XcomUtil somehow. Thanks! Oh and btw when's the TFTD version coming out? ;-) J'ordos 14:09, 24 July 2008 (PDT)

You can try this version: File:UFOExtender-dev.zip. I did not really have time to test it. Use the modified batch and keep me posted ;-) You'll get a crash if you activate the patch to disable the introduction movie. I checked the equipment screen patches, they were OK. TFTD will wait till I'm satisfied with the XCOM version. Anyway, I'm not in a disassembling frenzy right now :p Seb76 15:29, 24 July 2008 (PDT)
Hey fast response, thanks! I tried the new version but unless I'm missing something I've been unable to get it to include f0dder's bugfix loaders. I edited the ini file's Executable= to 'xcloader.exe', xcomutil's included bugfix loader, and when I run UFOloader.exe directly it works fine, but when using your modified runxcomW.bat it seems to be disregarded. This was not the case with your previous version. (I actually thought of modifying runxcomW.bat like that :-) ) Can't seem to find any reason for it in runxcomW.bat.
The only modification I did to this version is forward the parameters passed to the loader to the XCOM executable (geoscape is passed an argument which tells it if it needs to start from scratch, or use the data from the missdat folder). Also it cannot work with f0dder's patch the way you tried: doing so, you are patching the xcloader binary itself, which obviously is not what you want.
Edit: I added a "Video Pitch" bug fix to compensate for the incompatibility of the 2 loaders ;)
also a minor note, but on a fresh xcom install the console echoes a read error on MISSDAT\saveinfo.dat (I assume this is the work of xcomutil) and minimizes Xcom to the tray. It still works fine though.
while on the subject of minor notes the 'Rank In Inventory=' in your ini file actually has the letter O instead of the number 0 by default ;-)
Hm, I guess that's what you get when experimenting stuff at 1:00 am ;-) (GMT+2 here)
edit: I decided to do some testing first by manually disabling directdraw to circumvent the bugfix loader problem. Unfortunately the game crashes as soon as I enter tactical combat (when it should go to the equipment screen) even when all features are disabled. But unless I delete the MISSDAT folder's contents the next time I run runxcomW.bat I can hear the battlescape music playing. Unfortunately the batch file seems to get stuck in an infinite loop or something as it just keeps starting xcom over and over until it finally kills my system! :-) (all my base really belong to you ;-) )
I start the runxcomw.bat batch from a shell and I have to do a "ctrl-C" between phases . Maybe it is because I replied yes to "Do you want to see XcomUtil messages after combat?"
using the previous version I can enter battles just fine, but none of the UFOloader features work.
Did you try disabling every XComUtil features? I don't know how extensively it modifies the main executable. Here it works with the following config: replied "no" to everything while installing XComUtil (so that only executable splitting is done), enabling only equipment screen patches with my loader, and starting via the attached batch file. I can start a new game, down a UFO, go into tactical mode and go back to the geoscape view after taking down all the aliens. Did you try renaming UFOLoader.exe into xcloader.exe? It might work Seb76 12:21, 25 July 2008 (PDT)
Thanks for your efforts, but still no luck. I downloaded the new version and did a fresh install of xcom. Running the UFOloader without xcomutil works fine (with your directdraw patch I get a ~3sec pause everytime the game zooms in/out on an interception though, which does not occur with f0dder's patch). Running xcomutil without the UFOLoader also works fine (using ctrl+C). I then did another fresh install and put the both of 'em together. I enabled the equipment screen patch and the directdraw fix on UFOLoader and told xcomutil to use f0dder's loader, answering no to all other questions. Renamed UFOLoader.exe to xcloader.exe and started runxcomW.bat. The game crashed when it should go to the equipment screen. (no ctrl+C possible) Disabling the equipment screen patch and/or enabling xcomutil's messages after combat yielded the same result. :(
About the 3sec pause, it may be related to the musicfix that f0dder's patch does: it runs the MCI commands in a separate thread to remove the pause due to synchronous calls (with the unpatched version, there is a "slight" pause (~0.5sec on my computer) each time the music changes). Do you have the same pause in the main menu? Also if you activate the PSX music patch (even with no CD in the tray), it should remove the pause (if it is indeed the same problem). For your crash, I haven't got a clue. Maybe it's time I release the source code so people with different configurations can try more stuff. I know there are imaginative people out there ;-) Seb76 07:02, 27 July 2008 (PDT)
Ah that fixed the delays, thanks! Strangely the battlescape now works fine (using ctrl+C) as long as I don't enable the equipment patch with xcomutil... Don't know about the other fixes&flags. I'll do some more testing. J'ordos 10:31, 27 July 2008 (PDT)
edit: quick testing reveals that it actually crashes exactly 1 times in 2, apparently regardless of what fixes are on. (though I did not yet test any xcomutil features) I guess it's probably related to one of the MISSDAT files? J'ordos 10:37, 27 July 2008 (PDT)
edit2: OK here's what I have so far: It crashes if the previous mission worked. It works if it crashed on the previous mission. If I delete the contents of the MISSDAT folder it always crashes until I do a mission without xcomutil and/or without the loader. After that the normal rules apply. (i.e. next mission I play with both xcomutil&the loader it'll crash, as the previous mission worked, but the next one will work again) very strange :s Note that I did not yet try to play out a full mission, I always aborted on the first turn. Hope you can narrow the problem down a bit this way :-) J'ordos 10:50, 27 July 2008 (PDT)
Can you give me the address of the error when it crashes? (accessible in the crash window dialog)Seb76 11:29, 27 July 2008 (PDT)
There is nothing when it crashes, not even the console remains. Unless you're talking about a log file?
I was talking about the "a program has cause xxx to close unexpectedly" (or whatever it is in the US version) dialog box. This looks more like a silent crash (the worth case). I modified the loader and it looks better. I still have the "ctrl-C" issue however. Seb76 12:38, 27 July 2008 (PDT)
<3 don't know what you did but the latest version works perfect! Just did 3 missions in a row, restarted xcom and did another 2 (only actually completed one of 'em tho :) ) without any crashes at all! *crosses fingers* I enabled all the settings I wanted in both xcomutil and the UFOLoader without problems. Thanks Seb, excellent work! ;-)
oh and the ctrl+C thing is a problem in the xcomutil batch file, it's not your program's fault. The Xcopy commands in the runxcomW.bat file are missing a /Y parameter. Here's a link to the xcomufo.com forum thread discussing it for anyone interested: [1]
Whew, was quite a ride... Now, where's my ammo clip fix? ^^
Thanks for the feedback, it is good to know that it is possible to have this work with xcomutil. BTW, the fix I did in the test version is also in the latest package with the ammo clip hack ;-) Seb76 16:16, 27 July 2008 (PDT)
After spending an hour with reading through this double discussion and trying to find the right batch file in the old archives and make the game work, I decided to put your Xcomutil + UFOloader solution here: File:RunXcomW.zip with a simple explanation. Hope you don't mind.--Kyrub 15:43, 8 September 2008 (PDT)
Actually you don't need the modified runxcomw.bat file, the way I do it is I tell xcomutil to use f0dder's loaders and then I simply replace xcloader.exe (xcomutil's included f0dder patch) with UFOLoader.exe! J'ordos 05:01, 9 September 2008 (PDT)
Hey there, I've read about this project and I'm wondering if I can ran it with XComUtil but I play with the DOS versions (through DosBox) and thus use RunXCom. Hobbes 16:27, 13 September 2008 (PDT)
Sorry there, this project uses modifications of the binary so it'll work only on the windows version. Why do you have to stick to the DOS version BTW? Seb76 04:29, 14 September 2008 (PDT)
DOS version was the first I played and I prefer its sounds (specially the alien death cries). I also prefer the DOS bugs (some on CE are too annoying). Thanks anyway :) Hobbes 11:26, 14 September 2008 (PDT)
Hmm, something I remembered: IIRC, XComUtil splits the binary of CE into Tactical and Geoscape, in order for it to run with CE. I think I'll download your program and give it a try Hobbes 11:34, 14 September 2008 (PDT)
No success, doesn't surprise since I have the barest clue of what I should be doing. Hobbes 11:44, 14 September 2008 (PDT)
There's no way it could work like that, windows binaries cannot run in DOS environment; split binaries or not. If you're pissed about a particular bug, just tell. I may be able to fix it ;-) Concerning the sounds, I don't know exactly what is the problem about CE version. If someone can give some details, I may have a look at that too. Seb76 12:09, 14 September 2008 (PDT)
Hey Seb is it possible the latest versions of your extender don't work with xcomutil anymore? Did you drop support? Love the new features but I rather miss xcomutil's automatic re-equipping :) J'ordos 12:58, 26 April 2009 (EDT)
Yeah, it is possible ^_^ But you now, it was never officially supported, it worked more or less by chance ;-) As I said on the forum, it might be possible the older version of the loader still works (you can use the old loader with a recent patcher DLL, it should be OK), but I got little feedback so I don't know if I'm correct... Seb76 16:13, 27 April 2009 (EDT)
I for one am a huge fan of XcomUtil, though I'm now also a huge fan of UFO Extender! I'm really hoping I can get the two to play nice. I was up until now playing a dos version, myself. Mainly because the version I bought years and years ago was the DOS version on CD and it still worked via dosbox, which also has several filters similar to your HQ4x. (Some run a little faster and I think they can run in a window while I can't get HQ4x to run windowed at all. I don't mind that so much, though the game runs noticeably slower when I run HQ4x and I prefer to run windowed these days so I can more easily multitask. Still I LOVE UFO Extender so I switched to the Windows version just for this.) Some of XcomUtil's features only work in the DOS version with split exe's because it goes back into the batch file and allows XcomUtil to play with things when switching from Geoscape to Battlescape and vice versa. But, it's not that big a deal for me. UFO Loader's feature list is more than robust enough to give that up. As for the sounds the Windows CE versions changed a lot of the sound effects. If you're used to this version then it's Np, but if you played the DOS version and got used to it then it's VERY off putting. Luckily it's easy to patch it back to the DOS sound effects. The "Enemy Unknown Extended" page here lays out an install that includes UFO Extender, the original DOS sounds, ect... It's a good place to start. Anyway, great tool. Now let's see if I can get these to play nice.Mannon 04:40, 27 March 2011 (EDT) (I keep forgetting to sign things... too used to forums instead of discussion pages.)
Facinatingly XcomUtil actually DOES split the CE's executable into geoscape.exe and tactical.exe! It uses it's own sdump utility to do this during the setup batch file. I misread the above. XcomUtil splits them to preserve it's fuctionality so that it can use the batch file to knit them together like in the original DOS version and insert it's own exe into the mix. This does not make the windows exe run in DOS of course, but it does allow XcomUtil to keep it's functionality. I have to assume it really screws up UFO Extender, though... ;-( Mannon 21:31, 29 March 2011 (EDT)

Decided to look into this as there are a few XcomUtil features I like that aren't reproduced in UFO Extender. XCU does indeed split the exe. It also modifies both of the split exe's. It still loads both via fodder's loader when running them from the batch file. The command lines for that are "start /w xcloader geoscape.exe "0"" and start /w xcloader tactical.exe "1". Replacing xcloader with UFO Loader appears to work for tactical. The command line even appears to point UFO loader to the tactical exe since going into combat causes a problem. If I change the first xcloader call to "start /w xcloader" then the renamed UFO Loader finds the unsplit exe. Going into combat no longer fails like this, but it also prevents XcomUtil from running between phases. This does not prevent the running of XCU completely, but it will cause problems with some features, especially in the placement of soldiers in the new craft maps that XCU adds. Then again, by using the UFO Loader to use the original unsplit exe I believe that you are also bypassing all of XCU's modifications to the exe's as it probably does all those modifications to the geoscape and tactical exe's it created when splitting the exe. It may be possible to recombine those exe's or to find command line parameters that allow UFO Loader to load tactical.exe on it's own. The latter would probably be the best solution since it should allow XCU to function between phases.Mannon 21:31, 29 March 2011 (EDT)

Splitting of the exe is accomplished by first simply copying it with both of the destination filenames. Then sdump is run on each one using settings from XcomUtil.cfg to essentially transform each one into the geoscape only and battlescape only versions. The settings are available in the cfg, but not documented so I don't really understand them. Though... it is actually starting to make some sense as I compare the cfg to the sdump documentation in XcomUtil.txt. Seems like it would be possible to reverse the patch, though it might require first extracting the correct data from the unsplit version. Note: The split up geoscape.exe and tactical.exe are exactly the same size as the original ufo defense.exe, thus data was not removed by sdump, merely changed. I think the only change needed were to cause geoscape.exe to exit at the right time instead of going immediately to the battlescape, and for tactical.exe to go directly to battlescape loading the mission data like the old DOS version.Mannon 22:01, 29 March 2011 (EDT)
I believe that I have managed to get XcomUtil and UFO Extenter at least working together with a kludge. My method involves using modified versions of XcuSetup.bat and RunXcomW.bat and the creation of a new exe, (to avoid overwriting the original and keep it as a backup). RunXcomW.bat is changed to point to UFOLoader.exe instead of xcloader.exe and points UFOLoader at the new exe UFOmerge.exe. The second call of xcloader which normally initiates the battlescape has been simply disabled as it will never occur under my setup. The changes to XcuSetup.bat are also pretty simple. I allow it to copy the UFO exe into geoscape and tactical because XcomUtil.exe will only modify these exe's. But I disable the patching done to each via sdump which turns them into independent phases of the game. Then in every instance where XcuSetup calls XcomUtil to make a change to the exe's I insert a line after it that uses sdump to merge those exe's back into UFOmerge.exe. Viola! Theoretically this should allow XcomUtil to modify the UFO exe while still allowing UFO Extender to make it's own changes. However... Not all XcomUtil functions will work and some of them will flat out break because it cannot be called when switching phases of the game. So, for example, if you use the larger craft XCU includes then you could be in trouble since XCU cannot be run to place your soldiers properly. I suggest you stick to the normal number of soldiers each craft can carry. If I knew a way to make UFOLoader.exe compatible with tactical.exe then it should be possible to have full functionality. It actually works perfectly fine with geoscape.exe. Seb76, if you're around anymore I can provide you with exactly which bytes are altered in tactical.exe for both UFO and TFTD as they are in XcomUtil.cfg. After looking at the sdump documentation it's actually pretty straitforward. It basically uses hex numbers as commands specifying goto this address, write the next X bytes, skip the next X bytes, ect... I'll make my modified XcomUtil files available on my page if anybody asks for them. Now... to figure out how to disable the XcomUtil base disjoint bug fix. lol I think I'd prefer the UFO Extender fix, and I like having the option to leave the bug in place and use it for tactical options.Mannon 05:07, 30 March 2011 (EDT)
Kept getting sidetracked, but I finished that part and added it to XcuSetup.bat. All it took was adding the one line, "if exist maps\xbase_01.xcu xcopy maps\xbase_*.xcu maps\xbase_*.map /y" right after XcomUtil does it's map:cfg write. This only leaves the disjoint bug in xcom bases. I could revert the alien bases too, but I figure why bother doing that.Mannon 10:56, 30 March 2011 (EDT)
NVM Skip all this and use XcomUtil 9.7. It works just fine with UFO Extender even with split exe's, and makes all the bug fixes optional too.Mannon 06:40, 5 April 2011 (EDT)

I'm getting the exact same problem as [2]Doctoxic:

"this didn't work for me (win7/64 - steam version of UFO)I installed the extender first and the game starts fine, i then go through the UTIL setup and it sees Extender is there Ok and i run through all the options no problem. However when i run the game using runxcom.bat the game now crashes with error "xcom has crashed.......trying to access......""

Specifically, the error I get when trying to run RunXcom.bat is "XCOM Crashed at 0x45E6A5 with error 0xC0000005 trying to access 0x000000" I've uninstalled and reinstalled both XcomUtil and Xcom itself via Steam, to no avail.

On my initial install I opted for the "Run XcomUtil through Steam" or whatever it's called option during XcomUtilSetup, but when running it through steam it was obvious that while XcomUtil seemed to be working okay, UFOExtender was not active (I still had to select my language). I've also tried matching the steps exactly for installing [3]UFOExtender and [4]XcomUtil from the wiki. I've spent the evening looking up threads like [5]this one or [6]others and starting from scratch following the instructions, but still it seems I can only get Xcom to run with either XcomUtil or UFOExtender, but not both, whether running the DOS or Windows versions, whether by RunXcom.bat or any of the .exes or through Steam.

I'm really excited to play this game, but after reading up on it I really don't want to start off with any of the bugs/glitches addressed by XcomUtil and UFOExtender. I'd really like some way, any way, to run these both together, and it seems others have been able to do this already. Thanks in advance for any help, and for working on this tool so much already! --Xen0nex 09:52, 28 October 2012 (EDT)

EDIT: Looks like this did the trick [7]; disabling the Skip Intro movie option in UFOExtender. --Xen0nex 08:02, 29 October 2012 (EDT)

Heavy Laser Mod

Hey Seb, I've been trying the new heavy laser. It's a cool idea, adds some new options during battle :) But I think currently the full auto option is overpowered. I hardly use the burst mode at all. I'd suggest lowering the accuracy and/or (if possible) reducing the amount of shots fired? Currently when I see a single alien I use full auto (can't miss with 10 shots), when I see a terror unit I use full auto (2x2 + 10 shots = dead terror unit :) ), and when I see a group of aliens I also use full auto (10 shots > 5 shots). A few units still standing? Bring on the next heavy laser. Also because these new fire modes don't mind line of fire restrictions cover won't help aliens at all (unless the cover is strong enough to withstand HL power). Just use full auto to blast through any house that's in the way and in most cases it'll still kill the alien as well. (do need to make sure no agents/civilians are standing in the line of fire though) Should note that ATM I'm still only dealing with sectoids and the occasional floater. Will let you know how it fares against the later races. J'ordos 05:44, 31 August 2008 (PDT)

OK, it's cool but it really is overpowered. Accuracy must be lower in Auto modes than in Snap, that's basic in the game. If you assume the Heavy Laser is somehow better optimised for autofire than the Laser Rifle, and set the TUs for normal Auto at say 30% (vs 34% with Laser Rifle) that would let you get off 3 bursts, which would be better. (I could live with the idea that you can also only fire 3 snap shots). Then your "Full Auto" mode would be 100% TUs for 10 rounds and your "Burst Mode" could be 50% TUs for 5 rounds, and that would be consistent with the 'standard' Auto mode. But the accuracy per shot needs to be much lower. I would suggest the base Accuracy per shot is reduced to 33% (one third less than Snap, similar to a Laser Rifle). You are still making the weapon MUCH more effective this way. Spike 12:47, 1 September 2008 (PDT)

On further analysis, even this is too powerful. The stats I just cited would give firepower only a fraction less than a Heavy Plasma - with much lower cost, unlimited ammo and easier-to-reach technology. That's not balanced. Unfortunately, you can't really go above 6 shots per turn without unbalancing the game, as none of the 2 handed weapons fire more than 6 shots/turn. So the TUs for Auto need to be 34%-40%, and you can't really have it fire more than 6 shots per turn even in the Full Auto mode. I would suggest Auto = 35%, Burst = 75%, Full Auto = 80%. Burst and Full Auto only fire 6 shots. Burst Mode fires 2 shots each at 2 waypoints, and a further 2 rounds spread in between the 2 waypoints. Full Auto fires one each at 2 waypoints and 4 shots spread between the waypoints. And maybe the Burst Mode should be the more expensive one as it is more 'concentrated' fire. The reason you can't really exceed 6 shots per turn, even if you reduce the accuracy drastically, is because otherwise you create a super-effective shock weapon at point blank range (and a super effective terrain-clearing weapon). Somehow the 'shock power' in particular seems inappropriate for something as clumsy as a Heavy Laser. To rationalise it, think of it this way - it's not a machinegun, it's an energy weapon. The 'cyclic rate of fire' is limited by the energy circuitry as much as anything else. So squeezing six shots per turn out rather than 3 (the limit with Snap fire) is a pretty good improvement. With the Auto Mode I've suggested here, you have still double the 'shock' firepower of the Heavy Laser at short range, and increased its firepower by two thirds at longer ranges. Not a bad way to put some life back into a weapon that otherwise has very limited uses. Probably in the 'Area' modes (Burst / Full Auto) the Accuracy should drop, say to 25% (vs 33% in standard Auto). Spike 13:48, 1 September 2008 (PDT)

Ok I finally shut down my NeXCom Workstation and turned out the lights in the Bean Counter's Department at X-Com HQ - and headed down to the Armoury. I checked out one of the new, experimental Super Heavy Auto Lasers and ducked onto an Avenger heading into a hot LZ.

Seb, let me tell, you, it was SPECTACULAR! You are the Ayatollah of Rock-and-Rolla! I was like Jesse Ventura in Predator, carving up the jungle with his minigun. I love your gun. It is too cool. It must not be nerfed. So I have another suggestion for your coding skillz:

See if you can get the "hidden item", Gatling Laser, working. Add your Super Heavy Auto Laser as a new item, using the Gatling Laser image and OBDATA entry. I don't know if you can add a new Research option or a new Manufacturing option. If you can't, maybe you can offer it to Purchase (once Heavy Laser is researched, or perhaps Laser Cannon). Given the power of the weapon (as spec'd above), the cost to buy or manufacture should be similar to a Heavy Plasma: around a total cost of $164K to manufacture (including all costs) or around $225K to buy. As a quick hack, for the time being, if you are still using the Heavy Laser object for the Super Heavy Auto Laser (with 10 shot Full Auto), increase the manufacturing costs and buy/sell prices to roughly the same as the Heavy Plasma. Spike 13:29, 3 September 2008 (PDT)

Thanks for the nice feedback! The initial idea for this mod came when watching a Laser Squad speedrun (never played the game myself) and seeing the guy waste several baddies with one auto-shot sweep (in this game you can also select the number of shots when auto-firing). I chose to try a modification of the heavy laser for 2 reasons: everybody agrees to say that the default one sucks and second, since it uses no ammunition there is no need to handle out-of-ammo conditions. I personally see this weapon more as a recipe for new doors than a direct way to kill aliens. Several things could nerf it a bit but I didn't try them yet:
  • make accuracy lower and lower during a burst (to account for the laser lens deformation caused by overheating). This would restore the advantage of cover and make people thing twice before firing when a friendly unit stands in front
  • reduce accuracy even further when shooting out of sight (this was mentionned in another post)
  • change the damage model and reduce the probability that terrain is destroyed when shot
  • have a cooldown period where the weapon is not useable (not sure if it's feasible though)
Yeah cooldown periods! Then restore functionality of the melee HIT command. Hey it worked for incubation: time is running out. ^^ J'ordos 16:27, 7 September 2008 (PDT)
Hm, I already cannibalized the unused "open" and "close" actions for the heavy laser mod, there is no more room for a new "hit" command. Unless... ;-) Seb76 11:28, 8 September 2008 (PDT)
OK, here is the last draft before I finalize:
  • Shooting the HL will cost ~50 energy so you won't be able to abuse it (the shooter will be a sitting duck)
  • Each shot of a burst will reduce the accuracy (amount not determined yet)
  • The Range Based Accuracy will always apply to the HL
If everybody likes it, I'll got with that. Any comment? Seb76 09:16, 22 November 2008 (CST)

Sounds good to me. Spike 17:25, 22 November 2008 (CST)

OK, here we go. I won't tell you exactly what I did, just give me your feedback ;-) Seb76 05:24, 23 November 2008 (CST)

It's been a while, but recently tried your newest version and it seems the heavy laser is bugged? No matter which firing mode I choose it is extremely inaccurate and a lot of shots after travelling in one direction suddenly 'deflect' into another direction for some reason. It's a miracle none of my own guys were hit :) J'ordos 12:41, 28 February 2009 (CST)

It may have been broken by other stuff indeed. I'll have a look Seb76 17:29, 28 February 2009 (CST)

Hey, is it just me or is full auto not affected by range based accuracy, while burst is? I am using the RB accuracy mod on all weapons, and maybe that is affecting it. All I know is, even at long distance, full auto shows full accuracy. Not sure if the burst mode is showing the RB decrease I programmed or not though. --Talon81 06:01, 14 April 2009 (EDT)

The heavy laser and range based accuracy stuff were developped in parallel and merged later. It is almost sure that things will go wrong if you activate both ;-) I could reproduce some issues and will try to fix them. BTW, I got no feedback for the "shortcuts" patch. Is it broken that badly that nobody wants to have it fixed? Seb76 17:00, 18 April 2009 (EDT)

I just used an unpatched version (CE, as I always use), and used your patch on it. The only things I even activated in the patch are the video fix so it was playable, the heavy laser mod, and the accuracy mod. Still have the same problem, so yeah... they don't work well together at the moment. But... I am hooked on the accuracy mod, so I guess Ill just deal with it and not use full auto. As far as shortcuts go... I had enabled it at one time, but I found that I just never used them. Maybe I will try to use it a bit to give you some feedback. I added a comment for alien bases, too, btw. --Talon81 15:18, 19 April 2009 (EDT)

Wish List please please please

New and Outstanding Requests

  • Could we get TUs (in current/max format) at the inventory screen while on a mission? It would greatly help with swapping weapons among soldiers.
  • Could we get little numbers [like on the screenshot of accuracy mod] showing how much TUs an action on the inventory screen would take? Some players (me, of course, included) can't really remember all that reloading from backpack or from a leg slot TUs. Also...
  • a "drop all" button, maybe?
  • Soldiers' positioning in Skyranger is very good... but with the Avenger it is not so pretty. The ones at the top are not the ones closest to the trap door. Chooseable patterns, maybe?
  • Remember soldier load outs from last mission and re-equip accordingly. Or maybe just prevent units from taking more than they can carry. Removing grenades first, then magazines and ammo and lastly guns.
Save Equipment is under development, still some bugs
  • Make it so you can drop more than one screen worth of stuff in the pre-mission equipping phase.
  • Allow human side soldiers to reaction fire in their currently saved Reserved Fire mode - eg to take Autofire or Aimed reaction shots. That would be very, very cool. It would also be a balanced trade-off, if these Reacting soldiers were not allowed to 'switch' to Snap fire after they no longer have the TUs left to use their Reserved mode.
Has this been completed via the "Save Reserve Mode" feature? Not entirely I guess as Reaction fire is still always in Snap. To be honest that's not a bad thing. Spike 08:54, 23 November 2008 (CST)
  • Implement your 'Area Fire' (as per Heavy Laser) for all large automatic weapons (AutoCannon, Heavy Plasma) or maybe just for all automatic weapons, period. It would be very handy for Autocannon bursts to cover a wider area, firing a narrow burst is often not what you want at all in many tactical situations. There might be a problem implementing this for Plasma weapons, if you couldn't persuade the Aliens' AI to use the Area modes - it wouldn't be fair.
  • Close down Exploits. (I've just been reorganising the Exploits pages so it's on my mind.) Maybe this is pointless for those who have the willpower just to abstain from using Exploits. But as these are actually bugs I think it would be good to fix them. The worst exploits in my opinion are:
    • Free Manufacturing. Probably needs to add a check that the manufacturing project has >0 units before allowing it to start.
    • Free Wages. Pay wages regardless of whether staff are in transit. They are on the payroll after all. This has a drawback that you pay twice (1.5x) for staff you hired very near the end of the month, which would affect some styles of gameplay.
    • Tactical Exploits: The worst ones are the Collision Detection bugs, those I imagine are hard to fix.
    • Eliminate "infinite fuel" exploit for conventional aircraft.
  • Side-arm throws for grenades: It would be nice if the game could first check for a direct fire solution (side-arm throw or straight throw) for a grenade attack, if the target is in range for a straight throw, Range for straight throws would be reduced (to 1/4 or so of the parabolic range). It would only go on to attempt the indirect fire solution (parabolic vertical throw) if the direct fire attack returns "no line of fire". This would avoid a lot of the "hit the ceiling" issues with grenade indirect fire.Spike 08:54, 23 November 2008 (CST)
  • With View All Locations, put some kind of indicator or (better yet) counter on the Geoscape screen when there are UFOs in flight. In case the UFO is on the other side of the world from where you are currently looking. -OR-
  • Make the world rotate at normal speed (i.e. once per 24 hrs. Rotation starts after say 12 or 24 hrs of looking at the Geoscape and not touching anything. Stops again if you touch the globe controls.
  • Make Aliens able to pick up a weapon if they are empty handed! Or just make them pick up anything Alien in their square, if that's easier. Maybe move them towards a weapon if they have no weapon - much harder to do I suppose. But at least, if they are empty handed and happen to walk over an Alien weapon, pick it up! See discussion here.


  • "Eye in the Sky". Map (set to visible) all terrain features on Turn 1 (but do not sight any hostile units). Ideally this should be only the exterior of buildings but that's probably too tricky. Assume we have something like a FLIR on the Skyranger that can do basic imaging of the inside of buildings.
  • Fix Base Storage display problems that lead to storage weirdness. Discussion and recommendations here.
  • Enable native alien melee attacks within Alien Pets. The Floaters are pleading. (At the moment, Alien Pets+Big Brother means a crashed Superhuman Floater Large Scout costs 6-8 X-COM agents; corresponding crashed Sectoid Superhuman Large Scout is only worth 3-5 X-COM agents. Floater Large Terror Ship on just Big Brother : only one agent, and that was due to the top-of-stair pinning bug providing enough TU to do something.) -- Zaimoni 12:39, August 12 2009 (CDT)
  • Do something to help out the psi aliens as well within Alien Pets, as above. -- Zaimoni 12:39, August 12 2009 (CDT)
  • Would it be possible to change the master volume level in the game, or at least have a no sound option? Epiceuropean 00:26, 12 January 2010 (EST)
  • Would it be possible to change alien equipment loadouts based on their ranks? As in, aliens use more varied equipment between ranks instead of everyone toting heavy plasmas and blasters.
    • Soldiers would never progress beyond rifles. Yes, rifles don't have as much power as heavy plasmas but they ARE more accurate so X-COM guys would constantly have to be on the watch for snipers.
    • Engineers keep using stunners because of the explosion hazard in the reactor chamber where they usually patrol.
    • Navigators and Medics always stick to pistols (sidearms) because they're supposed to be non-combat personnel.
    • Leaders are the only ones who use heavy plasmas in order to invoke what TVTropes calls "Authority Equals Asskicking".
    • Ditto with Commanders being the only ones toting blasters.
This way people won't be forced to depend entirely on heavy plasmas if they don't want to waste Elerium on ammo manufacturing for guns the aliens stopped using months ago.--amitakartok 01:58, 11 January 2012 (EST)
  • On the unlikely chance you're still working on the loader, a few more ideas for your consideration:
    • Whenever a Zombie's health is below a certain threshold, there's a chance that the Zombie hatches into a Chryssalid at the end of each alien turn. The chance increases the lower the Zombie's health gets, ie. a Zombie at 1 HP would have a higher chance than one just barely skirting the threshold.
    • Psionic aliens, aside from having a normal sight range, also get a shorter range within which they can detect enemies. This psionic detection works in every direction regardless of facing and even through walls, making it that much harder to sneak up on them. Optionally, psi-trained soldiers could gain the same ability while holding a probe, with detection range depending on psionic strength (although it shouldn't reveal the exact alien with weapon, only that someone's there. Like the motion detector).
    • Suppressive fire: aliens knowing a soldier's location behind cover (terrain obstacle) gauge the obstacle's toughness, based on their intelligence. If the cover is weaker than what weapon the alien is holding AND the alien passes an intelligence check, the alien will auto-fire the weapon into the cover to get at the soldier behind it. Now, I don't know it this is actually possible to implement but it'd make Ethereals with heavy plasmas that much scarier, ESPECIALLY when combined with the above.
      • Could be reversed as well: if the alien has low intelligence (hint: muton soldiers) and the cover is stronger, the alien will have a chance of wasting ammo trying to blast through.
    • Related to the above: if the alien sees a soldier, the soldier fires at but does not kill the alien then breaks line of sight before the human turn is over causes the alien to undergo an intelligence check. If it passes, the alien primes a grenade to two turns and tosses it to the soldier's last seen location to flush him out.
      • Related to the above, not known if possible: primed grenades on the ground in a soldier's field of vision display how much time is left until detonation. If it is an alien grenade, it must be researched to see the timer. Alternatively, you can only see the timer while the soldier who primed it is selected (as he knows the setting).
    • Meleeing with non-melee weapons (like pistol-whipping) gets physical damage and a damage multiplier to stun damage if the soldier is wearing powered armor.
    • Similarly, heavily armored soldiers with both hands empty can still melee, albeit not do much damage (three hits to down a sectoid, for example).
    • A really bastardly one: alien commanders purposely killing themselves (shooting themselves in the foot with a blaster or priming a grenade, throwing it to one hex next to themselves and stepping on it) to avoid capture if not stunned or mind-controlled in time. Could optionally be tied to morale.

--amitakartok 16:05, 24 May 2012 (EDT)

A few more

Do any of these take your fancy:

  • Draw the Radar detection radii onto the map as a circle(s) around the base (also for moving aircraft?)
  • Show All UFOs (Ultrawave Detector - like Show All Locations, but doesn't show Alien Bases, you still have to hunt for those).
  • Sensible Ammo Recovery = add up all remaining rounds of ammunition at the end of a mission (in the ship, if Aborting), and recover a number of (full) clips equal to that number divided by the clip capacity (rounded down maybe).
There's a reason I didn't turn Clip Recovery on, and it's that I guessed that it didn't work exactly as it's suggested here. If it did work like this, I would use it. Stubbs
  • Implement tactical time limits for UFO Assaults/Recoveries. After a random period (within a pre-defined upper and lower time limit), the aliens leave. Pop up warnings appear at the end of each turn, saying the UFO engines are powering up. When the aliens leave, all aliens/items/equipment inside the UFO is gone - no loot, no score. Any soldiers still inside the UFO are considered MIA. The soldiers are captured in fact - score penalty worse than MIA? There must be one conscious alien inside the UFO for it to leave or attempt to leave. Maybe any live aliens outside are 'beamed' or 'tractored' inside the UFO, complete with their equipment? (E.g. the mission ends and you don't get score for them or their equipment either - just for the corpses and dropped loot).
  • No Milk Please: After XCom withdraws from an Alien Base, randomise the base's location and make it hidden again. Just like what happens to the aliens after they fail to assault an X-Com base. Though you would probably still need to locate it within the same country or region so finding it again wouldn't take long I guess. Would it mess things up to move the base to a random part of the world?

But I should probably code this up myself, looking at your source code it doesn't look too hard. Spike 14:46, 24 August 2009 (EDT)

Spike 14:46, 24 August 2009 (EDT)

  • Burning Zombies

It's more or less impossible to prevent Zombies from hatching into Chryssalids by killing the Zombies with fire, since fire does such a small amount of damage, and the requirement is that the actual killing point of damage is done by an incendiary. Apart from hitting them with an incendiary and running away, then waiting about ten turns for them to die (probably repeating the attack once or twice), this is only ever going to happen by blind luck.

It would be much more viable if the rule was (also?) that a Zombie which is on fire at the time of death would not hatch into a Chryssalid. This is not exactly easy either, but it is at least possible. It requires hitting the Zombie repeatedly with incendiary weapons until it catches on fire, then killing it right away with regular weapons (before the fire goes out).

A much easier version of this approach would be to say that if the Zombie is killed while it is in fire, it does not hatch. But that is probably too easy.

A way to do this by hacking game files, without code changes, would be to increase the Zombie susceptibility to fire, to 200%. This would make incendiary weapons a viable way of killing them, as well as increasing the likelihood that the killing shot was an incendiary shot.

An alternative approach would be for the Zombie to have a chance of not turning into a Chryssalid, proportional to the percentage of health damage that had been caused by incendiaries. But that's probably too hard to track, it would require an extra/unused field in UNITREF.DAT.

Spike 13:12, 7 September 2009 (EDT)

  • Fear of Fire

Apparently there is no morale effect from Incendiary damage. If anything, for humans, and maybe be for other humanoid aliens, fire should probably have a greater morale effect than ordinary damage, not none. A basic fix would treat fire damage the same as normal damage when reducing morale. A more complicated fix could add a weighting to this morale effect: multiply by the creatures susceptibility to fire (or reduce by its resistance to fire). Any creature or soldier that is immune to fire should not have its morale affected. Actually the affects of fire vary quite a lot (different aliens, different human armour types). Maybe this is why the designers didn't get around to implementing morale effects for fire, as it's a bit complicated.

Spike 13:40, 7 September 2009 (EDT)

Multi Stage Missions

Between each stage of a multi-stage mission:

  • Send all artefacts (non-usable items), corpses and recoverables back to base
  • If possible, remember the score for these items, and apply it to the score at the end of the mission
  • Alternatively, pop up a score window between the mission stages, and apply the score then?
  • Gather all loose usable equipment into the "equipment pile" for the next stage
  • Or possibly re-run the Equip Screen between mission stages, again gathering all loose usable items into the equipment pile first.
  • Keep an 80 item limit on what you can take into the next stage
  • Prune down to the 80 item limit using some sensible rules, not sure what exactly.

This is of limited use in X-Com EU but would be much more use for TFTD, one day. EU has only one multi stage mission, and it ends the game, so only some of these points above will be relevant.

Spike 20:54, 2 September 2009 (EDT)

Even More

Tremendous work, you've pretty much made the game worth playing again. Best work since Xcomutil. As with everone else, I have a few requests. KingMob4313 23:59, 12 August 2009 (EDT)

Ability to change damage modifier. Right now the damage runs from 0-200% of damage values on the weapon. I'd love to see a way to change it to 50-150%, 75-125% or the like.
A modifier to increase or decrease the explosion radius modifier. Right now the radius is either keyed to the explosive or to the explosive damage. I'll investigate it further. But it would be nice to have a very small radius, but high powered explosive for use as a breaching charge.
There is a "crimping" function on some of the explosions already so it might be possible to exploit that. Check the Explosions page. Spike 14:46, 24 August 2009 (EDT)
A modification of the range based accuracy. One handed weapons have a shorter range, to the point that even their aimed shots have an effective range, two handed weapons have a further range (and no aimed shot effective range) and really heavy two handed weapons have an even further range.
Ability to enable the Burst fire (5 shots over 3 picked spots) and/or the full auto mod that is on the heavy laser on other weapons (set by a flag).
A modification so that on the alien's side first turn, they do not have their full time units in reserve for reaction fire. Nothing like getting shot 3 times from the same sectiod after missing ONE shot on them.
You could always wait a turn before you open the door. :) Spike 14:46, 24 August 2009 (EDT)
Good point, I should be doing that anyways.

More Exploits to Close

Probably the worst single exploit in the game. What is needed is to disable any mind control actions for a Psi Amp, if the unit holding the Psi Amp is currently mind controlled.

Also a general mind control bug/exploit fix for:

Above 3 bugs are fixed by Hostile Civilians fix.
  • Probably many other missing/MIA-type bugs

These probably all arise from the daft decision to save a single byte (or even bit), by not recording separately the current vs default "side" a unit is on. The game only tracks the "current side". Consequently when mind control ends, the game often makes dumb decisions as to what side to "restore" the unit to. We could use an unused byte to track the default "side", but that would require overloading a presumed "unused" field and that could be risky. But actually we can always deduce the "default side" from the unit type: XCom for soldiers and tanks, Neutral for Civilians, Alien for everything else. So what is needed is just an end-of-turn check to restore everything to its correct side, based on its unit type. Actually it's slightly complicated by alternating turns. You need to update all (originally) Alien units at the end of the Alien turn, all originally XCom units at the end of the XCom turn. You might also need a special end-of-game update, to avoid the MIA-type bugs. Spike 12:22, 26 August 2009 (EDT)

AlienSWP.py implements turnswapping via mind control, like XCOMUtil. Handling the alternating turns, as you described, is necessary to make mind control work properly (a mind-controlled alien remains with X-COM during the alien turn, and so on).
I would assume that the original programming team had a coding policy forbidding both bitfields, and emulating them with bitwise shifts. That's really the only way I can explain most of the idiosyncrasies of the file format. Zaimoni 12:07, 26 August 2009 (CDT)

Soldier Colouration

Not the most "practical" request in terms of changes to gameplay, but still something I feel would be pretty cool if incorporated. Basically, the option to have the battlescape engine display soldiers according to their race/hair colour, as according to their inventory screens, like this.

The stored tactical palette is made up of 16 groups of 16 colours (256 total), in this order (though the last 16 colours are replaced with a grey-scale shade list at run-time, similar to the other fifteen groups - refer to the page on palette data for more info on that):

5 BattleScapePal.Png

Solders are drawn using colours from three of these groups: One for their clothing (x50-x5F for overalls/power armor, xE0-xEF for personal armor), one for their skin (x60-x6F), and one for their hair (x90-x9F). Flying suits use a few extra colours, but they don't matter for the sake of this explanation (they don't show hair/skin anyways).

With my battlescape editor I incorporated a feature where you could have the program redraw units on the fly (as per the screen shot), changing just the hair/skin colour. For example, to check to see if a colour index was supposed to represent hair, it simply checks if "(value & xF0) == x90", and if so, it'd add or subtract a certain figure to achieve the desired colour.

Well, there's a bit more to it then that (males in personal armor have a different hair colour already), but I'm sure the basic concept is obvious to you by this point. If you're interested, you can see a sample function in a file included in my toolkit - "bb_tact\UnitDrawer.java", line 384. It's not exactly well documented, but if you check the hair/skin arrays it refers to, it should be fairly obvious what it does. While the program is running, the "characteristics" variable is set to "true" by tapping C on your keyboard. Of course, I've no idea how the actual game deals with drawing soldiers, but I assume it decompresses every PCK image every time it wants to draw it, same as my code does.

- Bomb Bloke 09:46, 4 May 2010 (EDT)

See Also

Completed Items - Thanks Seb!

See also the lists at: User:Seb76#Mods and User:Seb76#Bug_Fixes

  • Add 1-2 UFO Navigation to the haul after a successful Alien Base Assault.
The game actually has specific code to remove these from the recovered items, it's just a matter of bypassing it. Next version will have an option to do so. Seb76 07:19, 7 September 2008 (PDT)
Completed with the "Keep Base Navigation Tables" option.
  • Random chance (1-2%, and only for Scouts) per mission that a UFO accidentally crashes - like the "Roswell Incident". Crash site would be automatically detected & UFO would have random damage.
Sounds like a nice idea. I'm working on it but I still have some crashes, and the routine to check if a ship is over water does not seem to work properly :( Seb76 07:19, 7 September 2008 (PDT)
Update: feature almost complete, time to bake a new version ;-)
Roswell.png
There are probably some bugs lurking (the most likely problem would be unfreed CRAFT.DAT entries), but I don't think I'll change the code much now. Seb76 07:47, 13 September 2008 (PDT)


  • Got an idea while I was at work today that I thought I'd throw onto the wish list. Some means to completely fast-forward the base defense screen. Either by making all the firing sequences happen in an instant, or completely skip the screen altogether. I always advise against making impenetrable bases if only to preserve your sanity. I mean you eventually get sick of being interrupted to watch the defense module firing screen for the umpteenth time. If you never got the interruptions then an impenetrable base would be quite satisfactory. You shouldn't be getting any points for a failed base attack so you won't be gaining from it. About the only problem would be when an undefended base gets destroyed, unless you can make a dialog box pop up to announce it. -NKF 03:10, 2 September 2008 (PDT)
Fixed with "Faster base defence sequence" option. Spike 06:40, 14 December 2008 (CST)


  • Multiple Radar - Fixed.

Can I ask what algorithm you used for Multiple Radar? The algorithm in my BaseFixer.py Python script is actually much better than the fairly lame one described on my User page. Spike

As I said, I used about the same as in you BaseFixer script:
float shortDetection=pow(0.9f,smallRadars);
float largeDetection=pow(0.8f,largeRadars);

*(short *)(&base[0x10])=(short)((1.0-shortDetection*largeDetection)*100.0);
*(short *)(&base[0x12])=(short)((1.0-largeDetection)*100.0);
However I keep the computed value even for the one small/one big radar combo ;-) Seb76 07:19, 7 September 2008 (PDT)
  • Accuracy reductions for long range snap and auto fire - Fixed.
  • Aircraft always ready for mission despite re-fuel/re-arm status - Fixed
  • Stack up base build orders in advance - Implemented
  • More smoke and fire - Fixed
  • Blaster drift and waypoint bug - Fixed
  • Stats visible during Equip phase - Implemented
  • Melee combat (bludgeoning) with any weapon - Fixed
  • With "Council Funding Only", allow items to be sold for money if they are purchasable (i.e. conventional weapons). Buying and selling these is loss making, and there is no source of them on the Battlescape, so it does not create any "income" (except at the start of the game perhaps). But it does help to manage a tight budget. And you need all the help you can get with "Council Funding Only". Check offset 18 of PURCHASE.DAT If byte 18 is true then it's ordinarily Purchasable, so it's ok to sell that item. - OK, here is your christmas gift ;-) You can sell what you can purchase now. Seb76 08:28, 28 December 2008 (CST)
  • Close Down Exploits
  • More video options. In particular, an option to put padding at the top and the bottom of the screen to preserve the aspect ratio on a 4:3 monitor. Maybe it's just me, but stretching the original height of the game to fit a 4:3 screen makes the Battlescape look weird. (Actually, if you update the source code link, I could try to do it myself. The current source doesn't seem to include your more recent changes. --Mikawo 20:30, 12 August 2009 (EDT))
    • Thanks for uploading the new source code. I managed to add the letterboxing that I wanted. If you wanted to make it an official feature I could upload the updated files. And I don't think I said this before, but thanks for the great loader! --Mikawo 18:40, 14 August 2009 (EDT)
Go ahead and upload/PM me the file (d3d.cpp I presume?), I'll gladly incorporate your modification. Seb76 19:14, 14 August 2009 (EDT)


  • Fix the bug where all units in smoke/fire take stun/fire damage, whenever any smoke/fire hex is hit with an Incendiary.
Boy oh boy this is a tough one. First we need to figure out how Incendiary actually works. Zombie is getting in to some heavy testing over on Talk:Incendiary. Right now, the more we learn, the more we know we don't know. With this 'Funky Fire' bug, presumably what is going on is that during an Incendiary explosion, the game engine loops through all units that are in fire(and on fire?). This is wrong. What it should be doing is testing to see if they are within the Area of Effect of this particular IN round. The game definitely has working code to correctly select units within an area of effect, since that's what happens for HE and Stun explosions. But in this case it does not apply the correct selection criteria. What is looks like it does is scans the Unitref table (copy in memory) for every unit standing on a tile with fire in it, and maybe also with the 'on fire' flag set. Both of these lookups are actually irrelevant to an exploding IN round. These looks would make exact sense for the end-of-turn processing of fire damage, but not for the instantaneous effect of an IN round. They should use the HE/Stun routine instead, to select the units for processing. Then when the units are selected, it should apply the IN effects - still to be determined. So yes, I think what's happened is the coders mistakenly used the "end of turn" criteria to select units for instantaneous damage/effect when an IN round explodes. Anyway, once Zombie has sorted out the facts, maybe you could take a look at these IN explosion routines? I guess one difficulty is that the HE routine is performing 2 functions - it's doing damage to terrain, and also flagging units to apply damage to. It may also be setting smoke. Similarly, the IN routine ought to have 2 functions - to apply fire/burning time to the tile, but also to apply IN damage effects to the occupants of the tiles. This really could be coded badly and just hard to fix. Spike 19:17, 11 March 2009 (CDT)

OK I'm pretty sure this is the whole problem with the Funky Smoke/Fire bug. What's going on is the Incendiary Explosion routine is calling the whole end-of-turn smoke/fire processing routine, every time an IN round explodes anywhere on the map. That's why you get smoke induced stun as well as fire-induced damage. All you need to do is find this IN Explosion routine and make it return unconditionally before it calls the end-of-turn routine. That will substantially solve the bug. What the IN Explosion routine ought to do is:

  1. In area of effect
    1. add fire to tiles
    2. possibly do 33% check for units to catch fire - unless this is performed by the end of turn routine (probably)
  2. IF a unit was hit directly
    1. check to see if it catches fire
    2. possibly do "impact" damage.
  3. Return, without calling the end-of-turn smoke/fire routine

And it's entirely possible there was never supposed to be any "impact" damage, all that was intended was to set tiles and units on fire, with any damage only coming at the end of turn. You can easily imagine a last minute and ill-considered coding decision to run the end of turn routine upon every IN explosion, as an attempt to increase IN lethality, without thinking through the implications properly. So the "impact" damage could just be a side effect of the funky fire bug - applying the 5-10 "on fire" damage right away, when it was meant to be applied at end-of-turn.

Spike 22:11, 11 March 2009 (CDT)

Hey, that's a nice piece of supposition:) There is actually what I called an ApplyFireAndStunDamage function which is indeed called after IN explosions and at the end of the turn... It basically damages/stuns every unit on fire/in smoke and makes units standing in firing tiles possibly take fire. The function is called 5 times, one of which is at the end of the turn so patching the 4 other locations should remove the bug; but also weaken the IN rounds...Seb76 16:22, 12 March 2009 (CDT)
Thanks! :) But now you're scaring me - why would there be 4 calls to this function, apart from end-of-turn? Why wouldn't there just be one piece of common code, one call, for IN explosions? I'm racking my brains. I guess there could just be 4 different situations when an IN round could explode. Maybe - direct impact, impact with terrain, reaction fire, large units, auto fire... guesswork! Reaction fire is a good guess - we already know lots of things that are bugged with reaction fire, which suggests the code for reaction fire may be a separate loop. There are hints that auto fire may be handled differently for IN - only hints. I'd be worried patching out all 4 calls. But, if you can do it, I'm very happy to test for unintended consequences.
It will be interesting to see if patching out all 4 calls eliminates "impact" IN damage from direct hits - suggesting it was only ever an unintended effect of the bug. It may not be possible, but "impact" damage might be the one thing to retain, to avoid making IN weapons too weak. Still it might not be an option. Interesting stuff!
Any chance you could do 5 separate config file flags to mask out the 5 calls? Then I could determine by experiment what each one does. Spike 18:27, 12 March 2009 (CDT)


  • Replace the batch file that runs xcomutil. Make it so the loader will call an outside program at certian points. Add a section to the config file that will allow the user to pick a program to be run.

[Utilities] Run Utilities=0|1 Run before battle="xcomutil ..." Run after battle ="xcomutil ..." Run before base screen="xcomutil ..."

The above works perfectly. KingMob4313 00:05, 13 August 2009 (EDT)
  • Allow scrolling the map with the keyboard. "WASD" as default maybe, since you used the arrow keys and most people have thier left hand free anyway. Allow moving units one square at a time with the numpad. First tap changes facing if not looking that way, second one moves you in that direction.
Fixed via Keyboard Shortcuts - and configurable too.

-- Sorry, I am having trouble finding this addition. Is it in the newest version? I can't see where to configure it if so.

Warm Grenades

It would be nice to have a Mod where grenades / HE explode a set number of half-turns after you drop/place them.

This could be implemented by an extra bit of logic that increments the "Turn When I Will Explode" field by +2 if the grenade is being held/worn when the Explode check happens.

For me this is a more natural way for grenades to work: set the fuse, then the fuse only starts when you release the spring or set the HE pack in position. Certainly hand grenades should behave this way. I guess people could argue that HE packs should behave in the standard way. In which case, you could check the weapon type and use different logic for HE.

Hopefully the Alien AI would not be confused by any of these changes. I suspect the AI cheats anyway? Or always sets to 0 and throws right away? Spike 02:00, 2 September 2008 (PDT)

Facility maintenance cost bug

Could you fix that? Spike 16:15, 3 September 2008 (PDT)

I'm a bit confused about this one. Some says that the fund graph is OK but not the amount of money taken. I had a look at the code and found that what is shown on the graphs is exactly the same amount as removed (the graph data is updated at the same place and the computation is done once for both). I think I remember also someone saying that the bug does not exist at all... Can someone clarify? Seb76 02:31, 15 September 2008 (PDT)
The graph is ok and the amount of money taken is ok (tested). What is wrong is the maintenance displayed in the 'Base overview' screen (in every respective base you go to 'overview' and something like 'maintenance'). The wrong way is very well described here Base_Facilities#Displayed_Base_Maintenance_Cost_Bug, I think you will guess what exactly is wrong in the code. --Kyrub 15:34, 17 September 2008 (PDT)
Thanks, I found the code and it is indeed completely f*cked up. I'll try a fix tomorrow. Seb76 16:53, 17 September 2008 (PDT)
Edit: Done. What's next? ;-) Seb76 01:15, 18 September 2008 (PDT)
Blimey. Seeing the work you have put in (below), it is impressive beyond measure. And... what next? Well... Could you possibly fix a game harming BUG of the blind spots? How come he sees you, and you do not see him, and vice-versa? There must be some strange way the line of sight is implemented in the code... See here: [[8]], "Blind spots around the corner".

Just how bad was the mess up? Curios minds demand to know! By the way, my mind was wandering while at the office and one thing came to mind to add to your already useful inventory display: Armed grenade status. Ever drop one you've just armed and lose it in a pile of other unarmed grenades on the ground?

Well, from the look of it, I think they were trying to compute the maintenance cost using an array. Obviously something was wrong.
  • they first try to clear an array of 0x11 entries at the begining of the function (there are 0x11 base elements types, hangar count as 1). Note that there is already a bug here and the array is not cleared as expected, only the first entry is cleared 0x11 times...
mov     esi, 11h
...
loc_44004C:
dec     esi
mov     word ptr [esp+3Ch+elementsArray], 0
jnz     short loc_44004C
  • ecx is initialized to point to the maintenance cost data (nothing wrong here)
mov     ecx, offset baseElements.maintenance
  • then they loop on each base element, but the inner loop is nonsense (at this point ax contains the base element type. edi is the total maintenance cost):
movsx   eax, ax
inc     word ptr [esp+eax*2+44h+elementsArray]  ;increment the array entry corresponding to the base element type
lea     eax, [esp+eax*2+44h+elementsArray]      ;get the address of the array entry we just incremented
xor     eax, eax                                ;discard the address we just computed (!)
mov     al, [ecx]                               ;get the maintenance cost from ecx; the element type is not used here (!)
lea     eax, [eax+eax*4]
lea     eax, [eax+eax*4]
lea     eax, [eax+eax*4]
lea     edi, [edi+eax*8]                        ;totalMaintenaceCost+=elementMaintenanceCost*1000
we see that they increment the array element, but the content of the array is discarded and the maintenance cost (edi) is computed simply from [ecx].
  • then after each row, we have this:
add     ecx, 10h
which explains why the cost changes for each row.
I don't see what kind of C code could produce such disassembly; maybe there is a bug in the compiler,at least the address calculation should have been removed (optimized out).
The fix required two patches:
  • remove the incrementing of ecx for each row
char nop[]={0x90,0x90,0x90};
PatchInPlace(0x44066E,nop,3);
  • make a working inner loop:
char patch[]={
  0x03, 0xc0,                  // add eax,eax
  0x8a, 0x04, 0xc1,            // mov al, BYTE PTR [ecx+eax*8] ;get the maintenance cost for the *specific* base element
  0x0f, 0xb6, 0xc0,            // movzx eax, al
  0x90, 0x90, 0x90, 0x90, 0x90 // nop the remaining
};
PatchInPlace(0x440651,patch,13);
this takes care of the nonsense code
inc     word ptr [esp+eax*2+44h+elementsArray]  ;increment the array entry corresponding to the base element type
lea     eax, [esp+eax*2+44h+elementsArray]      ;get the address of the array entry we just incremented
xor     eax, eax                                ;discard the address we just computed (!)
mov     al, [ecx]                               ;get the maintenance cost from ecx; the element type is not used here (!)

Very interesting stuff! By the way I'm playing a "Roswell" game at the moment and loving it - thanks Seb! Spike 10:31, 20 September 2008 (PDT)

Grenade Status Indicator

Is it possible to include an indicator on the end of the grenade's name string to show whether the grenade has been armed? Or perhaps even show how many grenade ticks are left to go?

Hmm, I'll see if I can find something

Keyboard Support

Would it be possible to introduce some keyboard shortcuts for simple tasks? -NKF 00:48, 19 September 2008 (PDT)

sSuch as? Seb76 02:52, 19 September 2008 (PDT)
Hmm, perhaps a few keys like they had in Apocalypse for ending the turn and raising/lowering the elevation with the page up and down keys would be a good start, or jumping to the inventory screen. Perhaps keys in the Geoscape for setting the time compression settings. I can already see a bit of an obstacle with adding a key capture function in the Geoscape, you'd have to know when you're entering strings or every other time when you're just toggling the Geoscape overlay. I've always admired this game for relying on a two button mouse for pretty much everything except when entering strings, but if it's within the realm of possibility I think it would be great to have some keyboard shortcuts. -NKF 12:39, 19 September 2008 (PDT)

Well, since it has been a little while now, and nobody has said anything, let me be the first. Thank you for the shortcuts on the geoscape. As I mentioned before, I had the shortcuts on battlescape on, but personally I never used them because it is not timed. But the geoscape, being that there is no pause, I have found a lot of use in shortcuts. Works perfectly for me, too. Secondly, the obdata editing feature is fantastic. If only it worked on accuracy, too.... Thanks again, my friend. --Talon81 17:19, 22 May 2009 (EDT)

I've put a new version with support for more settings, give it a shot ;-) Seb76 06:25, 23 May 2009 (EDT)

First off have to say that this is outstanding work Seb, sincere thanks for what you have done here. I have started playing this again after years thanks to your hard work. I was going to suggest the old smoke limit problem but before I could you fixed it!! I have some other ideas, I know there are a lot but I thought I would throw them in anyway. Don’t mind if you think there all rubbish, you’ve done loads already.

Thanks. Don't hesitate to suggest stuff, if it is not too difficult I'll try to make something :)

BTW is there a separate loader with your new Laser weapon? Can’t see it listed in the extender file (not researched it in my current game yet).

There is a special File:UFOExtender-dev.zip for the HL mod. It is not in the normal package since it is still too experimental.

A suggestion for a mod would be the following; I understand that if you defeat an alien assault on your base with base defense measures, then the aliens will continue to attack that base with more battleships until defeated inside the base (they then have to ‘find’ your base again before launching another attack). Can this be altered so that if their battleship is destroyed then they have to find your base again before dispatching anther battleship? Or a chance that they have to find it again.

I'd gladly work on that, but I need a savegame to reproduce the problem. I have one but when the battleship is destroyed, no other comes back later so there must be something wrong with it.

Another suggestion is that I also understand that when the aliens use psi attacks they always go for your guys with the most chance of failing the attack and going nuts. Is it possible to make those pesky aliens attack random soldiers, regardless of their psi skill/strength?

At one time I had the idea of having aliens target only visible units, but then I thought that the scout units would be doomed. Maybe targeting any unit randomly would be better. I'll give it a try.

If you psi control a human in a terror mission, they become enemies when you lose control (meaning you have to kill the poor idiots to finish the mission). Any chance that they could revert to friendlies/non enemies again when you lose control?

Men who are under alien control when you win become MIA, any chance they could be saved (you will have killed all the aliens after all).

These two are on my secret todo list ;-)
I was doing a Terror mission and getting creamed by Sectoids and Cyberdisks. Had a couple of guys left and got them back into the Skyranger only to find a civilian cowering at the back (must of walked in at some point). When I took off the civilian was counted as being killed by the aliens. Would it be possible to count any civilians in x-com craft at end of Terror as recued if you have to blast off? I think this would work interestingly with the civilians psi control issue above if they no longer became enemies after you control them. :-)--Mal310 09:23, 22 September 2008 (PDT)

80 item bug on base defense mission

May be hard to pull off. IIRC there is a 170 objects limit in the battlescape, and we must leave some room for the aliens...

I have noticed that sometimes you can shoot through hard objects, for example, recently I had a soldier up on the roof of a house overlooking a large scout craft. When a Sectiod moved through one of the inner doors of the UFO, my man shot him straight through the intact ufo roof!

I think this is a known issue with LOS, not sure though

I don’t know if this is already implemented in the game? When the aliens attack your base and you defend it with base defense measures does the following occur and if not a mod maybe? When you hit the battleship with your weapons but it still gets through (e.g. you hit the battleship with some missiles before it lands) can the number of attackers be reduced accordingly. For example if you hit it with some missiles then maybe they could have a couple less soldiers attacking (could be random small amount) or when you hit with loads of stuff like plenty of fusion balls and the battleship just makes it then their attack could be reduced to a few aliens (all others got killed in the defense). As I say not sure if this is already there to some degree (not played in a long time and I’m not at that stage yet this time round).

I don't think this is done already. It may be possible to modify the number of units according to the damage done to the attacking ship, I'll have to take a look

This one is way out there. Alien v Alien battles outwith main game, just ramdom battlescape maps. Sectoid and their terrorists against Floters and theirs etc. One side human controlled the other computer . Choice of ships involved etc.

Hmm, you do know I don't have the original source code available, don't you? :p

Any plans to work on Terror from the deep?

I had a look and reidentifying the specific patch locations is quite tedious, and I'm quite lazy... The loader source is available however, if anyone feels like giving it a shot ;-) Seb76 16:38, 19 September 2008 (PDT)

Thanks for the reply. If I get a suitable saved game re the base attack I’ll let you know. Great to hear that a couple of the ideas are on your list already. I have been playing around with the smoke bombs since your fix. I have not noticed any problems, seems to be working fine. --Mal310 12:10, 21 September 2008 (PDT)

Inventory screen ammo weight bug

I think there is a small bug. The weight of loaded weapons is not initially calculated. The base weight of the weapon is used but the weight of the ammunition is ignored. However if you reload the weapon in the inventory screen, the correct weight is then calculated. I have seen this repeatedly with AutoCannons. I am using XcomUtil to 'remember' the equipment loads - maybe this might be part of the problem? Spike 09:24, 21 September 2008 (PDT)

Yeah, I noticed this one already but flagged it as minor :) I'm using a function that I found in the executable to calculate the weight (the one that's actually used by the game to see if a soldier is overburdened) so it is an original bug. Anyway, this calls for a fix ;-) Seb76 09:47, 21 September 2008 (PDT)
Is this the same bug that is present when calculating the throwing range of a loaded weapon? (NKF)
Does not ring any bell. Any link?

There are major issues with your current weight calculations. I'm not exactly sure how it was occurring, but repeatedly messing around unloading and loading weapons, switching clips from the ground them putting them back in... at least one of these functions causes 'phantom weight' to be added to the soldier (e.g. strip them bare and they are still carrying a load). This was happening by 3 units of weight at a time; the weight of a clip. It's so bad that I managed to get 18 phantom weight units on a soldier before getting bored. Occasionally, 3 units of phantom weight would be removed again! It's hard to tell if this was in the original game, due to the lack of weight display in the inventory screen.

Edit: I've worked out what's happening. Add a loaded weapon to a soldier, unload it, and remove the ammo and gun: this removes 3 phantom weight units. But, add an unloaded weapon to a solider and load it... this adds 3 phantom weight units. Stubbs

This is a genuine bug because they forgot to unassign the clip of a weapon when you drop it. Also the default weapon's clip is not initially assigned to the wearer so if you unload and reload the clip, your soldier weights more. Seb76 13:27, 3 February 2010 (EST)
So is this impossible for you to override and fix? It's really irritating... I've edited lots of item weights, but I guess I'd have to make ammo light and guns heavy to minimize the effects of this bug. Stubbs
I second that, it would be great if this could be fixed. Rovlad 17:45, 13 May 2010 (EDT)

Equipment issue

Also, something that I was reminded of while in the rifle vs. laser pistol discussion. It's not related to the weight bug but it is inventory related: The weird pistol arming bug where sometimes no one arms any pistols, or only one guy will arm one pistol and then fill every available inventory slot with the respective pistol clip. I'm sure it was thrown in so that pistols were always the last to be armed, but is it possible to make the game ignore this and arm the pistol like every other weapon? -NKF 15:20, 26 September 2008 (PDT)

There is a lot of possible work to do with how the soldiers are equiped (equip stuff on shoulders first instead of belt, keep equipment from last battle à la xcomutil, stop having one guy get stuffed up with every ammo available, etc). Since obviously all that is tightly intertwined, it requires some thought before getting into it... Plus this is a part of code that I did not analyse yet ;-) Seb76 03:40, 27 September 2008 (PDT)

Request For UFO PS Explosion Offset

Hi Seb, in the Explosions Talk page you mention the following:

Looks like before the first turn, the engine will look for every tile in the map (it scans the MAP.DAT data linearly) ; when it finds a power source (it checks if the MCD special property is set to 2), there is a 25% chance that it will leave it alone. Otherwise, it'll generate an explosion at the UPS location with a strength of 180+RND*70. Whether the UPS blows up on top of that or is just destroyed, I do not know. Can someone hack the MCD data and see if it's possible to generate an explosion on a tile that is not a UPS just by messing with the special property? PS: I am almost certain of the 75% probability of explosion vs 70% that is often stated here. Seb76 09:31, 12 February 2008 (PST)

I'm just wondering where the power source explosion is coded in the executable. If you could tell me that, I'd be able to edit it down so that units don't take quite so much damage. This is a whole heck of a lot better than editing unit stats to near maxed-out levels as the number of trials needed to find the average would be cut by a few orders of magnitude. Also, if you have an email address where I could contact you directly, it would be appreciated (email me with it). Thanks! --Zombie 23:58, 2 November 2008 (CST)

Great new features

Hi Seb! I just saw you uploaded a version with lots of new features. It was a great idea to add some of the Making the Game Harder scenarios. I look forward to trying all the new features out (some previous ones I've missed as well). Cheers! Spike 16:37, 19 November 2008 (CST)

OK I dusted off my Windows version of XCOM and installed your latest loader. I have to say I love it! The range-based accuracy is great. I use about half the default values, I might try returning them to the default levels as it makes snap>auto for everything above point blank. But it's definitely working as designed. And I love the %Acc indicators over the target square. Not to mention the (primed) indicator on grenades.
I played with Alien Pets and Big Brother and View All Locations and found a few strange bugs:
  • If you use the left and right arrows in the Inventory screen to try to move to a different Alien unit, you only see human units
  • The character graphic displayed on the Inventory screen is a human, not the appropriate type of Alien
  • For some reason if you check on turn one the aliens weapons are not loaded and not in their hands. This was in a Roswell scenario, so might be more to do with Roswell. - No, I also got it on my base defence mission. Hang on, silly me, this is just normal for Aliens under mind control isn't it?
  • In night missions, even with Big Brother and View All Locations set, I could only see what my guys had illuminated & seen.
  • View All Locations showed the incoming Battleship before my radars detected it on the half-hour, which gave me a brief chance to prepare my base for attack. Not exactly a bug, more a feature - different. Sadly I wasn't quick enough so ended up defending with loads of ammo clips and not enough weapons. :)
The "Hack" section is really not to be used for gameplay; there I put patches that are useful to test my stuff, nothing more. I only make them available in case it can help someone with her analyse of the game. All the strange things you mention are expected behaviors ;-) Seb76
  • With Alien Bases and View All Locations, the X-COM bases show up as pink.
  • It wasn't obvious to me that I needed to set e.g. "Initial Alien Bases=20" rather than just "Initial Alien Bases=1". I is dumb! Spike 17:20, 25 November 2008 (CST)
Now I need to check the notes on this page to get it working with XComUtil. The one thing that really p____s me off about playing without XComUtil is having to allocate equipment to my guys before every mission. It's really tedious! Especially as I tend to take 14 guys on each mission.
I have not developed Heavy Laser yet, nor beaten up any aliens in melee, but I will let you know how that goes. Thanks for all your amazing work! Spike 19:00, 23 November 2008 (CST)
Awesome. I just completed a mission by my Captain pistol-whipping a Floater Navigator into unconsciousness. How cool is that? But - possible bug - it cost my guy only 8 TUs per attack when he has about 58 total TUs. Is that intended, or is that an error? Spike 19:38, 23 November 2008 (CST) (Later) I'm regularly beating up aliens, it's a giggle. The close quarters combat feels much more authentic now, I love it.
The small TU usage for the pistol is normal (it goes with small stun damage). I liked the idea of having to bash an alien for a while before he falls. Did you not experience reaction fire from the alien? Seb76
The TU costs are percentage based instead of fixed(this has been clarified on the main page). 15% of 58 is 8.7 TUs, which truncates to 8. Arrow Quivershaft 14:15, 24 November 2008 (CST)
I'm having so much fun and doing so well I got a Base Defence on Superhuman on Jan 12th. And with the old, sucky starting base layout (hangars take 25 days to move!). I've never seen so many Floaters and Reapers at one time. I knew there was a reason to hang on to those Incendiary rounds - bad doggie, down! Loads of fun, however one or two bugs have cropped up:
Glad you're having fun :-) Seb76
  • The game crashed as a soldier walked down the stairs from Living Quarters. This is probably a bug in the game and not a bug in your loader.
Let me know what details I can give you. Spike 20:43, 23 November 2008 (CST)
Can you provide me with a savegame that reproduces the crash? I think it is the bug that makes defence missions crash around turn 5-6 sometimes (it crashes during the alien turn). I could not reproduce it. Seb76


Base Disjoint Bug Fix

A Base Disjoint has occurred, despite enabling your Based Disjoint bug fix. It may be an usual one because it's not on the bottom nor the right edge of the map (isn't that where Disjoints are supposed to happen?). It's the normal, bottom of the map edge kind. Here is a screenshot (anyone got a freeware TGA converter?).

Hum, the code was badly f***ed up. Can you retry with the last version? Seb76

I downloaded the latest version but unfortunately no effect. It didn't fix the saved Base Defence scenario. I also restarted from 3 hours before the attack and so created a new Base Defence mission, twice, but no change - still bugged. I'll post the savegame from 3 hrs before in case that helps. Spike 14:24, 25 November 2008 (CST)

Kinda weird, it works here. Maybe I made a faulty delivery... Seb76 15:34, 25 November 2008 (CST)
Edit: nope, took the patcher from the delivery and it worked. Are you sure you enabled the fix? Seb76

Yes I doubled checked a couple of times. I set the flag as

Base Disjoint=1

Is that correct? I'll try again anyway. Spike 17:20, 25 November 2008 (CST)

Oops my fault. I updated the .exe but not the patcher.dll. (I didn't want to overwrite my UFOExtender.ini - very lazy of me.) Doh!

A couple of bugs to report

Two things so far. With wreck analysis enabled I am getting analysis reports even after raiding alien bases. On one occasion this seemed to have fairly random strings inserted into the variables, resulting in the message "The Alien Food UFO was on an Damage Capacity mission in Power Sources." All things considered, this is just a cosmetic problem as the actual UFOs are being properly analysed. However, this has got me curious as to what enables you to perform these analyses? It doesn't happen right from the beginning of the game, at least for me. From the description of the feature I thought maybe it was after researching UFO navigation, but then the messages started popping up before that.

The other bug I have encountered is more severe. After building my first Firestorm I was completely unable to send it out for interception. Clicking on the craft in the list simply returned me to the Geoscape screen without allowing to pick a target, and the game continued to play normally. Disabling the feature for crafts to always be ready despite rearming, repairs and refueling fixed this. Crowley 15:52, 3 January 2009 (CST)

Been out for a while... I'll have a look at these two. Seb76 11:04, 2 January 2009 (CST)

Another case of erroneous wreck analysis, this time from an actual UFO: I followed a battleship on an alien base mission and assaulted it when it landed on its own. After the battle the analysis claimed it was on a raiding mission. Perhaps this has something to do with how alien bases are created the moment the battleship appears? Crowley 15:52, 3 January 2009 (CST)

I use the data from MISDATA.DAT to get the mission details. Perhaps it is not correctly set at the time I retrieve the information. I'll investigate further. As for the firestorm problem, do you have a savegame just before the craft is finished so I can reproduce the bug easily? Seb76 18:23, 3 January 2009 (CST)
Unfortunately not, but I did make a separate save shortly after the craft was finished. I tested it, and turning on the "crafts always ready" option still disables Firestorms with all my saves. With more testing I found out this also affects Lightnings, but not Avengers. Crowley 08:36, 4 January 2009 (CST)

Instead of MISDATA.DAT, maybe grabbing the first byte out of LOC.DAT might be more accurate? I'm not entirely positive if offset 76 of MISDATA is for just crash sites or all sites in general. BB would know for sure. --Zombie 20:25, 3 January 2009 (CST)

"Raiding" is what you're supposed to get if you're not lucky enough to get both the mission type and the zone, as in the .ini file:
Zone Discovered=Intel found out that the %s UFO was raiding %s
If I remember correctly, difficulty level and the number of recovered navigation modules determine the chance of finding out both pieces of information, so it can't be Christmas every day ;)
Regarding the 'Craft always ready' option, I had some Interceptors not launching as described by Crowley above but turned out they had 0% fuel, thanks to the transfer bug (shuffled them around ages ago to make room for Avengers and forgot about them ;) ). Maybe Crowley's Firestorms were also transferred around? In any case enabling this option is a bit tricky, if you happen to have craft with the fuel bug sitting around without realising it (or knowing about the bug to begin with); all I can think of right now is to have this option enforce the transfer bug fix and somehow have buggy craft (0% fuel but ready) update their status to 'refuelling'... Wouldn't be surprised if there's a global 'update interval' in Geoscape when all craft marked as 'refuelling' get their fuel level increased; if so, it might be possible to change that status check to use fuel level instead (much like what this option already does, for the selected craft only) Goran 00:09, 4 January 2009 (CST)
Repairing interception craft repair one point of damage capacity per hour (XX:00), refuelling interception craft are granted an amount of fuel each half hour(XX:00 and XX:30) dependent on craft, and rearming interception craft are given an amount of ammo each hour(XX:00) dependent on the weapon being loaded. Arrow Quivershaft 05:12, 11 January 2009 (CST)
Being busy with work ccurrently so I've not much time for the loader. I already use the fuel level instead of the status. I used a value of 30 as a threshold for readyness which is OK for standard fuel ships, but for elerium ships it's too high: even when fully refuelled, they don't exceed it. Reducing the value should be enough to fix the problem. Seb76 05:22, 11 January 2009 (CST)

Some more comments:

  1. Limited Military = 1 gives you only 1 soldier. OK, I guess it's meant to do that, but it was not obvious. User error! But maybe it's time to add "usage" comments to the .INI file?
  2. Personnel Overflow works ok, even when the extra personnel are transferred in from another base (instead of being Recruited) - good job!

Spike 13:20, 2 January 2009 (CST)

What's wrong with the info from readme.txt? Seb76 05:13, 3 January 2009 (CST)
*Limited Military: you start with this specified amount of soldiers and cannot recruit any more during the game
User Error ^2 - I didn't read the readme.txt either :) Spike 12:17, 3 January 2009 (CST)

Errr.... why do Launchers do more stun damage than the Stun Rod? ... Electrocuting someone should do more than just hitting them with a large object? ... for that matter, stun damage of 80 is a LOT... remember that being shot with a rifle does 30, and a grenade does 50. (IMHO, the stun rod is likely to use VERY high voltage... it is much larger than a normal stun gun, and X-com doesn't mind doing permanent damage to the aliens) Here's a challenge for your coding skills, and a logical one too: make melee do more damage based on Strength stat. My 80 strength goliath should do more damage than my 10 strength rookie wimp... Jasonred Jasonred 18:40, 26 February 2009 (CST)

Glitches with Alien Pets

OK I know that Alien Pets is a Hack and we should expect side effects. I just want to list them here for information purposes - please do not feel under any obligation to fix them!

  • If Alien Pets is set to 1 at the start of a Battlescape mission, Aliens generate with all their equipment in slot 2, i.e. no clips in weapon, no weapon in hand. They remain in this state until they spot a human in their own turn, at which point they lose 19 TUs drawing and loading the weapon. Furthermore, they are incapable of reaction fire until they have seen a human, drawn and loaded their weapon as a result, and survived the experience. From discussions it seems likely that there is a pre-battle routine which moves a weapon from slot 2 on each alien, and arms it, prior to the start of Battlescape turn 1. This routine bypassed - possibly because Alien Pets flags the alien units as human-controlled, and so this 'arming' routine ignores those units?
  • It is possible to get to an Inventory screen for large terror units. Normally this is blocked (even when using the Alien Inventory 'trick'). This has these effects:
    • Large terror units can pick up and drop items. To pick up, position the topmost/northwest corner of the unit over the item. The Cyberdisc makes a great cargo vehicle!
    • Terror units can also equip weapons in their "hands". Move the weapon to the left hand slot and it will appear in the Battlescape display. However the weapon can't actually be used. Using the left weapon will cause the unit's built-in ranged weapon to be used instead. (But test with Reapers or when the built-in is out of ammo?)
  • I also saw some very weird TU and Weight/Encumbrance behaviour. Aliens at 200% encumbrance, unable to do anything and losing TUs each round. I need to characterise this more clearly.

This might or might not be unrelated (might be due to me using Bomb Bloke's object editor wrongly):

  • When an Alien loads a clip into a weapon and fired it, the ammo count goes negative. This clip (or even single rocket/bomb) then becomes an infinite ammo supply. Probably a signed vs unsigned integer error?

Now regardless of all these minor points, Alien Pets has been very helpful for me doing research on the Alien AI and Inventory handling, so thanks very much for this useful hack!

Spike 19:04, 5 March 2009 (CST)

My pleasure. It was the very reason I allowed it in the loader in the first place!
FYI: the weapons are not handed in a hidden turn but while the aliens are spawned. Also I think reaction fire is completely disabled for the aliens when the hack is activated Seb76 13:37, 6 March 2009 (CST)
Alien reaction fire works fine for me within Alien Pets. -- Zaimoni 12:41, August 12 2009 (CDT)

I dropped by after three months or so (you've inspired me to start an disassembly work on another oldie strategy ->> no time), and I am really astonished, Seb. Behold, incredible work with one of my old wishes, the decreasing accuracy. Fantastic for the gameplay! So - ehm - I'll try to wish for one more, hope you do not mind. There is the last, very (game-wise) frustrating issue: the AI fires a weapon and then sidesteps the alien just out of your view. I am bored to death to make that one step forward and always find the bad guy and shoot him in the back. If you could make this "retreating" a somewhat random thing (random APs, random where to), it would thicken the atmosphere (where he is??) and make the game 10x better. I guess you can't make them 'search cover', but make them running away RANDOMLY will do the job for me. I'll be very thankful to you. --Kyrub 20:26, 1 April 2009 (EDT)

Thanks for the support, I'm bored of the "the stuff does not work with ET" thing ;-) I can have a look but the alien AI is one of the points I'm clueless about, I don't really know what to look for. When I study the parts that interact with ROUTE.DAT data, I cannot figure what the hell is going on... Do you know if the backing alien has ran out of TUs? Maybe the game tries to keep some for reaction fire but no-one realized that turning your back on danger is not the best tactic for reaction shots ^_^ Seb76 15:46, 2 April 2009 (EDT)
The situation happens always a) in the open b) during the alien turn c) when the enemy spots you, fires and then retreats out of view. I think he even turns back to face you sometimes, but not sure. But the main (gameplay) problem is that you are totally safe to advance 1 step and shoot because you have full TUs, no reaction fire, no support from other aliens. Perhaps the program determines the quadrant with human, via substracting the positions and finding the angle with a pre-made table in the exe (I have the same thing in my disassembling game)? Or it just loops next fields until it finds the one without eye-contact? -- I am almost sure that this was repaired in the Ufo Tftd. The aliens are very nasty and retreat totally out of view... -- BTW, the aliens do well in the vessels in UFO-eu, they search cover in the next room!--Kyrub 16:22, 2 April 2009 (EDT)
Hum, too bad I never got to disassemble TFTD then ;-) BTW, which game do you work on? Seb76 17:22, 2 April 2009 (EDT)
Master of Orion I, correcting the bugs and improving AI. (Hey, noticed the doors' thing. Another great one.) --Kyrub 20:09, 2 April 2009 (EDT)

TFTD Door problem

Seb, there seems to be a problem using the TFTD Doors with the Proximity Mine bug fix. I do have several other patches to my game, and it is possible that they are complicating the matter, but simply by turning off the PM fix I can suddenly open doors again. --Talon81 06:02, 14 April 2009 (EDT)

Hi Talon81, what do you mean by "other patches". Are you using ET or xcomutils? Or are you just enabling other patches from the loader? Also what are the symptoms exactly. Can't you open any door? Seb76 14:24, 6 April 2009 (EDT)
Edit: Nevermind, I could reproduce the problem. Can you try the new version I just uploaded? Seb76 15:08, 6 April 2009 (EDT)

Yeah, I tried it, and it works fine. As you no doubt have already figured out, it wasnt working on any kind of door, as far as I could determine. The other things I am using should not interfere. They are minor patches such as Zombie's combo patch for terrain, etc, CE to DOS sound editor, and the aimed accuracy adjustment patch. I am not using Xcomutil or ET (would like to use ET, but I know that it doesnt work well with your patch).

If it means anything to you, I would like to say that your work has meant a LOT towards making this game what it should have been. I fell in love with this game in 94, and never have more than a couple years gone by without me playing it. Your patch is the best thing to come along since it was made. ;-) --Talon81 06:02, 14 April 2009 (EDT)

I second that, wholeheartedly. Spike 16:44, 14 April 2009 (EDT)
Thanks guys! This game is the best and I try not to divert it from its spirit with my patches... Actually the fix for the doors *might* increase compatibility with ET, but it's a wild guess. Seb76 16:56, 18 April 2009 (EDT)

Initial Alien Bases

OK, so I was having some problems getting alien bases to work, so I created a new folder of X-Com with nothing but your video patch on, and alien bases. I am still having the same problems I was having on my more heavily patched version. For example, I created one with 3 alien bases. Looks fine. I run it with the show all locations patch and sure enough, no alien bases. I make a new game with the show all patch on and there are the alien bases, shown until the point that I place my own base. Then they disappear and my base now looks like an alien base. There are some other minor bugs associated, too; however, that seems to be the main problem. In short, I have yet to get an alien base to survive past the placement of my base. I thought it could be a glitch in the show all patch, but scouting the areas where the alien bases were shown prior to base placement has returned nothing. --Talon81 15:23, 19 April 2009 (EDT)

By the way, Seb, are you the same as Strife67? --Talon81 13:13, 24 April 2009 (EDT)

Nope, never heard of that guy. What's he doing? Seb76 15:13, 24 April 2009 (EDT)

Nothing anymore. He created a sound patch a year ago or so, and there were some things he said that reminded me of you, not to mention in my head I was thinking you were Seb67 instead of Seb76. I just now noticed my mistake. --Talon81 20:16, 24 April 2009 (EDT)

OK, I uploaded a new version. Can you confirm it fixes the problem on your rig? Seb76 07:57, 26 April 2009 (EDT)

Seems to have solved the problem to me. The alien bases now appear after placement of mine instead of before like they previously did. X-Com bases are correctly shown, as well. --Talon81 13:34, 28 April 2009 (EDT)

Won't work on my rig Vista+CE version

Nice work! I really want to play this, it's not working on my PC though. I may be stuck with the Dos version in Dosbox forever.

My screen flashes between the squashed look of the unpatched EXE and the OK version. On screens without animation it changes back and forth as I move the mouse. On the Geoscape it just flashes and gives me a headache. Sorry about the big images, to lazy to cut them down.

--SaintD 19:09, 19 April 2009 (EDT)

Hum, looks like another Vista problem... Do you have the problem when using DXWnd? I use the following settings (but I'm under XP...):

Dxwnd.png

Seb76 14:57, 20 April 2009 (EDT)

Awesome. That worked. My 1440x900 regular resolution means that the window is really tiny though. You should really get the upscaler working now. Heheh. Dxwnd makes Internet Explorer crash on vista. Does that happen to you?

http://darksun.lunarpages.com/XCOM/xcomWindowed.png --SaintD 00:34, 21 April 2009 (EDT)

[edit] I didn't realize you can just drag the Dxwnd window bigger. I still miss the advinterp3x from dosbox.

I dunno exactly how DXWnd works but I think it may screw up aero stuff... I played with scale2x a bit and got that but it only works with DXWnd:
Scale2x.png
When I try fullscreen, it looks like DirectX won't allow me to go to 640x400 resolution :( Any DX guru out there? Seb76 14:36, 21 April 2009 (EDT)


Can I get a copy of the new version? :) I can only use Dxwnd anyway. If you can boil the problem down I might be able to get some Direct X help. I know a couple guys who have been playing with XNA a lot. Can you create a stand alone sample program to illustrate your issue maybe?
I uploaded this: File:UFOExtender-dev.zip. It works only in window mode on my laptop, maybe you can give it a try? You'll most likely have to alt-tab out of the black screen though... Seb76 11:08, 26 April 2009 (EDT)
Edit: version updated with support for HQ4x (in 1280x800). Feedback appreciated... Seb76 09:55, 3 May 2009 (EDT)

The above version works perfectly on my PC but only through DXWmd. I'd also like to note that using DXWnd eliminates fast speed issues in Battlescape for some reason. I'm really excited Seb is pulling this off. <3

Uploaded a new version, you need to add a "HQ4x=1" line under the "Mod" section to enable it. Seb76 15:36, 6 May 2009 (EDT)

Works perfect without the use of DXWnd, but there's some sort of frameskip feeling. Great work, this is getting better and better. :-)

Now the question is, how do you use DXWnd with the loader? KingMob4313 11:02, 12 August 2009 (EDT)

Works but won't multitask

Target system: prefab HP Vista with global data execution prevention. Problem is the same native, with D3D, and/or with HQ4X. (The two do combine nicely, visually, but a bit laggy for my tastes).

ALT-TAB terminates all further screen display on restore; the sea of blackness continues until Task Manager is used to kill the application, at which point D3D admits that it has "lost the device". (This is after the improved error reporting patch. Before, 0xc0000005 as Data Execution Prevention takes over.)

-- Zaimoni 12:27, 12 August 2009 (CDT)

Solved on Win7 for the most recent version: Program Properties dialog has an "unblock" button. Unblocking allows the program to survive being alt-tabbed away from. -- Zaimoni 22:03, 24 June 2010 (CDT)

Heavy laser mod

My heavy laser only has the two new firing modes. Also, when I fire, the beams don't go where I point. They seem to be grouped correctly, just off in the wrong direction. User:SaintD:SaintD

Yeah, it is a problem when you enable range based accuracy at the same time. I'll try to fix that when I get some time... Seb76 14:25, 23 April 2009 (EDT)
Made a new version. Can you try it and let me know if the problem is gone? Seb76 09:19, 26 April 2009 (EDT)
I tried it. The new modes now work, but Snap Mode is still missing from my HL. Also it's not clear the difference between burst and full auto since they both have the same accuracy and TU cost.--SaintD 19:25, 29 April 2009 (EDT)
Hmmm, on mine the burst and full auto have different accuracies (80% and 60%, respectively); and they fire 5 and 8 rounds, also respectively. I believe the snap shot was taken out on purpose to coincide with the idea of the heavy laser as being more suited to being a support weapon. Of course the last part is conjecture on my part, but I am pretty certain it is not supposed to be there. --Talon81 23:51, 29 April 2009 (EDT)

I am not the original poster in this heading, and I have not had the same problems with the heavy laser that others had (only one I had was about the Range Based Acc not affecting full auto), so I cannot confirm whether this patch has solved that. But I will tell you what you probably already know: everything is fuzzy, kinda like [ Mok's 2xSaI]. It is also a little bit jumpy. Due to that, I can't take advantage of the Funky Fire fix, or any other future fix, unless I am willing to deal with the fuzziness, or unless you create 2 runs; 1 with the Heavy Laser fix, and one without. --Talon81 13:42, 28 April 2009 (EDT)

Hum, I'm not sure I understand. What has the fuzziness to do with the HL fix? Seb76 14:15, 28 April 2009 (EDT)

Wow, to think I almost didnt bother to post because I was sure you would already be aware of it. As soon as I updated your loader from 6 April (TFTD door fix) to 26 April (funky fire fix), everything got fuzzy. After that, I tried the update without funky fire (HL fix). Still fuzzy. Then I rolled back to the previous one (Initial Alien Base fix). No more fuzzy. I even went back to HL fix, then back again to Alien Base fix. Same deal. I will try using it on a fresh X-Com install without my other patches. But yeah, you should seriously install the patch I linked to in my above post. Will only take a minute to try. Looks VERY much like it (I know that many people have the fuzzy problem with that patch). --Talon81 02:17, 29 April 2009 (EDT)

OK, it is indeed still fuzzy on a fresher copy of X-Com. It is not a genuine fresh install as I no longer have the disk, it is just the original files copied on my computer in another location. Furthermore, I forgot to mention there is also slight video garble (yes, even with the garble fix on) at the bottom of the menu screens. That in itself is not a problem as it is not throughout the game, and is only a few pixels in height. I can't wait to see if anyone else has these problems or if its just me. --Talon81 02:27, 29 April 2009 (EDT)

I have a crash with Mok's patch so I cannot check the problem. By fuzzy you mean something like the image is bilinearly filtered and all smoothed? Seb76 17:20, 29 April 2009 (EDT)

I am a total programming/graphics newb, so I don't know if that is a good description or not. The UFO's for example, instead of being crosses, are blurbs that slightly change shape as they fly, and everything has softer transitions that make it look like it is done with pastels or something. I can tell you I tried to take a screen capture but it did not reflect the screen as it appears in game. In any case, unless other people have this same problem, I would not worry about it for my sake. If it is something you want to tackle anyway, just tell me what I can do to help you. --Talon81 23:51, 29 April 2009 (EDT)

Hum, are youe using the "dev" version instead of the official one? It features a scale2x filter that craps the image up.Seb76 14:40, 30 April 2009 (EDT)

Not sure what you mean by "dev" version, but I am guessing you are referring to my version of CE. I do not know for sure, because it has been years since I got it, but I am guessing the answer is yes because mine runs in full screen without any mods. --Talon81 12:22, 1 May 2009 (EDT)

Your newest version seems to have gotten rid of my problem. --Talon81 12:32, 1 May 2009 (EDT)

That's great ;-) By dev I was refering to the "dev" version of the loader linked on this page. It is an experimental version that uses scale2x with 640x400 resolution. Seb76 12:53, 1 May 2009 (EDT)

Hi Seb, I've been playing the UFO series since the beginning but just joined this wiki. I've tried just about every mod there is for these games, and I must say, yours is one of the best as far as creating a "more complete" and stimulating game experience. My question is in regards to your "Heavy Laser" mod. I liked what you did by creating new "abilities" for the weapon with the Full auto and Burst fire mode, but every time I play I can't help but think that it just doesn't belong to the Heavy Laser as a weapon. I always envisioned the Heavy Laser as more of a long range "Sniper" support weapon, and I like the mod that the X-ComUtil added that gave the Heavy Laser a new life by increasing the accuracy and damage of the weapon making it one of the best Sniper weapons available (even if it is heavy to lug around) as well as finaly giving my troops a greatly needed new weapon for disposing of those pesky sectopods (on any difficulty). I do, however, think that the new fire modes (full auto and burst fire) would be a perfect addition to the Auto-Cannon. The in game image alone has always brought to mind a "mini-gun" type weapon that should be capable of very rapid fire, but at the expense of accuracy due to the encumbering nature of the beastly AC. I never liked how the AC seemed like a generic Heavy Cannon with less damage and only the added auto shot function. Also, I always wondered why that weapon even had an "Aim" function. Who's going to sit there trying to carefully aim a Gatling Gun? Nobody... that's who, you use a weapon like that for mass devistation and shock value, PERIOD! This is why I think that your mod to the Heavy Laser should be reconsidered for the Auto-Cannon. I think, at the very least, it will give people a reason to use the AC in the mid to late portion of the game, and being that it still has weak stats compaired to other weapons, it's not going to be overpowered or infringe on the use of specialty weapons (I think the Heavy Laser with full auto and burst fire is a little un-balanced due to its considerably higher power). If you don't agree that's fine, but since I'm not very knowledgeable about game programing, I was wondering if you could at least give me a hint on how to create similar weapon functions for other weapons, cause I'd like to at least try it out for myself. Thanks for any help you can give me and keep up the good work, you're mod is awesome.

REng UFO with IDA

Hi Seb =)

I've just started working with IDA in an attempt to understand the inner workings of TACTICAL.EXE. I have never used IDA or related tools before, nor do I really know what I'm doing ;) I have removed the DOS/4GW loader and am examining the LE code currently.

So far my only progress (using DOSBox debugger) has been to isolate the calls in main() which display the equip screen and handle the interative section of the mission. You could say progress has been slow, as this has taken a couple days (including time spent figuring out the basics of IDA/DOSbox debug).

Would it be possible to see your notes? You will no doubt have discovered most (all?) functions and exactly what they do. If I could see this data (such as comments, renamed funtions, cleaned up code) it would take months off of the time I would need to understand the underlying assembler code.

I also recently discovered a plugin called HexRays for IDA. Do you use this? I'm really a newb so would love to get some input on which tools are best for this job.

My long, long-term goal will be to implement TACTICAL as a native windows program, as it would be a great project to have whilst learning to program (I should say I have some basic programming already, but nothing beyond a simple Windows game in Delphi).

Any advice is deeply appreciated mate =)

XCom forever! --K9wazere 09:51, 17 June 2009 (EDT)

Hi k9,
Slow progress at the start is a normal thing. In the windows version I got help from the developers because they left a few error messages around to guide me during my initial analysis ^_^ I don't know about the DOS version, maybe they are also present.
For the DB, just PM me an email address where I can send you the file (~1.7MB)... I gave a shot at HexRays (early versions), but I didn't find it that much useful in helping to understand what's going on. Well, if you're not used to asm, it may be interesting for you ;-) Still, for re-engineering a function it may prove useful. All in all, I'm just using a standard 5.2.0.908 version, it got everything I need. Also for debugging, I use DXWnd because breakpoints and fullscreen DX apps don't live well together...
Good luck with your project,
Seb76 14:15, 17 June 2009 (EDT)
Thanks for that, Seb! I'm trying to understand how your loader and patcher works...
void InsertCall(int dst, void *func)
{
	DWORD oldProtect;
	DWORD *pOffset=(DWORD *)(((char *)dst)+1);

	VirtualProtect((void *)dst,5,PAGE_EXECUTE_READWRITE,&oldProtect);
	*(char *)dst=(char)0xE8;
	*pOffset=(int)func-(int)dst-5;
	VirtualProtect((void *)dst,5,oldProtect,&oldProtect);
}
This calculation here is interesting:
*pOffset=(int)func-(int)dst-5;
I assume 0xEA is assembler for CALL ... but then the reason for subtracting 'dst' from 'func' is not apparent. All in all I'm a bit confused as to how code in one area of memory (UFO Defense) can call code in another area of memory, belong to a different process (UFO Loader).
The 0xEA is indeed the CALL opcode, but it is a relative jump so you must feed it the delta between source and destination (the 5 is the size of the CALL instruction itself that must be removed).
The beauty of the thing is that the loader injects the code in the address space of the main executable image so you can call functions from/to it with no trouble :)
Can you suggest some good reading material to better understand this? Cheers!
--K9wazere 14:36, 20 June 2009 (EDT)
You can search for DLL injection methods on the web, that's the name of the trick. In a nutshell I spawn the "UFO Defense" process in a suspended state, then use the CreateRemoteThread/LoadLibrary trick. HTH, Seb76 14:48, 21 June 2009 (EDT)

D3D

If I select the D3D option, UFO Defense and patcher.dll crash and generate a Windows Error Report. It won't let me copy and paste the contents unfortunately. My XCom machine is an old laptop, Win XP Pro 2003, Pentium III 851MHz, 376Mb RAM. I'm not sure what version (if any) of DirectX it has.

I'm still checking out the Save Equipment / Auto Flares mods. Very welcome! Once these are working there will be no reason for most people to use XComUtil. I will get back to you when I have specific feedback - but thanks again, Seb. Spike 12:59, 18 July 2009 (EDT)

You need DirectX 9 installed (couldn't easily locate any older SDK, I'm sure I could've gotten away with DX7...), maybe I should make the code more robust and exit gracefully instead of crashing... Seb76 13:04, 18 July 2009 (EDT)

Hmm. I've installed DirectX version 9 (March 2009 version) and with D3D enabled the Loader just fails silently; no error message, nothing in the event log. Maybe the install didn't work properly. I'll see if I can find some kind of DirectX test/verification utility somewhere. Spike 21:23, 19 July 2009 (EDT)

OK I ran the dxdiag utility which comes with DirectX 9.0c. This tests DirectDraw and Direct3D levels 7/8/9. There were no problems and no issues detected, apart from my laptop does not support hardware sound buffering (software only). I can send you the full dxdiag.txt report if it will help. When the Loader fails, all I see is a little black square in the top left, which I think is a normal part of the loading sequence (some kind of command window), and then nothing. Spike 21:39, 19 July 2009 (EDT)

Might be related to using none power of two textures. Maybe your hardware does not support it? I'll add some more checks to make sure that's the problem.
Edit: Can you try the latest version? I added some more error handling, can you tell me if you have an error message at some point? Seb76 19:18, 20 July 2009 (EDT)

Unforunately I don't have access to the original laptop now, I won't do for a few months. I have tried on another PC (XP 2002 Professional SP3, DirectX9.0c, dxdiag tests all ok) and I also get a crash. Instead of dropping out right away, I see the smallish black square in the top left for a while, then I go to a full screen black or grey-black screen. This lasts for minutes. It doesn't eat up CPU and I can task switch out of it. I don't see any popup error messages and nothing in the event logs. When I kill UFO Defense the black full screen goes away. Sorry I know that's not much help. Spike 17:59, 22 July 2009 (EDT)

D3D mode isn't working for me either, I simply get a black screen. When I alt+tab out of it though I can see an error box titled 'D3D error' which tells me it 'Cannot create texture'. J'ordos 19:09, 8 August 2009 (EDT)

edit: forgot to mention, I have directx 9.0c installed and dxdiag reports no problems. I have a Geforce2 MX *blushes*
Do you know if this card supports non power of two textures? Seb76 05:10, 9 August 2009 (EDT)
no idea, but since your new version works fine with the D3D option on I assume it doesn't :) J'ordos 11:38, 9 August 2009 (EDT)
That's great. Spike, does it fix your problems too? Seb76 16:04, 9 August 2009 (EDT)
Sorry for the late reply - yes that fixes my problems too, D3D is working fine now. Thanks, Spike 15:55, 26 August 2009 (EDT)

Save equipment

Hi Seb. I've tried out the Save Equipment and Auto Flares (good idea by the way). I've seen some quirks. I had a few weapons (a Rifle and maybe a Pistol) that weren't loaded. Normally the game loads all weapons unless there isn't sufficient ammo. I moved some stuff around so this might have been due to me. So I restarted. Then I got a situation where:

  • 1 soldier had no weapons, just a grenade in a belt, even though there were Rifles and Auto Cannon (both with ammo) not allocated. Actually this soldier was showing 54/40 encumbrance from one grenade. Carrying a lot of "invisible" equipment!
  • Heavy weapons (Auto Cannon, Heavy Cannon, Rocket Launcher) were allocated only once each. Spare heavy weapons were not allocated. The soldiers allocated the heavy weapons carried 3 spare ammo clips and were overloaded. Also, a weak soldier (strength 21 or so) was selected to carry the Auto Cannon and 3 spare clips.
  • The mission appeared to be a night mission but no flares were allocated. (the previous mission, the Auto Flares worked fine). Maybe it was a Dusk mission? It looked dark out there.
  • Also the game crashed when I moved the first guy out of the transport. Of course this is not necessarily related to using Save Equipment.

Actually, making sensible automatic rules for weapon and ammo allocation is hard to do, and a matter of personal taste, and this is really a different goal than just saving equipment allocations that have been picked manually by the player. So I'm probably being really unfair. Maybe it would be easier not to allocate any weapons other than what the player has picked?

Anyway I have a save game file for the 2nd game if that is any use to you for debugging. Cheers, Spike 18:53, 18 July 2009 (EDT)

Thanks for the feedback, it got in the dev version for 2 months and nobody sent any comment so I figured I might as well put it in the official version ;-) I'm not surprised with the kind of problems you encountered, I got lots of 'em while making this... The crash at the start is most likely due to reaction fire.
The autoflare feature should trigger at the same time as the visibility reduction caused by the night. Were you able to see up to 20 tiles away?
As for the auto-allocation, I'm afraid there is no other easy option that I can see: when the mission starts, everybody is already equiped with the default stuff. I have to remove everything to be able to reassign items properly :( The default reequiping rules are quite simple: strength is not taken into account, and you require a set amount of free clips to be able to equip a weapon.
I had a look at your savegame, but one just before the mission would be better. Also can you attach your ini file? Maybe some problems are caused by incompatibilities between mods. Seb76 04:08, 19 July 2009 (EDT)
OK uploaded what I hope is the right .ini file. Unfortunately that was my first savefile of the game, I don't have any earlier one. All I did was bought some guns 'n ammo and landed on the first (Roswell) crash site. The weirdest thing was the female soldier (Martha Stewart? or am I hallucinating?) with 54/40 encumbrance but only carrying one grenade. Could this be connected to the problem you discovered in the game's weight routine? Anyway I will try and recreate the problem with more savefiles so you have a "before" and "after". Spike 07:15, 19 July 2009 (EDT)
In your savegame I indeed see that the Maria chick is overweight, but if I bail out of the mission and go on a new one, she only have a grenade and a weight of 3... Another strange thing is that in the equip.ini file of the savegame, she's marked as having a large rocket loaded in the weapon that she's holding, but she has no weapon... Did you equip her with the rocket launcher and changed your mind afterward? Seb76 11:27, 19 July 2009 (EDT)
OK I restarted from a new game. I took lots of savegames after each step. Everyone has your default basic loadouts - loaded pistol or rifle, one reload, one grenade. I see a couple of anomalies. Look for Jacques. He is overweight despite only carrying a Rifle. Also, he is carrying a grenade that shows as Primed - it isn't. I even threw it to make sure - no explosion. Like Maria before him, Jacques is the last soldier in the equip.ini list. Also like Maria, Jacques is carrying more guns & ammo in equip.ini than are shown in the inventory screen. He has 5 items but they don't add up to the 54 or so Encumbrance he is showing. Like Maria, he is carrying ammo (type 13) in a slot1 (left hand) weapon that doesn't exist, and it seems to weigh about 20! The crazy encumbrance persists into the next turn and it is still there after I restore a savegame. I will upload a full set of play-by-play savegame files. I did move some equipment around for some guys in the later saves. But never for Jacques. Spike 21:10, 19 July 2009 (EDT)
OK, I'll have a look at this, thanks for the effort.
Edit: I could not reproduce the problem staight away: I see the crapped up weight if I load your tactical games, but when using the "i/b" one, Jacques is alright... Does this problem happens 100% of the time on your PC? Maybe it's a problem with the ini file handling (W2K3?), who knows... I'll keep trying. Feedback from XP/Vista users could be useful on this one. BTW are you using split binaries? Seb76 15:44, 20 July 2009 (EDT)
I've uploaded another save game, this time on a different PC (better XP version, CPU, RAM). Same symptoms - the last man has phantom equipment. Actually I notice the last TWO men have 2 items of equipment on them, but only visible one item shown in equip.ini. Also I keep forgetting to send the UFO Extender.ini file. My games don't use split binaries. I don't think it's a problem parsing the equip.ini file because the problem appears right away, if I save as my first action when the battlescape appears - the equip.ini already has the weirdness, and on the battlescape the soldier already has the weirdness. Although - let me check this - but I don't think the phantom equipment weirdness is there during the Equip Screen, it only appears when the actual Battlescape starts. So, if you pass the equipment information from the Equip screen to the Battlescape via the equip.ini file, that's a possibility. Spike 17:21, 20 July 2009 (EDT)
Uploaded another New game, same/similar symptoms. This time the last guy is carrying weapons. But still, he is too heavy. The effect is NOT present in Equip Screen; his weight only increases once on the Battlescape. He is carrying a Rocket (object type 13) inside an invisible second weapon. So this could be a problem parsing the equip.ini file. Spike 17:38, 20 July 2009 (EDT)
Last note tonight. The guy is overweight by 13 x 2 = 26 units. His equip.ini shows him carrying a phantom type 13 object (in a nonexistent 2nd weapon). Is this a coincidence? Maybe check the other savefiles and see if the last man was also overweight by 26 units, or by 2 x the index of the phantom item. Spike 18:00, 20 July 2009 (EDT)
I uploaded a new version, can you check it out? Seb76 19:16, 20 July 2009 (EDT)
Re tried with New game after your fix. Still seeing last 2 characters with incorrect weights. The weights were the same on the Equip screen as on the Battlescape. Excess weights are 6 and 3 units. Uploaded the save game. Spike 14:14, 21 July 2009 (EDT)
Actually you're now hitting another bug: when putting a loaded gun to the floor, the ammo stays assigned to the soldier so its weight is still taken into account... Seb76 15:21, 21 July 2009 (EDT)
Yes you are right. In fact the weight errors were not 6 and 3 but 6 and 5 - the weight of heavy cannon ammo and auto cannon ammo, respectively. When I dropped the loaded heavy cannon and the loaded auto cannon, the encumbrance weights drop by 18 and 19 respectively. This is the weight of the unloaded weapon, not the correct weight of the loaded weapon. (Though normally, due to the buggy weight routine in the game, that *is* the actual (but incorrect) weight of the loaded weapon if you haven't yet unloaded it). So this is just a matter of ignoring the ammo weight from the soldier's encumbrance when dropping a loaded weapon. And it does look like the original problem has been fixed. Spike 18:18, 22 July 2009 (EDT)

Hmm more problems with Save Equipment. Ammo of all types seems to disappear. Eg I have 6 pistols and 6 pistol clips on the craft, but the Equip screen just gives me 6 empty pistols. Other weapons are short of ammo too. Is the Save feature perhaps "remembering" empty weapons (or loaded weapons) and somehow eliminating the clips. Spike 20:34, 18 August 2009 (EDT)

This looks like an issue with UnloadClips(). I noticed that the clip object's loaded_into is set to 0xff, but the not_loaded remains as 0. The game may see this as the clip still being loaded in an object, so the clip effectively disappears. --Mikawo 11:05, 19 August 2009 (EDT)
This is possible. The wiki is wrong on these 2 fields BTW: it is in fact just one field (loaded_into signed extended to 16bit). I'll have a look at that. Seb76 14:33, 19 August 2009 (EDT)

I think Mikawo is right. UnloadClips() should look something like this:

void UnloadClips()
{
	obpos_dat *pObPos=pObpos_dat;

	for(unsigned char i=0;i<170;i++)
	{
		if(pObPos->itemType != 0xff && pObPos->not_loaded == 0  && IsXComItem(i))
		{
			pObPos->loaded_into=0xff;
			pObPos->not_loaded=0xff;
		}
		pObPos++;
 	}
} 

Quite a few other functions in equipment.cpp use this check pObPos->not_loaded == 0xff so it is important to set this flag just for UFOExtender, regardless of whether the game needs it set (which it probably does). Eg items unloaded by UnloadClips will thereafter fail to be found by GetFreeItem, during execution of LoadSoldierEquipment. That probably explains the problems observed. Spike 15:24, 26 August 2009 (EDT)

I did some rework based on that. Do you have other problems? Seb76 16:08, 30 August 2009 (EDT)
Thanks Seb. This seems to be working mostly ok now. Some remaining smaller issues I have seen:
  • The weight calculation is so accurate, it is more accurate than the unmodified game. So the "weight free ammo" (the first clip loaded into a weapon, before the user takes any action in the Equip screen) is no longer weight free. Not sure if you want to "fix" this or not? It is debatable. Really, you have fixed a bug. But the normal game behaviour has changed. Maybe make the "weight free ammo" optional?
  • There is a weird glitch. If I unload a weapon, put it and the clip on the ground seperately, that works fine. But if I pick up the clip directly from the ground and load it straight into the weapon, then drop the weapon, the weight of the clip is still shown on the soldier. And actually the same thing happens with a clip that is first moved into the soldier's equipment. So in fact the problem is that a clip loaded into a weapon, doesn't get removed from the soldier weight when the weapon is dropped onto the ground. It happens even if the clip is pre-loaded by your routine.
  • Still outstanding - you can't use the right arrow to move onto a second screen of equipment. So you can't have more than one screenload of equipment on the ground. Or maybe you can, if you start the Equip screen with more than one screenload on the ground - I didn't check that.
Spike 13:10, 1 September 2009 (EDT)

Glitch with Alien Pets and Big Brother?

Hi Seb. I was trying to do some initial research on the idea of Tank mods but it looked like these 2 useful features of your Loader, Alien Pets and Big Brother, have both stopped working. Can you test this, on the latest version? I'm using a very recent version (last 2 weeks) but not the absolute latest as I have internet download problems.

Also, have you seen this new Wiki article: Enemy Unknown Extended. It is a package including your loader plus a few other odds and ends.

cheers, Spike 11:16, 17 August 2009 (EDT)

My mistake, I commented out that part of code a while ago and only recently noticed that. It was corrected one or two versions ago.
The article is a good idea, it should allow less techies an easy start. Seb76 13:51, 17 August 2009 (EDT)
OK cool yes the Hacks are back in place, thanks. Spike 20:34, 18 August 2009 (EDT)

Alien Bleeding

Test results:

  • 1-unit and 4-unit aliens can be healed by anyone (alien or human) holding a Medkit
  • 4-unit aliens can be healed by standing in any of their 4 squares
  • 4-unit aliens can only be healed while they are stunned. Pointing to their "control" square does not seem to work.
  • 1-unit aliens can be healed either while conscious or while stunned
  • Wounds on aliens can be correctly seen with Medkits
  • The Medkit display shows a human silhouette regardless of the alien type, of course
  • Healing aliens with Medkits, stops them from dying of wounds (not 100% tested but seems to be true)
  • Aliens (large and small) seem to lose the correct amount of Health per turn from Wounds
  • Aliens with wounds that are not treated, eventually die (not 100% tested but seems to be true)
  • A Mind Probe can see if an alien has Wounds.

Anomalies:

  • I had a lot more reports of Reapers dying than I would expect. I would not have expected any to die, and I had 3 reports of death by wounds. Even heavily wounded Reapers take a long time to die. In my test I was only shooting them with Pistols. Maybe there is a problem with the reporting? Maybe the death of the same Reaper was reported more than once? More testing needed on this.
I wonder if Reapers are receiving wounds on all 4 sections when hit by explosives (I don't know which weapon you were using). They really shouldn't, although I'm unsure how you'd get around this. If possible, put a cap on the maximum number of wounds something can ever have (perhaps 6). You could argue their multiple hearts really empty their blood out quickly, but I don't think fatal wounds should ever become more dangerous than burning alive.
Well, why not: hit four times by one explosive, check for incurring fatal wounds four times. -- Zaimoni, 13:49 Sept. 6 2009 CDT
  • Question: should the death of an alien by wounds be reported, or should it die silently? Did I only see these messages because I was using Alien Pets, and so they were on "my" side?
Regarding death reports, I enabled the dialog for aliens/civilians (it usually only shows up for xcom operatives) to help in testing. The final version will not show them. Seb76 14:10, 3 September 2009 (EDT)

Caveats:

  • I used the Alien Pets, Big Brother, and Alien Inventory hacks to do this test. I also hacked a save game to give me Pistols, Medkits, PsiAmps and Mind Probes. Spike 16:03, 3 September 2009 (EDT)

To Do:

  • Test if aliens (small, large and mechanical) suffer from other effects of wounds, e.g. penalties to Energy, Accuracy, Time Units
  • Do Cyberdisks, which have no legs or arms and probably no head, only ever receive Torso wounds?

Mechanical Bleeding

  • Question: Do Cyberdiscs and Sectopods receive Fatal Wounds? I'm wondering whether an unconscious Cyberdisc is safe to be around. Even if they didn't explode, Fatal Wounds would be stupid for a robot. If XCOM tanks can't end up leaking fuel and sparking dangerously, neither should enemy robots. Stubbs
I think you can make a case for tanks and robots having "wounds", i.e. damage that gets progressively worse by itself. You can even make a case for them being "stunned" - temporarily non-operational. You can even make a case for it applying to alien robots but not to X-COM tanks, since alien robots all have some degree of organic component (which is why they can be Mind Controlled). But I still think you are right, neither effect should apply to machines, whether alien or human. As for your question, see the tests below:


Cyberdisk Bleeding Test Findings:

  • Cyberdisks take Wounds (with Alien Bleeding option enabled)
  • Cyberdisk wounds can be healed (though only after unit is stunned)
  • Cyberdisks lose health from wounds
  • Cyberdisks can die from wounds
  • Cyberdisks don't seem to explode when they die from wounds ("has died from wounds" popup)


Cyberdisk Bleeding TestTest Caveats:

  • Same caveats as previous tests (above), plus:
  • The Cyberdisks were modified from Reapers using xcomutil :rpl
  • Some Pistols were changed to Laser Rifles using xcomutil :chg
  • (xcomutil was not installed in the game directory however, it was used from another location)
  • The stats (Armour 34 all round, Health 120) appeared normal for Superhuman
  • However the Cyberdisks seemed to fall too easily to Laser Rifle fire (e.g. 1 hit)
  • Also, they seemed not to explode as often. This was because they were often stunned.
  • Hard to tell in-game whether a Cyberdisk is dead or stunned. The graphic is the same, you can't use a Mind Probe, nor look on the ground, nor even check by changing sides.
  • Actually there is one way to tell: stand over it and use a Medkit. Didn't think of that. Spike 08:22, 5 September 2009 (EDT)
Thanks for finding out, Spike. Autopsy text shows you are right about the Sectopod( but not about the Cyberdisc) having biomechanical components, but it's not like there are gallons of blood pumping around the thing to gush out. One thing: did you check both conscious and unconscious death-by-wounds for the Cyberdisc? Stubbs
No problem Stubbs. I didn't deliberately test this, but I had numerous deaths-by-wounding while unconscious and I think at least a few while conscious. I believe those that died while conscious, exploded. (I think this is the basic rule for Cyberdisks. If they are stunned, they don't explode. This typically happens with stun weapons but can also happen with regular weapons, if you are lucky.) Spike 20:54, 5 September 2009 (EDT)


  • Seb76: maybe robots receiving wounds was an oversight, or maybe you really do want robots to take wounds. In either case, it would be nice to have a separate option for this. My arguments against robot wounds are pretty simple: tanks do not receive them, the bled-out dialogue "X has died from a fatal wound" sounds silly for a robot that was never alive, and finally that a Medkit should not be able to heal a robot.
It's reasonable that alien mechanisms (Sectopod, Cyberdisk) would not suffer from wounds. Possibly also Zombies should remain immune to wounds? From a note Seb made elsewhere, I think the UNITREF.DAT "can be wounded" flag is the same as the "can be stunned" flag. Wounding is probably prohibited globally for aliens, by an override somewhere in the executable. Seb has probably removed this override, unconditionally. To remove the override more selectively, I suspect Seb would need to put a logic test in the code, to check the alien type. .Spike 20:54, 5 September 2009 (EDT)
There was a check for ownership that I simply removed. Next version will have an explicit check for robots/chryssies/zombies not to bleed. Seb76 12:29, 6 September 2009 (EDT)
  • If you want a sense of "the Sectopod's leg got damaged" or even "the tank's track was broken", perhaps robotic units could be 'wounded' by damaging max TUs.
  • If, however, the above won't let weapon usage TU %s recalculate as TUs are lost (i.e. the units lose firing ability as well as walking), then certain values of Energy with the correct Energy usage modifier could emulate loss of speed without losing firing ability. Since Energy is returned at a rate of 1/3 of TUs, these units could have an Energy value of (slightly less than) exactly 1/3rd of their TUs. Their energy usage modifier is then changed to allow this small energy value to usually suffice. Now, when Energy is damaged, the units will be permanently slowed, but their weapons won't be affected. Stubbs

Zombie Bleeding

Zombies that bleed to death don't seem to turn into Chryssalids. As discussed above, it might be better to disable wounding for Zombies. (Death by wounding for Zombies was already possible, without this fix, if the Zombie was mind controlled, wounded while mind controlled, then released back to Alien control.) Spike 21:07, 5 September 2009 (EDT)

Hostile Civilians

This fix also seems to prevent:

It does not fix:

(Probably because fixing both of these requires special, end-of-mission processing)

Still To Be Fixed:

(This requires a check in UNITPOS to ensure that the unit attempting Mind Control is not, itself, already mind controlled.)

Spike 16:16, 3 September 2009 (EDT)

Fixed Funky Fire and Zombies

Fixed Funky Fire still permanently kills Zombies, when the killing damage comes from (end of turn) fire damage. Spike 21:02, 5 September 2009 (EDT)

Research Tree

I've found a way of modding the research tree and was wondering if people are interested in an updated version. I've read of stuff like enabling hovertanks from cyberdisc autopsies or flying suits with floater research, but I think there is more that can be done. The limitations from the original game is that having researched a topic cannot unlock more than 4 new topics, and cannot unlock the production of more than 4 new item types. Any ideas? Seb76 12:40, 6 September 2009 (EDT)

  • Another one I mentioned was: Mind Probe before Psi-Amp, although I'm going to retcon that to "Mind Probe before Psi-Lab" (which then leads to Psi Aimp as per usual). The logic behind this is that the first step of a psi-attack must be scanning for enemy brainwaves to pick them out of the other signals. Before you can teach soldiers to do this, you'd have to have studied the mind probe to see how the non-psychic aliens are managing to find targets. You've got to walk before you can run, after all.
  • I'm unsure if the next suggestion is possible, given what you have said. I'd like some kind of necessity to research at least some corpses/aliens - is it possible to require, say, any 6 alien 'live' or 'autopsy' reports finished before Alien Origins unlocks? You might also make it dependent on difficulty (6/7/8/9/10 needed). You could also include alien missions in this count.
  • My only other suggestions are: you should have to research Elerium before you can build anything that requires Elerium to build. You should have to research Alien Alloys before you can build anything that uses those (which is true only for some things currently. It doesn't seem to be a prerequisite for building alien weapons). Is it possible for a manufactured item to require two separate research entries to be manufactured?
  • Question: is there also a limit of 4 prerequisites for a research item? Stubbs
There is no limit on prerequisites, it's the code that shows "you can now build/research xxx" that has a 4 entries limitation. Seb76 15:05, 6 September 2009 (EDT)

A boring suggestion but how about making sure that for all weapon research, you need to do the pistol before the rifle before the heavy weapon, etc. And similarly with the ammo types. Apart from that, I'll think on it. Spike 17:42, 6 September 2009 (EDT)

Another boring suggestion: each specific laser weapon should take a little longer to research - force you to use the starting weapons for a little longer. You could also rebalance the Plasma research times so that the rifle took a little longer and the Heavy Plasma took significantly longer. It might then be more viable to research them from weakest to strongest, without forcing your hand as Spike suggested. Stubbs

Yep that's a good alternative.

You could make the Stun Launcher a little harder by requiring (as well as Alloys and Elerium), perhaps a live Medic to be researched before the Stun Launcher (since it's usually Medics that carry them and presumably understand how to operate them), and an Engineer for a Blaster Launcher. It's not much extra but it helps to make these powerful weapons a little harder to get. If you wanted to make Blaster Launcher quite a lot harder to get you could add something like UFO Navigation (something to do with plotting all those waypoints, alien-stylee), or at least a Mind Probe for similar reason.

But, what are we trying to do here? Make things harder in general? That's one option. Or "rebalance", i.e. make things that are relatively too easy to get, relatively harder to get? Or make things more "logical"? There's lots of ways to play this.

It's a shame there's not a distinction in the game between using, and manufacturing, alien weapons - as is done in XcomUtil. Really, there should be a world of difference between figuring out how to use scavenged alien weapons, and actually being able to manufacture them. But that's not really a research tree topic, unless - would it be possible to create new topics? Could you separate out the using of an item from the manufacturing of it? (If not, it would be good to have a game variant in which nothing that can be scavenged, is allowed to be manufactured).

UFO Navigation might also be a good prerequisite for Hyperwave Decoder. I'm sort of rambling here, but what are the most powerful technologies, that are kind of easy to get... which ones need to be made harder. (Are there any that need to be made easier?)

Powerful technologies:

  • Psionics (Psi Lab == Psi Amp). Adding the Mind Probe, as suggested, would be a good idea. Maybe a psionic Commander capture required for each.
  • Blaster Launcher - maybe require an Engineer and a Soldier research, as well as Elerium & Alloys. Mind Probe or UFO Navigation for the "plotting" element? A separate Engineer capture to produce the ammo? What else?
  • Stun Launcher - Medic and an Engineer? Maybe a full set of autopsies - but that's too onerous.
  • Heavy Plasma - stretching the research time would be good, though this can already be done. Additional pre-reqs - maybe add a live Engineer requirement (maybe for each Plasma weapon type?). If you keep making these requirements you probably need to add a hint in the UFOPaedia along the lines of "we will need to interrogate alien technical experts to further understand this weapon technology". (OK that's hardly a hint.)
  • Laser Cannon (?) - But I'm not sure this Laser Cannon factory thing is a big deal. Arguably building a new intercept base is a better cash cow than building a 50-Engineer Laser Cannon factory.

Spike 16:34, 8 September 2009 (EDT)

64 bit compatibility

Any way to make the loader compatible with 64-bit operating systems, like 64-bit XP/Vista/7? Jwilcox25

I'm using it on Windows 7 and it's working fine. Not sure if that's 64 bit though. Spike 07:26, 9 September 2009 (EDT)
If you're not sure, you are probably running the 32-bit version of Windows 7. Starting from XP, Windows comes in both 32-bit and 64-bit flavors. Most 32-bit programs are backwards compatible, but apparently not X-COM from my experience. Jwilcox25
It works fine with Windows 7 64-bit. Didn't have to enable any compatibility options or anything like that. Rovlad 02:29, 23 April 2010 (EDT)
I can comfirm this result. (Steam release) --Necuno 08:13, 29 July 2011 (EDT)

Music bug

When enabled "MIDI freeze" bugfix, after entering first combat the music stops playing completely, for the remaining game session.

Also, when using Extender, for some reason music is playing at really low volume, i have to manually reduce my main sound channel and crank up the volume to hear it. When just starting normal UFO CE volume levels of music and sfx are about equal. I have SB Live & WinXP.

Fire Speed bug

Sometimes, for no apparent reason, fire speed setting jumps to 3, instead of what you had it set on.

I believe it's a bug in the game itself, not the loader. I remember encountering it in both DOS and CE versions. Rovlad 02:31, 23 April 2010 (EDT)

Reserve TU for x-Shot

Not sure if this has been addressed or fixed, but if you reserve Time Units for any shot type, all you get is Snap Shots for the reaction phase - never aimed or auto. Is there any way you could enable these two unused types for reaction shots? --Zombie 22:51, 25 October 2009 (EDT)

As far as I can tell, the reserve is only meant to be used during the active turn. Reaction shots are hardcoded to snapshots (that's true for the aliens too), it's no bug that your guys don't use reaction autoshots. Seb76 12:10, 16 January 2010 (EST)

TFTD

I know you're hoping to perfect the current version before taking on any new projects, but I just want to add my plea to the others requesting a TFTD version. Even some of the basic functionality would be awesome and probably completely portable, such as the stats on the equipments screen, default new base, etc.

Can't change tasks in D3D

Hey, I'm having an issue with D3D. If I alt-tab out, I can't switch back to the X-Com task. I'll switch to it but nothing can happen. I'm on Windows 7 x64 with an ATI Radeon HD 5770. Rlbond86 20:19, 15 January 2010 (EST)

I too have hangups sometimes when alt-tabbing out of XCom, sadly I'm no D3D expert :( I'll add more checks to see if resetting the D3D device worked though. If anyone knows of a 100% working way of dealing with "device lost" conditions, now is your chance... Seb76 12:06, 16 January 2010 (EST)

Battlescape Soldier's Stats Crash

I'm having this little problem with this and I wanted to know if I'm the only one that's suffering with it: everything works fine, but when in battlescape mode I want to check the stats of a soldier (by clicking his rank icon) the entire game CTD. Does it happen to anyone else? How can I fix it?

Never saw such problem...
  • Does it still crash when you disable the extender (and what options did you enable)?
  • Do you have the address where the crash happens?
Seb76 15:55, 22 January 2010 (EST)
It didn't, but now I reinstalled the game and it works wonderful. This is a great job you did here. Is there any chance that you could access to the stats of the soldiers from the assign crew screen? --Slibluhr 16:56, 22 January 2010 (EST)
OK, I could reproduce the crash this time, it has nothing to do with the stats screen as I supposed to do. The game crashes RANDOMLY if I have turned on the D3D thingy, any clue? I've also noted that if I turn on the caps mod (to put most of 'em in 150-200 to overcome the distance penalty) the soldiers do NOT improve, even after kicking a large scout's butt with KAtherine Sharpe, she didn't get any FAc point! --Slibluhr 05:30, 23 January 2010 (EST)
The caps bug is a known one, and a fix is available. I thought I'd wait for more substancial stuff before releasing a new version though. You can try the latest dev version that has the fix included.
As for your crash I cannot do much without a crash address... Seb76 11:46, 24 January 2010 (EST)
This is what it said during last crash:
AppName: ufo defense.exe AppVer: 1.0.0.1 ModName: ntdll.dll
ModVer: 5.1.2600.5755 Offset: 00011689
--Slibluhr 15:29, 24 January 2010 (EST)
Sadly the address is of no use (crash inside Windows code, most likely because of wrong arguments). I've put a new version up with better D3D error handling, does it help with your crashes? Also since I was feeling like it, I updated the "Reorder Soldiers" feature so that when you click the name of the soldier, his stats show up. You must click the rank/name of the ship to assign the soldier. Seb76 18:00, 24 January 2010 (EST)
Thank for the access to the stats of the soldiers via crew screen, it releases them from having their FAcc and PStr in the name.
btw, the crash moved to this location now:
AppName: ufo defense.exe AppVer: 1.0.0.1 ModName: ntdll.dll
ModVer: 5.1.2600.5755 Offset: 00028c0b
could it be that's my pc's fault? does this happen to anyone else?
------------------
System Information
------------------
Time of this report: 1/25/2010, 01:25:00
Machine name: 0X000001
Operating System: Windows XP Professional (5.1, Build 2600) Service Pack 3 (2600.xpsp_sp3_gdr.090804-1435)
Language: Spanish (Regional Setting: Spanish)
System Manufacturer: FOXCONN
System Model: A6VMX
BIOS: BIOS Date: 03/13/09 09:59:28 Ver: 08.00.14
Processor: AMD Sempron(tm) Processor LE-1250, MMX, 3DNow, ~2.2GHz
Memory: 3072MB RAM
Page File: 466MB used, 4490MB available
Windows Dir: C:\WINDOWS
DirectX Version: DirectX 9.0c (4.09.0000.0904)
DX Setup Parameters: Not found
DxDiag Version: 5.03.2600.5512 32bit Unicode


Hi there
I'm having the exact same problem with the Soldier's Stats window on Battlescape: If I ever click the area 16, the game crashes to desktop. (The error is always the same)
Crashmq.png


This is my current UFOExtender.ini configuration: http://www.4shared.com/file/GwpZmHJ8/UFOExtender_CONFIG.html

EDIT: I unchecked every single option, it seems it has nothing to do with the UFOExtender.ini, it's something related to soldier's stats data, maybe? Any ideas? --Nekrocow 02:42, 21 June 2012 (EDT)

Are you using the extender alone or with XCOMUTIL? If alone, have you tried recreating the error without extender running? The error code only tells me that somehow the program is being told to access an empty register that should have the reference for the current solider instead. Tycho 09:24, 23 June 2012 (EDT)

Store limit question

Nice to see you've implemented the general store change (unfortunately, UFOExtender doesn't work under wine, so I can't test this). I'm curious why 187 is the limit? I thought it would be a power of 2 (possibly minus 1)... Possibly you wanted to write 127? Cesium 19:43, 21 February 2010 (EST)

You can build 35 general stores max in a base and 65535/35 ~= 1872 (the internal representation is ten times what's shown ingame). Seb76 00:19, 22 February 2010 (EST)

Mouse scaller not working on Windows 7 x64

with d3d=1 and Scale Mouse=1 I still have issues with the mouse going way off screen. --BladeFireLight 01:57, 22 February 2010 (EST)

I have noticed that alt-tabbing out of X-COM at the title menu (or any other point that won't crash it) and then alt-tabbing back into it fixes this problem for me in Win7-64. --Xusilak 13:12, 22 February 2010 (EST)
Thanks for the heads-up. I uploaded a test version here: http://www.ufopaedia.org/index.php?title=Image:UFOExtender-dev.zip
Does it fix you problems? Seb76 14:36, 22 February 2010 (EST)
Yep. Seemingly no issues with the mouse going off the screen using it, although I didn't test for long. I'll try to get more test time in later. --Xusilak 20:46, 24 February 2010 (EST)
Actually, it doesnt work for me either, in WinXP. And it was broken since the version of 7th November, the one with windowed mode addition. Also, Alt-Tabbing didnt work too. This fix makes things right, though.
Edit : also, this dev version crashes in 100% cases when going to battlescape.
Strange, I do not have any trouble even when using split binaries. Do you have an address for the crash? Seb76 14:03, 1 March 2010 (EST)
Okay, i hope this is what you wanted, but it says the adress is 0x0000000000bd22ca. I can load an actual save with tactical mode, but cant go into tactical from geoscape. So i use the version from 1st November still.
Hum, you say the dev version crashes and that you are stuck with the version from 1st november. Do you mean you have the problem since the version of november the 7th, independently from the dev version? Seb76 14:08, 4 March 2010 (EST)
Actually yes. At first i didnt want to use it, because i use a tablet instead of mouse, and its really noticeable when a window failed to scale properly, since a tablet works in absolute screen coordinates. But just now i checked several new (non-dev) versions for the crash - its there. Crashes every time i try to enter tactical mode from geoscape. Saves from tactical load up fine. Version from Nov.1st gives no problems whatsoever.
Do you still have the problem if you disable D3D or use windowed mode? Also if you load a tactical game, don't you get a crash when it goes back to geoscape? Seb76 03:20, 6 March 2010 (EST)
When disable D3D - yes. When enable windowed - yes. When going from tactical to geoscape - no.
OK, I suspect this has to do with the "Save Equipment" feature. Can you try disabling it if you have it on? Seb76
OK, um...i tried all my saves, and with that feature disabled all my saves load up fine, and i can go from geoscape to tactical and back. So i thought everything was alright, and kept playing - the very next tactical mission loads up fine, but as soon as i try to move anyone - it crashes. And that is the same in all my saves, first mission is alright - second one always crashes. The crash adress is 42064f, in case you're gonna ask.
Alright, can you PM me a savegame before the crash? I doubt it'll help but who knows...Seb76 12:43, 6 March 2010 (EST)

Extender in Steam (+ maybe XComUtil)

Hi do you know of any way to use the two apps together with the Steam version? I would really like to be able to combine the 'Reorder Soldiers' feature of Extender and the 'Capturing Aliens for Research' of XcomUtil.

Actually now that Ive put a bit more time into it I can't get UFOLoader.exe to run in steam's dosbox implementation at all. I can just run UFOLoader but it doesn't run in dosbox which makes the game run horribly. If you don't have a steam copy for testing / integration of the basic Extender program please let me know and I would be happy to send you a gift copy.


-Dogfish

P.S. What a great program, you are a credit to gaming.

As far as I know, the Steam version also ships with the windows CE edition, the default shortcut just happens to point to the dosbox one. Also the latest version of XComUtil is able to detect the loader presence and act accordingly. Seb76 15:42, 25 February 2010 (EST)
STEAM comes with both EXE. XcomUtil and UFO Extender work together with STEAM. To use Setup UFO Extender in the game folder. Then Download and install the latest build of XcomUtil 9.7. It will auto start XcuSetup in windows, Detect UFO Extender and allow you to configure RunXcom to use it. To use UFO Extender, or UFO:CE you can't launch the game from STEAM. You have to create a short cut for RunXcom. (Right click > send to > Desktop as Shortcut) --BladeFireLight 19:13, 25 February 2010 (EST)

Thanks guys I was able to start the game with both mods. I apparently had everything configured correctly but I kept launching it from steam. Is there a way to play in windowed mode (since its not using dosbox)? I tried launching dosbox and running 'RunXCom.bat' file from there but it does not recognize UFOExtender.

Oh boy the game is fast, even on slowest scroll it is difficult play a battle :)


-Dogfish

What options did you turn on? Seb76 14:18, 26 February 2010 (EST)

Show Stats=1 Apply=1 (wreck analysis) Proximity Grenades Experience=1 Elerium-fueled Craft Bug=1 Save Reserve Mode=1 Rank In Inventory=1 Manual Interception Fire Mode=1 Crafts Always Ready=1 Reorder Soldiers In Crafts=1 No Funkers=1 TFTD Doors=1

Full System Specs: Win Vista 64 Intel i7 920 6GB RAM GTX 285 Video Asus p6t

Everything is fast the geoscape tics are at least 5 times faster than running the non-Extender mode via dosbox.

Would you have any suggestions how to slow it down? I've actually been playing in steam(dosbox) with XComUtil only and then saving/loading between missions so I can reorder the soldiers.

Aha! I found the D3D Windowed option... HQ4x=0 D3D=1 D3D Windowed=1 Always On Top=0 Clip Cursor=1 Scale Mouse=1 Screen Ratio=0.833333

I can manually resize it to be bigger, excellent! What is strange is that running it in windowed mode seems to slow it down enough for the scroll speed settings to make it playable :)

I ran into a "Unsupported 32/16/64 bit error message switching from geoscape to battlescape but it happens only 1/3 times maybe?"

I will be playing this and let you know if I run into any more problems.

Thanks a bunch! -Dogfish


Hi guys, dogfish again I've been getting a couple of glitches.

1. Switching from battlescape back to geoscape in the cmd prompt it displays 'echo----------------------------Leaving' is not recognized as an internal or external command, operable program or batch file.

2. This has happened twice

Get someone who has been shot is at low health and has fatal wounds

Have them pass out due to smoke inhalation

Let them bleed to death and get the "Joe McSoldier has died from a fatal wound" *while unconsious from the smoke*

I will lose points for the mission but the soldier will be recovered at the end of the mission but terribly wounded. (Currently Hans 'Jesus' Vogel is taking 55 days to recover his 41 health.)

Both of these are XcomUtil issues. 1 has been fixed in Build 413 but I need a saved from just before ending combat to fix 2. --BladeFireLight 18:19, 28 February 2010 (EST)
Sent the savegame to your gmail (whatever was listed on my paypal reciept from your donate button). Just hit end turn (all the aliens are dead) and the bug is triggered. -Dogfish
I got it. Was up all night with Bomb Bloke and we worked out what was going on. The fixed works with your save. The next build will fix the zombie bug. Also Thanks for the donation. Every little bit helps. --BladeFireLight 16:02, 1 March 2010 (EST)


-- Hi! I'm thefarside. This is my first time ever editing a wiki page so please bear with me. I'm not even sure I'm allowed to do this.

However, I have a problem with the cursor. It moves WAY out of the screen to the right and downwards. I've read something about a "clip cursor" fix but I can't seem to find out where and how to implement it.

Regards, thefarside --


Manually Select Promotions

Just an Idea, not sure how easily done it is but I was thinking it would be really cool if (when its time for promotions) it would bring up a soldier screen with the eligible soldiers so that you could pick who gets promoted. Bonus if you could click on the candidates and be taken to their stats screen.

Love, Dogfish



Xusilak's Patch Additions

Since my patches are being integrated into the main release now, everyone should let me know if any issues are found with them. I'll try to get on fixing them as quickly as possible.

For clarity, the patches in the current build that I developed are:

  • AutoSell
  • Show Money

Thanks! --Xusilak 14:51, 24 March 2010 (EDT)

I went ahead and set up my own user page: User:Xusilak. If possible, direct discussion about my patches to my discussion page there. Thanks again! --Xusilak 15:44, 24 March 2010 (EDT)


Hi Seb, I've been working with IDA, your database, and your patcher's code for some time now, learning my way around it, and so on. So far, I've managed to come up with three UI improvement patches, although they still need some polish and testing.

The first one is a battlescape movement confirmation patch; it requires the user to click twice (double-click with no time limit) on the same tile to move, instead of once, to eliminate movement errors. In practice, I have found this very helpful.

The second one shrinks the geoscape clock and adds your current funds above it, letting you see your financial situation at a glance while waiting for time to pass.

The third one enables auto-selling of manufacturing items. Pressing the down arrow when the production quantity is at 0 engages this mode. When in this mode, production of that item never ceases (unless resources become unavailable), and the item is immediately sold upon completion.

Would you like me to make the code for these available once I've finished polishing them up? They currently consist of a few C functions accompanied by some InsertCall()s and Nop()s, as well as some additions to XCOM.h. I haven't added INI options to enable them, so I'd leave that up to you. You may use them as you wish, with no conditions.

Note: I'm still learning x86 assembly, so the patches may not be bug-free. I'm hoping to give them a good testing myself, though. --Xusilak 16:10, 19 March 2010 (EDT)

Glad to see you could make something out of this database :-) Do not hesitate to send me your modifications, I'll incorporate them in the codebase so others can enjoy them. I'm sure your autosell feature will make a few happy ones ;-) Seb76 19:12, 19 March 2010 (EDT)
Yeah those features would all be great! Thanks Xusilak. Spike 15:08, 22 March 2010 (EDT)
OK. I'm going to finish up my last touches on them, then test them for a while; they should be ready within a couple days. --Xusilak 21:59, 19 March 2010 (EDT)

v1.21, Battlescape crashes

I enabled the new mods and they worked ok in Geoscape. Then this Popup box starting the first Battlescape:

Application failure
XCOM crashed at 0x10002571 with error 0xC0000005 trying to access 0x0968DF43

Media:UFOExtender1.21.BSCrash.zip contains the UFOExtender.ini file. This was a New Game but not a new install of XCOM, just an overlay of updated UFOExtender.

  • Win XP Pro 2002 SP2 32bit PAE
  • Pentium-4 3.00GHz 3.5GB RAM

Any ideas? Need more info? Spike 20:20, 24 March 2010 (EDT)

Does it happen consistently? I've been plagued by a random geoscape->battlescape transition crash in the collector's edition. It's one of the things I'm looking to fix at some point. The current UFOExtender doesn't appear to crash any more than previous ones do for me. I managed to do four missions in a row just now. --Xusilak 21:00, 24 March 2010 (EDT)

I'm doing some research into this; I started up in debugging mode and spammed missions until I hit a crash. The crash (on this occasion) is an access violation caused by an invalid pointer stored at 0x49B954 (the offset that pSoldierDat points to). This means *pSoldierDat is being changed at some point. It took many, many tries to get this crash to happen; I reloaded something like 20 times hitting the same mission, went ahead and did the mission quickly, proceeded, did another mission, proceeded, then the next mission crashed. Given that I'm in debug mode, it's not impossible this is due to the various hacks enabled by it, so that should be kept in mind. I'm going to continue working on this. --Xusilak 22:26, 24 March 2010 (EDT)

It appears the "invalid" pointer is actually set by malloc() - 0x0771D380 (for me). I can only assume something along the way disrupted the data on the heap, as the pointer was the same when examined on a battlescape transition that didn't crash. Still researching. Note that for me, the crash itself happened inside GetSolderUUID() in the Save Equipment patch functions when it attempted to use that *pSoldierDat pointer. However, I assume it would still happen if the Save Equipment patch were disabled, just elsewhere. This is something I'll test as well. --Xusilak 23:41, 24 March 2010 (EDT)
Sorry I'm guilty of reporting a bug I didn't (couldn't) repeat. But as I had no previous save game positions I couldn't repeat anything - the crash happened on the first Battlescape mission which for me is unusual, I would say that for me that transition crashes less than 1 in 100 times, if even that many. I had enabled Save Equipment I think and on instinct I would suspect that mod as being responsible. Those UFOExtender functions would run while setting up the Battlescape presumably. The equipment handling functions and structures already present in the game are known to be buggy. BladeFireLight and I just found another issue with them last week. Manipulating them is still risky. If you can investigate that would be very helpful.
In the meantime I will see if I can try to repeat the fault, with and without Save Equipment enabled, and starting from a clean XCOM install. One trick I may use is to set No Score Game Over and then just abort from each mission rather than fighting it, to speed up the testing.
Thanks for your good work Xusilak, it is appreciated! Spike 03:25, 25 March 2010 (EDT)

One possibility: On this mission I had only 6 soldiers (2 HWPs) but enough weapons in the Skyranger to equip 14 soldiers. Is there some known issue with needing to allocate all weapons to soldiers during the equip phase, in order to avoid a crash? If so that might be the cause. I will try to recreate those conditions and see if it provokes a crash. In case it's not clear, Battlescape never appeared to start, no Equip Phase screen ever came up. Spike 03:31, 25 March 2010 (EDT)

Assuming the same crash is afflicting us, then the crash is when the very first soldier is accessed, when the Soldier.Dat data is first used for that mission. It's unlikely that volume of equipment is affecting that, and in particular, I hadn't changed my Skyranger's loadout to any degree whatsoever, having only briefly touched researching and manufacturing; it was otherwise a gamestate set entirely by doing one quick regular mission and one quick terror mission. However, I was also in debug mode, which enables certain cheats, like Alien Pets, automatically. This might, itself, have unseen bugs that could corrupt the data structures and cause a similar crash. When I get the time to, I'll be testing again with those cheats disabled, trying to further isolate the conditions involved. --Xusilak 08:34, 25 March 2010 (EDT)

I've repeated this multiple times now, with a clean install of XCOM and a clean install of UFOExtender 1.21. The game crashes everytime, after the "mission screen" that comes up just before the Equip Phase of Battlescape for the first mission. It's regardless of my equipment loadout or number of soldiers/tanks: it happens with totally default equipment and Skyranger load. So I imagine it must be due to some combination of the UFOExtender.ini file options I selected, and maybe code changes in 1.21. My .ini file is the upload at the top of this section. The error is always "error 0xC0000005 trying to access 0x0968DF43", though the crash location (in the code) varies. Spike 20:31, 25 March 2010 (EDT)

If you have time, could you try to 1) confirm it's specific to 1.21 2) try to correlate it to ini options? Turn everything but the basics off and see what happens... if that works, turn on Save Equipment and try again, etc. I haven't seen any behavior like that in my local tests, on either of my computers (Win7-64 and XP-32). I'll try it with your ini, though. Maybe I can find something. --Xusilak 20:39, 25 March 2010 (EDT)
Just tested with your ini, although with D3D and D3D window enabled. Started a mission, didn't crash. I also noticed one thing: you have General Stores capacity set to 1. I don't think that's helping anything, but it's probably not causing the crash, either. Experimenting more. --Xusilak 20:48, 25 March 2010 (EDT)
Save Equipment=1 is part (at least) of the problem. If I turn that off, and leave all my other .ini settings as is, I no longer get the Battlescape crash. Seb, did you make some changes there? Maybe after the investigations we were doing with BladeFireLight? Spike 21:13, 25 March 2010 (EDT)

I have isolated the problem (on my end) to the fact that the SOLDIER.DAT data in memory is deallocated when the transition to the Battlescape starts. When Seb's Save Equipment code attempts to use it, it's getting random unallocated (or unrelated) memory instead of the SOLDIER.DAT data. Interestingly, the dynamic memory used to hold the SOLDIER.DAT data is deallocated on the transition to the Battlescape, and reallocated to a new memory address on the transition out of the Battlescape. I assume this is an artifact of the way the Collector's Edition merged TACTICAL.EXE with GEOSCAPE.EXE, because TACTICAL.EXE had no need of SOLDIER.DAT, and only used UNITREF.DAT and similar. At any rate, this problem can be resolved by not relying on **(0x49B954) (or **pSoldierDat) to contain the correct data. Instead, a workaround to get the needed data should be used. One option would be to patch the way the transition works to prevent the deallocation from happening, and then ensuring on exiting the Battlescape that the old memory block is still used. I may be able to work in that fix myself. If so, it would require no changes to the Save Equipment code. I'm not sure if this is a general issue or local to me only. I'll try to test on my XP system and see if it suffers from the same problem; if it does, it's a safe bet this is a general issue, and the likely cause of your crashes. --Xusilak 00:06, 26 March 2010 (EDT)

Save Equipment did used to work for me before. Maybe it's because I also selected Reorder Soldiers In Craft. Does that sort and rewrite SOLDIER.DAT? Spike 03:39, 26 March 2010 (EDT)

I have confirmed this behavior in the original X-COM Collector's Edition UFO Defense.exe copy, running on my XP system. As such, it cannot be a result of any patches Seb has made (because it still happens even when not using Seb's loader). I'm not sure if it will crash without Seb's patches still, but the way Seb uses the *pSoldierDat pointer in GetSoldierUUID() appears to be unsafe, as *pSoldierDat has already been deallocated at that point. On some systems, it may work, because the nature of memory on the heap is such that different systems give different results when dealing with deallocated memory and bad pointers. Regardless, the crashes can be at least partially (maybe entirely) resolved by using a workaround that avoids the deallocation of *pSoldierDat when the battlescape transition starts. I'm going to see if I can implement the fix I suggested, that prevents the memory from ever being deallocated. That should completely resolve it. At the least, I am going to study the assembly responsible for deallocating it to see if I can confirm the exact issue on the code level. --Xusilak 13:26, 26 March 2010 (EDT)

It seems that when GotoGeographMode() returns to move into GotoTacticalMode(), it calls FreeEverything() in the process, deallocating all data structures. Then, GotoTacticalMode() never bothers to reinitialize *pSoldierDat, so when the equipment phase comes up, it's still unallocated. Still working on a fix. --Xusilak 14:29, 26 March 2010 (EDT)
Surely at some point the (unmodified) game needs to at least read the *pSoldierDat structure, in order to populate the UNITREF.DAT and UNITPOS.DAT structures for Battlescape? Unless it reads SOLDIER.DAT but doesn't bother storing it, not even temporarily, in *pSoldierDat.Spike 15:27, 26 March 2010 (EDT)
Nice piece of analyse there :-). I'll modify the patch to load the soldier data when needed and clean up afterward. Seb76 15:30, 26 March 2010 (EDT)
Edit: I uploaded a test version. Can you check if it fixes your crash? Seb76 15:47, 26 March 2010 (EDT)
Looking good so far; Save Equipment works for me now, and it never has in the past. I'll run through a bunch of missions quickly and see if I get any crashes. Thanks Seb! --Xusilak 17:01, 26 March 2010 (EDT)
No, thank you for figuring out the cause of the crash. Seb76 17:21, 26 March 2010 (EDT)
Just ran through several dozen (very quick, mostly aborted) missions all the way up to June. I never crashed, and Save Equipment always worked correctly. I think we're good to go. Hopefully it works for Spike as well. --Xusilak 18:00, 26 March 2010 (EDT)

I've also been narrowing in on another crash, unrelated to the patcher, I believe. It happens rarely upon clicking the air to move somewhere, like stepping out of the Skyranger by clicking the air one tile in front of the soldier, to move onto the ramp. It appears to be the result of a bad calculation on the tile to check in MoveUnitTo(). The calculation is looking at (char *)pMap + 4 * (xpos + (currentUnit_zpos + esi) * map_numTilesPerLevel + dword_4A28AC * tac_mapYSize); // when esi is 2 or greater; this esi factor shouldn't be there, as far as I can tell, because it results in the offset used being much greater than it should be and frequently going out of bounds of the MAP.DAT data stored at *pMap. Continuing my research into this when I get a chance. --Xusilak 17:01, 26 March 2010 (EDT)

I noticed that crash also (I think it's the number one crash cause on a genuine XCOM setup) but was never able to reproduce enough to investigate it. I was tempted at one point to patch the GetTileAt function to check its arguments, but finding the cause of the corrupted value would be better. Seb76 17:21, 26 March 2010 (EDT)
Yes, it's definitely a hard crash to catch, because of how rare it is. I've got a few ideas, though. We'll see if they help. --Xusilak 18:00, 26 March 2010 (EDT)
Currently, my guess is that this line:
.text:00420534 BE 01 00 00 00   mov  esi, 1
should be "mov esi, 0" instead.
To sum up the issue:
The way the 'click on air to move to a tile below unit' part of MoveUnitTo() works is that it examines each level below the unit until it finds a floor to move to. It does this by looping through the level below you, incrementing esi to loop through the next level below that, and so on. To do this correctly, esi should start at 1. However, the X-COM programmers appear to have made an oversight: they initialized esi to 1, but then incremented esi again before the initial value actually gets used. The net result of this, is that we get zpos += 2 for the very first cycle. This works OK on floors 3 and 4, but for floor 2, it will attempt to access a z level that doesn't exist (one below the ground), causing this line:
(char *)pMap + 4 * (xpos + (currentUnit_zpos + esi) * map_numTilesPerLevel + dword_4A28AC * tac_mapYSize);
to exceed the bounds of the *pMap memory block. Obviously, running off the end of that block will cause unpredictable results, and if it reaches into a block that isn't allocated, it will crash. That's why the actual crash is very rare: it has to overrun into an unallocated memory block.
Of course, I could be completely wrong, but it makes sense, and patching 'mov esi, 1' to 'mov esi, 0' doesn't seem to cause any problems. I'm going to be testing with that patch enabled from now on, to see if I crash in that circumstance anymore.
Looks like you are right. I instrumented the code and there are indeed systematic out of bound accesses when getting out of the craft, though the game does not crash every time. I suspect this is the same crash that happens during base defence when an alien tries to move down from the access lift. Kudos for figuring all this out! I'll provide the fix in the next version. Seb76 14:04, 27 March 2010 (EDT)
By the way, Seb, the 1.21 source code doesn't include autosell.cpp; I assume it's a simple oversight. I reconstructed it to get it compiling properly. Just wanted to make sure you knew. --Xusilak 20:37, 26 March 2010 (EDT)
Oops, forgot to check the unversioned files before checking in...Seb76 14:04, 27 March 2010 (EDT)

Minor cosmetic enhancements?

Had these ideas come to mind while I was at work today, and since your loader is doing some amazing things for the game, I thought I'd ask if the possibility of any of these enhancements exist.

The short of it is: Are you able to overlay any additional bitmap surface on top of the battlescape view, and are you able to play additional sounds?

The main idea for drawing an extra bitmap (semi-transparent) over them map would be to simulate rain/snow for some outdoor maps. Lightning even - though that would require clever use darkening and lightening the overlay. This would have some issues attached to it such as knowing when to display it and when not to, thanks to the various other screens available.

As for playing sounds, which would be simpler, would be to play a looping sound clip to provide environmental sound effects, such as insects chirping and owls hooting at night in woodland maps or town noises at terror sites. Or during the day in a jungle map, some tropical bird calls made at random intervals. TFTD already does the looping environmental sounds, such as teh under water bubbly noises or the wind and sea noises when on land mission. Would it be possible to duplicate this for UFO CE?

Not the most important of enhancements, but I was still wondering if the possibility is there.

-NKF 01:41, 25 March 2010 (EDT)

Save/Load shortcuts

Seb, would it be possible to enable shortcuts for the Save/Load in geospace & tactical (like F2 or F3) ? ;) except for saving in the final battle (from level 4 if remember) :)

Other things: - rosvell incidents occured for me too often - 5 in the first month while there was no other alien craft movement detections

- option to disable mission briefing window with the only ok button :) supposedly for advanced users ;)

Aliens continue using pistols&rifles

Hi Seb, sorry to bother you - i have been playing X-COM titles on and off for about 10-15 years now, and one thing always bothered me: Why do the aliens always swith to heavy plasma (or the Sonic cannon in case of TFTD) later on? It encourages the player to swith to heavy plasma too, if only for the free ammunition you almost drown in later on. Would it be possible to have the aliens continue using the plasma pistol&rifle after june/july? It would make using those weapons more feasible, getting ammunition during missions and not having to use elerium to produce it.

Another request (don't know if it is possible) - let the aliens continue using the abductor and the harvester for the respective missions. Later on, all you get are large scouts or even battleships doing those missions - getting some variety in there would make the endgame more interesting. You get to do 50+ battleship missions in a game, but only 4 or 5 with a harester/abductor. Those ships should see a lot more use during the missions they are "designed" for. The "MISSIONS.DAT" page says something about ufo and mission counters and their associated ufo-types - would it possible to modify those entries via the loader?

Regards, Equinox

ALIEN MISSION DATA CLARIFICATION

According to link title

I found it in TFTD. At offset 505448 (decimal) is starting (mission Probe). Next Interdicition/resource raid/infiltration/colony expansion/surface attack/Floating base attack

I understood what is 3-rd word. If You interesting - I can exlain

Seeing speeds of USO sub we can determine the mission of this USO sub even without transmission resolver - even in january 2040 Every USO sub in every missions (interdiction, colony, probe and other) have unique speeds and we can determine mission of USO on their speed And we can determine what amount of times a sub touch down on his mission - because every mission has unique rule for touch down USO subs And we can determine what amount of time USO Sub will touch down on their mission - because every Sub in every mission has unique and ALWAYS equal amoun of time to touch down (p.s. this time we can see in file Loc.dat) Here - I attached file speeds.zip link title

3-rd word - it is reference to unique speed of each sub

4-th word - is time that precede to arrive next uso sub. In other word, in line ufo/c 0/0 if time = for example = 200 - it's time to arrive sub that indexes 1/0. And where can I get time to arrive EXACTLY sub 0/0 is incomprehensible for me. I assume that this time contain at similarly word of last uso for this mission - but its'not truth because at some missions time in the line of last ufo/c = 2 half-hours and it's means that ufo/c 0/0 can to arrive at new month at 2 half-hours. It's true for Surface attack Mission but not truth for other missions. I assumed that time in line ufo/c 0/0 - that time to arrive for NOT next ufo - and I assumed that it's time to arrive exactly ufo/c 0/0 itself. But many my tests (more than 100) denies my suppositions. In example, at line ufo/c Cruiser mission Colony Expansion time in file =2. Cruiser in that mission arriving much more than 2 half-hours after Escort. Instead Fleet supply Cruiser in that mission arriving after 2 half-hours exactly after Cruiser.

Question - Where can I find time to arriving for ufo/c 0/0 for each missions except Surface attack mission ?

I am sorry for disturbance and will great thank for you for help.

After the first month the game creates a mission per month, up to the 6th where it generates 2. I guess a mission starts immediatly, there is no timing added for its first ship. Seb76 15:18, 30 April 2010 (EDT)

Mission starts not immediately. often time to arrive to survey ship (first sub) about 10-15 days. 1-st day of month at 0-00 we can see it time at Missions.dat but wants to know average time similarly such average time for other subs from alien data mission at executable if possible.

What is exactly 6-th? mission from Probe to Colony Expansion? or from January to June?

Yep, 6th month. Seb76 20:04, 30 April 2010 (EDT)

what happens after 6-th month June?

I so sorry for reminder and bother you, but don't you know it? ((

Formules about Retaliation/Floating base attack mission

Hi

My great respect to you for you formules I need few help. I am great thank to you in advance

Now I found alien data missions in TFTD (in a similar in EU ) and I ask generously to you to check 3 your formules in TFTD. Is these same or not?

1. After a shootdown, the next UFO for that mission is delayed between 1 and ~9 days ( the formula is 48+RAND()*400 half hours

Xusilak is more knowledgeable than I concerning TFTD. I cannot help you here... Seb76 14:41, 30 April 2010 (EDT)

Formule 2 and 3 probably contins mistake. formule 'll have to have symbol > instead symbol <. Otherwise retaliation mission activates more often on Beginner diificulty than Superhuman difficulty. Is is strange.

2. A retaliation mission will be scheduled if RAND()*100 < 4*(24-difficultyLevel).

There is indeed a mistake there. It's been so long I cannot remember if I got it wrong or just messed it up wikifying it ^^ Seb76 14:41, 30 April 2010 (EDT)

3. If RAND()*100 < (50-6*difficultyLevel), the retaliation mission will use the same zone as the shot UFO, else it'll be the zone containing the base the craft in coming from. The first UFO is scheduled in 100 half-hours (the value is taken from the table I speak of later at the bottom of this page).

And RND() - what values may has? from 0 to 1 or not?

When I write RAND()*100, it just means a random number between 0 and 100. Seb76 14:41, 30 April 2010 (EDT)

I will be very thank for given help

MISSIONS.DAT formula clarification

Hi Seb76. I've been having a discussion with Alexchamp and trying to interpret the formula you mentioned on Talk:MISSIONS.DAT about retaliation missions being scheduled after a shoot down. Namely: if RAND()*100 < 4*24-difficultyLevel

We mainly need clarification on the logical operator. Should it be less-than or greater-than?

As it reads now, it could be interpreted as though retaliation missions are generated more frequently on the easier levels. But if we treat it as >, then this means that retaliation missions are generated about (Beginner) 4%, 8%, 12%, 16% and (Superhuman) 20% (or 28% for TFTD) of the time on their respect difficulty levels.

If you could clarify that for us it would be great, thanks. - NKF

Yep, I goofed up. Don't take everything I say as gold ;-) Seb76 14:45, 30 April 2010 (EDT)

And I precise too one mainly moment. Whether there must be the opened bracket after the sign of multiplication? Because if no, then right interpretation formule in Superhuman example such: Rand*100>4*24=96-6=90 and that means that retaliation mission would be sheduled in 10 cases from 100. IF there must be opened bracket then rand*100>4*(24-6)=4*18=72 wouid be sheduled in 28 cases from 100 What is this versions is right?

Then needs clarification for second formula yours. If RAND()*100 < (50-6*difficultyLevel), the retaliation mission will use the same zone as the shot UFO, else it'll be the zone containing the base the craft in coming from. What logical operator there? should it be too greater-than or less-than?

You have found later formules about activation retaliation mission (if we shotdown alien craft) Where exactly in assembler is subprogram that determines it? What address/offset of it?

COLONY SUPPLY MISSION

As we know, When alien base built, Fleet Supply Cruisers with missions Colony Supply can to arrive to this base.

Where can I see (file/offset) 1) average time to arrive colony supply ship for examle/at least in XCOM-EU. As I said later, in responsible offset is time to PRECEDE to ARRIVE NEXT UFO SUB it's not time to arrive this sub 2) real time to wait arriving colony supply ship similarly times in file Missions.dat

According to Colony Supply - time to arriving

If guesses of NKF is right, we need to formule of probability to arrive Colony Supply ship. Can you to render courtesy with this formule?

Thank you very very great in advance

I added details in the LOC.DAT talk page. The supply ship is spawned randomly and starts its mission. There is no "time to first supply ship" that I can see. Seb76 15:11, 30 April 2010 (EDT)


Thank tou very much for this clarification. I found this offset in TFTD even. Changed, checked - it works. You are greatly people!

Roswell mission bug?

Hello, Seb76.

I've just had two consecutive games (meaning, I restarted the application and began a new game) where the same strange behavior occurred.

Both games had Roosevelt mission as the first one. It showed the window (type, terrain, UFO size) as usual. Afterward, whenever I clicked on it (to check mission conditions again), it showed a typical "hyperwave transmission decoded" window, stating race/mission type, etc. Needless to say, I had no decoder at this time, since it happened both times in the first game week.

I have a saved game if you want to take a look at it. It's completely reproducible, at least for me. You just click on the white cross and get this window.

Also, I'm using plain CE version with a "complete UFO patch" from StrategyCore. The saved game was not hacked in any way.

Cheers! Rovlad 10:08, 30 April 2010 (EDT)

Hum, I gave it some shots but could not reproduce your problem. Anyone experiencing the same problem? Seb76 15:36, 30 April 2010 (EDT)
Here's the savegame. Let me know if it works fine for you. Rovlad 21:47, 30 April 2010 (EDT)
Looks like the CRAFT.DAT entry is not cleared when a new craft is created and the offset 0x64 could be garbage till the craft is detected by a base/another ship. Since I bypass the detection when "crashing" a UFO, it is possible the "HWD detected" flag is set randomly, producing a full report. I'll clear the bit and we'll see if it corrects the issue, just wait for the next release. Thanks for providing the savegame BTW. Seb76 14:22, 5 May 2010 (EDT)
You're more than welcome. Fantastic job on the extender, keep up the good work. Rovlad 19:04, 5 May 2010 (EDT)

ALIEN RACE SPAWN

Your post: In EU, the race is based off a lookup table starting at offset 0x46E53C (containing 300 entries).

Offset-0x46E53C is absent. Is one symbol odd?

Your posr:The table is made up of 10 entries lines.

It means that this bit of array has 10 rows width of 30 bytes. is right?

What is means this 10 entries lines? Can you copy 2-3 lines from exe and explain that means known for you offsets in line?As simiilarly as you done for alien data mission in file Missions.dat Can you get more particularly answer about values it this array?(naturally if know it)

0x46E53C is the address in memory. In the file it should be 0x6E53C (UFO Gold edition).
The begining starts like this:
.data:0046E53C byte_46E53C db 0, 0, 0, 0, 0, 0, 0, 1, 4, 4         ; 0
.data:0046E53C                                                                       ; DATA XREF: CreateAlienMission+15B�r
.data:0046E546 db 0, 0, 0, 0, 0, 1, 1, 4, 4, 4         ; 0
.data:0046E550 db 0, 0, 0, 0, 0, 0, 4, 4, 4, 4         ; 0
.data:0046E55A db 0, 0, 0, 0, 0, 0, 1, 1, 4, 4         ; 0
.data:0046E564 db 0, 0, 0, 1, 1, 4, 4, 4, 4, 4         ; 0
.data:0046E56E RaceForTerrorMission db 0, 0, 0, 4, 4, 4, 4, 4, 4, 4         ; 0
.data:0046E56E                                                                       ; DATA XREF: GeoPerformMonthlyActions+15E�r
.data:0046E578 db 0, 0, 0, 0, 0, 0, 1, 1, 4, 4         ; 0
.data:0046E582 db 0, 0, 0, 0, 0, 0, 1, 4, 4, 4         ; 0
till the end:
.data:0046E67C db 0, 1, 1, 2, 2, 2, 3, 3, 2, 4         ; 0
.data:0046E686 db 0, 0, 1, 1, 1, 2, 2, 3, 3, 4         ; 0
.data:0046E690 db 0, 1, 2, 2, 2, 2, 3, 3, 4, 4         ; 0
As you can see, at the begining you'll get tons of sectoids (0), a few floaters (4) and even less snakemen (1).
At the end, you'll get ethereals (2) one time out of two. Also note that for terror missions, the line is taken a bit farther than normal missions, which means that you'll get stronger aliens sooner in terror missions. HTH, Seb76 13:36, 5 May 2010 (EDT)

Thank you greatly for your detailed answer ... I want a few more precise ... I right understand? I guessed That line 1 - is used for January mission Research? Line 2 - Jan Harvest? Line 3- Jan-Abduction Line 6- January Terror? What define Line 7? Line 8 - is February Research?

According to - Line 13 -Feb terror? Line 20 - March terror? Line 27 -April Terror? Line 34- May terror? that sequence and guesses is right?

And question 2) does affect score to choose the value among values in line? How differ choose values in line at the level superhuman and level beginner ? If you know, naturally, I would be greatly thanks to you for this wonderful magic help.

Research tree in executable

Do you know location (starting offset) of research tree in EU? and how much entries it contains ? and what means values within this array?

Very great thank in advance for this help to you

The research tree is not stored as a data array but is a hardcoded sequence of "if this is already researched and that is also researched and such item is in the inventory, then enable this research". Modding this would require a complete reengineering, not just patching. Still feasible though. Seb76 13:25, 5 May 2010 (EDT)

What is starting offset (ce version) of this hardcoded sequence? and what is latest offset of it? what is length of one sequence? If possible -what is structure of it briefly? (how much bytes to tech requirements, how much bytes to items requrements)

Thank you for this help VERY VERY GREAT

As I said, there are no *sequences* but just a cascade of hardcoded ifs:
Research.png
If you want to take a look, the function begins at address 0x446A0. Seb76 07:28, 24 May 2010 (EDT)

Seb76, you are GREAT GENIUS!!!! GREATLY RESPECT FOR YOU!!! THANKS FOR YOU VERY VERY MUCH!!! I have found research tree in TFTD too with your help. Now I can do some changes in it. Maybe do you know, how can I find subprogram that run 1-st day of any month in assembler code of game? This subprogram determines new mission's month and terror ship route (in TFTD) There is not in EU terror ship route, I know. But If you know and tell me - what is subprogram in EU that runs 1-st day of any month, I would be able to edit probability of terror ship route in TFTD. Greatly thanks in advance to you dear Seb76!

In EU, monthly actions start here:
 .text:0043B9B0                               GeoPerformMonthlyActions proc near      ; CODE XREF: GeoIncrementDayAndDoMonthlyActions:loc_4420C1�j
HTH, Seb76 16:31, 28 May 2010 (EDT)

Any way to slow down geoscape time?

Is there any way to slow down geoscape time progression on fast computers, esp. multiprocessor ones, where it is impossible to significantly slow it down using utilites like MoSlo and Turbo?--AVE 03:01, 5 May 2010 (EDT)

Did you try enabling D3D? If you're drivers are configured to wait VSync, it should limit the game speed (well, if you use a CRT@120Hz it'll still be too fast I guess...). Also is it still too fast if you put it windowed? (enabling both D3D and D3D Windowed options) Seb76 13:19, 5 May 2010 (EDT)
Yes, both D3D and D3D Windowed are enabled. This is even more surprising, because it shows the same results on two different computers (Dual Core one and simple P4Celeron) with different video cards (NVidia and ATI). Both have vsync explicitly enabled. LCD@60Hz both. Also I've tried to use different combinations of Video Pitch, D3D, D3DWin and HQ4x settings - no luck. AVE 04:20, 6 May 2010 (EDT)
Personally I've never been able to reproduce this "CE game running too fast" thing people keep harping on about. Perhaps I just have a different perception as to what "too fast" means.
Anyways, I know Mok's patched executable includes a timer hack for the Geoscape, but I found that makes it run far too slow for my taste. Not sure off the top of my head whether it works with Seb's loader, either - you'd probably need to at the very least need to rename Mok's executable to replace the original in order to try it that way. - Bomb Bloke 05:14, 6 May 2010 (EDT)

Some problem with edit research tree

I want to add new 20-30 commands to research tree. I wrote this subprogram. How can I add it to game? I tried to write "call sub" instead useless 5 bytes in subrogram research tree. I checked in IDA after it, all other commands is preserved. And I placed my new subprogram after latest byte of executable file. But game is crashed. I tried to place my new subprogram after all subprograms and before first byte of idata, but game is crashed too. All indexes in subprogram was exactly. in second case IDA displayed "sp-analysis failed".

Where and how can I placed my new subprogram that will be addition to current subpogram research tree?

To add new code, you need to modify the PE header of the exe file accordingly. I'm not quite knowledgeable regarding the procedure (that's one of the reasons why I made a loader instead of patching the file directly) so you're gonna have to find help somewhere else on this one. Seb76 16:36, 28 May 2010 (EDT)

Update to IDA database

Hey again Seb76 :)

After a long time I've come back to your extender, dusted off my copy of VC Express, and decided I'd have another go at doing some UFO modding (don't ask how the first attempt went; it's not pretty! :p )

I'm assuming you've probably updated the IDA database since last time I asked. Would be extremely grateful if I could get the latest version.

Thanks for all the hard work, staring at assembly code all day is no joke! --K9wazere 18:07, 6 June 2010 (EDT)

Arf, didn't realise I could send you an email, so this new section on your talk page is a bit redundant now :p Oh well, maybe someone else will want the file too!

Line of Sight Origin Points

Hiya.

A while back you mentioned the co-ords for the firing point origin. The zpos is calculated according to the unit's effective height, and the x/ypos co-ords come from look-up tables depending on which way the unit is facing.

I was wondering, are these same two tables used for the purpose of line of sight? And by any chance could you find the formula for the initial LOS zpos?

Any help would be appreciated, as usual. There are many other obvious questions around this issue (such as where the end point for these lines is), though the origin would be a good start. - Bomb Bloke 07:44, 24 June 2010 (EDT)


Training Stat Request

Hi there.

In the Equipment screen where the Weight and TUs are displayed during battle, would it be possible to also include the current unit's number of Reaction shots, Hits, Psi attempts and (possibly) Throws? Possibly along the bottom in a horizontal string where there's room?

Source code problem

Greetings. Thanks so much for all the work you put into this. You really improved on an already great game. Now I want to take a whack at the source code, but I've run into some problems. I downloaded the 3 April 2010 source code file and tried to get it to compile. It complains about several missing files:

1>  moreobjects.cpp
1>c1xx : fatal error C1083: Cannot open source file: 'moreobjects.cpp': No such file or directory

So it seems to be missing moreobjects.cpp. Did this file get left out of the zip?

Thanks.

(Edited question because I figured out the directx file I was missing.)

Okay, so just scratch all that. It appears moreobjects.cpp was some leftover cruft that isn't actually used. Well, at least, not to the point I've gotten.  :)

So to document for anyone else, just remove moreobjects.cpp from the project. And for all the dx3d stuff, you'll need to download the DX SDK from here and install it. It should produce a directory of includes. You then need to go into the VC project and add that include directory (if it doesn't do it automatically for you).

After doing all all that, I got the project up and going. Thanks again for providing the source! -- Nadir 01:26, 8 June 2011 (EDT)

UfoPaedia Craft Weapons' Accuracy Bug

Seb, Thanks for making such a useful utility. Not only has it made the game more enjoyable for me but looking at your source code for the loader has helped me to understand assembly language much faster than if I were to attempt it on my own. I was able to track down the problem byte for the craft weapons in Ufopaedia. Feel free to include this into your loader if you like:

.text 45B2CC: 0F BF 4E 04 // movsx ecx, word ptr [esi+4] Regards, Tycho 22:40, 7 January 2012 (EST)

Using Extender in Steam (seamlessly)

Hello,

Do you know of any way for me to use your XCOM extender through Steam, without using a separate executable? My games are on Steam precisely for ease of use (double-click on game, game loads), and digging through executables is the thing I'd like to avoid. (Nor is "add the extended executable to Steam" acceptable.) Rampancy 00:01, 17 January 2012 (EST)

I'm not familiar with the Steam setup. If my understanding is correct, the usual Steam setup is to run the game through DOSbox. UF0loader doesn't work for DOS (only with the CE version). Check and see if you have a UFO Defense.exe in the same folder. IF so, you could use the loader and make a new shortcut to the UFOloader program (which will then load UFO Defense.exe)Tycho 04:54, 5 April 2012 (EDT)

Steam now gives you the option to run the CE version as an alternative to the DOSBox version. Spike 10:57, 3 September 2012 (EDT)

Adjusting animation speed

Great thanks to making this great software. I have several questions and requests for enhancing this program.

I would like to change the animation speed of cursor, smoke and other objects in battlefield, since I think the animation speed of cursor and smoke are still too fast, and other animations such as internal objects in UFO are extremly fast!(Currently cannot be changed.)

1. Is it possible to adjust or change the animation speed of cursor and smoke? ==> OKAY, I have compiled the source code properly and I am able to change the animation speed of cursor and smoke.

2. Is it possible to adjust or change the animation speed of other objects such as internal objects and alien numbering marks in bottom-right side of screen?

--Xcomplayer 20:51, 24 January 2012 (EST)

I have the same issue, I'm quite fond of arctic bases but the water animation speed is hilarious. -- Splicer 00:33, 01 February 2012 (GMT)

Have you guys tried adjusting the MaxFPS in the INI to something like 60~75? I found that this fixes a lot of the speed issues without the need for the other patches. Tycho 05:56, 22 May 2012 (EDT)

Initial alien bases bug

I have a bit of a problem. I use Steam version of UFO with most recent UFO Extender. Every time I start a new game on superhuman difficulty (I didn't test other difficulties) I get alien base directly on my base (with initial alien bases enabled). So far, I started 5 new games, where first three (1st Europe, 2nd North America, 3rd Island in the middle of Pacific Ocean) all had Alien Base 3 directly on it. 4th game (Madagascar) didn't, while 5th (Europe again) has two alien bases directly on it (I have save from this game for you if you want to check this out). I don't think this was intended?


Music patch problem

I seem to have an issue with the music patch. When I originally installed the loader months ago, everything worked flawlessly. Now however, the game crashes upon entering the main menu. To track down the problem, I enabled first the intro then the language selector screen; no problems with either. In the process, I discovered that the problem is with the music: if I disable it, the game loads properly. If enabled, the loader exits without an error message upon entering the main menu. I did a full reinstall of the game, didn't work. The only other thing I've changed away from the fully working configuration is an upgrade from WinXP to Win7 (VC++2010 is installed).

Here's my [Music] section's contents:

[Music]
Apply=1
Source=MP3
;Source=PSX CD

CD Drive=F

MP3 Folder=SOUND
Battlescape=Battlescape.mp3
Start Menu=Defeat.mp3
Bad Ending=Defeat.mp3
Good Ending=Dogfight.mp3
Geoscape=Geoscape1.mp3;Geoscape2.mp3;Geoscape3.mp3;Geoscape4.mp3
Dogfight=Dogfight.mp3
Mission Debriefing=Debriefing.mp3
UFO Assault=Briefing1.mp3
Base Defense=Briefing2.mp3
Base Attack=FinalBriefing.mp3
Mars=FinalBriefing.mp3
Terror Mission=Briefing2.mp3


All the files exist and all settings here unchanged from the time they worked. I have NO idea what's going on. Additionally, if the patch is disabled, the game only has music in the main menu and nowhere else until Alt-Tabbed out and back at least once.--amitakartok 12:53, 22 September 2012 (EDT)

Try these settings and see what happens:
Battlescape=*Battlescape*.mp3
Start Menu=*Final Briefing*.mp3
Bad Ending=*Final Briefing*.mp3
Good Ending=*Dogfight*.mp3
Geoscape=*Geoscape*.mp3
Dogfight=*Dogfight*.mp3
Mission Debriefing=*Debriefing*.mp3
UFO Assault=*Briefing1.mp3
Base Defense=*Briefing2.mp3
Base Attack=*Briefing1.mp3
Mars=*Debriefing*.mp3
Terror Mission=*Briefing2.mp3
Also, what version of the loader are you using? I am concerned when you say that you get no music without the patch: that should mean the game is using the default midi files (this is the Windows version?). If your not getting music with the midi files, what happens if you run w/o the extender?Tycho 13:19, 22 September 2012 (EDT)
There is MIDI music but it only starts to play after I Alt-Tab out of the game; it stops again during the next Geoscape/Battlescape transition. Without the loader, I get no graphic output whatsoever and it gives up after a few seconds, producing the generic Windows error message about the executable having stopped working. Also, tried your lines above, didn't work.
One more thing: I read it elsewhere on the net that the patch works with OGG files too, once the INI file is edited with proper filenames; it allegedly fixes some music-related crashes as well. I'm trying it out now.--amitakartok 08:06, 23 September 2012 (EDT)
Alright, tried out the OGGs and the loader now crashes at 0x754CD36F with error 0x406D1388. So much for that.--amitakartok 09:21, 23 September 2012 (EDT)

Look at this post in regard to troubleshooting codec problems that prevent mp3/ogg playback: [9]

laser-plasma bug / alien containment

some bugs/suggestions (sorry for my english) >

  • Sectoid first shoot by plasma and my laser rifle firing with plasma (looks like plasma beam, not laser). [shoot at one turn]
Sorry, does this mean: "When a Sectoid fires at you with a plasma weapon, and you return fire with a laser rifle in the same turn, the laser rifle 'bullet' looks like a plasma beam"? Spike 18:07, 21 October 2012 (EDT)

^^^Almost Right,but it happens when i try to fire and sectoid incept turn and fires first ("More Reaction Fire=1")

  • Alien Containment - want to see used/unused space.
  • HQ4x ? DosBox let you to choose much more kinds of resize.

LOAD button like OpenXCOM

how about something like this? http://imageshack.us/a/img94/2927/ufoload.png

ALIEN BASE Wreck Analysis ? :)

there is a little bug :) http://imageshack.us/a/img600/1123/ufobasewreckanalysis.png

Seb76 INACTIVE - Don't post here

To repeat the note at the top of the page, Seb76 is currently inactive, and any comments or questions should be made on the Talk:UFOextender discussion page.