{"author_name":"McFunkypants","cat":"LD #24","comments":[{"author_name":"","time":"August 25, 2012 2:55 pm","epoch":1345924500,"text":"That looks great!","spam":"N"}],"epoch":1345923840,"likes":9,"metadata":{"p_key":"53171","p_author":"McFunkypants","p_authorkey":"501249","p_urlkey":"88873","p_title":"Fantasy Map Tactics Terrain","p_cat":"LD #24","p_event":"LD24","p_time":"1345923840","p_likes":"9","p_comments":"1","p_status":"UPD5","us_key":"501249","us_name":"mcfunkypants","us_username":"mcfunkypants","event_start":"1345766400","event_key":"12","event_name":"LD24"},"text":"<p>I&#8217;ve always loved the &#8220;fantasy maps&#8221; that you find at the beginning of all fantasy novels (LOTR, Game of Thrones, etc.). There&#8217;s something exciting about seeing the map, with all sorts of interesting looking places just begging to be explored. I thought it would be fun to make a turn-based strategy tactics wargame based on this visual style.<\/p>\n <p>I&#8217;m creating my game in HTML5 using jquery, because something like this doesn&#8217;t need 3d rendering performance, and because it is very easy to turn the game into a mobile (android, ios and ouya) app using phonegap. I started by first drawing some typical fantasy map icons using marker on paper:<\/p>\n <p><a href=\"http:\/\/www.ludumdare.com\/compo\/2012\/08\/25\/fantasy-map-tactics-terrain\/fantasy-map-tactics-screenshotsaturday-scan\/\" rel=\"attachment wp-att-166625\"><img class=\"aligncenter size-large wp-image-166625\" title=\"fantasy-map-tactics-screenshotsaturday-scan\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2012\/08\/fantasy-map-tactics-screenshotsaturday-scan-550x372.jpg\" alt=\"\" width=\"550\" height=\"372\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2012\/08\/fantasy-map-tactics-screenshotsaturday-scan-300x203.jpg 300w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2012\/08\/fantasy-map-tactics-screenshotsaturday-scan-550x372.jpg 550w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2012\/08\/fantasy-map-tactics-screenshotsaturday-scan.jpg 1024w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><\/p>\n <p>After scanning in the images and creating a spritesheet, I wrote a simple random map grid creation class. It uses deterministic random <strong>procedurally-generated terrain<\/strong> (a seeded mersenne twister PRNG) so that a complex map can be recalled with a single integer seed value (no need to save a huge array to disk\/cookie\/localstorage). I then add extra water tiles around the edges by varying the shoreline randomly. Finally, I scatter hamlets, towns, cities, forts and castles in non-blocked tiles and give them <strong>random location names<\/strong> by combining two syllables from an array of three-letter strings. This results in a fantasy book-style map with scattered forests, mountains, hills, swamps, and deserts that hold a plethora of interesting-sounding locations.<\/p>\n <p><a href=\"http:\/\/www.ludumdare.com\/compo\/2012\/08\/25\/fantasy-map-tactics-terrain\/fantasy-map-tactics-screenshotsaturday-terrain\/\" rel=\"attachment wp-att-166643\"><img class=\"aligncenter size-large wp-image-166643\" title=\"fantasy-map-tactics-screenshotsaturday-terrain\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2012\/08\/fantasy-map-tactics-screenshotsaturday-terrain-550x378.jpg\" alt=\"\" width=\"550\" height=\"378\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2012\/08\/fantasy-map-tactics-screenshotsaturday-terrain-300x206.jpg 300w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2012\/08\/fantasy-map-tactics-screenshotsaturday-terrain-550x378.jpg 550w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2012\/08\/fantasy-map-tactics-screenshotsaturday-terrain.jpg 1250w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><\/p>\n <p>Finally, I implemented an <strong>A-Star pathfinding<\/strong> algorithm that can navigate a character around obstacles to get to any waypoint on the map (the green and red blocks: green is how far you will move in a single turn before running out of &#8220;energy&#8221;). I also coded a <strong>line-of-sight<\/strong> (LOS) algorithm for use in the combat, which means that eventually projectiles and magic spells could be cast in a straight line but would be blocked by mountains or towns.\u00a0The light beige blocks are tiles that you are able to attack.<\/p>\n <p>There&#8217;s no actual gameplay yet &#8211; no enemies or win conditions &#8211; but at least you can move around the map.<\/p>\n <p>The game jam is half over: so far so good! Wish me luck on this grand adventure: my quest is to make something that is fun enough to provide some replay value and will hopefully serve as an ideal proof-of-concept for a larger and more polished project over the next few months.\u00a0I love Ludum Dare (and Orcajam &#8211; this weekend&#8217;s local game jam gathering).<\/p>\n \n <p>Tags: <a href=\"http:\/\/ludumdare.com\/compo\/tag\/mcfunkypants\/\" rel=\"tag\">McFunkypants<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/progress\/\" rel=\"tag\">progress<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/screenshot\/\" rel=\"tag\">screenshot<\/a><\/p>","time":"August 25th, 2012 2:44 pm","title":"Fantasy Map Tactics Terrain"}