Jump to content
XCOMUFO & Xenocide

Apoc?d Offsets


DIREWOLF75

Recommended Posts

Ok, so Apoc?d really dont like my Apocalypse version, the offsets for either English or German version completely wrong.

 

So, faithful to my old pseudo-hacker ways using UFOpaedia, Apocutil and Overkill to get the numbers i have figured out alot of the offsets in my version, posted as the part of the Apoc?d config file copy i used for notes, the added numbers are the offsets and sometimes the change from the German version which seemed to be slightly closer to mine than the English one:

 

///German Version Offsets (2)   [UFO2P.EXE]
1374500		;research topics	1372602	-1898
1309824		;research data
1383767		;manufacturing items	
1313588		;manufacturing data	
1319536		;funding data		*correct?
1352664		;vehicle names 		*1352610   -54 
1622648		;vehicle data 		*1616524	-6124
1630124		;vehicle slot data 
1353202		;aequip names		*1353072 -130
1694858		;aequip1 data			1688746 -6112
1694132		;aequip2 data (protection)	1688020 -6112
1694282		;aequip2 data (weapons)		1688170 -6112
1696424		;aequip2 data (other)		1690312 -6112
1692460		;aequip3 data		*1686348 -6112
1357338		;cequip names		*1357225 -113
1626932		;cequip1 data		*1620808 -6124
1628108		;cequip2 data (weapons)	*1621984 -6124
1628960		;cequip2 data (engines)	*1622836 -6124
1629026		;cequip2 data (cargo)	*1622902 -6124
1638812		;market data		*1632688 -6124
1359866		;craft ammo names	1359758	 -108
1395366		;ufopaedia categories	*1390813	-4553
1354895		;building names		1354715?	-180
1357034		;facility names		*1356908	-126
1359247		;org names		*1359121	-126
1404371		;damage types		*1398422?
1691632		;damage mod data	*1685520?
1407840		;unit stat data		*1401716 -6124
1400458		;unit names		*1395215 -5243
1358273		;building functions	*1358150
1323176		;aequip alien artifact
1309034		;craft ammo manufacturers
1303732		;facility data		*correct?
1307488		;UFO loadout
1655192		;alien building defenses
1696916		;aequipset score req data	*1690828 -6070
1697056		;aequipset data			*1690944 -6112
1402374		;difficulty levels		*1396726 -5648
1385192		;agent ranks			*1381689
1406480		;weekly UFO growth data
1305596		;UFO mission data
1323916		;base layout data

 

///German Version Offsets (2)   [TACP.EXE]
3148230			;aequip1 data			3145974 -2256
3147504			;aequip2 data (protection) 	3145248 -2256
3147654			;aequip2 data (weapons)		3145398 -2256
3149796			;aequip2 data (clips)		3147540 -2256
3145832			;aequip3 data			3143576 -2256
3145004			;damage mod data		3142748 -2256
3137992			;unit stat data			3135736 -2256
3150288			;aequipset score req data	3148032 -2256
3150428			;aequipset data			3148172 -2256

 

Now, i would like someone to post the first 5,10 or 20(as many as is needed to make it the only occurence in the file preferably) bytes of data for the remaining offsets so i can locate them(UFO mission and loadout data could be major fun to play around with! ).

My UFO2P.exe is 1 705 790bytes

My TACP.exe is 3 161 594bytes

 

edit by j'ordos: cleaned up post using code tags

Edited by j'ordos
Link to comment
Share on other sites

Hey Direwolf thanks for looking up the offsets yourself! Would you mind sending me your UFO2P and TACP.EXE so I can add support for them in apoc'd? Any other details like cd label/download location, language etc... would be nice too!

 

Anyway here are some bytes :)

 

research data:

00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 32 00 88 13 00 00 01 08 0A 00

 

manufacturing items:

this is just text, starts with dimension probe.

 

Manufacturing data:

01 00 A8 61 00 00 64 00 00 00 00 00 02 00 FF FF FF FF FF 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 70 17 00 00 03 00 14 00 01 00

 

Vehicle slot data:

1B 00 06 04 04 04 01 01 01 01 03 04 02 04 01

 

Aequip alien artifact data:

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 01 01 00 01 01 01 01 01 01 01 01

 

craft ammo manufacturers data:

06 00 0A 00 00 00 03 00 03 00 03 00 05 00 05 00 00

 

UFO loadout data: (long)

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 02 00 00 00 04 00 00 00 00 00 00 00 04 00 00 00 01

 

