xezon / GenToolBugs

0 stars 0 forks source link

The game crashes when a certain 3D Shadow limit is exceeded #9

Open xezon opened 3 years ago

xezon commented 3 years ago

The game crashes when a certain 3D Shadow limit (4096) is exceeded.

Can be tested in test map: https://github.com/xezon/GeneralsGamePatch/tree/main/Maps/Any/!TestScorpionShadowLimit513

It is W3DBufferManager that has 4096 buffer size.

Thyme has DX8VertexBufferClass and DX8IndexBufferClass reversed, which use the W3DBufferManager.

xezon commented 3 years ago

Try to redirect buffer access to custom larger buffer. Buffer struct size can be determined by trial and error using the test map above or by looking at memory of layout of buffer itself. Buffer address will reveal itself near the asserts that the World Builder executable has for exceeding the buffer limits. Then data breakpoint can be put on buffer to find all places it is access from.