-
Posts
36 -
Joined
-
Last visited
Everything posted by kanet32
-
Good show. Yeah, I think it's probably just a combination of my samples being incompatible with your version, and maybe a change that was made to the executable that's preventing XSHAPE from working perfectly. And, totally with you on the dumb models. XCOM is a lovely game--though I have my quibbles with some bits--which makes those models a bizarre error on the part of the design team. It's especially strange since the models for the female characters are some of the least dumb I've seen in games recently. I'm pre-emptively calling "Bioware syndrome," where they get so many things mostly right that it makes the disastrously bad things look even worse by comparison.
-
Ahh, I think I found your problem. Check in XGGeoscape, the InitNewGame() function. It uses magic numbers. Tsk tsk tsk, Firaxis, very unprofessional.
-
Just a heads up, I successfully changed the way the game chooses a soldier's sex during character generation. I linked to my modified UPKs in this post. So it CAN be done. Strange that your change to the starting year didn't work. I didn't do anything different than you did. Maybe there's another spot where the starting year is chosen which overrides the part in that file?
-
Are you getting crashes using my modified files? I guess the changes in the patch must have been extensive enough to cause incompatibilities between the two versions. If you're using UltraEdit to make the changes, that's what I used, and it has some really bizarre behaviour when hex-editing. Pasting doesn't replace selected bytes, it inserts before them. Also, when you right-click and go to "Insert/Delete Bytes," that function's parameter is taken in bytes, NOT in nybbles, as I initially thought. (And, frankly, as I think is intuitive, since that's how hex is represented.) Thinking back, I'm pretty sure that's why my attempt to swap the 02 00 2C 02 and the 01 00 26 didn't work. I was copy/pasting, assuming it would replace the selected bytes. I really need to find a better hex editor. Anyway, now I've thought about it I'm kind of baffled that they apparently changed 25% to 33% in that patch. I mean, that's hardly a substantial change. If they saw people were annoyed at how few female soldiers there are, the logical thing to do would be to make it 50%. The difference between 25% and 33% wouldn't be noticeable. (And, indeed, wasn't, in my case.) It's kind of like if soldiers were twice as likely to come from Egypt than the other countries, and then they quietly went in and changed it so they were only 1.9x as likely.
-
Haha, yeah, it's a bit complex. See, the way conditionals seem to work in compiled UnrealScript is that the condition is a fixed size, and then the "true part" and "false part" are both preceeded by a (I think little-endian) integer indicating the number of bytes those parts are. That's what the "02 00" preceeding "2C 02" means. It's saying there's two bytes for that part (the true part). I actually tried swapping THOSE as well, but had no luck. Since I couldn't figure out why that didn't work, what I ended up doing was, like you said, changing the == to != (simply change 9A to 9B, those bytecodes can be found in the Native Tables I mentioned in the post you're talking about) to reverse the ratio, or changing the 04 to 02 to get a 50/50 ratio. If you want to save some time, I can just give you my already-modified files. Since DaemonJax has released the XSHAPE tool, you won't have to trust my executable if you don't want. Others might find them handy, too--it's not quite as good as being able to set it yourself in a config file, but I figure these are roughly the ratios people want most. This version fixes the gender ratios to 50%/50%. I included the modified executable, but if you want to play it safe you can also use DaemonJax's XSHAPE tool to get the same result. While if you, like me, want to spite the developers for not making it 50/50 in the first place, this version reverses their bias, making it 2:1 in favour of women. EDIT: Oddly enough, I just looked in the native tables again, just to be sure I was right about 9A/9B, and the operators actually appear twice in there: in one spot, == is F2 and != is F3; in another, == is 9A and != is 9B. I'm guessing it has something to do with the way parameters can be arranged. Different parameters require different bytecodes. (Like maybe if it's a fixed-size constant it gets one bytecode, and if it's the return value of a function call it gets another.) At any rate, 9A and 9B are the ones I used, so if you want to do it yourself that should work for you.
-
Beyond DefaultGameCore.ini - Analyzing the Game Scripts
kanet32 replied to Beknatok's topic in XCOM's Enemy Unknown
Oh, is that true? I hadn't thought about that. I guess it makes sense--maybe it's a debugging facility that most devs don't turn off. You know, when a new test build goes out you lock the hashes for all the game files into the executable so that your testers can't accidentally run the game with bits and pieces of old code. If that's the case, maybe there's a command line argument for some kind of "developer mode" where it doesn't bother with such sanity checks. -
Beyond DefaultGameCore.ini - Analyzing the Game Scripts
kanet32 replied to Beknatok's topic in XCOM's Enemy Unknown
Haha, don't worry, it was made with the UDK, so it's pretty much certain that people will figure out how to use the UDK tools to repack the UPKs and recompile the scripts. They might not want us modding the game, but by using UE3 they basically gave us all the original source code. All we're missing now is essentially compiler settings. Heck of a lot better than the good old days of C&C modding ;) -
Beyond DefaultGameCore.ini - Analyzing the Game Scripts
kanet32 replied to Beknatok's topic in XCOM's Enemy Unknown
Awesome work. That should simplify things enormously. Thanks muchly for your efforts. Gotta say, though, it's kinda sad that we have to do this. Deliberately putting checks in to stop people modding the game? Have those nitwits not been made aware of the massive number of sales of ArmA 2 that DayZ has been driving? -
Is your file really showing Rand(4)? Mine says Rand(3), for a 33% chance. At any rate, I've edited two different versions of XComGame.upk, one which fixes it to equalise the gender ratio and one which just reverses the game's default bias, and it seems to have worked just fine. I'd put them up for people to use, but until we have a tool to automatically update the executable with the correct hashes, you have to edit your .exe manually, which I'm guessing most people aren't willing to do. (And it's even less likely they'll trust a modified executable from some random Forumperson like myself.) In theory, it might be possible to modify it to load a ratio from the config files, so users can edit it themselves. Presumably, the game will load ANY value you put in the config files, so it's just a matter of referencing it in CreateTSoldier(), but that would require either a tool to recompile the scripts, or a better understanding of UnrealScript bytecode than I've got.
-
Beyond DefaultGameCore.ini - Analyzing the Game Scripts
kanet32 replied to Beknatok's topic in XCOM's Enemy Unknown
Managed to make the edit I wanted to make to XGCharacterGenerator, so I thought I'd share some information that helped me. Get UE Explorer and Gildor's decompressor and extractor. Then, like Mashadar said, decompress UPK and use UE Explorer to find which file has the code you want to change. Then, extract the UPK and find that file, open it up in a hex editor, and figure out how to alter the bytecode to make the change you want. This source file for an UnrealScript decompiler gives a ton of detail on the compiled bytecode. The list of bytecode values close to the top doesn't include function calls, like Rand(), or native operators like == and !=, but if you have UE Explorer, the Native Tables in its program directory will give you those if you open them in a hex editor. For reference, when you're trying to figure out the format of those Native Tables files, == is 9A, != is 9B, and Rand() is A7. Presumably, the ExportTable, ImportTable, and NameTable in the UPKs should have the rest of the functions, but in practice I haven't been able to get them to work. I just converted the decimal values to hex, maybe it's a little-endian/big-endian thing? Once you've made the change, you can search for the original contents of the file in the UPK (again, using a hex editor) and replace them with the new contents. Then, apparently, you have to update the file hashes in the executable, but I haven't tried that, yet. Figure I'll wait for Sir Daemonjax's program, rather than trying to figure it out myself. EDIT: Oh, and just in case somebody runs into the same problem I had, they have separate bytecodes for constant 0 and 1, 0x25 and 0x26, respectively. Other constants are preceeded by something like 2C (IntConstByte) or 1D (IntConst). So, for instance, 2 is "2C 02," but 1 is just "26" -
Beyond DefaultGameCore.ini - Analyzing the Game Scripts
kanet32 replied to Beknatok's topic in XCOM's Enemy Unknown
The UDK has something called Unreal Frontend in it, which can apparently cook UPK files. I don't have the UDK installed (and don't want to download and install the whole damn thing), so I can't check if it works with XCOM packages. If you have the UDK installed, you could give it a try. This article talks about it. If it works for you, I'd love to have a bit more detail on how you edited the UPKs. I want to fix the gender ratios so they're 50/50 (the constant appears in XGCharacterGenerator). Hopefully you aren't just relying on the constants being unique so you can search for them, because this one is "3" and that's not quite unique ;)