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

Limit breaking 101

Here you find the different tutorials on editing and MODing Freelancer

Dev

Post Thu Aug 17, 2006 3:46 pm

Limit breaking 101

First off, to modify any constants in these files you're going to want a hex editor; something simple like this one is ideal. Second, notation: 0x is a prefix meaning "hexadecimal"; for example, 0xFF is 255 in decimal. i is a suffix meaning "4-byte integer"; for example, 2000i would be encoded as 0xD0070000. f is a suffix meaning "4-byte single-precision floating point"; for example, 2000f would be encoded as 0x0000FA44. d is a suffix meaning "8-byte double-precision floating point"; for example, 2000d would be encoded as 0x0000000000409F40. The hex editor will take care of encoding values into hexadecimal for you, so just make sure you're encoding it as the correct data type. If you put an integer where a float should go, bad things could happen.

The format below is: <value> in <file>, <address> = <functionality>

-------- Visibility --------
3f in Freelancer.exe, 0x210530 = near plane of view frustum
250000f in Freelancer.exe, 0x210534 = far plane of view frustum (nothing will be drawn beyond this)
20000f in Freelancer.exe, 0x1C8910 = max distance at which ships can be seen (even if LODranges specify a higher distance)
100000000f in Freelancer.exe, 0x1D15B8 = square of max distance that a ship can be selected
6250000f in server.dll, 0x84ADC = square of NPC disappear distance in MP
25000000f in server.dll, 0x84AE0 = square of player disappear distance in MP
100000000f in server.dll, 0x84AE4 = square of grouped player disappear distance in MP
Another note on visibility, planets need LODranges specified if they are over about 1.5 million meters away (just add LODranges = 0, 1000000000 to the solararch entry and you'll be set).

-------- NPC spawning/behavior --------
1775d in content.dll, 0x11AC80 = initial NPC max spawn distance in SP and MP (such as after respawn)
2500d in content.dll, 0x11AC68 = NPC max spawn distance in SP and MP (following initial spawn)
2500f in content.dll, 0xD3C3E = maximum distance that NPCs will persist in MP (I don't recall if it applies to SP)
3750f in content.dll, 0x591B6 = distance over which NPC spawning will ignore density cap in SP; as a general rule, make it 1.5 * NPC max spawn distance
7500f in content.dll, 0x116A68 = distance over which NPC spawning will ignore density cap in MP; as a general rule, make it 3 * NPC max spawn distance
5000f in common.dll, 0x1407E0 = max range at which NPCs will engage enemies; don't forget to increase the range at which NPCs will engage in pilots_population as well (attack_preference under JobBlock)
5000f in content.dll, 0xD0510 AND 0x11AD10 = max range at which NPCs will go hostile upon seeing their allies go hostile (AND means both values must be changed)
500i in content.dll, 0x6C790 = max range at which NPCs will scan your cargo
2500f in content.dll, 0x6CA37 = max range at which NPCs will initiate scan of your cargo

-------- HUD --------
2000i in Freelancer.exe, 0xD2C02 = distance over which kilometers rather than meters are displayed (in the contact list)
2000i in Freelancer.exe, 0xEEF90 = distance over which kilometers rather than meters are displayed (target bracket in space)
10000i in Freelancer.exe, 0xD2C32 = distance over which fractions of kilometers are not displayed
99999i in Freelancer.exe, 0xD2C94 = distance over which "far" is displayed rather than an actual distance
999i in Freelancer.exe, 0xD597A = speed over which "---" is displayed
0x0F85->0x90E9 in Freelancer.exe, 0xD5936 = remove cruise speed display limit of 300 (in other words, change 0x0F85 to 0x90E9; this hack was found by someone else)
0.6f in Freelancer.exe, 0xDFC09 = speed at which target crosshair closes on subtarget in wireframe view (make smaller for faster)
0.8d in Freelancer.exe, 0x1D7E50 = width of bars for energy, shield and hull gauges (for example, set to 1.0 to make the bars solid)
1.25f in Freelancer.exe, 0x1C9804 = multiplier for distance at which brackets around non-targeted ships in space will appear (1.25 = ~3km, 37.5 = ~93km, etc)
3.0f in Freelancer.exe, 0x1D7964 = seconds between updates of the distances in the contact list

-------- Misc --------
1000f in common.dll, 0x18ADB4 = max dock acknowledge distance
10000f in common.dll, 0x13F45C = max docking initiation distance
0.8f in Freelancer.exe, 0x1D6D38 = resale % for ships
9999999f in Freelancer.exe, 0x1CAEE8 = maximum value of any single good
0.9f in common.dll, 0x18C5D4 = Reputation over which will give you affiliation with that faction (faction name appears in space before your name)

----------------
Visual effects: These are kind of a bizarre hack I came up with for making vis_beam effects appear beyond 2k, since I couldn't track down the constant(s) responsible for them disappearing. If you don't need to make vis_beams appear at long range then don't bother with this, since it's much easier to work with effect_types.ini.
For any of this to work, you must first do this:
0x45->(something else) in Freelancer.exe, 0x1C8890 - alter the 'E' of 'EffectType' to make the parser not recognize EffectType from effect_types.ini and force default render distances.

Once this is done you can directly edit the defaults. They more or less correspond with the values you would normally set in effect_types.ini. There are default entries for every effect type, but I found that I only needed to change three. However, they're all bunched together in Freelancer.exe, so it shouldn't horribly difficult to identify the rest of them.
EFT_EXPLOSION_LARGE (limited duration):
100f in Freelancer.exe, 0x212AF0 - on-screen radius of effects, affects size-on-screen-based cutoff (make larger to increase cutoff range)
15f in Freelancer.exe, 0x212AF8 - max run time of effects
100f in Freelancer.exe, 0x212B00 - unknown, likely the first value of pbubble
500f in Freelancer.exe, 0x212B04 - visual cutoff range of effects (second value of pbubble)

EFT_WEAPON_LARGE_PROJ (infinite duration):
50f in Freelancer.exe, 0x212C58 - on-screen radius of effects
-1f in Freelancer.exe, 0x212C60 - max run time of effects
100f in Freelancer.exe, 0x212C68 - unknown, likely the first value of pbubble
500f in Freelancer.exe, 0x212C6C - visual cutoff range of effects (second value of pbubble)
15f in Freelancer.exe, 0x213158 - on-screen radius of vis_beam effects
100f in Freelancer.exe, 0x213168 - unknown, likely the first value of pbubble for vis_beam
500f in Freelancer.exe, 0x21316C - default vis_beam cutoff range (second value of pbubble for vis_beam)

EFT_DAMAGE_LARGE_SMOKE (infinite duration):
20f in Freelancer.exe, 0x212DE8 - on-screen radius of effects
-1f in Freelancer.exe, 0x212DF0 - max run time of effects
100f in Freelancer.exe, 0x212DF8 - unknown, likely the first value of pbubble
500f in Freelancer.exe, 0x212DFC - visual cutoff range of effects (second value of pbubble)

----------------

Those are all the hacks that I have found (except for the cruise speed one, that was somebody else). All have been extensively tested, so they definitely will work. The real trick will be making good use of them. May the zomgbay haxx be with you.

Post Thu Aug 17, 2006 7:02 pm

... Wow. Dude, I just wanted to congratulate you. I hex-edit content.dll and freelancer.exe lightly for my 88 Flak mod (partly how I accomplished hirable NPC wingmen), and I'd long ago given up looking for these values. I'm guessing you found the offsets by an on-the-fly memory check? If so, briliant. Either way, you are my new hero, you don't know how cool this is for me. =P

Dev

Post Thu Aug 17, 2006 7:03 pm

I suppose I should add that these are for unpatched version 1.0 of Freelancer, not version 1.1. It is very likely that some if not all of these addresses will be different in the patched version.

Edit:
"I'm guessing you found the offsets by an on-the-fly memory check?"

Actually, nothing so sophisticated as that. It was basically a very large-scale guess and check operation using some simple utility programs that I wrote specifically for the job. Not the most efficient approach, but it did work.

Edited by - Dev on 8/17/2006 8:05:48 PM

Post Fri Aug 18, 2006 12:42 am

Wow Dev ... excellent ....

Dev

Post Fri Aug 18, 2006 1:35 am

Since it doesn't seem to want to let me add things to my original post, here is another hack that I just found.

999999999i in server.dll, 0x6EEF1 = maximum credits that a player can have in MP

The value should not exceed 2^31 - 1 (2,147,483,647) which is the maximum positive value of a 4-byte integer.

Post Fri Aug 18, 2006 4:30 am

about the faction-join-limit location - does this trigger a universe message about 'player affiliation changed'? and have you changed affiliations twice with the same character?

have you noticed any increased load when testing the LOD locations? i'm wondering just how far we can extend it without tweaking the models and textures' performance for huge distances

also how does scanning work, generally?

this is mana from heaven indeed - i just hope my gfx card will be up to it. i'm practically wetting myself in anticipation of trying some of this; the non-selected-ship-bracket thing is of particular concern to me - i hate it! anyways awesome work, much appreciated =)

Edited by - Cold_Void on 8/18/2006 5:33:25 AM

Dev

Post Fri Aug 18, 2006 4:55 am

"about the faction-join-limit location - does this trigger a universe message about 'player affiliation changed'?"

Well, for you it says "New Affiliation: <faction>". I don't think there is a message sent to the rest of the universe.

"and have you changed affiliations twice with the same character?"

Indeed so, it will even say "Lost Affiliation: <faction>" before "New Affiliation". The best part about faction affiliation is that players belonging to opposing factions will actually appear hostile to one another.


"have you noticed any increased load when testing the LOD locations? i'm wondering just how far we can extend it without tweaking the models and textures' performance for huge distances"

Mmm, not terribly. The current test release of the mod these haxx were originally made for has visibility and spawning of ships set to 100 kilometers, and the distance itself does not seem to have any influence on server lag. However, large distances bring with them significant consequences regarding travel and, if you make things big enough, ship rattling from Hades. So, you can make your galaxy huge, just bear in mind that true 1:1 scale is probably not going to work (but at least now you can try).


"also how does scanning work, generally?"

By default, if you are within 2500 meters the NPCs will decide whether or not to start scanning your cargo (based on faction_prop stuff), and they will fly toward you until they get within 500 meters before actually performing the scan (the cargo scan range of the NPC scanners must be at least 500 meters). In the test mod mentioned above I had ships scanning me at up to 100k, depending on how far their scanner equipment could reach.


"the non-selected-ship-bracket thing is of particular concern to me - i hate it!"

Coming back to the test mod thing again, brackets can be quite useful for converting your cockpit view into a makeshift radar screen, like so (the radar overlay is ugly, but it's just a temporary model): screenshot. However, it all depends on what you want to do with your mod.

Ogu

Post Fri Aug 18, 2006 5:52 am

"25000000f in server.dll, 0x84AE0 = square of player disappear distance in MP"
So this is 5k. If that was turned into 100000000f, it would be 10k. Would this allow non-grouped players to stay on your 'radar' (lower left text list) until they were 10k away? For example, I would like to know if I could use this to make better scanners. I'm assuming I could scan a non-grouped player at 8k with this change.

Great list Dev.

Post Fri Aug 18, 2006 6:47 am

it seems all address are only for the version 1.0 of dll ...
i have start to look on all address on 1.1 version

Post Fri Aug 18, 2006 8:14 am

great work I have tried afew of these and they work fine
in multiplayer

the one I can't seem to get to work is the max cash i changed it from the 999999999 to 2000000000 and in mp it still will not let go past the 999999999 mark.

What did I do wrong?

I have got the maximum value of any single good, max docking initiation distance to work and they work fine in mp.

Triple

Post Fri Aug 18, 2006 12:10 pm

well I don't know if I did the max cash proper but I got it to work by changing all 999999999 that show up in the server.dll (and there is quite afew) to 2000000000 and it worked on my test server.

Triple

Dev

Post Fri Aug 18, 2006 2:42 pm

""25000000f in server.dll, 0x84AE0 = square of player disappear distance in MP"
So this is 5k. If that was turned into 100000000f, it would be 10k. Would this allow non-grouped players to stay on your 'radar' (lower left text list) until they were 10k away? For example, I would like to know if I could use this to make better scanners. I'm assuming I could scan a non-grouped player at 8k with this change."

I don't know where you got 8k... If you changed that value to 100 million (10k squared), ungrouped players would stay on your radar until they went past 10k. If you changed it to 10 billion (100k squared), ungrouped players would stay on your radar until they went past 100k. If their ships are set to be visible at this range (LODranges), then they will be directly visible in space as well as in the contact list.

Post Fri Aug 18, 2006 2:50 pm

6250000f in server.dll, 0x84ADC = square of NPC disappear distance in MP
25000000f in server.dll, 0x84AE0 = square of player disappear distance in MP
100000000f in server.dll, 0x84AE4 = square of grouped player disappear distance in MP

in the 1.1 server dll these can be found at 86AEC, 86AF0 and 86AF4

i have anly altered the last 2 and tested on my test server

25000000 changed to 1000000000 you pick up an ungrouped player at 32k away

1000000000 changed to 2000000000 picked up a grouped player at 44k away

Triple

Post Fri Aug 18, 2006 3:34 pm

I'd just like to say that, while I had to re-learn quite a bit (I haven't worked with floats in so, so long), once I figured out what exactly to do I've been having awesome results with this, especially the faction tag thing, something I'd been trying to hack for quite a while now. However, you might want to point out that you have to use the "Encode" functions of the Hex Editor to hack away at this data - just for the people who haven't Hex-edited before (or in a very, very long time). This was driving me absolutely nuts until I remembered the simple "Encode" thing (I was basically trying to work it out with math lol). None-the-less, you deserve a medal for putting this list together Dev. =)

Post Fri Aug 18, 2006 3:35 pm

I tried this again with

2000000000 for ungrouped 44k away

3000000000 for grouped 54k away

Triple

Return to Freelancer Editing Tutorial Forum