To this day I still feel very very dirty about this hack, but it was needed to achieve the objectives and harmed no-one :)
Great story! Next time just make sure you wear gloves.
I wouldn't call it dirty - that's elegant. I'd call it a clean, fast way to ship a product because of someone else's un-fixable screwup.
The dirty code is the stuff that was stomping yours in the first place.
True enough :) We did what we had to do given the circumstances.
We once found that the floating point precision bit could change at unspecified times in our game. This destroyed any hope of deterministic computations for networked lockstep games or game replays. We tracked this to some driver or dll hooking into the full-screen switching process for DirectX (could be a mouse driver, or a gfx driver, or who knows what else). It only seemed to happen in pre-NT versions of Windows.
We just forcefully reset the bit after any call to the Windows message pump, and that was the last of our network desyncs gone for good. Ship it!
(I recall DirectX later added some flag related to this, but memory is hazy)
Re:Coding tricks of game developers
by damian2000 on Sunday February 12, 2012 @08:32PM
(#3583769)
@toonse awesome story - would you mind if I updated the blog post to include it?
To this day I still feel very very dirty about this hack, but it was needed to achieve the objectives and harmed no-one :)