Alien building defenses data:

04 00 00 00 00 00 00 00 00 00 00 00 06 00 00 00 0C 00 00 00 02

 

Weekly UFO growth rate data:

09 00 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02

 

UFO missions data:

09 00 08 00 07 00 01 00 01 00 02 00 07 00 07 00 0B 00 FF FF FF FF

 

Base layouts data:

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 01 01 01 01 01 01 01 01 02 01 01 01 01 01 01 01

 

Hope these are the defaults.

Link to comment
Share on other sites

Sure no problem, just drop a pm where i should mail them to and ill do it.

 

Now for the problem of, where do i have the CD and where?s the box(running from HDD mounted ISO since a few years back). Oh found the cd at least... Readme textfile says version 1.00 and on CD it says "English"(and the game is totally in English), CD has almost the start menu background(yellow fire in blue cross) except in red/black/white.

Game bought here in Sweden within a few months of getting available(dont know how long thats from actual release though).

While trying to locate offsets i tested d/l a copy of the collectors edition, and the executables at least had the same file size as mine.

 

 

Manufacturing data, UFO loadout, Alien building defenses data, those sequences are not findable as written.

 

Ok then:

Research data seems to be same offset as German version...

Manufacturing items are at 1380339

Vehicle slot data is at 1624000

Aequip alien artifact data seems to be same offset as German version...

Weekly UFO growth rate data is at 1400356

UFO missions data & Base layouts data seems to be same offset as German version...

Craft ammo manufacture data seems to be same offset as German version...

 

Oh and by the way, when saving changes, it ONLY saves CHANGES? If thats the case i can start using it as it is now...

 

Correction, it seems manufacturing data uses the original German offset, you either just mistyped a bit or the files dont save the data identically, hmmm, ah there, my file has an additional 2 "FF" bytes before the "00" byte.

Ok, the UFO loadout also seems to be in the right place, just that where your data has 4s, my has 5s, an extra spitter and anthropod for my enjoyment i guess. :)

 

Alien building defenses data is definetly not at original German offset(that would put it in the middle of sound file pointers) and there is no occurrence of the data sequence as written at all.

 

Looking pretty good. =)

Link to comment
Share on other sites

Suggestion, if you?re going to tinker with it anyway, perhaps under "Funding", add all organisations?

 

Also, getting some lock ups from the program sometimes when using the save command(and i cant figure out what caused it), and it requires reboot because while interface works, and start menu "works", the lock up seems to prevent any and all HDD access so cant start anything, including the commands for logging off or shutting down...(yes dont we all just love the marvel of logics that is windows)

 

Will be interesting to run the mod that i think is mostly done by now, and see if its easier or harder than normal. :)

Edited by DIREWOLF75
Link to comment
Share on other sites

Alien building defenses data is at 1649068

Silly me, it seems i had ran Apocutil with 125% aliens settings on the file, was a few months since i played so had totally forgotten it.

 

(Note though that the uploaded files are the originals without error, including UFO loadout that also isnt upped 25%. )

Edited by DIREWOLF75
Link to comment
Share on other sites

Suggestion, if you?re going to tinker with it anyway, perhaps under "Funding", add all organisations?

I'd love to but I don't know where to find these yet. For now you can only edit other organisations' funding in savegames.

 

Also, getting some lock ups from the program sometimes when using the save command(and i cant figure out what caused it), and it requires reboot because while interface works, and start menu "works", the lock up seems to prevent any and all HDD access so cant start anything, including the commands for logging off or shutting down...(yes dont we all just love the marvel of logics that is windows)

Strange, make sure the file isn't read protected? (though if they were read protected apoc'd would probably fail on startup) Does it happen on a particular section or randomly?

To answer your previous question, apoc'd saves the entire section you're viewing, even if no changes were made. Though that shouldn't cause any damage whatsoever.

 

Anyway I attached another version of apoc'd.cfg which replaces the german offsets with yours for anyone to use. Hope they are correct.

 

edit: attachment removed, get the one below instead.

Edited by j'ordos
Link to comment
Share on other sites

I'd love to but I don't know where to find these yet. For now you can only edit other organisations' funding in savegames.

Ah ok, ill see if i can find them then.

Hmm i see the problem, those numbers gets a big chunk of random to them each game start..., but LOL thats evil, on Easy and Medium, the government will often start with less income than X-Com, with higher levels of money on the other 3 difficulty settings.

