{"id":121,"date":"2014-08-25T09:09:04","date_gmt":"2014-08-25T09:09:04","guid":{"rendered":"https:\/\/blogs.scummvm.org\/lukaslw\/?p=121"},"modified":"2022-05-22T09:12:16","modified_gmt":"2022-05-22T09:12:16","slug":"finally-completable","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/lukaslw\/2014\/08\/25\/finally-completable\/","title":{"rendered":"Finally completable"},"content":{"rendered":"<p>Hello everyone!<\/p>\n<p>Great news! The Prince and the Coward is now completable! This means that we are able to play from beginning to the end of the game without skipping any important part of it. Here we have a screenshot from ending sequence to give you a proof:<\/p>\n<figure id=\"attachment_123\" aria-describedby=\"caption-attachment-123\" style=\"width: 656px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/game_ending.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-123\" src=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/game_ending.jpg\" alt=\"\" width=\"656\" height=\"516\" srcset=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/game_ending.jpg 656w, https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/game_ending-300x236.jpg 300w\" sizes=\"auto, (max-width: 656px) 100vw, 656px\" \/><\/a><figcaption id=\"caption-attachment-123\" class=\"wp-caption-text\">Prince completable<br \/>Game ending<\/figcaption><\/figure>\n<p>First thing that I had to change was hero drawing and movement to implement second hero displaying. I made some changes in Hero class (hero shadow drawing, zooming) and also update pathfinding functions for second hero and now it&#8217;s working fine:<\/p>\n<figure id=\"attachment_124\" aria-describedby=\"caption-attachment-124\" style=\"width: 654px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/second_hero.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-124\" src=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/second_hero.jpg\" alt=\"\" width=\"654\" height=\"517\" srcset=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/second_hero.jpg 654w, https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/second_hero-300x237.jpg 300w\" sizes=\"auto, (max-width: 654px) 100vw, 654px\" \/><\/a><figcaption id=\"caption-attachment-124\" class=\"wp-caption-text\">Second hero implementation<br \/>Displaying and movement<\/figcaption><\/figure>\n<p>I also implement drawing &#8220;power meter&#8221; and bind it with mouse and keyboard buttons, so now last mini-game &#8211; &#8220;Escape from jail&#8221; is working correctly:<\/p>\n<figure id=\"attachment_125\" aria-describedby=\"caption-attachment-125\" style=\"width: 656px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/last_mini_game.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-125\" src=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/last_mini_game.jpg\" alt=\"\" width=\"656\" height=\"516\" srcset=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/last_mini_game.jpg 656w, https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/last_mini_game-300x236.jpg 300w\" sizes=\"auto, (max-width: 656px) 100vw, 656px\" \/><\/a><figcaption id=\"caption-attachment-125\" class=\"wp-caption-text\">&#8220;Escape from jail&#8221;<br \/>Last mini-game<\/figcaption><\/figure>\n<p>Next things that I had to code were credits loading and scrolling function for them. They are displayed after game ending animations and they look like this:<\/p>\n<figure id=\"attachment_126\" aria-describedby=\"caption-attachment-126\" style=\"width: 656px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/credits.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-126\" src=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/credits.jpg\" alt=\"\" width=\"656\" height=\"516\" srcset=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/credits.jpg 656w, https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/credits-300x236.jpg 300w\" sizes=\"auto, (max-width: 656px) 100vw, 656px\" \/><\/a><figcaption id=\"caption-attachment-126\" class=\"wp-caption-text\">End credits<br \/>Scrolling after ending animations<\/figcaption><\/figure>\n<p>I also work on graphics functions to add<i> <\/i>anti-aliasing code that exist in original version of game for sprite drawing functions. Prince is using 256 colors palette and its edge smoothing is based on 256 x 256 table of colors transition. Algorithm is checking if currently drawing pixel is located next to the edge of sprite and if it makes jagged line. If it does then this pixel is set with color from transition table calculated of original background pixel color and sprite&#8217;s edge pixel color. Personally I don&#8217;t see a big difference, but I think that it is visible mostly on not moving sprites, like shovel. You can compare it on screenshots below:<\/p>\n<figure id=\"attachment_127\" aria-describedby=\"caption-attachment-127\" style=\"width: 1600px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/diff_antia.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-127\" src=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/diff_antia.png\" alt=\"\" width=\"1600\" height=\"425\" srcset=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/diff_antia.png 1600w, https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/diff_antia-300x80.png 300w, https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/diff_antia-1024x272.png 1024w, https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/diff_antia-768x204.png 768w, https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/diff_antia-1536x408.png 1536w, https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/diff_antia-1200x319.png 1200w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><\/a><figcaption id=\"caption-attachment-127\" class=\"wp-caption-text\">Anti-aliasing comparison &#8211; first location<br \/>(from left to right) Original game, ScummVM &#8211; AA on, ScummVM &#8211; AA off<\/figcaption><\/figure>\n<figure id=\"attachment_128\" aria-describedby=\"caption-attachment-128\" style=\"width: 846px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/shovel_diff.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-128\" src=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/shovel_diff.png\" alt=\"\" width=\"846\" height=\"219\" srcset=\"https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/shovel_diff.png 846w, https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/shovel_diff-300x78.png 300w, https:\/\/blogs.scummvm.org\/lukaslw\/wp-content\/uploads\/sites\/27\/2014\/08\/shovel_diff-768x199.png 768w\" sizes=\"auto, (max-width: 846px) 100vw, 846px\" \/><\/a><figcaption id=\"caption-attachment-128\" class=\"wp-caption-text\">Anti-aliasing comparison &#8211; shovel sprite<br \/>(from left to right) Original game, ScummVM &#8211; AA on, ScummVM &#8211; AA off<\/figcaption><\/figure>\n<p>Most of work is done now, but there are still glitches that I have to fix (e.g. correct shadow drawing, fix drawing of last frames of FLC animations) and some ScummVM&#8217;s Advanced Engine Features that I&#8217;d like to implement before merging of the engine.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello everyone! Great news! The Prince and the Coward is now completable! This means that we are able to play from beginning to the end of the game without skipping any important part of it. Here we have a screenshot from ending sequence to give you a proof: First thing that I had to change [&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-121","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/posts\/121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/comments?post=121"}],"version-history":[{"count":2,"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/posts\/121\/revisions"}],"predecessor-version":[{"id":129,"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/posts\/121\/revisions\/129"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/media?parent=121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/categories?post=121"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/lukaslw\/wp-json\/wp\/v2\/tags?post=121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}