Lezing's DN3D Resource»In development»Qwnz0r Qwn3d (Lezing's New Generation Art)
Whilst EDuke32 has got a support of modern graphic features owing to the Polymer renderer, I decided to make a mod giving a new life to the good ol' 8-bit mode. Also, such a mod would be a sort of exercise for me before stand-alone commercial game projects I plan to participate someday.
The project called "Lezing's New Generation Art" was started instead of the abandoned SkyTown TC. Due to lots of resource demanding features, LNGA turns up very CPU-intensive. To assure appropriate framerates, most of that shit is being designed for the 640x480 resolution. However, I hope that all heavy things I put into the mod will be easily mastered by most of computers when it will have been released.
WTF is LNGA
Lezing's New Generation Art mod's principal goals are (some aren't attained so far):
- Drastic changes in 8-bit mode visuals with advanced rendering capabilities based on a new palette;
- Better acoustics with realistic falloff, delays and echoes;
- A family of various controller sprites to replace the Sector Effectors and other hard-coded crap;
- Refined game physics with proper inertia, particles, more precise clipping etc;
- More advanced AI for NPCs and enemies; ingame communication system;
- A modular HUD with integrated user interface and an unique crosshair for each weapon;
- Redone inventory system, weapons and actor programming;
- A gadget system with "onboard" power management;
- Compatibility with both original Duke tiles and new ones;
- Strategy elements with ability to do research and manufacture items.
Development status
I have started a number of fundamental features, such as the GUI and the controller sprites, but nothing is finished so far. I'm going to try some more ideas for this mod, but I keep working mostly on the Last Pissed Time series. A slew of visual and audio stuff for the future TC was made using Evaldraw; this app made by Ken Silverman (Build engine developer) really allows manipulating information ad lib.
Downloads
Releases available for downloading are listed here.
The palette
I've been experimenting with creating various 256-color indexed palettes for a long time to find out one suitable for using in a modern-looking computer game. The palette utilized in LNGA is so-called IDX8_L, a logarithmic-scale palette designed in 2008 for representing a wide range of natural colors in a variety of lighting environments. Its main advantage is capacity of very uniform brightness transitions. However, usage of exponential growth of color values results in an intensity jump in its brightest shades, because each shade is sqrt(2) times brighter compared to previous one (corrected to a gamma of 2.0 by default). The palette consists of 23 hues with 8 to 16 shades, plus 5 extra colors (superblack, transparent and three special near-white colors reducing the leaps of brightness). Older versions of this palette were called from IDX8_A to IDX8_K, most of them were similar to the IDX8_L just having a different set of colors.
|
|
The Duke's palette was replaced with this one. The right image is a collection of 23 base hues with native and approximate (repeated) colors separated by a dotted line.
| |
Beside the new palette, new CLUTs are necessary for texture shading and preprocessing, so I wrote a program in C++ able to generate them. After a lot of hex editing of PALETTE.DAT and LOOKUP.DAT files, all needed data were ready. There is a table of addition instead of 33%/67% translucency, and a new exponential shading table with a step equal to palette's shade difference.
|
|
Original Duke palette used this translucency table.
|
LNGA uses a table of color addition. The last row and column correspond to the transparent color (0xFF) and can be used for special effects.
|
The new "translucency" table adds colors together instead of mixing them (just like in additive color system). This enables the engine to render realistic effects in high dynamic range scenes; but such CLUT is unusable for making shadows (it can't darken the colors). Thus, there are also special color multiplication and division tables (which produce effects similar to "Multiply" and "Divide" blend modes in Photoshop). These tables can be used for lightmap-like effects or light filtering like in stained glass. They can be applied to game objects owing to EDuke32 blending table extensions.
The logarithmic shading model has important advantages compared to linear shading we're used to; despite visible banding it 8-bit color mode, it enables to change overall map brightness uniformly without much unwanted artifacts. Also the dynamic range of texture shades possible in LNGA maps is immense: when ranged from -128 to 127, the brightest shaded texture would be 2127.5 times brighter than the darkest one. The shading CLUT has 43 different color patterns (23 overlit, 19 underlit and one full-bright). The brightest shade makes all colors white except the so-called superblack, which always remains the #000000; and the darkest one fades all colors to the superblack. Since the maximum supported number of shades in Build engine is 128, there's room for two more shading sets, which may be used to simulate our scotopic and mesopic vision to some extent. There's also a compatibility region covering first 20 shades.
|
Exposure values. There are 43 different shades available ranging from white to pitch black. Each column in this image is 1.41 times darker (half an exposure 'stop') than previous one, and each row is 16 times darker (4 stops). Having both underbright and overbright shades enables for working with high dynamic range scenes.
|
|
The main multiplicative set of look-up palettes gives 23 different hues (in fact, hue-saturation doublets). Combining them with the shades gives a color lighting support. Actually, there's a friggin' load of pals in the mod. Tiles made for the original Duke palette may be lit in this way as well owing to a separate set of look-up pals adapted to the Duke palette.
|
Staged (multipass) rendering
Using the capabilities of event processing via CON scripts makes possible splitting a complex scene into several passes and showing them consequentially in a separate way. Each pass can have its own camera coordinates, screen bounds and lighting circumstances, giving a plenty of useful effects, such as multiple Fresnel reflections/refractions, dynamic skyboxes, scaling of environment, a limited form of HDR rendering, image perturbations, fake parallax occlusion mapping (specifically on floors and ceilings). Unfortunately, the limitations of the 8-bit render make impossible slanted reflections, as well as sloped parallax textures. Another benefit of multiple passes is the possibility of multiple instancing of the same sectors in different places of the map instead of copy-pasting them; this feature can vastly improve details and trim work.
Making additional sectors passable requires refining game physics; the engine must perform collision checks for all possible sector connections. Currently I'm searching for an effective way to realize this. Splitting an actor into several sprites (multi-layering) is necessary for visual effects like an alpha channel and a good-looking motion blur.
To simulate diffraction patterns caused by very bright objects, lens flares are rendered after all passes. Each flare consists of a bloom (light coma) sprite, several light streaks and a tiny bright disk in the center; patches of reflected light (ghosts) may be shown as well. To determine whether a flare is visible to the observer, an occlusion check is performed each game tic by means of hitscan.
|
An experimental 12-layer window being shown through eleven additional rendering passes. "Hall of mirrors" artifacts are visible in the bottom and right of the image due to EDuke32 issues. Also, some wrong pixels are noticeable on the window frame itself; the most of glitches are about to be eliminated in the stage of debugging.
|
Audio improvements
To make my TC more realistic and atmospheric, I plan to introduce significant changes into the game acoustics. The first task is forcing sound intensities to obey an inverse-square law. Take note that the sound pressure follows an inverse-proportional law, and amplitudes correspond to sound pressure values, so they must behave inverse-proportionally as well. To prevent the sound amplitude from reaching infinity when distance goes to zero, a finite-radius model may be used as illustrated below.
Duke's sound engine allows varying amplitudes from 1 to 150, resulting in a range of approximately 43 dB. Any sound will spawn its own actor placed at a continuously-recalculated position corresponding to the needed sound intensity. The echoes must have their own emitter sprites. The disappointment of such acoustics system is incompatibility with multiplayer modes, so I decided to do everything with single play in mind.
|
Comparison of two distance-amplitude models. The left chart shows the "vanilla" Duke dependence with a "Vol" parameter acting as an internal sound volume adjustment. The right one is more calculation-expensive, but represents game acoustics more accurately. The amplitude (A) is calculated depending on the distance (D), emitter radius (R) and the maximum amplitude value Amax.
|
Then, the system will try to emulate a finite speed of sound propagation. Making a delay proportional to object's distance to the listener is quite easy, and pitches can be changed dynamically as well to mimic approaching or receding objects. Unfortunately, since Build engine doesn't support changing pitch of sounds already being played, the Doppler effect can't be modeled to the full.
Qwnz0r Qwn3d
Qwnz0r Qwn3d (QQ) will be a four-level episode conjoining 3D action, quest, simulator and even real-time strategy elements. Its title comes from a perverted "pwn" term. At the moment I haven't started making the episode itself, but its concept is already prepared. A nice geeky atmosphere is expected there. Unusual action elements include interaction with NPCs via telecommunication and zero-gravity space travels. Also, a skirmish mode is planned, having a variety of options.
Beside new levels, the original Duke episodes will also be playable with most of the mod's improvements, like the advanced enemy AI, lens flares and the different set of weaponry and items. Any level made for vanilla Duke can be automatically preprocessed in order to make it playable inside the mod.
Forum threads
YouTube videos
|