Low FPS - Hit Escape - Come back - Fixes itself

Need help with hardware? Game doesn't run? System wont boot? We might be able to help!

Moderators: Darksaber, Forceflow, decoy

Post Reply

Low FPS - Hit Escape - Come back - Fixes itself

labc133
Cadet 2nd Class
Posts: 68
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!

blue_max
Lieutenant JG
XWAU Member
Posts: 570
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: 68
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: 68
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

Fleet Admiral (Administrator)
Posts: 10424
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: 68
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. :(

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1802
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.

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1802
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.

xwa_hook_d3d_WIP.zip

To enable it, set "IsHookD3DEnabled = 1" in "hook_d3d.cfg".
The hook requires a modified DDraw.dll (included in the zip).
You do not have the required permissions to view the files attached to this post.
Last edited by JeremyaFr on Sun Feb 23, 2020 1:33 pm, edited 1 time in total.

blue_max
Lieutenant JG
XWAU Member
Posts: 570
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?

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1802
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.

blue_max
Lieutenant JG
XWAU Member
Posts: 570
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
Ensign
Posts: 362
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?)

Post Reply