szapp / GothicFreeAim

Free aiming for the video game series Gothic
https://gfa.szapp.de
MIT License
36 stars 4 forks source link

[Singleplayer] FPS Drops / [Multiplayer] Not able to connect #203

Open Flauschefuchs opened 1 year ago

Flauschefuchs commented 1 year ago

I got a little problem over here.

Originally everything worked fine, but lately after i changed my GPU to a 4070 TI it seems that any mod with free aim (GMP / G2 Nostalgic Edition) give me some Problems.

While i cant connect with the Multiplayer Server (it works fine without GFA), my FPS drops to 2 in the Singleplayer. zSpy give me no information, my RAM works fine (also tested my memory). All Drivers are up to date. Enable and disable the LaaHack and the Renderer doesn't work as well.

We also tried to rise the priority in the Taskmanager, boosted the perfomance with the MSI Software (MSI CPU/Mainboard/GPU), disable every background program, tried a complete clean G2 Installation (G2 Gold Steam Version). Nothing worked so far.

Whats a bit confusing is, that i could play about 2h with about 250 FPS in the Nostalgic one time, and also could connect 2 times to the MP Server (about 50 Testings). it cant be reproduced by anyone.

If you need specific information, just ask. Hope you can help.

Flauschefuchs commented 1 year ago

We have tried a bit and it looks like the FPS Drops coming from the 2 base functions. GLA_Ranged and GLA_Spells. Every other Module doesn't change the performance overall.

szapp commented 1 year ago

@Flauschefuchs thanks for the report and also for going ahead and doing some digging.

The issue does indeed seem a bit odd. Performance issues had so far only occurred on low-end machines due to high sampling rate of the focus during aiming.

A few questions come to mind - for now - that may aid in finding the cause:

  1. Do you have insight into which versions of GFA are used in the mentioned mods? Find the version using the zSpy or the console.
  2. As for singleplayer; Does the drop in FPS relate to the progress in the game? In other words, does the low FPS happen regardless of new game (in a fresh session) or loaded game?
  3. As for multiplayer; You mention that it works fine without GFA. How do you test that? Are there different mutliplayer versions with and without GFA integrated?
Flauschefuchs commented 1 year ago

Hey, thanks for your reply.

  1. We are using Gothic Free Aim v1.2.0.
  2. No it doesn't matter. Its no difference. I can already start with 2 FPS in a new game... so do i right in the valley of mines in Chapter 2 or Chapter 3.
  3. We are running a liveserver without GFA for actual roleplay and a testserver with GFA as a testing environment. The only difference between these is GFA. We also have allowed to load our testserver with enabled GFA to join with our liveservermod... so its possible that one player plays with free aim and the other uses the original focus-mode.

Some additional infos as well:

szapp commented 1 year ago

Okay, thanks for the further info. Let me summarize to make sure I get everything fully:

There was no issue before changing the GPU. Now, there are severe FPS drops. This only occurs with the features GFA_RANGED and GFA_SPELLS enabled.

Let me know if I missed crucial information there or something is incorrect.

A few more questions for clarification

  1. Are the FPS constantly low or are they rather fluctuating (e.g. high, low, high, low...)?
  2. Are the FPS constantly affected or only during certain actions like drawing a bow/crossbow/spell?
  3. What about in-game menus or during dialogs?
  4. Is there anything else that changed alongside the GPU, like an update of the D3D11 renderer, union/system pack - or - as little as a change in some settings?
  5. Can this problem be recovered by stripping patches/tools, like starting without the D3D11 renderer, without union/system pack, etc.?
  6. I am no longer too familiar with high-end GPUs. Does your GPU utilize something like (a) DSR or (b) AI features to interpolate rendered frames?
  7. What versions of Ikarus and LeGo are used?

A bit of context:

If any, the bottle neck of GFA is the updating of the focus collection. This happens at every frame and includes tracing rays from the player camera to the nearest intersection with the world. However(!), this only is performed during aiming (drawn bow, spell) and also does not require much resources - especially on modern machines.

What I suspect happening here is that some Daedalus code of GFA is executed more than once per frame - like many, many more times. Most of the hooks GFA places in the game engine are tied to the rendering of a frame to perform its operations much like the rest of the engine does. If now, for some reason, hooked portions of the engine are executed multiple times per frame, the Daedalus code could slow down everything. I assume here that the D3D11 renderer, a GPU optimization software, or union is tinkering with the execution of certain engine code.

I will have a look which hooks from the two mentioned GFA features are running every frame (regardless of aiming or mot), to narrow down the problems. I will comment that below soon.

szapp commented 5 months ago

@Flauschefuchs Is the issue still present? Could you give me an update and if applicable address the numbered questions in my previous comment?