{"id":111,"date":"2018-06-18T14:42:10","date_gmt":"2018-06-18T14:42:10","guid":{"rendered":"https:\/\/blogs.scummvm.org\/joefish-gsoc\/?p=111"},"modified":"2022-05-21T14:43:15","modified_gmt":"2022-05-21T14:43:15","slug":"week-4-show-me-the-world","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/joefish-gsoc\/2018\/06\/18\/week-4-show-me-the-world\/","title":{"rendered":"Week 4 &#8212; Show me the World"},"content":{"rendered":"<h3 id=\"overview\">Overview<\/h3>\n<ul>\n<li>Map rendering<\/li>\n<li>Improving dialog handling<\/li>\n<\/ul>\n<p>Unfortunately the map rendering kept breaking so there\u2019s no video of it right now. While there are improvements in other areas like the dialog handling, the map renderer blocked me for most of the week.<br \/>\nBelow I describe the structure of the MAZE.CMP file that stores static background tiles and how it is used.<\/p>\n<h3 id=\"details\">Details<\/h3>\n<pre>struct Map { \/\/ MAZE.CMP\r\n    byte tileIndex[128][20]\r\n    byte subTileIndex[146][64]\r\n    byte bitmap[1832][32]\r\n}<\/pre>\n<p>Compared to sprites from animation files (discussed in Week 2) the static background is composed of tiles from MAZE.CMP. Those tiles in turn are made of subtiles of 8&#215;8 to save space by assembling the bigger tiles of the smaller ones. So the <em>tileIndex<\/em> are offsets into <em>subTileIndex<\/em> that again are offsets to the 8&#215;8 pixel data in <em>bitmap<\/em>.<\/p>\n<p>On every frame an indexMap is generated of the currently visible subtiles. The reason is not only for caching but for clipping tiles (that\u2019s what kAnimationShadow* are for) and general tile manipulation depending on game state.<\/p>\n<p>34&#215;18 tiles are shown at a time on screen. There will be overdraw as the viewport is only 256&#215;128 but it doesn\u2019t matter as the video buffer is 320&#215;200 and it is clipped off by the frame border in the end. Currently my implementation draws the frame border first for \u201cclearing\u201d the screen as it was convenient to just blit the fullscreen image without the need for transparency.<\/p>\n<h3 id=\"next-week\">Next Week<\/h3>\n<p>The most urgent feature right now is renderering the map. Not only does it help to visually convey the progress better but other features like player movement, rendering of NPCs, Objects, animation of static objects like torches, collision, \u2026 depend on it. Besides that, the definitions for the all objects, \u2026 will need to be ported over as well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview Map rendering Improving dialog handling Unfortunately the map rendering kept breaking so there\u2019s no video of it right now. While there are improvements in other areas like the dialog handling, the map renderer blocked me for most of the week. Below I describe the structure of the MAZE.CMP file that stores static background tiles [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-111","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/joefish-gsoc\/wp-json\/wp\/v2\/posts\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/joefish-gsoc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/joefish-gsoc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/joefish-gsoc\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/joefish-gsoc\/wp-json\/wp\/v2\/comments?post=111"}],"version-history":[{"count":2,"href":"https:\/\/blogs.scummvm.org\/joefish-gsoc\/wp-json\/wp\/v2\/posts\/111\/revisions"}],"predecessor-version":[{"id":113,"href":"https:\/\/blogs.scummvm.org\/joefish-gsoc\/wp-json\/wp\/v2\/posts\/111\/revisions\/113"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/joefish-gsoc\/wp-json\/wp\/v2\/media?parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/joefish-gsoc\/wp-json\/wp\/v2\/categories?post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/joefish-gsoc\/wp-json\/wp\/v2\/tags?post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}