Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

Levelling, SP, content.dll

The general place to discuss MOD''ing Freelancer!

Post Mon Mar 29, 2004 8:04 pm

Levelling, SP, content.dll

Well, I'm back. Dunno for how long though. Don't know who the hell I am? No worries. For those who do, my comp died in a flood about half a day after my last post here.

Anyway. Got myself a new rig, played through FlRebalance 3.40 Full. Nice, but very short because of Fl's stupid leveling scheme. Hardly saw any of the galaxy really, beyond EA.

I am attempting to remedy this.

As you're all aware, once you finish all the missions, your levelling goes up normally and you aren't given any 'boosts', etc. I want to set this behaviour to be the default, no matter what.

To this end, I've disassembled server.dll and content.dll.

For those who want to know, its all in content.dll.

So far, I have achieved (good and bad) :


- Plot vanishes after mission 01a. Similar to OpenSP, but that uses M13.

- Found what triggers the 'Mission' label. It's whether or not delta_worth = -1 in the save game.

- I think I found the level cap. I believe I can force content.dll to allow... um, 255 levels.


My goal here is :

A) be able to play normal SP missions but with OpenSP levelling. No 'Mission'. But I want the actual mission code to continue to trigger.

Increase the number of levels between missions. I think its doable, but I'm not sure.


I'm close.

Any asm coders out there? Anyone handy with a debugger/disassembler? And before you mention it, I couldn't give a rancid baboon about copyright/whatever laws. This sucker's _old_.

Post Mon Mar 29, 2004 9:49 pm

lol - good stuff. Notice anything about max money and cruise engine max whilst digging? Would ask for more advanced stuff, but thought i would see bout the smaller items first

Post Tue Mar 30, 2004 1:59 am

Max money's 99,999,999 isn't it? Shouldn't be hard to find/nuke. I'll have a look tonight.

Max cruise speed? Hasn't that been dealt with using INI files, or is that a no-show? Sorry, I've been out of the loop for so damn long.

Post Tue Mar 30, 2004 7:40 am

You can make the cruise speed whatever you like, its just that the display stays at 300 regardless once its engaged

Oh - max money is 999,999,999 just to make sure

Sounds good by the way

Edited by - Chips on 3/30/2004 8:40:19 AM

Post Tue Mar 30, 2004 8:02 pm

Tried searching for 99,999,999 - no luck. So went back to my mission butchery and found the bugger by accident.

Note that this is 'theoretical', as in I haven't tried it yet myself. It should work, though.

It's all in server.dll, and there are six locations that have to be modified using a hex editor.

<pre><font size=1 face=Courier>
0xHEX_OFFSET :: OLD_VAL :: NEW_VAL
==================================
0x6EE82 :: 7E :: EB
0x6EEA1 :: 7E :: EB
0x6EEF5 :: 7E :: EB
0x73C0B :: 7E :: EB
0x73CA4 :: 7E :: EB
0x74B70 :: 7E :: EB
</font></pre>

Doing this might let you get your cash up to... hmm, mebe 2,147,483,647 before you hit problems with the game's code throwing your bank balance into the negative.

See what you mean now about the cruise. Annoying. Haven't found it yet though, its doing the comparisons in float, which is a pain to deal with in hex. Fl does this with your money too, btw.

Post Tue Mar 30, 2004 11:31 pm

BTW, is it just me or does no one else seem to care that, during the SP campaign, ptough.ini is pretty much ignored? I mean, after 01b, the game calculates your net worth, adds approx 4,000 and sets that as your 'next level requirement'. Suckage, and its THAT I'm trying to nuke.

Post Wed Mar 31, 2004 1:58 am

This entire chunk of code is convoluted and is filled with redundant code... which is good, because it will allow me to add new code to bypass this piss-poor behaviour. I can't enjoy SP with the levelling limits as they are.

Oh, found the bit that causes you to level up at the end of a mission, prior to a 'free time'. Being a level zero non-person in OpenSP has its charms.

Also, I think I've found the code responsible for the occasional 'mission' bug. The code is checking for 0x26 (38), and 0x0 (empty during most save loads). If above, skip to end of code, don't do anything. There is another section of code that does a similar task (another redundancy) but this one checks for level 41 instead, doesn't care about zero but in either case goes ahead and (I think) goes through the ptough.ini settings. Seems to trigger when you load a savegame.

Oh, as you can see this is where the level cap is. It's all interconnected with the damned mission assignment code.

Isn't there _anyone_ else working on disassembling FL DLLs? At all? I've searched and searched, but I've found squat, aside from Xerx with OpenSP (must have been disasmed or at least debugged).

Post Wed Mar 31, 2004 2:47 am

