Freedom Force (original) Level Editor Under Windows 7.

Started by WH2000, September 07, 2012, 05:16:29 AM

Previous topic - Next topic

WH2000

Hello everybody. I've been perusing these boards for a while, but haven't made any contributions. Now I think I have something worth posting.
I found a way to run the Freedom Force (first game) level editor under windows 7, 64 bit (may work on others versions). Being the obsessive nut I am, I fired up a debugger to try and catch what was causing the crashing, and it turns out it was the Miles sound system. So, I edited out the offending calls, and voila!, the editor runs.
You will need to download the OllyDbg debugger V. 2+.
1.- Open OllyDbg as admin, go to File -> Open and browse leveledit.exe.
2.- Go to File -> Set New Arguments and put "-w" in the text box.
3.- Right Click on the Window with the actual dissasembly (right below the Menu bar), and click on the Go To -> Expression option, and put 0040570A on the textbox.
4.- Once the cursor is over address 0040570A (you can see which address you're in on the left), the fun begins:
     The original dissasembly should look like:
         0040570A         50             PUSH EAX
         0040570B         E8 ...         CALL 0057996C
         00405710         84C0         TEST EAX, EAX

We have to change that so it reads:
         0040570A         90              NOP
         0040570B         31C0          XOR EAX, EAX
         0040570D         90              NOP
         0040570E         90              NOP
         0040570F         90              NOP
        00405710          84C0         TEST EAX, EAX
To do so, double click on "Push EAX", and put "NOP" on the textbox. Both "Keep Size" and "Fill rest with NOPs" MUST be checked.
Next, double click on "Call 005...", and put "XOR EAX, EAX" on the textbox, again, make sure both checkboxes are checked.
Done!
Click on the Play button to make sure everything works as it should.

Now, you can make the changes permanent on the file so that you don't need to go over the hassle again, or keep it safe and do the process all over again.

In the event that the editor works inside the debugger, but not outside the debugger, you will have to fire up the debugger each time you need to use the editor.
Since the editor needs some commandline parameters to work, you can change the parameters as stated above. The parameters needed are:
-game (Your mod Folder, replace white spaces with "?", without quotes) -w -e -m C:\Program?Files?(x86)\Irrational?Games\Freedom?Force\(You Mod Folder)\Missions\(The Mission folder to be edited)\mission.dat

In FFEdit, instead of clicking on "Edit In Game", just save the mission, and use the debugger (OllyDbg).
I hope this is helpful for the community, happy modding.

WyldFyre

Have been trying this but cannot get the debugger to save the file.  How is this accomplished?
For Freedom!

WH2000

First make sure the program runs before saving any changes.
I have been testing this under several other systems, and apparently it is only able to run under the debugger (something to do with a call to DX8, sadly I cannot fix that without screwing up the whole program), so it may not do much good to save.
To save the changes, on the dissasembly windows right click and click on Edit -> Select All. When everything is selected, right click again on the dissasembly window then Edit -> Copy to Executable.
Hope that helps, and if anyone has been able to run it without the debugger, please post.
Edit:
       Remember you can also set command line parameter on the debugger, File -> Set New command Line Parameters, in order to be able to edit maps within the debugger.

spder16

I'm having trouble with this. My code looks right all the way down till 00405710 then it looks like this.
0040570A         90              NOP
0040570B         31C0          XOR EAX, EAX
0040570D         90              NOP
0040570E         90              NOP
0040570F         90              NOP
00405710          84C0         TEST AL, AL

The part on yours is TEST EAX,EAX. So when I went and tried to edit it to TEST EAX,EAX it changed the number 84C0 to 85C0, and when I tried to change the binary number back to 84C0 it switched back to TEST AL,AL. Either way it's still not letting me use the editor.

WH2000

The "Test EAX, EAX" was only put there for a bit of clarity, no need to change that, since you can offset everything, and the program will not work.
What you could do, instead of "Nop, Xor Eax Eax, Nop, Nop, Nop" is:
40570A   NOP
40570B   XOR EAX ,EAX
40570D   INC EAX
40570E   NOP
40570F   NOP

and leave "Test Al, Al" as it is. If you can't make it work outside the debugger, you will have to run it under the debugger, using the parameters as stated in the original post. You can still use it without a problem under the debugger, but you cannot call it from the editor.
Please let me know if this solved your problem, since it does work under my computer, so maybe it is something else that is causing the error. By the way, I'm running it under Windows 7 64bit (laptop).

bearded

I spent all night trying to get this to work.  The best I got was with arguments "-game flash -w" would start the opening credits (sea urchin) and then "must run from ffedit". But saving exe to original leveledit made no change when clicking edit in game from ffedit, a short hourglass and then nothing. But there is a fforce.exe process running.
With arguments "-game flash -w -e -m C:\Program?Files?(x86)\Irrational?Games\Freedom?Force\flash\Missions\mission1\mission.dat" I get an access violation writing to 0000038.
My system is 32 bit, and running winxp.
Has anyone else tried getting this working? Would turning off sound entirely help?

abenavides

I'd be very interested if you could get this working.
www.alexff.com
Creator of EZ Danger Room, EZFX, EZHero, The JLA Mod, The X Mod, Superhero TV, & famous Hero Recipes, coming up: New mods.