v0.7.3
DOOM_Ants 0.7.3 — Fixes, speed and hardening from the code review
Changed
Every push is checked for leaked secrets, and the local test gate checks the commits being pushed. (DOOM-0471) A push that changes only documentation skips the test run, but only when GitHub's last run on that branch passed.
Classic's software renderer does less redundant work per pixel, with an identical picture (DOOM-0445) The original 1993 renderer's inner loops looked up the screen width in a way that stops the compiler keeping it in a register, cleared more memory than it uses for each new floor or ceiling, and did a multiplication per pixel of the spectre effect. Each is now done once. The picture is checked byte for byte against the old renderer.
Solid and Ultra spend far less time each frame updating moving floors, doors and animated textures (DOOM-0443) Every frame the game checks each corner of the level for doors, lifts and animated textures that changed. It was reading the level back from graphics memory to do so, which is slow. It now keeps a copy in ordinary memory and sends only what changed. Measured standing still at the start of E1M1 on the development machine in Solid, the frame rate roughly tripled. The picture is unchanged.
Solid's full nearest-lights recalculation is faster (DOOM-0461) When a level loads, or a lit surface moves, Solid recalculates which fixed lights are nearest each part of the level. It now reads the lights from ordinary memory instead of graphics memory. The result is unchanged.
Solid runs much faster in levels with many glowing objects (DOOM-0437) Each frame, Solid works out which lights are nearest each part of the level. It was reading the glowing objects' details back from graphics memory over and over, which is slow. It now keeps a copy in ordinary memory. Measured standing still at the start of E1M3 on the development machine, the frame rate nearly tripled. The lighting is unchanged.
Animated nukage and lava no longer trigger a full lighting recalculation each time they change frame (DOOM-0436) In Solid, an animated floor changing frame used to redo the whole nearest-lights calculation, a regular spike in frame time. A changing floor moves no light, so now only the light colours are refreshed. The lighting result is identical.
Levels resolve their wall textures by direct lookup instead of searching the texture list for every wall side (DOOM-0446) Loading a level used to compare each wall side's texture names against the whole texture list. It now goes straight to the entry. Every wall resolves to the same texture as before, including when a mod repeats a texture name.
Finding a picture or sound in the game data is now a direct lookup instead of a search through the whole index (DOOM-0435) The game used to search its whole data index from one end every time it needed a picture or sound, and the Load, Save and volume menus did that inside their drawing loops. It now goes straight to the entry, and a mod file still overrides the original data exactly as before.
Volumetric fog now defaults to Medium instead of Low The user's pick. A saved rt_fog setting in ~/.doomrc still wins. Part of DOOM-0011, which is still in progress.
The game is now built with the compiler's optimiser switched on (DOOM-0434) It was shipping with the optimiser off — the setting used for debugging — which looks inherited from the 1997 source rather than chosen. Measured at about 5% less processor time on the original renderer. The classic renderer draws pixel-for-pixel the same frames as before, and the recorded demo fixtures are unchanged, so nothing about how the game plays or looks has moved.
-rtviewand-rippletimenow say why a value was refused (DOOM-0405) Both refused a bad value in silence and carried on with the default. Both flags exist for repeatable headless captures, so the run looked like it worked and the picture was filed as evidence for a setting it never used. Neither flag stops the game; the message is the whole change.Saved games now record which build wrote them, and refuse to load into a different one (DOOM-0426) A saved game is a straight copy of the game's memory, so a different build can lay it out differently and read it as nonsense. It now says which layout it was written in and is politely refused if that does not match, instead of loading a broken game. Note: this makes saves from earlier versions unreadable. They were already being misread rather than refused.
Removed
The config file no longer carries two serial-mouse settings nothing read. (DOOM-0450) mousedev and mousetype were 1997 settings for a serial mouse; SDL handles the mouse now. Old config files still load, and the two lines drop out the next time the game saves.
Removed
-statcopy, which wrote game data to an address given on the command line (DOOM-0401) A 1997 hook for an external statistics program that no longer exists. Passing it crashed the game at the end of a level.
Fixed
Opening a door or riding a lift in a ray-traced view no longer writes past the end of the world's ray-tracing structure. (DOOM-0128) The structure was compacted to save about 90 KiB of video memory, and Vulkan cannot refresh a compacted structure in place. It now keeps its full size.
Co-op games no longer quit at the first level exit, and multiplayer chat types what you press. (DOOM-0464) Three checks meant "is the game in French?" and always answered yes. Co-op asked for a French-only intermission graphic and quit when it was missing. Chat ran every key through the French keyboard layout.
A lost graphics device now stops the game with a message instead of freezing it (DOOM-0412) If the graphics driver reset under the game, several checks threw the error away and the game carried on against a dead device. It now stops and says why. Also: on a screen that offers no ordinary 8-bit colour format the game says which one it fell back to.
The ray-traced view now says when a crowded map has more monsters than it can draw (DOOM-0411) Past about 4,000 things it used to leave some out without a word. Also: a fog calculation at the far edge of a huge map no longer starts from a garbage position, and a debug message no longer floods the log during firefights.
Ultra finds its HD textures wherever the game is started from (DOOM-0410) It used to look relative to the folder you launched from, and quietly fell back to the original artwork otherwise. It now looks beside the game itself and says which folder it used. The texture loader also reports every texture it shrinks or leaves out, and it no longer loads every texture into memory before deciding which ones fit.
Ray-traced ghosting protection no longer switches off for good on very bright pixels (DOOM-0409) The denoiser stored a squared brightness in a format too small to hold it. Once it overflowed, that pixel could never reset its history again. Also: the bloom glow no longer smears thin lights at 67% and 75% render scale, and a single bad lighting sample can no longer spoil a room's baked light for the whole level.
Solid's contact shadows no longer read the edge of a monster as a nearby wall (DOOM-0408) The shadow pass blended depth values across object edges, and a blend of a monster's marker value with a wall's depth looked like a close occluder. It now reads exact values. Also: a bad pixel can no longer reach the screen through the tone mapper, and the torch's shadow is only computed where the beam actually lands.
The ray-traced view converts DOOM's colours with the exact sRGB curve (DOOM-0407) It used a rough approximation that was up to 59% off in the darkest colours. The sky, the HD art and the glow maths already used the exact curve. On screen, dark rooms brighten by about 1/255.
Ray-tracer robustness fixes from the shader review (DOOM-0407) Zero-area lights no longer enter the light list, where they could produce infinite values. A missing GI table is no longer read. The -rtverify self-test now fails on any non-finite pixel instead of passing or reporting nothing.
DOOM 1's animated intermission map now draws (DOOM-0391) The between-levels map was static. A check meant to skip the animation for DOOM 2 tested a constant that is always true, so the drawing step gave up on its first line while the artwork was still being loaded and advanced every frame. DOOM 2 is unaffected -- it never had the animation.
The Windows build was missing a compiler safety flag the Linux build had by accident (DOOM-0434) This code deliberately reads the same memory as two different types, which the optimiser is allowed to assume never happens. The flag that disables that assumption was arriving on Linux only as a side effect of an unrelated sound library, and the Windows build was getting none of it. Both are now set deliberately, so switching the optimiser on could not quietly change behaviour on Windows alone.
Fog now reaches rooms it was failing to light (DOOM-0406) The search that works out how far outdoor air seeps through a level ran on a fixed-size worklist. Once that filled, it recorded a shorter route to a room but never went back to tell that room's neighbours, so parts of a map were treated as further from the open air than they are. The worklist now grows instead.
The lighting bake no longer scores cells outside the map (DOOM-0406) Every cell in the border ring around a level reported itself as breathable air, so the fog-lighting pass tested lights against points beyond the map's edge. Those tests could never light anything. Removing them cuts the work done each time a door finishes moving, and not one lit cell changed.
A sprite could be freed while the texture atlas was still reading it (DOOM-0406) Building the atlas looked up the palette partway through copying a sprite. That lookup can evict cached data to make room — including the sprite being copied — and the copy carried on reading it. The palette is now looked up before the sprite is held.
A crafted WAD can no longer push a sector's light level out of range (DOOM-0406) Wall and floor brightness was taken straight from the map file with no bounds check, while every other surface type already clamped it. The ray-traced view used the raw value, so an out-of-range level reached the lighting maths. Clamped at the source, which covers both views.
An out-of-range
-rtviewvalue is no longer accepted on Windows (DOOM-0405)-rtview 9999999999was refused on Linux and silently accepted as 2147483647 on Windows. The guard compared against the int limits but the type it compared is half as wide on Windows, so an overflowing value saturated to exactly the limit and passed. Measured on both toolchains before and after.-rippletimeno longer accepts a value that is not a finite number (DOOM-0405)inf,nanand a number too large to represent were read as numbers and reached the renderer. No range check can catch one:infcompares as greater than zero, and every comparison againstnanis false. A value that underflows is still accepted, because zero is its right answer.Keypad and Home/End keys no longer trigger unrelated actions (DOOM-0404) Keys the game has no name for were being folded onto letters that do have one. Tapping the keypad's full stop on the automap wiped your marks; keypad 9 acted as 'a', Caps Lock as '9', Home as 'J'. Those keys now do nothing, which is what they did in the original release.
An add-on level pack with a damaged colour table can no longer read past its own data (DOOM-0404) The game read a fixed amount from the WAD's colour table without checking how much was actually there. A crafted or truncated file made it read past the end. The length is now checked once when the game loads, and a short table is refused with a clear message instead.
Very long pauses in a music track no longer mistime everything after them (DOOM-0404) The MUS-to-MIDI converter could not write a gap longer than about 28 bits and produced a corrupt timestamp instead, throwing out the timing of every note that followed. Over-long gaps are now capped at the longest the format allows.
Network errors on Windows now say what actually went wrong (DOOM-0404) Windows reports network failures separately from ordinary file errors, and the game was printing the wrong one -- a connection problem could appear as "No such file or directory", or as success.
A failed clock read can no longer feed garbage into the game's timing (DOOM-0404) Two places read the system clock without checking whether the read worked, from a variable that starts with whatever was left in memory. The one that paces the game now stops with a clear error; the one behind the FPS counter reports zero and carries on.
Saved games with an unusual character in the name no longer show as empty on Windows (DOOM-0403) The file was being opened in text mode, where Windows stops reading at certain bytes. A perfectly good save was then listed as an empty slot, with nothing said about why. Linux was never affected.
The FPS counter no longer opens on a nonsense figure (DOOM-0403) It started by measuring across the level load, when nothing is being drawn, so the first reading was about 1 frame per second. It now waits for a period it was actually drawing in. This applies to every level change, not just the first.
The Renderer setting now says when your machine cannot run the 3D tiers (DOOM-0403) With no suitable graphics device the setting would not change and gave no reason. It now reads "Classic (no 3D)".
The end-of-level frags column goes away again when nobody has fragged anyone (DOOM-0403) Once any level in a network game had a frag, the column stayed for the rest of the session. Network games only.
Three smaller fixes in the menus, the end-of-game text and the settings file (DOOM-0403) An unrecognised quoted setting leaked a small amount of memory each time the settings were read; an add-on ending a level the original game has no text for could crash instead of showing the first chapter's text; and the developer menu's scroll arrow overlapped the status bar.
The decorative border around the view is drawn again on a widescreen display (DOOM-0402) At any Screen Size below full, the carved stone frame around the picture was measured against the old 4:3 canvas rather than the actual screen. The right-hand edge was dropped entirely and the other three were pushed into the picture, where nothing ever copies them to the screen -- so the border was simply missing. A 4:3 display was never affected.
The PAUSE graphic is centred on the picture again on a widescreen display (DOOM-0402) It was drawn about three-quarters of its own width to the right of centre, at every Screen Size. Same cause as the missing border, found while fixing it. A 4:3 display was never affected.
A broken wall texture no longer leaves the rest of its columns pointing at nothing (DOOM-0402) A texture with a gap in it stopped the engine part-way through preparing it, and every later column of that texture was left uninitialised.
The field of view is now correct at smaller screen sizes on a widescreen display (DOOM-0402) Shrinking the view with Screen Size kept the wide field of view but not the extra width to draw it in, so the picture was squeezed horizontally. Only full-screen was right. Nothing changes on a 4:3 display.
Bounded four more command-line options against bad input (DOOM-0401)
-wartwith a missing map crashed;-maxdemo 0recorded into a zero-sized buffer;-warptowith a huge coordinate silently put the player somewhere else and said it had worked; an empty or unreadable @response file was read as garbage arguments.Ultimate Doom episode 4 no longer shows an invented par time (DOOM-0401) The par-time table only holds episodes 1 to 3, and episode 4 was reading past the end of it. There is no par time in the 1997 data for those levels, so none is shown.
The byte-order swap helpers can be built, and are now tested (DOOM-0401) They were declared for big-endian machines and compiled only for little-endian ones, so a big-endian build could not link at all, and the types would have swapped the wrong width.
A bad number in your settings file can no longer stop the game starting (DOOM-0383) The volume settings were passed straight through to a check that shut the game down, and the menu you would have used to fix them is behind the game that will not start. Out-of-range settings now quietly go back to their normal value instead.
A misspelled value in the settings file is reported and skipped (DOOM-0383) It used to be silently replaced by whatever the line above it said, or by leftover nonsense if it was the first line.
Security
The Windows build checks a fingerprint of every library it downloads (DOOM-0413) A swapped or tampered SDL or Vulkan download is now refused instead of built into the game. Also: the release script explains why it stopped instead of exiting silently, and the Windows packaging steps exist once instead of in two drifting copies.
Refuse a WAD whose texture lumps claim more than they hold (DOOM-0402) A crafted WAD could make the engine read past the end of its texture list. It now says which lump is wrong and stops.
Refuse a WAD with no flats, no sprite lumps or no wall textures (DOOM-0402) These counts come from the WAD and could go to zero or below, which the engine then used as an array size.
Refuse a network game with more players than DOOM can represent (DOOM-0401) Joining with more than four hosts wrote past the end of the player list. The engine now says so and stops instead.
The Linux download is now built with packaging tools that are checked before they run (DOOM-0259) The build used to fetch three helper programs from a moving link and run them unchecked. They are now pinned to fixed releases and verified against a recorded fingerprint on every build.
Network games now check that packets arrived intact (DOOM-0256) The check existed but had been switched off since 1997, so it passed everything. It now catches a damaged packet, and a packet from a different build of the game, instead of playing them as movement. Note that this means a network game only works between two copies of this version or newer.
Two overflows inherited from the 1993 renderer can no longer be reached (DOOM-0382) Both were in the original game and had been made larger by this project's widescreen and higher-resolution work, so a map could scribble over memory it did not own. One is now impossible by sizing; the other regained a guard the original already had a few lines away. A floor-drawing check that was one row too generous was corrected at the same time.