Jump to content

Ever want to try playing as the aliens in Apoc?


Tain

Recommended Posts

Ok first off: This works only for saved tactical games, not cityscape, no strategic stuff. It will only work on the game you edit so i will refer to it as a "mission".

 

Secondly, you will need a hex editor. I can hear the groans already, but its necessary.

 

Ok lets begin. To make it a bit easier, i suggest you get a copy of the programs XED and something that can edit research. i suggest "midnight editor" as its the easiest to manage.. It will come in handy.

 

 

1. Pick a cityscape save you are willing to sacrifice for the cause. Once selected, use your research editor to set all live aliens and autopsies to researched. This is important, otherwise you will not be able to attack with poppers, spitters, psimorphs, multiworms, hyperworms, or alien eggs.

 

2. Once done, load the eddited game and get into a tactical mission of your choosing. Choose well, because this will be the mission. Equip your agents as you see fit, but remember- you will be facing them! So don't load them down with too much butt kicking stuff if you want a fair chance. Especially if this is early in the game.

 

3. Once the tactical map loads, save the tactical game. I use slot 10 to make it easy to find. Once saved, exit Apoc.

 

4. Load up XED. Select the saved Tactical mission (slot 10 for me). You will see a list of ALL units on the map, friend, foe, and neutral. Go through the Aliens one by one and select Heal. (H button). You will notice that the aliens side switches to X-com. This is correct. Do this to all the aliens. If you did it right ALL units shown will be shown as X-com. Exit XED and save changes.

 

5. Heres where it gets mean. Open up your hex editor. Use it to open up your saved tactical game. (the same one you modded with XED) Find your agents names by searching for them. There are 2 values you have to change on each agent. the first switches your agents team, the second turns on his AI. To find the location of the first value to change, use this method. Select the first hex value in the agents name. Including it, count 20 values (the max for a name). Once you hit 20, count 7 more. at this location, the value should read 00. change it to 01. For the second value to change, just count 4 values to the right of the value you just changed. It should also say 00. Change it to 63. Here is an example of it, done to an agent named "Jurgen".

 

Before changed values: Note "4A75" is the start of the agents name, it will be different for each agent.

 

4A75 7267 656E 0000 0000 0000 0000 0000

0000 0000 0000 0000 0000 0000 0000 0000

 

 

After Changed values:

 

4A75 7267 656E 0000 0000 0000 0000 0000

0000 0000 0000 0000 0000 [01]00 0000 [63]00

 

 

(i bracketed values that were changed so you can see them, do not type brackets)

 

Repeat this for every X-com agent in the savegame, and then save the file. This will set all your agents to be the "bad guys" and give them a rather nefarious AI to use also.

 

 

WARNING: This is advanced stuff, and attempt it at your own risk. I am not at fault if you mess up and your computer goes Chernobyl.

Link to comment
Share on other sites

Roughly Bombloke. The easiest way to find the soldiers for me is to to simply search for their names or their hex equivalents. The values follow the first occurance of their names in the file always. As for a program being rigged to do it, it certainly could be done, it would just require someone with familiarity in that type of programming to do it.

 