Still, at least its big numbers, might be possible thanks to that... Hmm maybe not, the random part is annoyingly large(+-35% perhaps?)... Oh well never mind, ill look into it but no promises, as it really do seem quite troublesome finding it.

 

Strange, make sure the file isn't read protected? (though if they were read protected apoc'd would probably fail on startup) Does it happen on a particular section or randomly?

Have only happened while under Cityscape sofar(ie not in Battlescape)... Mmm those i recall, happened while increasing skill hours for researching UFOs, once while changing UFO missions, once while changing personal armour values... As i said, i havent been able to see a pattern in it, could be its just some driver on my computer disagreeing with the program...

 

Edit: And now it just "crashed" for 1st time in battlescape, and i can still write this as i had it running at the time, and torrent client is still running fine, but Apoc?d is unrestorable and uncloseable, and i cant start ANY new programs nor can i in any way access any files myself(but torrent client still seems to do fine).

 

Anyway I attached another version of apoc'd.cfg which replaces the german offsets with yours for anyone to use. Hope they are correct.

So do i as im using them now(game is still runable and doesnt seem to have any problems at least)! But they sure look correct overall. Only numbers that seems odd are the ones after "Dimension Shifter" under "Market".

 

To answer your previous question, apoc'd saves the entire section you're viewing, even if no changes were made.

Yeah, figured that out from the difference in time it took to save, from near instant to 5-6+ seconds...

 

Anyway, many thanks for making the program and figuring out as much as you have! Many of these values are things i have wanted to get at for years, literally. Finding the vehicle weapons always had me stumped due to the way accuracy is stored...

Edited by DIREWOLF75
Link to comment
Share on other sites

Any data you can tell me about is most welcome!

Sorry about the crashes, is anyone else experiencing this? Otherwise the freebasic port might fix it, once it's done that is. :)

 

You're right about the market section, I spotted a bug that'll break it for any version other than the default english one. I'll release a fix soon! (there was a mistake in the import function anyways)

Link to comment
Share on other sites

Seems the funding of the other organisations is located at the same spot xcom funding is after all. But I don't know how it works yet.

Starting at decimal offset 1315944.

08 00 00 00   00 00 00 00   E0 22 02 00   60 67 01 00

