{"id":41,"date":"2026-06-01T12:46:34","date_gmt":"2026-06-01T12:46:34","guid":{"rendered":"https:\/\/blogs.scummvm.org\/mohit\/?p=41"},"modified":"2026-06-01T14:07:46","modified_gmt":"2026-06-01T14:07:46","slug":"week-1-chasing-crashes-in-the-dm-engine","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/mohit\/2026\/06\/01\/week-1-chasing-crashes-in-the-dm-engine\/","title":{"rendered":"Week 1: Chasing Crashes in the DM Engine"},"content":{"rendered":"<p>Hi everyone! Now that the GSoC coding period has begun, I moved from working primarily on the GUI to investigating crashes and gameplay bugs in the DM engine while becoming more familiar with its internals.<\/p>\n<p>The first issue I looked at was a progression blocker near the start of the game. After assembling my party in the Hall of Champions, I found, as Strangerke had pointed out, that the gate to the dungeon remained shut despite stepping on the floor sensors. The issue turned out to be an incorrect early return in the sensor effect logic, preventing the pressure plate from triggering the door-opening event.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-42 size-large\" src=\"https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/IntialGate-1024x648.png\" alt=\"\" width=\"580\" height=\"367\" srcset=\"https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/IntialGate-1024x648.png 1024w, https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/IntialGate-300x190.png 300w, https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/IntialGate-768x486.png 768w, https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/IntialGate-1200x760.png 1200w, https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/IntialGate.png 1453w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/p>\n<p>Another crash occurred when highlighting a selection in the game&#8217;s save dialog. The cause was a simple parameter ordering mistake in a box constructor used to draw the selection highlight.<\/p>\n<p>Another task involved implementing <em>EventManager::highlightScreenBox()<\/em>, enabling visual highlighting for UI elements such as the movement controls.<\/p>\n<div style=\"width: 514px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-41-1\" width=\"514\" height=\"258\" loop autoplay preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/UI-highlight.mp4?_=1\" \/><a href=\"https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/UI-highlight.mp4\">https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/UI-highlight.mp4<\/a><\/video><\/div>\n<p>&nbsp;<\/p>\n<p>Next was a save-loading bug, where the first in-game load attempt would start a new game instead of loading the selected save. Setting the correct game mode when a valid save slot was chosen resolved the issue.<\/p>\n<p>Next was a stairs transition crash when moving from level 0 to level 1. The crash is currently fixed, but Sev explained that I will need to revisit this area and make the implementation aware of endianness and struct padding to achieve a fully portable solution.<\/p>\n<div style=\"width: 580px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-41-2\" width=\"580\" height=\"350\" loop autoplay preload=\"metadata\" controls=\"controls\"><source type=\"video\/webm\" src=\"https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/Stairs.webm?_=2\" \/><a href=\"https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/Stairs.webm\">https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/Stairs.webm<\/a><\/video><\/div>\n<p>&nbsp;<\/p>\n<p>Next was a crash that occurred whenever certain creatures, such as mummies, entered the player&#8217;s field of view.<\/p>\n<p>&nbsp;<\/p>\n<div style=\"width: 580px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-41-3\" width=\"580\" height=\"326\" loop autoplay preload=\"metadata\" controls=\"controls\"><source type=\"video\/webm\" src=\"https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/StairsRightCrash.webm?_=3\" \/><a href=\"https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/StairsRightCrash.webm\">https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/StairsRightCrash.webm<\/a><\/video><\/div>\n<p>Another bug involved a teleporter that was intended to appear as a normal wall. Incorrect bitfield masks caused it to render instead as a room filled with teleporter, hiding the key that was supposed to be visible on the ground.<\/p>\n<p><strong>Before:<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-53 size-large\" src=\"https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/scummvm-dm-amiga-00000-1024x576.png\" alt=\"\" width=\"580\" height=\"326\" srcset=\"https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/scummvm-dm-amiga-00000-1024x576.png 1024w, https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/scummvm-dm-amiga-00000-300x169.png 300w, https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/scummvm-dm-amiga-00000-768x432.png 768w, https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/scummvm-dm-amiga-00000-1536x864.png 1536w, https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/scummvm-dm-amiga-00000-1200x675.png 1200w, https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/scummvm-dm-amiga-00000.png 1920w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/p>\n<p><strong>After:<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-54\" src=\"https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/scummvm-dm-amiga-00001-1024x576.png\" alt=\"\" width=\"580\" height=\"326\" srcset=\"https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/scummvm-dm-amiga-00001-1024x576.png 1024w, https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/scummvm-dm-amiga-00001-300x169.png 300w, https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/scummvm-dm-amiga-00001-768x432.png 768w, https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/scummvm-dm-amiga-00001-1536x864.png 1536w, https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/scummvm-dm-amiga-00001-1200x675.png 1200w, https:\/\/blogs.scummvm.org\/mohit\/wp-content\/uploads\/sites\/82\/2026\/06\/scummvm-dm-amiga-00001.png 1920w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Next was a crash in the game&#8217;s debugger, where entering an invalid <em>gimme<\/em> command such as <em>gimme gold key<\/em> instead of the expected <em>gimme GOLD KEY <\/em>would result in a crash.<\/p>\n<p>Another set of fixes involved correcting several incorrectly ordered <em>CLIP<\/em> calls across the codebase, which were responsible for a number of crashes.<\/p>\n<p>I also resolved several warnings reported by PVS-Studio, addressing a number of potential issues in the codebase.<\/p>\n<p>Now that I&#8217;m gaining momentum, I hope to tackle many more bugs in the coming weeks while continuing to resolve PVS-Studio warnings and improve the overall stability of the DM engine. That&#8217;s all for this week. See you in the next update!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi everyone! Now that the GSoC coding period has begun, I moved from working primarily on the GUI to investigating crashes and gameplay bugs in the DM engine while becoming more familiar with its internals. The first issue I looked at was a progression blocker near the start of the game. After assembling my party [&hellip;]<\/p>\n","protected":false},"author":30,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-41","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/mohit\/wp-json\/wp\/v2\/posts\/41","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/mohit\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/mohit\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/mohit\/wp-json\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/mohit\/wp-json\/wp\/v2\/comments?post=41"}],"version-history":[{"count":28,"href":"https:\/\/blogs.scummvm.org\/mohit\/wp-json\/wp\/v2\/posts\/41\/revisions"}],"predecessor-version":[{"id":79,"href":"https:\/\/blogs.scummvm.org\/mohit\/wp-json\/wp\/v2\/posts\/41\/revisions\/79"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/mohit\/wp-json\/wp\/v2\/media?parent=41"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/mohit\/wp-json\/wp\/v2\/categories?post=41"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/mohit\/wp-json\/wp\/v2\/tags?post=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}