You found out some stuff about the content.dll?? Good stuff ^^...could you...maybe tell us how?

Post Wed Mar 31, 2004 3:08 am

By disassembling it. I'm sifting through screens and screens and screens of raw assembly code.

By debugging it. I'm making my PC do a hard reboot every other time I double click Freelancer.exe.

Here's a sample of what you get when you disassemble something. This is from server.dll, one of six chunks that limits how much money you're allowed :

<pre><font size=1 face=Courier><font size=1 face=Courier>
06E43BE6: 8B54240C mov edx,[esp[0000C
06E43BEA: 69C9F8030000 imul ecx,ecx,0000003F8 ;" &#9829;°"
06E43BF0: 8B843124FFFFFF mov eax,[ecx[esi[0FFFFFF24
06E43BF7: 03C2 add eax,edx
06E43BF9: 8D8C3108FCFFFF lea ecx,[ecx[esi[0FFFFFC08
06E43C00: 7904 jns .006E43C06 -------- (2)
06E43C02: 33C0 xor eax,eax
06E43C04: EB0C jmps .006E43C12 -------- (3)
06E43C06: 3DFFC99A3B cmp eax,03B9AC9FF ;<<< 999,999,999
06E43C0B: 7E05 jle .006E43C12 -------- (4)
06E43C0D: B8FFC99A3B mov eax,03B9AC9FF ;";<<< 999,999,999
06E43C12: 89811C030000 mov [ecx[00000031C,eax
06E43C18: 8DB134030000 lea esi,[ecx[000000334
06E43C1E: 8B0D74CAE706 mov ecx,[006E7CA74
06E43C24: 8B11 mov edx,[ecx
06E43C26: 50 push eax
06E43C27: 56 push esi
06E43C28: FF9234010000 call d,[edx[000000134
</font> </font></pre>

What that's doing is comparing (CMP) eax, which is essentially a variable, with 999,999,999.

The next line, JLE is the CPU instruction that says "Go to this address if less than or equal".

The next line overwrites your money with 999,999,999.



Edited by - Stone-D on 3/31/2004 4:19:46 AM

Post Wed Mar 31, 2004 8:02 pm

Well, I'm gonna give up with the SP levelling as far as rewiring how much you need goes. This is why :

<pre><font size=1 face=Courier>
This is the location where the 'Free Time' level-up data is. Player's
Net worth is calculated, then one of these (Short, not Long) floating
point values is then added to it.

.06F95E49: C7053CDD0B0700C05A45 mov dword_70BDD3C, 455AC000h 3,500 (FreeTime_01_02)
.06F95E53: C70548DD0B070080A245 mov dword_70BDD48, 45A28000h 5,200 (FreeTime_02_03)
.06F95E5D: C70554DD0B0700C0DA45 mov dword_70BDD54, 45DAC000h 7,000 (FreeTime_03_04)
.06F95E67: C70560DD0B0700401C46 mov dword_70BDD60, 461C4000h 10,000 (FreeTime_04_05)
.06F95E71: C7056CDD0B0700007A46 mov dword_70BDD6C, 467A0000h 16,000 (FreeTime_05_06)
.06F95E7B: C70578DD0B0700000000 mov dword_70BDD78, 0 (Mission 07)
.06F95E85: C70584DD0B0700A00C47 mov dword_70BDD84, 470CA000h 36,000 (FreeTime_07_08)
.06F95E8F: C70590DD0B070060EA46 mov dword_70BDD90, 46EA6000h 30,000 (FreeTime_08_09)
.06F95E99: C7059CDD0B0700000000 mov dword_70BDD9C, 0 (Mission 10)
.06F95EA3: C705A8DD0B0700000000 mov dword_70BDDA8, 0 (Mission 11)
.06F95EAD: C705B4DD0B0700000000 mov dword_70BDDB4, 0 (Mission 12)
.06F95EB7: C705C0DD0B0700000000 mov dword_70BDDC0, 0 (Mission 13)
.06F95EC1: C705CCDD0B0700000000 mov dword_70BDDCC, 0 (The reason for 'Mission' buglet after Mission 13, I think)

For those who believe that RankDiff.ini does jack ****, this is pretty damning evidence.
</font></pre>


Quite frankly I've decided that manually editing the 'Delta_Worth' value in my save games before each 'free time' is more hassle-free.

However, I'm still gonna stop the damn game from levelling me up after every mission.

Why?

I'm trying to extend the plot's lifetime, because, generally speaking, I tend to get bored after it finishes. THIS way I can explore away, fully in the knowledge that 'its not over'.

Now, I think I'll abandon this thread because otherwise it will get off-topic. Chips, I found the speed stuff but I'll start a new thread for that.

Return to Freelancer General Editing Forum