Don't know what the first two are but the last two are xcom's funds&funding. The alien 'organisation' follows this pattern (though it's 0 by default) but it seems to be incorrect for the other orgs. Filling the area with '00' gave rather inconclusive results (government funding was unchanged for example) but filling it with 30 did affect every org so it's definately there. Will need to look into it.

Edited by j'ordos
Link to comment
Share on other sites

Any data you can tell me about is most welcome!

Hehe, im not sure what else there is to find! :wacko:

 

Seems the funding of the other organisations is located at the same spot xcom funding is after all. But I don't know how it works yet.

Starting at decimal offset 1315944.

Wow thats fast...

 

Will need to look into it.

Im not really up to your level, but ill see if i can find something out. Those results indeed sounded a bit odd...

Link to comment
Share on other sites

Seems the funding of the other organisations is located at the same spot xcom funding is after all. But I don't know how it works yet.

Starting at decimal offset 1315944.

08 00 00 00   00 00 00 00   E0 22 02 00   60 67 01 00

Don't know what the first two are but the last two are xcom's funds&funding. The alien 'organisation' follows this pattern (though it's 0 by default) but it seems to be incorrect for the other orgs. Filling the area with '00' gave rather inconclusive results (government funding was unchanged for example) but filling it with 30 did affect every org so it's definately there. Will need to look into it.

Obviously the last two are funding levels (hence the 4 byte "word"). The first and the second words probably only use the low bit but what they stand for is unknown. That one with the 8 sounds interesting though. Could that be the organization pointer perhaps? (Just a guess off the top of my head, as I haven't done any code diving in Apoc for a while). :)

 

- Zombie

Link to comment
Share on other sites

Lemme post some more data, for easier brainstorming :)

 

05 00 00 00   00 00 00 00   00 00 00 00   00 00 00 00

This is the alien funding which comes directly after xcom's funding I posted earlier. It works the same: some unknown byte up front (editing had no immediate effect) and the funds&funding at the end. Editing those worked fine (checking savegame funding in apoc'd)

 

00 00 00 00   00 00 B8 0B   00 00 02 0E   20 4E 00 00

This is the following piece of data which should be the governement funding but it doesn't work as expected. It's funds would be 235.012.096 (00 00 02 0E) and it's funding 20.000 (20 4E 00 00). Editing the last 4 bytes (funding) did affect governemt funds, but there's something else that gives them some 'base' funds as setting it to 0 didn't matter. Perhaps the buildings they control?

 

and to be complete here's the row that follows governemt funding:

00 00 00 00   14 00 01 00   88 13 00 00   02 10 10 27

Edited by j'ordos
Link to comment
Share on other sites

Correction on my earlier offsets, Building Names is 1354706, not 1354715. Apart from the bug you mentioned, havent found any other problems sofar though.

 

00 00 B8 0B 00 00 02 0E 20 4E 00 00

I would say you have values 3000, 2,14,20000 there...

 

but there's something else that gives them some 'base' funds as setting it to 0 didn't matter. Perhaps the buildings they control?

Sounds a possibility. Hmm well its not number or type of buildings alone, Medium gets govt 1 office building, 1 luxury apartments, 4 warehouses and 3 slums while it seems to have lowest funding, Superhuman seems to have highest funding but only gives 1 additional warehouse. So values for individual buildings i guess then.

 

Unknown 96 in Buildings section in Apoc?d perhaps? Looking at Medium level, Apartments have 4-6K, Luxury Apartments 7-8K, Corporate HQs 14-18K, Senate 53.5K, a shopping mall 46K, Offices 8-10K warehouses around 2K, Slums around 1K...

 

14 00 01 00 88 13 00 00 02 10 10 27

20,1,5000,0?,2,16,10000 maybe?

 

some unknown byte up front (editing had no immediate effect) and the funds&funding at the end. Editing those worked fine (checking savegame funding in apoc'd)

If you change that byte for the govt to the value of either XCom or Aliens, any change? My thought was that there is a byte somewhere to determine what type of funding/funds it is. Ie, why govt seems to work different from XCom...

 

Hmm the building settings arent in the ufo2.exe are they? Ah yes, the citymap files...

Ok tested changin ownership of Senate building to Solmine, most definitely had a major effect on Govt funding, 64K was lowest before change, 32K was lowest after. Solmine also seemed to get a healthy boost to its income value so maybe all except XCom and Aliens work like this?

Link to comment
Share on other sites

None of the "Unknowns" seem to directly influence income for owning organisation.

However, Building Function is almost certainly confirmed as having effect.

Not sure how its done though, changing ownership of Senate made a big difference for both loosing and receiving it, while changing a bunch of the other Govt buildings to "Senate" in function seems to have had a smaller impact. Changed a total of 6 buildings to Senate and highest funding on starting Medium level went from 113K to 233K.

 

Makes me wonder if there is a random modifier for building "worth" to income based on difficulty level and building function.

Link to comment
Share on other sites

Not sure how its done though, changing ownership of Senate made a big difference for both loosing and receiving it, while changing a bunch of the other Govt buildings to "Senate" in function seems to have had a smaller impact.

Good work Dire! I found out the size of the building (Map position X1,2 & Y1,2) also affect the funding, which probably explains the difference (the senate is quite a large building). Now to find out how much each building type gives per 'tile' :)

In the meantime I released a new version of apoc'd though, fixing that market bug and adding the other organisations to the funding section. Get it here: http://www.xcomufo.com/forums/index.php?showtopic=242028524. I couldn't be bothered to change the code to allow for three different versions of xcom apocalypse though, so you'll have to get this seperate cfg file instead for now.

 

Let me know if something doesn't work right!

edit: btw, that readme where you got the version number, does it also have a date?

apoc__d.zip

Edited by j'ordos
Link to comment
Share on other sites

I found out the size of the building (Map position X1,2 & Y1,2) also affect the funding, which probably explains the difference (the senate is quite a large building).

Ah ok, "just" a matter of finding where tile values are stored then... ;) :P

 

edit: btw, that readme where you got the version number, does it also have a date?

Yup:

X-COM ® Apocalypse Version 1.00 11th June 1997

Link to comment
Share on other sites

Unknown 96 in Buildings section in Apoc?d perhaps? Looking at Medium level, Apartments have 4-6K, Luxury Apartments 7-8K, Corporate HQs 14-18K, Senate 53.5K, a shopping mall 46K, Offices 8-10K warehouses around 2K, Slums around 1K...

 

