{"id":32,"date":"2025-06-23T13:27:01","date_gmt":"2025-06-23T13:27:01","guid":{"rendered":"https:\/\/blogs.scummvm.org\/prime\/?p=32"},"modified":"2025-06-23T13:27:01","modified_gmt":"2025-06-23T13:27:01","slug":"week-3-titanic-tetraedge-and-a-sea-of-strings","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/prime\/2025\/06\/23\/week-3-titanic-tetraedge-and-a-sea-of-strings\/","title":{"rendered":"Week 3: Titanic, Tetraedge, and a Sea of Strings"},"content":{"rendered":"<p data-start=\"204\" data-end=\"526\">This week was quite busy and eventful! I had my keymapper implementations for the <a href=\"https:\/\/github.com\/scummvm\/scummvm\/pull\/6709\"><strong data-start=\"286\" data-end=\"299\">Supernova<\/strong><\/a> and <a href=\"https:\/\/github.com\/scummvm\/scummvm\/pull\/6715\"><strong data-start=\"304\" data-end=\"314\">Voyeur<\/strong><\/a> engines successfully merged, and I also completed keymapper support for <strong data-start=\"387\" data-end=\"398\">Titanic<\/strong> and <strong data-start=\"403\" data-end=\"416\">Tetraedge<\/strong>. In addition, I took on an extra task to help normalize all keymapper action descriptions across the project.<\/p>\n<hr data-start=\"528\" data-end=\"531\" \/>\n<h3 data-start=\"533\" data-end=\"583\">Titanic: The Most Challenging Engine So Far<\/h3>\n<p data-start=\"585\" data-end=\"680\">Out of all the engines I\u2019ve worked on so far, <strong data-start=\"631\" data-end=\"642\">Titanic<\/strong> has definitely been the most complex.<\/p>\n<p data-start=\"682\" data-end=\"1064\">Implementing the keymapper took me about <strong data-start=\"723\" data-end=\"736\">four days<\/strong>, most of which were spent trying to understand how input was being handled. Unlike other engines, Titanic processes input through a system of &#8220;messages.&#8221; Key presses are encapsulated in these messages and passed around to various components that need to handle input. This indirect approach made the input flow harder to trace.<\/p>\n<p data-start=\"1066\" data-end=\"1462\">Even though I\u2019m still not 100% confident I fully understand every detail of the mechanism, I eventually got the keymapper working by <strong data-start=\"1199\" data-end=\"1255\">mimicking how raw keycodes were originally processed<\/strong>. After two days of reading and experimenting, things finally started to click \u2014 and from that point on, it was just a matter of replacing keycodes with action-based mappings and writing the action bindings.<\/p>\n<hr data-start=\"1464\" data-end=\"1467\" \/>\n<h3 data-start=\"1469\" data-end=\"1506\">Tetraedge: The Easiest One Yet<\/h3>\n<p data-start=\"1508\" data-end=\"1711\">In contrast to Titanic, <strong data-start=\"1532\" data-end=\"1545\">Tetraedge<\/strong> was a breeze. The engine only uses three keys and mouse input, so I was able to wrap up the keymapper integration in <strong data-start=\"1663\" data-end=\"1677\">half a day<\/strong>. Always nice to have a quick win!<\/p>\n<hr data-start=\"1713\" data-end=\"1716\" \/>\n<h3 data-start=\"1718\" data-end=\"1775\">Action Label Normalization: A Multilingual Cleanup<\/h3>\n<p data-start=\"1777\" data-end=\"2054\">ScummVM\u2019s GUI is actively translated into many languages by the community using <a href=\"https:\/\/translations.scummvm.org\/projects\/scummvm\/scummvm\/\">Weblate<\/a>. Weblate automatically picks up strings that are explicitly marked for translation in the code.<\/p>\n<p data-start=\"2056\" data-end=\"2433\">To reduce the translators&#8217; workload, it&#8217;s important that identical strings are reused consistently across the codebase. Weblate treats strings with even minor differences \u2014 like different capitalization \u2014 as separate entries. Unfortunately, over the years, different contributors have used varying styles (sentence case, title case, etc.) for keymapper action descriptions.<\/p>\n<p data-start=\"2435\" data-end=\"2777\">To help streamline translations, I went through and normalized <strong data-start=\"2498\" data-end=\"2521\">1100+ action labels<\/strong> to follow sentence capitalization. The task itself wasn\u2019t difficult, but it was quite repetitive. Fortunately, <strong data-start=\"182\" data-end=\"189\">sev<\/strong> helped by providing a <code data-start=\"212\" data-end=\"222\">git grep<\/code> and <code data-start=\"227\" data-end=\"232\">awk<\/code>-based workflow that made identifying and editing the labels much faster. With that in place, I was able to get through the normalization process much more efficiently.<\/p>\n<hr data-start=\"2779\" data-end=\"2782\" \/>\n<h3 data-start=\"2784\" data-end=\"2801\">Wrapping Up<\/h3>\n<p data-start=\"78\" data-end=\"91\">This week, I:<\/p>\n<ul data-start=\"93\" data-end=\"395\">\n<li data-start=\"93\" data-end=\"156\">\n<p data-start=\"95\" data-end=\"156\">Got my <strong data-start=\"102\" data-end=\"115\">Supernova<\/strong> and <strong data-start=\"120\" data-end=\"130\">Voyeur<\/strong> keymapper PRs merged \ud83c\udf89<\/p>\n<\/li>\n<li data-start=\"157\" data-end=\"236\">\n<p data-start=\"159\" data-end=\"236\">Implemented full keymapper support for <strong data-start=\"198\" data-end=\"209\">Titanic<\/strong> (the hardest one so far)<\/p>\n<\/li>\n<li data-start=\"237\" data-end=\"303\">\n<p data-start=\"239\" data-end=\"303\">Added keymapper support to <strong data-start=\"266\" data-end=\"279\">Tetraedge<\/strong> (the easiest one yet)<\/p>\n<\/li>\n<li data-start=\"304\" data-end=\"395\">\n<p data-start=\"306\" data-end=\"395\">Normalized <strong data-start=\"317\" data-end=\"350\">1100+ keymapper action labels<\/strong> for consistent translations across the GUI<\/p>\n<\/li>\n<\/ul>\n<p data-start=\"397\" data-end=\"647\" data-is-last-node=\"\" data-is-only-node=\"\">Next week, I plan to keep the momentum going and tackle keymapper support for more engines. With each engine, I\u2019m getting a better understanding of the diverse input systems in ScummVM\u2014and figuring out how to adapt the keymapper to each one\u2019s quirks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week was quite busy and eventful! I had my keymapper implementations for the Supernova and Voyeur engines successfully merged, and I also completed keymapper support for Titanic and Tetraedge. In addition, I took on an extra task to help normalize all keymapper action descriptions across the project. Titanic: The Most Challenging Engine So Far [&hellip;]<\/p>\n","protected":false},"author":28,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-32","post","type-post","status-publish","format-standard","hentry","category-week-3"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/prime\/wp-json\/wp\/v2\/posts\/32","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/prime\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/prime\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/prime\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/prime\/wp-json\/wp\/v2\/comments?post=32"}],"version-history":[{"count":2,"href":"https:\/\/blogs.scummvm.org\/prime\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"predecessor-version":[{"id":34,"href":"https:\/\/blogs.scummvm.org\/prime\/wp-json\/wp\/v2\/posts\/32\/revisions\/34"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/prime\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/prime\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/prime\/wp-json\/wp\/v2\/tags?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}