My method is actually kind of a work around way to doing it, as you never technically leave the X-com "side". (ie when the aliens move it will say "Turn X side: X-com" etc, and it will say it is the alien's turn when X-com moves. This is not a problem except for 2 things, the hyperworm spawns and brainsucker launchers. Both hyperworms and launched brainsuckers spawn enemy. (because they are spawning to the "alien" side, which is now occupied by the AI X-com)

 

It is still my hope that there is a trigger somewhere to set the true alien side to player:human. I have yet to find this however, and this is the only method i have found that gets results currently, and it works rather well. I have a UFO mission saved done this way if you are curious as to how it works, or want to try your hand at edditing it yourself. Just i have no real webspace so i would have to send it via email.

Link to comment
Share on other sites

Hmm that could be kinda difficult, seeing as the way i find them is by searching the actual agents name.

 

 

What about adding an identifier to the agents? like starting all their names with XCOM or some other easily picked out value?

 

 

 

As to how i worked it out? Well the first value, the one that sets side allegience, i already knew of. 00 being X-com 01 Being alien. After being told that, i searched for the other values myself, and found most by exactly that- trial and error.

 

For example, i found the ai value (63) by saving a game with a single agent right before, and right after he was brainsucked. After comparing the two save files in hex for some time looking for any other values that changed between the pre-sucked and post-sucked agent, i found that one. Finding values can be really annoying, but also quite rewarding in this case. Before i found the 63 value, the agents would not move around, they would only fire out of reaction, and would still show up in your squad window.

Link to comment
Share on other sites

For example, i found the ai value (63) by saving a game with a single agent right before, and right after he was brainsucked.  After comparing the two save files in hex for some time looking for any other values that changed between the pre-sucked and post-sucked agent, i found that one.

WOW! A true detective! Nice work. I admit I would never muster the will (nor the knowledge)... :Thumbsup!:

 

And yes, I agree it would be MUCH easyer if one would find a switch between the X-COM and the aliens. But it wouldn't be anywhere among the units. Perhaps somewhere in the loading of the mission? Please note that I don't really know what I'm talking about...

Link to comment
Share on other sites

Naming all the units as "XCOM"-somethng would be tedious... There must be a way to work out where the values would go, but I dunno if Apoc saves formats are documented.

 

However, I guess the soldier trooper blocks would be fairly easy to spot. They would all be the same size, and mostly filled with the same values.

 

I reckon the best solution would be some sort of loader, that monitors memory and patches it as the game is played... That would fix the brainsucker/hyperworm problem, as the loader would spot the incorrect values and flip them on the fly. I can program, but I'd have a begger of a time working out how to write something like THAT! A few changes to a save file I can manage, though. :blink:

 

I actually have my copy of Apoc with me now... I might take a look and see if I can script something up tonight.

 

Edit:

 

Because I like to work out loud, this thread can be my sketch pad. I have X-Com and internet access at the same time! w00t! :)

 

Anyway, I downloaded XeD and used it to convert a tactical game, changing all aliens to X-Com units. I'd backed up the original game, so I wrote a quick program to compare the two. It spat out this:

 

Mis-match at 139000 : 0 1

Mis-match at 139004 : 0 99

Mis-match at 139006 : 5 1

 

Mis-match at 140180 : 0 1

Mis-match at 140184 : 0 99

Mis-match at 140186 : 5 1

 

Mis-match at 141360 : 0 1

Mis-match at 141364 : 0 99

Mis-match at 141366 : 5 1

 

Mis-match at 142540 : 0 1

Mis-match at 142544 : 0 99

Mis-match at 142546 : 5 1

 

(More or less, I divided the notes to groups of three. The first column of numbers is the edited version, the second column is the original).

 

Now, my program uses decimal as opposed to hex. 5 and 1 when coverted to hex are 5 and 1, but 99 converts to 63. Which is what you'd expect. However, three bytes got edited by XeD... I'm not sure what the third change is supposed to achieve. (I have to check out what XeD does, so I can remove the XeD editing from the steps and just have one magic side-swapping program). So the alien conversion essentially does the troop conversion in reverse (I guess the XeD writer didn't figure to leave the AI and ownership bytes alone, or something).

 

Edit 2:

 

Ok, I've downloaded a hex editor (don't ask why I didn't already have one, I use a lot of machines... :) ), and checked the locations my output mentioned. And what do you know? The aliens are strored in much the same way as the soldiers. Great, eh? Name format and everything.

 

Edit 3:

 

Each unit name in the save file seems to have a prefix of these hex characters:

 

FF FF xx 00 ...

 

Where xx is a number that goes up for each unit. I'm currently trying to work out the number of the first unit (it does not seem to be 00 or 01). The byte doesn't go up by one per unit, it seems to vary greatly, according to the type of unit. The only groups I noticed in my vague checks were androids, soldiers, and aliens.

 

Anyway, with any luck that should make it easy to scan the file for units. :)

 

