Low FPS - Hit Escape - Come back - Fixes itself

Any issues with the XWAU or X-Wing Alliance? Please let us know here!
Post Reply

Low FPS - Hit Escape - Come back - Fixes itself

labc133
Cadet 2nd Class
Posts: 85
Joined: Wed Jun 12, 2019 4:47 am

Post by labc133 » Sun Feb 09, 2020 5:12 pm

Hello,

I've been experiencing low FPS at certain times during the game, especially when there's alot of lasers at the same time. I hit escape and go to menu and that seems to help, as soon as I come back the animation goes really fast for a split second and then it comes back to normal. Any way to fix?

Thanks!

User avatar
blue_max
Lieutenant Commander
XWAU Member
Posts: 1319
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Mon Feb 10, 2020 1:40 am

Something similar happens to me (low FPS) when I've got a browser running at the same time XWA is running. In my case, it stays low even after pressing Escape. If I reboot my machine this usually solves the problem.

labc133
Cadet 2nd Class
Posts: 85
Joined: Wed Jun 12, 2019 4:47 am

Post by labc133 » Mon Feb 10, 2020 3:40 pm

That unfortunately doesn't fix the issue for me :/

labc133
Cadet 2nd Class
Posts: 85
Joined: Wed Jun 12, 2019 4:47 am

Post by labc133 » Wed Feb 12, 2020 7:35 pm

