{"author_name":"yangamedev","cat":"MiniLD","comments":[{"author_name":"","time":"July 27, 2013 12:13 pm","epoch":1374945180,"text":"Either you, or I do need to get some sleep \ud83d\ude09 Sorry, have to read that again tomorrow.","spam":"N"}],"epoch":1374939660,"likes":1,"metadata":{"p_key":"42248","p_author":"yangamedev","p_authorkey":"20928","p_urlkey":"77871","p_title":"Recursive Level Development","p_cat":"MiniLD","p_event":"LD27","p_time":"1374939660","p_likes":"1","p_comments":"1","p_status":"UPD5","us_key":"20928","us_name":"yangamedev","us_username":"yangamedev","event_start":"1377216000","event_key":"18","event_name":"LD27"},"text":"<p>Gearing up for final content push, getting the maps setup. Next couple of days are going to be a panic so I had to get this solid. The idea is that this map I&#8217;ve been staring at all week can become a <b>Tile<\/b> in the larger world. I already spawned a bunch of them but the pathfinding wouldn&#8217;t sync up and I wasn&#8217;t about to make a colossal A* matrix for whatever map size I decide.<\/p>\n <div id=\"attachment_263904\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2013\/07\/firsttile.png\"><img class=\"size-medium wp-image-263904 \" alt=\"firsttile\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2013\/07\/firsttile-300x199.png\" width=\"300\" height=\"199\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2013\/07\/firsttile-300x199.png 300w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2013\/07\/firsttile-550x365.png 550w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2013\/07\/firsttile.png 904w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p class=\"wp-caption-text\">Tile-ification: Marked exits as Doors with their respective direction normals (dx, dy)<\/p><\/div>\n <p>&nbsp;<\/p>\n <p>This tile already has a method for constructing the A* map, so I wanted a way to\u00a0<strong>allow units to seamlessly travel between any two points on the<\/strong>\u00a0<strong>map.<\/strong>\u00a0That&#8217;s going to be brutal for long distances, and I don&#8217;t want to be limited in this regard. Why? Because I guess I just don&#8217;t feel like it&#8230;and that&#8217;s why I don&#8217;t finish LD48&#8217;s <img src=\"http:\/\/ludumdare.com\/compo\/wp-includes\/images\/smilies\/frownie.png\" alt=\":(\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/><\/p>\n <p>Before I could crap all over myself I realized that if I arrange these tiles on a grid of their own like cards on a table, <span style=\"text-decoration: underline\">I realized I could use the pathfinder to solve the <\/span><strong><span style=\"text-decoration: underline\">world path<\/span>\u00a0<\/strong>(macro, or inter-tile path as opposed to\u00a0<strong>tile path<\/strong> which is micro, or intra-tile path). So I hacked a fake Ogmo file and modified the loading code to generate tiles.<\/p>\n <div id=\"attachment_263911\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2013\/07\/worldmap.png\"><img class=\"size-medium wp-image-263911 \" alt=\"worldmap\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2013\/07\/worldmap-300x168.png\" width=\"300\" height=\"168\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2013\/07\/worldmap-300x168.png 300w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2013\/07\/worldmap-550x309.png 550w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p class=\"wp-caption-text\">Rigging the level loader and pathfinder to build worlds from building blocks is the smartest wheel-reinvention I&#8217;ve yet to perform.<\/p><\/div>\n <p>&nbsp;<\/p>\n <p>Since A* assumes adjacency means walkability, this system would allow world pathing across adjacent tiles even if there was no door. Sticking this limitation on the designer is not the end of the world, and the pathfinder could be subclassed to be door-aware.<\/p>\n <p>So here&#8217;s where the recursion comes in: why don&#8217;t I just screengrab each of the tiles and allow myself to build world maps in Ogmo?<\/p>\n <div id=\"attachment_263912\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2013\/07\/yo-dawg.png\"><img class=\"size-medium wp-image-263912\" alt=\"yo dawg\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2013\/07\/yo-dawg-300x168.png\" width=\"300\" height=\"168\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2013\/07\/yo-dawg-300x168.png 300w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2013\/07\/yo-dawg-550x309.png 550w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p class=\"wp-caption-text\">Since the world map tiles are image captures, they&#8217;ll need to be updated if the referred tile gets changed. Otherwise, I&#8217;m ready to rock.<\/p><\/div>\n <p>I could essentially build a GTA-sized map with layers upon layers of these things. I got no sleep.<\/p>\n <p>Finally there&#8217;s the pathfinding. What&#8217;s great about using these pre-baked tiles is the A* map doesn&#8217;t change. <strong>And the paths between doors can be pre-computed, meaning the traveller is doing no A* work except at the start and end tile destinations.<\/strong> Booya.<\/p>\n <div id=\"attachment_263913\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2013\/07\/choochoo.png\"><img class=\"size-medium wp-image-263913 \" alt=\"choochoo\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2013\/07\/choochoo-300x214.png\" width=\"300\" height=\"214\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2013\/07\/choochoo-300x214.png 300w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2013\/07\/choochoo-550x393.png 550w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2013\/07\/choochoo.png 976w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p class=\"wp-caption-text\">The units know which tile they want to get to, but they have to ask for directions at each purple square. The directions are accurate&#8230;occasionally.<\/p><\/div>\n <p style=\"text-align: left\">I thought I was a genius, but I cracked open Game Programming Gems and there it is. I will create the patent and sue myself, see you later suckers I&#8217;m rich.<\/p>\n <p>Say goodbye to the beanie babies, I&#8217;m piling Oryx art in now that I can create some interesting roguelike levels.<\/p>\n <p>&nbsp;<\/p>","time":"July 27th, 2013 10:41 am","title":"Recursive Level Development"}