Edit 4:

 

I just spent an age scanning through a mission file. For some reason, there seemed to be many more troops in the field then I sent... And when I finally got through the list, I found no aliens!

 

Ironically, it turned out I was busy raiding the cultists in that save. Figures.

 

However, it seems soldier data appears in the same position in each save, if I'm right. Then each soldier is listed every 1180 bytes.

 

Simple.

 

I'll write a program to do the work, now... I don't know how well it will work, but I think I have enough info now.

Link to comment
Share on other sites

Ok, the tool is complete enough to be useable. Could be better, but it's good enough for now. You can download it from the UFO section of my website (which you can find in my sig).

 

The program does the hex editing for you, and even handles that stuff XeD was supposed to do. A very simple program to write, but quite cool, nonetheless. :blink:

 

Yet more post editing:

 

I tried to test my download, and low and behold I discovered a few things:

 

- 50megs can suck, just like any other free internet hoster.

 

- 50megs doesn't seem to want to let me host zip files. Or at least, it won't let people download them. So I converted it to rar format (goto Rar Labs to get WinRar).

 

- Download resumers such as GetRight also seems to stuff up 50megs, so don't try them on it.

Link to comment
Share on other sites

Oy, 1180 bytes per soldier? The original X-com battlescape unit table only needed 138 per unit (add 42 for large units). Either you've got lots of large data types or the unique inventory really takes up a lot of space! A mix of both wouldn't be too surprising.

 

Is there any identifier for each soldier that relates the soldier to a physical soldier in the cityscape? The original X-Com battlescape units were virtual and the actual soldiers were stored separately. The Geoscape soldiers are what the battlescape virtual units are based off whenever the battlescape mission is created, and the experience (or death) gained by the battlescape unit is then applied to the geoscape soldiers. All battlescape units are discarded at the end of the mission, unless they're linked to a unit in the Geoscape soldier file. I wonder if the same holds true for Apocalypse? If it is, would the cityscape soldier be able to be converted into a non-X-Com unit?

 

Large units and defense turrets are also something worth having a look at sometime.

 

Ugh, I babble again. Next NKF will be referring to himself in the third person.

 

- NKF

Link to comment
Share on other sites

Those 1180 bytes include a lot of null bytes. Remember, though, that I play real-time games - which makes me wonder if my program will work on a turn based save file. I guess it would; I think you can save in mid-movement in Apoc TB mode, too, can't you? :blink:

 

In real time, a troop can be DOING something when you save the game, as opposed to in UFO when he's guarentied to be standing still. Right? All that needs to be stored, so I guess it goess somewhere in those 1180 bytes.

 

There seems to be a byte which is two bytes in front of the name of a given troop, and at the moment, I believe that is the in-game identifier.

 

*runs a test*

 

Ok, it seems the identifiers used in the tactical games don't vary too much. That is to say, I started a new tactical game with the same squad I was using before, but put them in a different order this time around - their order in the tactical save file, as well as their 'unit IDs', did not change. Maybe that order is dictated by their order on the craft they are assigned to?

 

