Re: Widescreen hack and some other fixes aka AiO Patch
Posted: Sun Nov 11, 2018 12:21 pm
Interesting, we just found an odd bug.
If a giant's explosive barrel is exploded in his hand at exactly the right moment, Drakan crashes with an access violation after trying to copy slightly under 4GB of RAM.
That tells me that there's a 32-bit overflow error somewhere, since that's clearly wrong.
Said crash can be caused by either directly hitting the barrel with an arrow (very difficult/random, due to the giant's hand bspheres interfering with the collision detection on the barrel itself), or - more consistently - by causing another nearby barrel to explode, which subsequently blows up the barrel the giant is currently carrying.
It was DragonsLover who originally brought this crash to my attention; in his case it manifested in a different way (crashing when the giant was about to pick up the next barrel instead), but I was unable to replicate that particular mode of crashing.
For me it always crashes immediately when the barrel is destroyed - but only if that happens on some very specific frames.
Judging by roughly how many tries it takes to cause the crash, it appears there's an exactly 1 frame window in which the crash can happen.
I expect this to be related to the long-since-fixed crash that sometimes happened when they threw Rynn; especially since the procedure in which the crash occurs appears to show signs of earlier modifications.
The immediate cause of the crash is an access violation at (ImageBase)+161C83h, due to reading past the end of allocated memory. I'm trying to track down the root cause now.
What I've managed to establish so far is that the procedure in question is called with invalid parameters; the arithmetic overflow happens in some other calculations even before that function is called.
If a giant's explosive barrel is exploded in his hand at exactly the right moment, Drakan crashes with an access violation after trying to copy slightly under 4GB of RAM.
That tells me that there's a 32-bit overflow error somewhere, since that's clearly wrong.
Said crash can be caused by either directly hitting the barrel with an arrow (very difficult/random, due to the giant's hand bspheres interfering with the collision detection on the barrel itself), or - more consistently - by causing another nearby barrel to explode, which subsequently blows up the barrel the giant is currently carrying.
It was DragonsLover who originally brought this crash to my attention; in his case it manifested in a different way (crashing when the giant was about to pick up the next barrel instead), but I was unable to replicate that particular mode of crashing.
For me it always crashes immediately when the barrel is destroyed - but only if that happens on some very specific frames.
Judging by roughly how many tries it takes to cause the crash, it appears there's an exactly 1 frame window in which the crash can happen.
I expect this to be related to the long-since-fixed crash that sometimes happened when they threw Rynn; especially since the procedure in which the crash occurs appears to show signs of earlier modifications.
The immediate cause of the crash is an access violation at (ImageBase)+161C83h, due to reading past the end of allocated memory. I'm trying to track down the root cause now.
What I've managed to establish so far is that the procedure in question is called with invalid parameters; the arithmetic overflow happens in some other calculations even before that function is called.