Anyone might have a fix for this? :(

User avatar
Darksaber
Vice Admiral
Posts: 10932
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Wed Feb 12, 2020 7:38 pm

With the lack of people responding to your post you can conclude for yourself that the answer is no

Though saying that a few details about your computer may be helpful, such as OS, Ram, CPU anything else you can think of
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

labc133
Cadet 2nd Class
Posts: 85
Joined: Wed Jun 12, 2019 4:47 am

Post by labc133 » Wed Feb 12, 2020 8:02 pm

Well, maybe someone with an answer hasn't seen it yet? :?

OS: Win10
Ram: 16GB 4266 (PC 34100) (Max XMP Profile I got was to 4000)
CPU: Intel i9 9900k - 3.6 stock - OC to 5.2ghz
GPU: GTX 2080

I have several patches activated... including the one you gave me to resolve the target window out of range crash. 0x000d332d I think it was.

I have the latest craftpack and latest ddraw.dll

I have tried installing all the hooks. Nothing fixes it. :(

User avatar
JeremyaFr
Commander
XWAU Member
Posts: 2590
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Feb 12, 2020 9:07 pm

Hello,
There is not yet a patch to fix low FPS issues.

User avatar
JeremyaFr
Commander
XWAU Member
Posts: 2590
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Feb 22, 2020 8:16 pm

Hello,
Here is a WIP hook to improve a bit the fps.

EDIT: link removed

To enable it, set "IsHookD3DEnabled = 1" in "hook_d3d.cfg".
The hook requires a modified DDraw.dll (included in the zip).
Last edited by JeremyaFr on Mon Feb 24, 2020 5:30 pm, edited 2 times in total.

User avatar
blue_max
Lieutenant Commander
XWAU Member
Posts: 1319
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sat Feb 22, 2020 9:34 pm

This is very interesting, Jeremy. I haven't tried it yet myself; but could you share a few details of what you did in the hook above?

User avatar
JeremyaFr
Commander
XWAU Member
Posts: 2590
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Feb 23, 2020 1:50 pm

The following functions are hooked:

Code: Select all

L00594E6C Xwa3dDeviceBeginScene
L00594EF8 Xwa3dDeviceEndScene
L00595006 XwaD3dExecuteBufferLock
L00595095 XwaD3dExecuteBufferAddVertices
L00595106 XwaD3dExecuteBufferProcessVertices
L00595191 XwaD3dExecuteBufferAddTriangles
L005954D6 XwaD3dExecuteBufferUnlockAndExecute
Between begin and end scene, the tringles are not immediately drawn. The vertices and triangles are stored in a buffer. When the EndScene method is called, the triangles are rendered.
Doing that, the vertex and index buffers are mapped, written, and unmapped only one time per frame.
When the execute buffer is locked, the pointers to the execute buffer, the vertex buffer and the index buffer are stored in the D3DEXECUTEBUFFERDESC structure. Then the game writes the vertices and the indices directly to the vertex and index buffers, without an extra copy.

The DDraw dll is modified to not copy the vertices and indices to the vertex and index buffers when the execute buffer is executed.

User avatar
blue_max
Lieutenant Commander
XWAU Member
Posts: 1319
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sun Feb 23, 2020 9:16 pm

So, in the current version of ddraw, the vertex/index buffers are mapped/copied/unmapped every time an execute buffer is executed. The execute buffers are executed several times per frame.

If I understood what you're saying, in the new version the vertex/index buffers are only mapped/copied/unmapped *once* per frame. So we get better performance. Have you ran a benchmark to see how big is the improvement in performance?

I'm looking forward to seeing the new ddraw code!

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 577
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Sun Feb 23, 2020 9:57 pm

Nice. Some additional questions: does this constitute draw call batching, or would that be a further optimization? (Is it even feasible/applicable to a game as old as XWA?)

User avatar
JeremyaFr
Commander
XWAU Member
Posts: 2590
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Feb 24, 2020 5:24 pm

UPDATE
Hello,
I've uploaded the code of the d3d hook and the updated DDraw dll:
Last edited by JeremyaFr on Sun Mar 29, 2020 6:30 pm, edited 3 times in total.

User avatar
JeremyaFr
Commander
XWAU Member
Posts: 2590
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Feb 24, 2020 5:27 pm

blue_max wrote:
Sun Feb 23, 2020 9:16 pm
Have you ran a benchmark to see how big is the improvement in performance?
I haven't. I've run the game without and with the hook, and I've compared the fps.

labc133
Cadet 2nd Class
Posts: 85
Joined: Wed Jun 12, 2019 4:47 am

Post by labc133 » Sun Mar 29, 2020 6:04 pm

JeremyaFr wrote:
Mon Feb 24, 2020 5:24 pm
UPDATE
Hello,
I've uploaded the code of the d3d hook and the updated DDraw dll:
Hey Jeremy, I couldn't find ddraw.dll in that zip. :/

User avatar
JeremyaFr
Commander
XWAU Member
Posts: 2590
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Mar 29, 2020 6:34 pm

:kopfwand:

Hello,
I've done some changes and forgot to update the links.

I've updated the links in the above post.

labc133
Cadet 2nd Class
Posts: 85
Joined: Wed Jun 12, 2019 4:47 am

Post by labc133 » Sun Mar 29, 2020 7:32 pm

JeremyaFr wrote:
Sun Mar 29, 2020 6:34 pm
:kopfwand:

Hello,
I've done some changes and forgot to update the links.

I've updated the links in the above post.
FPS improvement worked! But now I can't view the new hyperspace or the new laser bloom that was currently in my ddraw.dll :(

User avatar
JeremyaFr
Commander
XWAU Member
Posts: 2590
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Mar 29, 2020 7:37 pm

The latest version of blue_max's DDraw dll is now compatible with the d3d hook.
Intall it and the effects will be back.

labc133
Cadet 2nd Class
Posts: 85
Joined: Wed Jun 12, 2019 4:47 am

Post by labc133 » Sun Mar 29, 2020 8:40 pm

JeremyaFr wrote:
Sun Mar 29, 2020 7:37 pm
The latest version of blue_max's DDraw dll is now compatible with the d3d hook.
Intall it and the effects will be back.
Woohoo... Do you have a link for that? Sorry to be a drag, but I have no idea where that might be! :?

User avatar
JeremyaFr
Commander
XWAU Member
Posts: 2590
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Mar 30, 2020 8:46 am


User avatar
JeremyaFr
Commander
XWAU Member
Posts: 2590
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Tue Mar 31, 2020 11:28 am

Hello,

There is now an installer for the new effects:
Installers for New Shaders, Effects (Bloom, SSAO, SSDO) and VR/TrackIR Support

labc133
Cadet 2nd Class
Posts: 85
Joined: Wed Jun 12, 2019 4:47 am

Post by labc133 » Tue Mar 31, 2020 11:23 pm

JeremyaFr wrote:
Tue Mar 31, 2020 11:28 am
Hello,

There is now an installer for the new effects:
Installers for New Shaders, Effects (Bloom, SSAO, SSDO) and VR/TrackIR Support
Thanks Jeremy.

FPS is better, the problem is with the new ddraw.dll the shadows are off, because light from the backdrop lightsource loses intensity. Is there anyway to make blue_max 's original ddraw.dll compatible with this hook? I like that ddraw so much more. Alot of my missions are very dependent on these lights for specific ambience in the mission, and that is all lost with the new ddraw.dll.

I really appreciate your help.

User avatar
blue_max
Lieutenant Commander
XWAU Member
Posts: 1319
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Wed Apr 01, 2020 6:41 am

Just wanted to post that labc133 and I worked this out offline. The settings that fixed the visuals for the VR mod were "ssao_enabled = 0" and "disable_xwa_diffuse = 0".

labc133
Cadet 2nd Class
Posts: 85
Joined: Wed Jun 12, 2019 4:47 am

Post by labc133 » Thu Apr 02, 2020 3:13 pm

blue_max wrote:
Wed Apr 01, 2020 6:41 am
Just wanted to post that labc133 and I worked this out offline. The settings that fixed the visuals for the VR mod were "ssao_enabled = 0" and "disable_xwa_diffuse = 0".
Yes. Just to clarify:

Jeremy, I was able to use your hook with the Blue_Max's newest ddraw.dll and keep the older ddraw.dll settings by changing ssao_enabled to 0. The hooked worked fine with the new textures, I just preferred the old settings, basically because of the xwa light sources.

I will wait patiently for the new shaders to come out. :)

Blue_max was awesome help and so have you, Jeremy.

Post Reply