Some things I haven't tested are what happens when you run this thing on a base mission (I presume turrets are set as X-Com units controlled by AI, so my program would change them to alien units with no AI if I'm right (that is, they won't do a thing)). I dunno what it does to civilians either.

 

*pulls out the hex editor*

 

*runs another test*

 

Ok, this time, I did a base raid. I took one of my soldiers (an android I called Tin Woodman) and swapped his identifier with an enemy grunt, and flipped the AI/unit control switches so's I could move the grunt, and Woodman would act like a proper enemy. I managed to get all the troops to evac the level (the enemy all seem to spawn in one area, so the grunt I took was under heavy fire - it was tricky to get him off the map in time!). The end game score showed I both gained and lost equipment, so I guess I 'lost' the gear on Woodman, and gained the gear on the grunt.

 

However, back in the cityscape, Tin Woodman flew home with the rest of my squad, still equiped with the exact same gear. So I guess there isn't that much of a link. I dunno.

 

There's always a chance the byte I figured was the unit ID, isn't that at all - but that would surprise me. Truth be told, though, I know little about the format.

 

However, it makes me wonder - can you mind control a unit, and make it exit the level? It seems you might even earn their kit for your trouble. Too much effort for me to test THAT one out, though. :)

 

Edit: Incedently, I guess big units get 1180 bytes just like any other, as one of the two main save files I used for testing was the last map. There were nearly fifty units there! Anyway, many of them were Psimorphs/Megaspawns, and they all joined X-Com quite happily. That, and the gap between units alwasy seems to be 1180 bytes. :)

Link to comment
Share on other sites

Your program works great Bomb Bloke, thanks much for it! Makes things so much easier, and hopefully will allow others to make use of this. The research edit still needs to be preformed though correct?

 

 

 

Also, i am interested in any theories on how to fix the brainsucker launcher problem. That one has be rather stumped.

The only thing i could think of earlier was hoping to find some kind of player:side value, and swap sides that way. Seeing as when a turn goes by, it will say something like Side: Aliens Player: Computer. I am hoping there is a value somewhere that defines Side:Player and that it can be changed. If we can set Side:Aliens to Player:Human, this will fix the brainsuckerlauncher/hyperworm problem, and make all the individual unit editing unnecessary.

 

 

And once again, cheers for the program Bomb Bloke, its a huge step forward, and it rocks!

Link to comment
Share on other sites

When an alien is created, it would be added to the game with it's AI enabled and it's control set to alien. Which means that you (the player) have no control over it.

 

Therefore, the way to fix this would be to edit the game files themselves, so that they read a #63 as a 0, and vice versa. Thus all aliens, including new ones, would be treated as yours, and all X-Com agents would also be treated as aliens. Given that this would require extensive reading of the machine code that makes up the game, I can officially say that such an edit is beyond me. :blink:

 

What I was think was to make my program spot the difference between aliens and humans, or just to allow individual unit edits. That way, the problem could be fixed by saving the game and re-running the editor whenever new aliens are placed in the map. It would be annoying to quit out all the time, but I reckon that would be the best that I could come up with.

 

The best solution would be to write some sort of loader that stayed in memory, and kept track of the units as the actual game was played. This would spot any new units as they were created, and it could flip their stats on the fly, just by working in the background. I gather such a tool would be simple to write, but I've never tried anything like it, and wouldn't know where to start.

 

As for the research, yes, you do still need to research all the stuff. I might later throw something into the program that handles that, but I doubt it.

 

Incedently, I didn't do many tests, but I was just thinking... Say you start a map with an Antropoid carrying some brainsucker pods, wouldn't they instantly hatch and try to attack their unfortunate carrier? I reckon it might be tricky to stop those things hatching instantly, even if I did find a way to keep them on the aliens side (as brain sucker pods are not 'units', they simply spawn brainsuckers whenever they get close to one of 'your' units).

Link to comment
Share on other sites

Actually Bomb Bloke, the suckers do not hatch, and do not attack you. They can somehow still tell you are not human, and will leave you alone. They will just run around and be on the opposing team. They won't hatch unless you die carrying them, or launch them near a human (species human, not human controlled). So somewhere there is a value that defines that also.
Link to comment
Share on other sites

Is that so? Interesting. Well, that's a good thing - it'd suck to have them spawn instantly and take all your units over.

 

Did Androids hatch the suckers? I remember the suckers used to chase the androids around. They seemed to ignore the civilians, though. I don't know whether civilians hatched them or not.

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...