{"id":2299,"date":"2015-03-18T21:54:00","date_gmt":"2015-03-18T21:54:00","guid":{"rendered":"http:\/\/www.spellcasterstudios.com\/?p=2299"},"modified":"2015-03-11T16:02:45","modified_gmt":"2015-03-11T16:02:45","slug":"navigation-and-bugs","status":"publish","type":"post","link":"https:\/\/www.spellcasterstudios.com\/?p=2299","title":{"rendered":"Navigation and bugs"},"content":{"rendered":"<p align=\"justify\">Today I tackled a difficult subsystem: the \u201cmake sure you can walk everywhere\u201d system.<\/p>\n<p align=\"justify\">I have a system that makes sure the player can walk on all the game area, and usually it would raise\/lower terrain to achieve that\u2026 That work relatively well, but with the rivers, etc, lowering and raising terrain would sometimes screw up the rivers big time!<\/p>\n<p align=\"justify\">So I decided to build a new system\u2026 What it does is mark all the areas, find points of interest (boundaries) and then find the closest points between boundaries and join them together with a \u201cbridge\u201d (not necessarily a bridge, but some sort of ramp). The GIF below illustrates this (you can see the green area in the left\/middle of the map disappearing in the first frames).<\/p>\n<p align=\"justify\"><a href=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/03\/area00.gif\" class=\"thickbox\"><img loading=\"lazy\" decoding=\"async\" title=\"area00\" style=\"display: inline\" alt=\"area00\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/03\/area00_thumb.gif\" width=\"538\" height=\"538\" \/><\/a><\/p>\n<p align=\"justify\">This worked fine, but it created sometimes this problem:<\/p>\n<p align=\"justify\"><a href=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/03\/screen500.jpg\" class=\"thickbox\"><img loading=\"lazy\" decoding=\"async\" title=\"screen500\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"screen500\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/03\/screen500_thumb.jpg\" width=\"830\" height=\"482\" \/><\/a><\/p>\n<p align=\"justify\">You can hardly reach the place where the bridge was built (the water tiles)\u2026 To avoid this, I had to change the algorithm so that it uses a better heuristic to find the \u201cpoints of interest\u201d, namely they there has to be a certain number of tiles around it with the same area id:<\/p>\n<p align=\"justify\"><a class=\"thickbox\" href=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/03\/area01.gif\"><img loading=\"lazy\" decoding=\"async\" title=\"area01\" style=\"display: inline\" alt=\"area01\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/03\/area01_thumb.gif\" width=\"587\" height=\"587\" \/><\/a><\/p>\n<p align=\"justify\">The selection then became much better, and the bridges are looking great, but it added another issue: the map used the heightmap to display\u2026 But the bridges don\u2019t affect the heightmap, which means they aren\u2019t shown\u2026 So I had to build another subsystem to take care of that, wasting more RAM and it was tricky to debug (I had a silly error on it).<\/p>\n<p align=\"justify\"><a href=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/03\/screen501.jpg\" class=\"thickbox\"><img loading=\"lazy\" decoding=\"async\" title=\"screen501\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"screen501\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/03\/screen501_thumb.jpg\" width=\"830\" height=\"482\" \/><\/a><\/p>\n<p>Now I found lots of small bugs in the game, which I need to fix before moving towards the next task\u2026<\/p>\n<p><em>Now listening to \u201cTime of the Oath\u201d by \u201cHelloween\u201d<\/em><\/p>\n<p><em>Link of the Day: Very interesting art style for a game:<\/em><\/p>\n<div id=\"scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:3ab8b30e-d837-4cac-9230-926e0a778131\" class=\"wlWriterEditableSmartContent\" style=\"float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px\">\n<div><object width=\"448\" height=\"252\"><param name=\"movie\" value=\"http:\/\/www.youtube.com\/v\/7JoT5KFD7Ak?hl=en&amp;hd=1\"><\/param><embed src=\"http:\/\/www.youtube.com\/v\/7JoT5KFD7Ak?hl=en&amp;hd=1\" type=\"application\/x-shockwave-flash\" width=\"448\" height=\"252\"><\/embed><\/object><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Today I tackled a difficult subsystem: the \u201cmake sure you can walk everywhere\u201d system. I have a system that makes sure the player can walk on all the game area, and usually it would raise\/lower terrain to achieve that\u2026 That work relatively well, but with the rivers, etc, lowering and raising terrain would sometimes screw [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,147,8],"tags":[72,22,242],"class_list":["post-2299","post","type-post","status-publish","format-standard","hentry","category-development","category-chrome-hunter","category-technology","tag-lava","tag-navigation","tag-polish"],"_links":{"self":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts\/2299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2299"}],"version-history":[{"count":1,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts\/2299\/revisions"}],"predecessor-version":[{"id":2300,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts\/2299\/revisions\/2300"}],"wp:attachment":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}