D2X-XL Worklog

Notes on features and problems from the development of D2X-XL, newest first.

Speedup #2: Illumination

When doing some testing I noticed a massive performance degradation in level 4 of Yokelassence's mission 'The Sphere'. Looking into the issue revealed that it had to do with an excessive amount (over 1100) dynamic (i.e. variable, moving or destructible) lights in that mine, which was particularly impacting object rendering. The reason is that the light sources affecting visible objects were determined segment by segment, as this was how the objects were ordered for rendering. So I rewrote that part of the renderer to take advantage of multi threading when available.

Pitfalls ...

Since this code calls the OpenGL driver for rendering there were a few pitfalls though. I couldn't just split rendering up into several threads each handling a segment of the mine, computing the lighting and rendering the objects inside that segment, because a thread doesn't inherit the OpenGL context of its parent process and hence calling OpenGL from it causes the graphics driver to crash. This made it necessary to use a semaphore mechanism to synchronize the illumination and render processes.

... and their solution

So what I did was to put the light calculation into threads and have each lighting thread stop after it had computed a segment's light and only proceed when the main process had rendered the objects in that thread. Since Visual C++ 9 (VS 2008) doesn't support OpenMP version 3, I couldn't use the OpenMP 3 task pragma and had resort to SDL threads. A problem with SDL's multi threading support is that it is somewhat rudimentary; I didn't find an elegant way to have the lighting and render processes communicate via semaphores and had to go for a brute force approach by polling global variables instead, which works well enough though. I also had to make sure one CPU core was reserved for the main thread doing the rendering, so this enhancement requires at least a triple core CPU.

Results

Optimizing path finding and illumination resulted in an approximately twofold acceleration of the renderer, which of course is most noteable in huge levels with massive numbers of effects and objects. Sirius' map 'Anthology', which is my favorite test subject since I am using it for such a long time to collect D2X-XL performance data already, shows a speed increase when rendering the entire level in the textured automap with effects turned on and objects visible from less than 5 fps to around 8 fps. (Core i7 920 @3.2 GHz, Radeon 4890 @ 1920x1200x32).


News

A new D2X-XL update fixing broken screen resolution persistence is available

There is yet another D2X-XL update is available (the new Pumo Mines broke a few things ...)

Believe it or not: There's a new D2X-XL version online!

Uploaded updated D2X-XL and library source code that compiles with Visual Studio 19

After a really long time, another new DLE version is available

A new DLE version is available (hear, hear!) :D

A new Max OS X version of D2X-XL is available!

D2X-XL now offers a cartoon style render mode!

New D2X-XL and DLE versions are available

Blarget has got his own area in the level spotlight

New D2X-XL and DLE versions are available

A couple of levels have been added to the level spotlight

Hooray! We're finally having a new Mac OS X version of D2X-XL!

D2X-XL now features an observer mode for multiplayer games

A new D2X-XL version with improved multiplayer synchronization is available

A new D2X-XL version fixing out of sync problems in multiplayer games is available

A new D2X-XL version with many multiplayer bug fixes is available

Added high quality (ogg) Descent 1 and 2 music to the downloads area

A new D2X-XL version with important bug fixes is available

D2X-XL compiles and runs on Linux again!

Descent 1 and 2 high res textures are now available as complete downloads

A new DLE version with a ton of bug fixes and improvements is online

A new D2X-XL version is online

A new D2X-XL version with a much needed bug fix is online

A new DLE version is online

Published another DLE version with more bug fixes and improvements by Sirius

Published a new D2X-XL version

Published a new DLE version with tons of bug fixes and improvements by Sirius

D2X-XL now supports Oculus Rift 3D headsets!

Updated DLE and D2X-XL to support new level features requested by Pumo

Added an article about DLE's new tunnel generator to the worklog

DLE's new tunnel generator is finished

Added a new article to the worklog

Published a new DLE version

Added a new article to the worklog

Added two new articles to the worklog

D2X-XL and DLE-XP now support triangular segment sides!

DLE-XP has an OpenGL render and 1st person view!

New DLE-XP version available

Wrote a new worklog article

Check out DarkFlameWolf's level spotlight section!

New DLE-XP and D2X-XL versions are available

A new DLE-XP version is available

Added a worklog article about the way point feature

Added way point support to DLE-XP and D2X-XL

Posted a bunch of new screenshots

Posted a bunch of new screenshots

A New version of DLE-XP is available

New OS X version of D2X-XL is available!

Added article about lightmaps to worklog.

New article and video added to worklog.