{"id":108,"date":"2022-09-11T17:03:40","date_gmt":"2022-09-11T17:03:40","guid":{"rendered":"https:\/\/blogs.scummvm.org\/stablesteady\/?p=108"},"modified":"2022-09-11T17:03:40","modified_gmt":"2022-09-11T17:03:40","slug":"week-15-part-ii-working-on-avalanche","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/stablesteady\/2022\/09\/11\/week-15-part-ii-working-on-avalanche\/","title":{"rendered":"Week 15 Part II &#8211; Working on Avalanche"},"content":{"rendered":"<p>A small addition to Week 15&#8217;s entry is some work I did on Avalanche. There&#8217;s wasn&#8217;t much time left when I got to Avalanche so after looking at the pending issues, I decided to tackle some gameplay bugs as those are generally simpler than implementing entirely new features.<\/p>\n<p>The first one was about the in-game movement direction indicator.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110\" src=\"https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.17.00.png\" alt=\"\" width=\"587\" height=\"448\" srcset=\"https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.17.00.png 587w, https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.17.00-300x229.png 300w\" sizes=\"auto, (max-width: 587px) 100vw, 587px\" \/><\/p>\n<figure id=\"attachment_109\" aria-describedby=\"caption-attachment-109\" style=\"width: 594px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-109\" src=\"https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.16.43.png\" alt=\"\" width=\"594\" height=\"472\" srcset=\"https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.16.43.png 594w, https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.16.43-300x238.png 300w\" sizes=\"auto, (max-width: 594px) 100vw, 594px\" \/><figcaption id=\"caption-attachment-109\" class=\"wp-caption-text\">Direction indicator in bottom left.<\/figcaption><\/figure>\n<p>The game has two different movement methods, arrow keys and clicking. The bugged behavior would update the direction indicator only when arrow keys were used. To fix this was quite simple, I just found the function used to handle keyboard input and checked how the direction indicator was being updated for the corresponding arrow key input. I then went to the part of the code which handles mouse input and used those same function and now it works perfectly.<\/p>\n<p>The second bug was something I found while playing through the game. Spoilers for the game upcoming incase that&#8217;s something you are worried about.<\/p>\n<p>There&#8217;s a segment where you have to climb up a dais but it&#8217;s rigged to shoot a arrow as soon as you do that. The solution to progress is to quickly climb down to avoid the arrow. However, the bugged behavior would insta-kill you as soon as you entered the command to climb up.<\/p>\n<figure id=\"attachment_111\" aria-describedby=\"caption-attachment-111\" style=\"width: 1601px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-111\" src=\"https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.21.29.png\" alt=\"\" width=\"1601\" height=\"880\" srcset=\"https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.21.29.png 1601w, https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.21.29-300x165.png 300w, https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.21.29-1024x563.png 1024w, https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.21.29-768x422.png 768w, https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.21.29-1536x844.png 1536w, https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.21.29-1200x660.png 1200w\" sizes=\"auto, (max-width: 1601px) 100vw, 1601px\" \/><figcaption id=\"caption-attachment-111\" class=\"wp-caption-text\">We are killed before the arrow reaches us.<\/figcaption><\/figure>\n<p>To fix this I looked for the code which handles the arrow firing event. Luckily the error in that code was quite obvious.<\/p>\n<figure id=\"attachment_112\" aria-describedby=\"caption-attachment-112\" style=\"width: 524px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-112\" src=\"https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.23.30.png\" alt=\"\" width=\"524\" height=\"90\" srcset=\"https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.23.30.png 524w, https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.23.30-300x52.png 300w\" sizes=\"auto, (max-width: 524px) 100vw, 524px\" \/><figcaption id=\"caption-attachment-112\" class=\"wp-caption-text\">The same sprite data is used for both the character and the arrow<\/figcaption><\/figure>\n<p>The sprite data is what holds the coordinates of the sprite. Since the same sprite data was being used, they would immediately pass the collision check. I replaced this to use the correct sprite data for the main character.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-113\" src=\"https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.26.30.png\" alt=\"\" width=\"1065\" height=\"620\" srcset=\"https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.26.30.png 1065w, https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.26.30-300x175.png 300w, https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.26.30-1024x596.png 1024w, https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.26.30-768x447.png 768w\" sizes=\"auto, (max-width: 1065px) 100vw, 1065px\" \/><\/p>\n<figure id=\"attachment_114\" aria-describedby=\"caption-attachment-114\" style=\"width: 987px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-114\" src=\"https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.27.24.png\" alt=\"\" width=\"987\" height=\"771\" srcset=\"https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.27.24.png 987w, https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.27.24-300x234.png 300w, https:\/\/blogs.scummvm.org\/stablesteady\/wp-content\/uploads\/sites\/52\/2022\/09\/2022-09-11-22.27.24-768x600.png 768w\" sizes=\"auto, (max-width: 987px) 100vw, 987px\" \/><figcaption id=\"caption-attachment-114\" class=\"wp-caption-text\">We now die when the arrow reaches us<\/figcaption><\/figure>\n<p>This was the last fix I could make for Avalanche in the time I had and also the last of my contribution for this GSoC. This was a great journey and working on ScummVM was a good experience for me. I&#8217;ll be posting a GSoC summary post after this (and you might have already seen a password protected version thanks to a mess up) so look forward to that. Thanks for sticking to the end with me!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A small addition to Week 15&#8217;s entry is some work I did on Avalanche. There&#8217;s wasn&#8217;t much time left when I got to Avalanche so after looking at the pending issues, I decided to tackle some gameplay bugs as those are generally simpler than implementing entirely new features. The first one was about the in-game [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-108","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/stablesteady\/wp-json\/wp\/v2\/posts\/108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/stablesteady\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/stablesteady\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/stablesteady\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/stablesteady\/wp-json\/wp\/v2\/comments?post=108"}],"version-history":[{"count":1,"href":"https:\/\/blogs.scummvm.org\/stablesteady\/wp-json\/wp\/v2\/posts\/108\/revisions"}],"predecessor-version":[{"id":115,"href":"https:\/\/blogs.scummvm.org\/stablesteady\/wp-json\/wp\/v2\/posts\/108\/revisions\/115"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/stablesteady\/wp-json\/wp\/v2\/media?parent=108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/stablesteady\/wp-json\/wp\/v2\/categories?post=108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/stablesteady\/wp-json\/wp\/v2\/tags?post=108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}