Nisk
Mortal
Posts: 15
|
Post by Nisk on Jul 28, 2013 18:28:10 GMT
Hey. I'm newly registered here, although I've been observing the place for years, ever since I discovered the All Ghosts mod. In particular, I've been trying to see what people have accomplished in modding the game over the years. It makes me sad that this game has been abandoned when there was so much more the developers had originally planned.
Anyway, what I'm wondering now is what we know and what we don't know about modding and editing. I've seen plenty of interesting stuff while creeping through this forum, but I don't remember everything. Does anyone have a compact list of stuff we've uncovered, or advice on how I could compile such a list myself?
In particular, I'm wondering about:
-an editor: Have all pleas for an editor just been ignored by whoever owns the game now? Also, I saw somewhere that there was already an editor in ghost.exe, but we couldn't figure out how to access it. Is that confirmed or just a myth? Also, I remember reading about plans to decompile the exe, but I assume nothing came of that? Is that even possible to do with an exe?
-the BSP files: Do we know of any specific differences between the BSP files for animations, characters, levels, and scenarios? To get at the actual data for all of them, do you just need to extract data from them once with WinRAR or is there more to it? And if I made edits to the extracted data, do we know how to recompress it into the proper format?
My goal was to write my own level editor, although I have no idea whether that would be within my coding capabilities even if I had all the necessary information. I just have the urge to do something with Ghost Master.
|
|
|
Post by Nemesis on Jul 29, 2013 12:26:05 GMT
From what we know, the editor in ghost.exe isn't a myth. Sadly, no information is available on using it. Even the decompilation attempt yielded no results on how to start the damned thing. With the BSP files I got as far as unpacking and visually "recognizing" two parts in the data file: the model and de textures. Unfortunately I got stuck after that. Maybe you have some ideas/tricks up your sleeve?
|
|
Nisk
Mortal
Posts: 15
|
Post by Nisk on Jul 29, 2013 18:08:21 GMT
Sadly I wouldn't say I have any tricks up there. But when you say decompilation "attempt", are you implying that you didn't actually get readable code or just that it was too cryptic to follow? I think that would be the only reasonable starting point for figuring out the structure of all the data. I found this list of decompilers, so there might be one that could give a better result if that's the problem. And to further clarify with the BSP files, you only decompress them once, and then you can see the two parts in the resulting file? And the scenario BSP files, for example, would be decompressed the same way but wouldn't have the same model and texture parts?
|
|
|
Post by Nemesis on Jul 30, 2013 6:18:43 GMT
Oh dear! It's been a while... The decompiler crashed while trying to get readable code. I'll check out your list and see if there's another one who does do the trick (when I have time). Thanks for the info. The BSP files have to be decompressed twice: once as (from memory) TAR or GZ and once as ZIP. Then, like you already assumed, you get a result file with two distinctive parts. Info we did get from the developers: the models were made in Maya and then exported using a special plugin (no details on the plugin).
|
|
Nisk
Mortal
Posts: 15
|
Post by Nisk on Jul 30, 2013 19:17:48 GMT
I've experimented with a few myself already, without too much luck so far.
The first one I tried was Boomerang. Using the GUI, it crashed when I tried to decompile. When using the console version, it did print an error message 3 times before stopping, but I forget what it said (it didn't seem very useful to me).
Then I tried ExeToC. It didn't crash, but all I got was two lines of assembly which clearly isn't all that's in the file. I'm not sure if I was using it correctly, though. While using the example exe that comes with the program, I would just click a button labeled "Optim" repeatedly, and each time it would turn the assembly into slightly more readable C, step by step. The same button seemed to have no effect on ghost.exe, but I'm sure there's more to the program I could try.
Most recently I tried the Reverse Engineering Compiler. It was the most promising so far, spitting out 20-some lines of assembly (clearly still not the full code, but a bit better). I didn't have enough time to struggle through it for anything interesting, and I don't remember whether I tried and failed to get the decompiler to generate C from the assembly or if I simply haven't tried yet. I'm going to investigate that more later today.
EDIT: I would definitely start with REC. It can do a lot more than I initially realized. I can hardly understand most of it but I think in the right hands there's a lot of information that could be analyzed. Unfortunately the GUI seems really buggy, almost always crashing if you try to do multiple tasks without restarting it (even with other files, like the simple test program that came with ExeToC).
EDIT: I just got C source! I was using the Steam version of ghost.exe, and I decided to try installing it from my disk again (US Version) and using that. REC was able to decompile it. It's still hardly readable, but we're closer than ever.
|
|
|
Post by Nemesis on Jul 31, 2013 7:16:47 GMT
That sounds really promising! I'll have a go at it myself as soon as I can. Maybe in the weekend after this one, when I have a less busy schedule. Thanks for the info!
|
|
dark273
Experienced Haunter
Posts: 117
|
Post by dark273 on Jul 31, 2013 13:06:39 GMT
Wow, sounds really good.
I'm not sure, but perhaps you can find a commandline somewhere in the code, that would open the editor. I don't really see why else they would hide the editor in the game, expect if it's needed to run the game (but that would be a little weird).
|
|
Nisk
Mortal
Posts: 15
|
Post by Nisk on Jul 31, 2013 17:37:04 GMT
I'm not sure, but perhaps you can find a commandline somewhere in the code, that would open the editor. Yep, that's what I'm trying to look for right now. I think that makes the most sense. The only other reasonable option would be a boolean somewhere in the code to toggle between normal running of the game and some debug/editing mode. That's how I would do it for a solo project, but I'm not sure if it really makes sense for a team project. Anyway, the main problem now is that I may have been a little generous in describing it as "C". I would give this mess a D- at best. Essentially it looks like assembly with curly braces and semicolons. The compiler couldn't even determine most of the data types, even creating some of its own like "intOrPtr". I haven't even been able to find where it begins execution. I did find some information, which is probably already known: -they used C++ to code the game, and I also know they used Visual Studio to compile it from all the vssver.scc files in the GhostData folder -the engine they made for the game is called SpEngine and it uses OpenGL My next step is going to be trying to coax some more information out of the decompiler. I think there were more options I haven't explored. If that fails then I'll write a quick C++ program of my own with optional command line parameters and compile it using Visual Studio. Hopefully looking at what the decompiler creates from that could help point me in the right direction for ghost.exe.
|
|
Nisk
Mortal
Posts: 15
|
Post by Nisk on Aug 1, 2013 19:51:50 GMT
Well, I think I'm a bit stuck. The decompiler has a "strings" command which finds and lists all the strings that it somehow generates from the exe. When testing this with other exes, it does in fact generate the possible command line options. I tried using a few of the strings it generated, but with no luck. I also tried specifying a level file immediately after the "ghost" command, with similar results. Here's the list it generated: pastebin.com/frGtPKu5Please feel free to test some of those if you want to help. You would use them as-is, with no - or / in front of the command as in some programs. (Those symbols are just convention, and would need to be actually specified in the code.) So here are the possibilities, from least optimistic to most: 1. There is no editor in ghost.exe. Whatever tools Sick Puppies used are most likely on long-lost hard drives, never to see the light of day. 2. There is an editor in ghost.exe, but it needs to be triggered somewhere in the code. It will most likely never see the light of day unless decompilation programs become more sophisticated (even one of the developers probably couldn't help us here). 4. There is an editor in ghost.exe, triggered by some command, but Sick Puppies went out of their way to keep it hidden and impossible to reverse engineer (I highly doubt this one). 5. There is an editor in ghost.exe, triggered by some command, but the command is something I haven't tried from that list of 1076 strings. With enough perseverance, we can find it using only what we already know. 6. There is an editor in ghost.exe, but it isn't in the US version. If the UK version were to be checked for strings, it would surface easily. I'm going to start with 6, but I need to take a break from this fool's errand for now.
|
|
|
Post by Nemesis on Aug 2, 2013 6:20:17 GMT
The UK version has editor screens in ghost.exe. I've seen them. Although "editor" may be a big word. It's a test tool, allowing you to set different things in the game. The modelling was done in Maya and the ghost/mortal/level functionality is compiled in the ghost.exe code. Pretty crappy kind of programming, if you ask me!
|
|