RTSS not working on old game (LotR - BfME)

Discussion in 'Rivatuner Statistics Server (RTSS) Forum' started by Triko, May 4, 2021.

  1. Triko

    Triko New Member

    Messages:
    5
    Likes Received:
    1
    GPU:
    Intel HD 4000
    Hello, I have been using RTSS (with MSI Afterburner) for like 3 years and so far it worked for every game I ran. It's a super useful tool for gaming, especially with scanline sync, so thank you very much to the creator and all contributors!

    Now for the first time I have found an older game where RTSS is not working: Lord of the Rings - Battle for Middle Earth

    I have tried various settings in RTSS with no success:
    - Application detection level high/med/low
    - stealth mode on/off
    - custom Direct3D support on/off
    - Setup > Compatibility properties > Enable dedicated encoder server service = 32-bit

    According to the pcgamingwiki entry, the game runs via Direct3D 9.0c:
    https://www.pcgamingwiki.com/wiki/The_Lord_of_the_Rings:_The_Battle_for_Middle-earth

    The game's shortcut launches "lotrbfme.exe" though this exe is not under load. When I check task manager the strange thing is that the actual game process seems to be "game.dat" as that's the only process under load (25% cpu usage).

    Does anyone have a solution on how to make RTSS work with this specific game?
     
  2. Unwinder

    Unwinder Moderator Staff Member

    Messages:
    15,391
    Likes Received:
    2,661
    The game is not purchasable now and I don't own it. So the changes that I look into it are equal to zero.
     
  3. Triko

    Triko New Member

    Messages:
    5
    Likes Received:
    1
    GPU:
    Intel HD 4000
  4. Astyanax

    Astyanax Ancient Guru

    Messages:
    10,612
    Likes Received:
    3,889
    GPU:
    GTX 1080ti
    the DAT process is using D3DWRAP functions, might be why its not working,



    I checked all my other games and none of them make use of this, so its the only thing i can think of.

    it also isn't using a pure D3D9 Hardware set

    BFME
    Code:
    info:  D3D9DeviceEx: Using extended constant set for software vertex processing.
    info:  D3D9DeviceEx::ResetSwapChain:
    info:    Requested Presentation Parameters
    info:      - Width:              2560
    info:      - Height:             1440
    info:      - Format:             D3D9Format::A8R8G8B8
    info:      - Auto Depth Stencil: true
    info:                  ^ Format: D3D9Format::D24S8
    info:      - Windowed:           false
    
    GTA4
    Code:
    info:  D3D9DeviceEx::ResetSwapChain:
    info:    Requested Presentation Parameters
    info:      - Width:              2560
    info:      - Height:             1440
    info:      - Format:             D3D9Format::A8R8G8B8
    info:      - Auto Depth Stencil: false
    info:                  ^ Format: D3D9Format::D24S8
    info:      - Windowed:           false
    
    tossing DXVK into the mix makes the overlay and limiters work.
     
    Last edited: May 5, 2021
    Triko likes this.

  5. Triko

    Triko New Member

    Messages:
    5
    Likes Received:
    1
    GPU:
    Intel HD 4000
    Thanks Astyanax for your investigations and the new info!

    DXVK is not an option on my Intel iGPU as it doesn't support vulkan (it does on Linux though), but I mainly just wanted to report this RTSS compatibility issue anyways. LotR - BfME has good frame pacing by default.
     
    Last edited: May 5, 2021
  6. emperorsfist

    emperorsfist Maha Guru

    Messages:
    1,417
    Likes Received:
    776
    GPU:
    NVIDIA GTX 1080 8Gb
    If I may add to this @Triko : BfME (and other old EA SAGE-based RTSs that use the injected .DAT file) can be hooked through the Global profile, I have tested that myself (and they react very well to RTSS, imho). @Unwinder , if you really want to look at this issue, then the same applies to the still purchasable C&C Tiberium Wars and Red Alert 3. Same injected dat file as @Astyanax mentioned, same reaction to the Global profile. That's just a heads-up, though. I'm certain your time's better spent elsewhere.
     
  7. Astyanax

    Astyanax Ancient Guru

    Messages:
    10,612
    Likes Received:
    3,889
    GPU:
    GTX 1080ti
    This does not appear to be the case (for me), my global is set to show the frame limiter but it doesn't appear (BFME)
     
  8. emperorsfist

    emperorsfist Maha Guru

    Messages:
    1,417
    Likes Received:
    776
    GPU:
    NVIDIA GTX 1080 8Gb
    Curious, it worked for me. Try to limit frames to something lower than 30fps. These games are locked to 30.
     
  9. Triko

    Triko New Member

    Messages:
    5
    Likes Received:
    1
    GPU:
    Intel HD 4000
    @emperorsfist I can't get it to work via the global profile either (it's what I tried first), that's quite interesting that it works for you. Have you installed BfME v1.06 or did you test it on the original v1.0?

    I'm not sure if it's related, but I always have to launch the BfME shortcut twice in order for the game to start. The first time 3 processes start:
    • lotrbfme.exe (~2MB ram)
    • rundll32.exe
    • dllhost.exe (closes itself after 5sec)

    The second time when the game actually boots, 3 more processes activate:
    • ~e5.0001 (description just says "Cleanup")
    • lotrbfme.exe (another one but with ~4MB ram)
    • game.dat

    when closing the game, the 2 processes from the 1st boot attempt will remain active:
    • lotrbfme.exe
    • rundll32.exe
    Also I'm on Windows 7, which might be another reason why it's not working for me.
     
  10. Astyanax

    Astyanax Ancient Guru

    Messages:
    10,612
    Likes Received:
    3,889
    GPU:
    GTX 1080ti
    This is a legacy windows 7 issue with the GameUX shim (Games for Windows library/browser) polls a no longer working service for version and game info, you can use the KrossX patched dll @ https://www.ngemu.com/threads/gameux-hack.168633/ to make games start first time, everytime.
     
    Triko likes this.

  11. Triko

    Triko New Member

    Messages:
    5
    Likes Received:
    1
    GPU:
    Intel HD 4000
    I finally got BfME to work with RTSS by enabling Windows 7 compatibility mode for the shortcut (Properties > Compatibility). That's strange, as I'm on Windows 7 anyways...

    You can even add a profile to RTSS for BfME like this:
    - via the RTSS GUI, you can only add executables (.exe), but in the case of BfME the actual game file is "game.dat"
    - copy any existing profile config (.cfg) in C:\Program Files (x86)\RivaTuner Statistics Server\Profiles
    - rename the copy to game.dat.cfg
    - restart RTSS
    - game.dat entry is now listed in the RTSS GUI and can be edited for BfME

    By default, BfME runs @ 38.4 FPS (~26ms frame times). With Scanline Sync x/2 it's locked to 29.9FPS and scrolling is now perfectly smooth, that's awesome!

    @Astyanax thanks for the tip about the gameux issue, the solution works great :)
     
    emperorsfist likes this.
  12. Astyanax

    Astyanax Ancient Guru

    Messages:
    10,612
    Likes Received:
    3,889
    GPU:
    GTX 1080ti
    default windows compatibility profile for this game sets the compatibility to Windows XP SP2 with the runasinvoker compatibility mode.

    upload_2021-5-15_22-55-27.png

    Now this isn't actually applying the fix listed as "Windows XP SP2", as that would come under "Compatibility Modes" like RunAsInvoker is.

    When you apply that, you get
    upload_2021-5-15_23-21-46.png

    When you apply Vista, or 7RTM you get
    upload_2021-5-15_23-22-4.png

    now what weird, is if you apply all of those options seperately rather than selecting the overall 7 or vista mode., it doesn't do anything, but setting the overall mode to vista or 7rtm does.

    I'm stumped, theres no reason for the compatibility mode to fix anything here, unless..... the toolkit is actually not listing everything that this mode does.
     
  13. Unwinder

    Unwinder Moderator Staff Member

    Messages:
    15,391
    Likes Received:
    2,661
    That’s absolutely expected for RTSS overlay to stop working in D3D9 applications if XP compatibility mode is forced for some application in Vista or newer OSes. D3D9 swapchains have slightly different architecture under XP and Vista+, so there are different hooking codepaths in RTSS for XP and newer OSes. By forcing XP compatibility mode you’re faking OS version visible to application and forcing wrong codepath for overlay.
     
  14. Astyanax

    Astyanax Ancient Guru

    Messages:
    10,612
    Likes Received:
    3,889
    GPU:
    GTX 1080ti
    This makes sense, i've gone through a lot of the games i know of that were D3D9, in the Compatbiilty administrator and i don't see many at all that actually tells the game exe that its running on XP, the Setup files yes, but not the actual game executables - the 2 BFME games seem to be unique in this.
     
  15. emperorsfist

    emperorsfist Maha Guru

    Messages:
    1,417
    Likes Received:
    776
    GPU:
    NVIDIA GTX 1080 8Gb
    Hey thanks a lot for this tip! I never tried it like that! Maybe the difference between us was that I use Win10. Still, I'll try your method to get game.dat registered by RTSS.
     

  16. Astyanax

    Astyanax Ancient Guru

    Messages:
    10,612
    Likes Received:
    3,889
    GPU:
    GTX 1080ti
    no, its specifically that the BFME games are told by the system that they are running on XP SP2 so any libraries loaded by them inherit this, since the RTSS hooking libraries have cases specified for behaviors unique to the version of the D3D Runtime and OS specifically.

    XP and older are 4.9.0.901-5.3.2600 depending on Bitness and 9x vs NT, Vista plus are 6.0.6001 - 10.<current w10build> with most beyond w8 entirely just versioning change (with only a single change from W8's dll till the current w10 version for the 4GB vram limit bug)

    Vista+ have D3D9Ex and NT6 specific behaviour changes and bugfixes (ie, implementation of Fixed function and SM1-3 as unified shaders).

    Tldr,
    RTSS can't talk to a NT6+ D3D9 dll when being told its the NT5 version.
    RTSS can talk to OpenGL/DDraw on NT6+ while they are loaded as W9x/NT5 because these have basically unchanging hooking points. (ie, mixed d3d/ddraw starlancer, or homeworld opengl with W98/NT4 compatibility respectively hook just fine)


    The games you cited don't have any overrides on the Windows version so they have no issue with hooking.
     
    Andy_K likes this.
  17. emperorsfist

    emperorsfist Maha Guru

    Messages:
    1,417
    Likes Received:
    776
    GPU:
    NVIDIA GTX 1080 8Gb
    I see.
     

Share This Page