Unknown 96 is the building's maintenance cost. It only works in the savegames section though (and after waiting for the next week update, or perhaps day, didn't test that), editing it in the buildings section didn't have any effect. Guess they are somewhere in the exe too for some reason. This one is randomized though.

Unknown 98 seems to be the revenues per tile, though not sure what formula it uses. A building size of 1x1 (X1 = 84, X2 = 85, Y1 = 84, Y2 = 85) with unknown 98 set to 1000 and a building type of Corporate HQ gave a funding of 13.000. (used the Technocrats 'The New Empire Tower' in the superhuman level for testing purposes as it is their only building and thus easy to check when their funding was set to 0)

Any size smaller than this gave a funding of 0 instead. Again this only works in the savegames section.

 

edit: Unknown 99&100 seem to influence funding as well, 99 in terms of costs and 100 in terms of profits. Savegames only as usual.

 

Yup:

X-COM ? Apocalypse ™ Version 1.00 11th June 1997

Thanks, same as here then though :)

Edited by j'ordos
Link to comment
Share on other sites

  • 2 months later...
Not sure how its done though, changing ownership of Senate made a big difference for both loosing and receiving it, while changing a bunch of the other Govt buildings to "Senate" in function seems to have had a smaller impact.

Good work Dire! I found out the size of the building (Map position X1,2 & Y1,2) also affect the funding, which probably explains the difference (the senate is quite a large building). Now to find out how much each building type gives per 'tile' :)

In the meantime I released a new version of apoc'd though, fixing that market bug and adding the other organisations to the funding section. Get it here: http://www.xcomufo.com/forums/index.php?showtopic=242028524. I couldn't be bothered to change the code to allow for three different versions of xcom apocalypse though, so you'll have to get this seperate cfg file instead for now.

 

Let me know if something doesn't work right!

edit: btw, that readme where you got the version number, does it also have a date?

I've been wanting to change stuff in Apocalypse for ages, but until now I didn't have the means to do so. This config file (and apoc'd, of course) is exactly what I needed! Thanks a bunch, j'ordos. I'm going to have fun replaying the game with a bunch of changes to make things harder. :)

 

I think you should reconsider changing the code to check for this version as well though. I got my current copy of Apocalypse from Steam and it seems to use the offsets you have posted here. I expect that Steam will be one of the most common sources for the game from now on, and so I'm sure other people will be looking for a version of apoc'd that uses these offsets. Of course, I don't really know how hard it is to set up the autodetect stuff for a third version. Maybe it's a real pain...

 

Anyway, thanks again.

 

- edit -

I noticed something strange while I was working on my mod. The "weapon set score requirements" for Superhuman seem to be messed up. (level 2: 28000, level 3: 3735597, level 4: 2687977, level 5: 0, ...). Looking back at the values for other difficulty levels, it appears that there is a problem with the offsets.

 

- 2nd edit -

The BattleScape editor appears to have the correct offsets; but not the CityScape editor.

Edited by karadoc
Link to comment
Share on other sites

  • 8 months later...
- edit -

I noticed something strange while I was working on my mod. The "weapon set score requirements" for Superhuman seem to be messed up. (level 2: 28000, level 3: 3735597, level 4: 2687977, level 5: 0, ...). Looking back at the values for other difficulty levels, it appears that there is a problem with the offsets.

In the config file, change value 1690828 to 1690804, seems i did a bad count originally or something (and i really wonder how i could miss it later...??? ).

The level 2 number you see on Superhuman is the one that should be at lvl 8.

 

 

 

 

 

j'ordos, a question, how does the weapon sets actually work?? There are 8 alien weapon sets(apart from "built in" ones) but only numbers 8 to 12 used while there?s 12 listed for other units but the numbers used are just 13-18...

And, what happens if the damage type of the Tracker gun is changed? Would be fun to add it as a plasma rifle or something. :)

Link to comment
Share on other sites

I assume you're talking about the weapon set fields in the unit stats section? These are only used by the aliens that have built in weapons, all others receive equipment according to the equipment sets section based on current tactical score, their weapon set number is not used though the numbers do work if you assign them to one of the aliens with built-in weapons. I have been unable to edit the equipment assigned to each number, I assume they are hardcoded. In short: the 'weapon set' fields in the unit stats section are completely unrelated to the 'equipment sets' section.

I'm guessing they were used before score based equipment was done to test the game, and never removed afterwards.

 

Never tried to alter the tracker gun, do let me know how it fares!

Edited by j'ordos
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...