FLHook

There are 18 replies in this Thread. The last Post () by SWAT_OP-R8R.

  • Flhook is a background tool on the server, why should it have a UI? That makes no sense.

    Multicore support for FL would mean to create the Freelancer code again... from the scratch... without even knowing what the original code looks like.

    That is not how it works.

    signew.jpg


    cfmoddblogo.png5904.png5904.png
    http://www.moddb.com/scripts/topsite.php?ts=4766


    Only dead fish swim with the stream.
    Don't discuss with idiots. They only drag you down to their level and then beat you with experience there.


    This is ten percent luck,
    Twenty percent skill,
    Fifteen percent concentrated power of will,
    Five percent pleasure,
    Fifty percent pain,
    And a hundred percent reason to remember the name!

  • As for multicore support, there is no reason to limit Freelancer.exe to one CPU core, even if it is only single-threaded. This happens while playing online. (on the crossfire server)

    I have brought this up in the past (can't find it anymore) but Freelancer.exe (the game, not the launcher) will assign itself to use only CPU core #0.

    You can check this in Task manager - details - freelancer.exe - affinity, after having played a bit.

    The game sets its CPU affinity to core #0 every time you dock or launch from a base.


    Forcing this program to only run on the first CPU core causes 100% load on core #0 and framerate drops for me.

    If I set CPU Affinity back to all cores it runs smoother and at higher framerates, because it isn't pressing other programs away from CPU core #0, and Windows can freely assign it to run on another core if it wants to. Unfortunately, I have to do this manually each time I dock / launch, or have a batch script running in the background that keeps Freelancer.exe assigned to my whole CPU.


    This issue is specific to the Crossfire mod, if I assign Vanilla Freelancer.exe to all CPU cores, it stays on all cores, no matter what I do in-game, both single- and multiplayer.

  • the server does not run the freelancer.exe but the server.exe instead.... whichbis a bit difference.

    Since FL is single-thread only it can only utilize one core/thread at a time. No matter how many you select only one is used.


    By default all cores are selected to give the system a choice where to run it. To limit it to core 0 is generally a bad idea since most system processes will try to run on that core and therefore this will limit the performance of both the system and fl.

    Running fl on the other cores exclusively could improve the performance if you still don't limit it just to one core in order to give fl a choice in case the core is used by other processes. And if the other cores are not weaker/slower than the first one (which is possible in modern systems).


    The fact that only one thread is executed wont change no matter which core you select.

    signew.jpg


    cfmoddblogo.png5904.png5904.png
    http://www.moddb.com/scripts/topsite.php?ts=4766


    Only dead fish swim with the stream.
    Don't discuss with idiots. They only drag you down to their level and then beat you with experience there.


    This is ten percent luck,
    Twenty percent skill,
    Fifteen percent concentrated power of will,
    Five percent pleasure,
    Fifty percent pain,
    And a hundred percent reason to remember the name!

  • Since FL is single-thread only it can only utilize one core/thread at a time. No matter how many you select only one is used.


    By default all cores are selected to give the system a choice where to run it.

    FL is single-threaded, but this thread is always assigned to execute on Core #0 by default (contrary to last statement above).


    Sometimes, soon after launching MP, the Freelancer.exe process starts to stress this core at 100%, and the game becomes laggy. That can be fixed by setting the CPU affnity for Freelancer.exe to all cores in the Task Manager. After this change, the CPU remains stressed by the amount corresponding to 1 logical core (e.g. 12.5% load on my 4C/8T CPU), but the load jumps continuosly from one core to another as seen in the Task Manager. The game runs smooth then, even though the CPU load is the same.


    This high CPU usage does not occur every time, but often starts on next MP launch after a game crash, after logging out in space or after switching IDs. It was especially bad in CF 1.9 (high CPU load almost every time) and became much rarer in CF 2.0. Also, it is different from the normal CPU usage by Freelancer: normally the load drops to nearly 0% when the game is minimized, but in these cases it always stays at maximum.


    Hope this clarifies what Apache was talking about.

  • I can not confirm this but that might be due to the fact that I am not 100% sure if you talk about the launcher or the original game.


    The affinity of processes should be remain stored once individually set and by default should be set to all cores unless there is a user account quota set on you pc.

    This default behaviour should apply to both, launcher and game.

    signew.jpg


    cfmoddblogo.png5904.png5904.png
    http://www.moddb.com/scripts/topsite.php?ts=4766


    Only dead fish swim with the stream.
    Don't discuss with idiots. They only drag you down to their level and then beat you with experience there.


    This is ten percent luck,
    Twenty percent skill,
    Fifteen percent concentrated power of will,
    Five percent pleasure,
    Fifty percent pain,
    And a hundred percent reason to remember the name!

  • Just tested it. The launcher uses all cores that are available. The game itself too. As long as i dont dock or undock. Seems something else resets the affinity when these events occur. Its not the launcher but must be something else. Either its a plugin or something else i am not aware of. Adjusting the affinitry from the launcher on seems to work but doesnt change the fact that something in the game itself resets the affinity back to one core :(

  • Here is the batch script I made for resetting Freelancer's CPU affinity to all CPU cores: (edit: it is on a 2 seconds loop)

    copy this code into notepad, save it as a .bat file on desktop, and run it as administrator after starting Freelancer Crossfire. This is only needed for multiplayer.

  • But it should reset once you dock or undock. So not sure if this should work.

    It's on a loop, I just turned echo off. It resets to all cores every 2 seconds. I have been using it for a couple months and check occasionally while playing.

    When I (un)dock, the game jumps to Core 1 only, then a few seconds later, the script sets it back to all. I chose 2 seconds delay so it wouldn't take too long to reset to all cores, for example when you are doing PvP matches, 2 seconds should be quick enough, but 10 might be too slow.


    Anyway, I still don't know why Freelancer.exe sets its CPU affinity to 1 when (un)docking. When it starts up, it has all cores assigned.

    And Vanilla FL multiplayer does not reset its CPU affinity to 1, it always stays on all cores.

    Crossfire singleplayer also stays on all cores, the issue only happens on Crossfire multiplayer

  • As huor found out its part of the anticheat.

    We can try to disable it and see if it has negative impact resulting in higher amounts of player reports.

    I think we simply should do a test run and observe the logs. If there are no or only minimal side effects we can keep the setting.

    The changes will take effect after the next server restart.

    signew.jpg


    cfmoddblogo.png5904.png5904.png
    http://www.moddb.com/scripts/topsite.php?ts=4766


    Only dead fish swim with the stream.
    Don't discuss with idiots. They only drag you down to their level and then beat you with experience there.


    This is ten percent luck,
    Twenty percent skill,
    Fifteen percent concentrated power of will,
    Five percent pleasure,
    Fifty percent pain,
    And a hundred percent reason to remember the name!

  • we absolutely do not know why

    We even restored old backups prior xmas but the problems remain. The files I patched prior xmas are not even the ones reported in the logs and definitely not every player gets banned. Its a big dunno.

    signew.jpg


    cfmoddblogo.png5904.png5904.png
    http://www.moddb.com/scripts/topsite.php?ts=4766


    Only dead fish swim with the stream.
    Don't discuss with idiots. They only drag you down to their level and then beat you with experience there.


    This is ten percent luck,
    Twenty percent skill,
    Fifteen percent concentrated power of will,
    Five percent pleasure,
    Fifty percent pain,
    And a hundred percent reason to remember the name!