{"author_name":"LoneStranger","cat":"LD #15 - Caverns - 2009","comments":[],"epoch":1251773160,"likes":0,"metadata":{"p_key":"72504","p_author":"LoneStranger","p_authorkey":"203","p_urlkey":"108326","p_title":"LoneStranger\u2019s Caverns Post-Mortem","p_cat":"LD #15 - Caverns - 2009","p_event":"LD15","p_time":"1251773160","p_likes":"0","p_comments":"0","p_status":"UPD5","us_key":"203","us_name":"LoneStranger","us_username":"lonestranger","event_start":"1251417600","event_key":"1","event_name":"LD15"},"text":"<p>This was probably the best Ludum Dare weekend I&#8217;ve had.\u00a0 My game was more than just a tech demo or an &#8216;unfinished&#8217; idea.\u00a0 Of course, they never are truly complete after 48 hours time; there is always something else that can be tweaked or added.\u00a0 When all was said and done, however, my entry was a playable game.<\/p>\n <h3>Background<\/h3>\n <p>The theme was not one that I had put much thought into before it was announced so I really had zero ideas at Go time.\u00a0 One thing that kept popping into my head was the <em>Kroz<\/em> series of games by Apogee software back in the late 80&#8217;s\/early 90&#8217;s.\u00a0 They&#8217;re all pretty much the same engine with a new collection of levels, but one was called <em>Caverns of Kroz<\/em>.\u00a0 The object of the game is to take your hero through twenty or thirty levels to find or capture some relic.\u00a0 Along the way you had to run, whip or out-maneuver swarms of monsters and solve puzzles.\u00a0 I had always thought those games were neat, and it would be interesting to try and &#8216;recreate&#8217; some of that nostaliga.\u00a0 <em>Caverns of Kroz<\/em> didn&#8217;t have anything special that made it more caverny than the rest in the series, but I thought I could do better with actual graphics instead of ASCII art.<\/p>\n <div id=\"attachment_10190\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><\/p>\n <div class=\"mceTemp mceIEcenter\">\n <dl>\n <dt><a href=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2009\/08\/kroz.gif\"><img class=\"size-medium wp-image-10195\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2009\/08\/kroz-300x226.gif\" alt=\"Kingdom of Kroz\" width=\"300\" height=\"226\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2009\/08\/kroz-300x226.gif 300w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2009\/08\/kroz.gif 402w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/dt>\n <\/dl>\n <\/div>\n <p><a href=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2009\/08\/20090830_202424867.png\"><img class=\"size-medium wp-image-10191\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2009\/08\/20090830_202424867-300x225.png\" alt=\"LoneStranger's Caverns level\" width=\"300\" height=\"225\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2009\/08\/20090830_202424867-300x225.png 300w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2009\/08\/20090830_202424867-550x412.png 550w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2009\/08\/20090830_202424867.png 800w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p class=\"wp-caption-text\">Top-Kingdom of Kroz, Bottom-LoneStranger&#39;s Caverns<\/p><\/div>\n <h3>Graphics<\/h3>\n <p>One of the first things I do in a LD is grab a piece of printer paper and start sketching some objects.\u00a0 More is better, even if I think I may not use them.\u00a0 For <em>LSC<\/em>, I sketched a few doodles and scanned them in.\u00a0 The designs were done in homage of the original ASCII characters and colors.\u00a0 For example, my monsters look remiscent of the <strong><span style=\"color: #ff0000\">\u00c4<\/span><\/strong>, <span style=\"color: #00ff00\"><strong>\u00d6<\/strong><\/span> and <span style=\"color: #0000ff\"><strong>\u03a9<\/strong><\/span> characters.\u00a0 The first problem I had to resolve was how big to make the map.\u00a0 <em>Kroz <\/em>uses something like 60&#215;24, but I don&#8217;t really like how smushed that is.\u00a0 I wanted a square ratio on an 800&#215;600 pixel window.\u00a0 This led me to pick 16&#215;16 as the tile size, which seemed small to me.\u00a0\u00a0 For the first couple tiles, the floor and the walls, I used 16&#215;16 image to create them.\u00a0 That went OK.\u00a0 Next I took a look at my scans to turn them into tiles.\u00a0 I did an overhead view of the player, basically just a head and shoulders.\u00a0 I created the tile originally as a full 120&#215;120 image with margins.\u00a0 I colored him yellow and red like the <em>Kroz<\/em> hero.\u00a0 I copied the merged image and pasted it into a new document that I then resized to 32&#215;32.\u00a0 Inside the drawing routines I have it again resized on the fly as 16&#215;16.\u00a0 The reason for this was that I may want to add a &#8216;zoom&#8217; feature to the game in the future and it would be great if the images didn&#8217;t get pixelated.\u00a0 I followed the same procedure for all the rest of the tiles.<\/p>\n <p>The style of the art is not much different than the other LD entries I&#8217;ve done.\u00a0 I don&#8217;t try to draw the straightest or the best.\u00a0 I just draw to my ability.\u00a0 Those are then scanned in and then modified in Photoshop.\u00a0 Since I shrunk these down, you don&#8217;t see the imperfections as much, and maybe that&#8217;s better?\u00a0 I don&#8217;t think some people &#8216;get&#8217; that the imperfect art is part of my style and I think I get marked down for it sometimes.<\/p>\n <h3>Coding<\/h3>\n <p>This is the fourth time I&#8217;m using the same general base code for my LD entry.\u00a0 I think it shows because I have a hang of it&#8217;s abilities and limitations and I can get what I need to get done faster and more efficiently.\u00a0 Also, each LD I add more basic functionality to it so I don&#8217;t have to reinvent the wheel each time, as they say.\u00a0 Additions this time are an unfinished menu system and a tile\/map data structure.<\/p>\n <p>Most everything that I coded worked fairly soon thereafter, even the changes that take 30 minutes in between builds.\u00a0 I think I had only two major problems: monsters moving over walls and monsters not dying when they move onto the player.\u00a0 The first problem was because I couldn&#8217;t figure out why my collision detection logic was failing for monsters.\u00a0 And it wasn&#8217;t.\u00a0 I had an errant semicolon tagging along the end of an <em>if<\/em> statement.\u00a0 My logic was fine and the if was completing an empty statement.\u00a0 Then the next line moved the monster anyway.\u00a0 The second problem was weird in that the monsters would sometimes die when they moved into the player, but not always.\u00a0 A majority of that problem was due to how I keep track of the monsters.\u00a0 I have two references for them.\u00a0 One is in a two dimentional array similar to the tile map.\u00a0 Either the cell has a link to a monster, or it&#8217;s null.\u00a0 The second reference is in a linked list.\u00a0 The grid is used for monster-monster collision detection since I only have to check the cell next to the monster for another monster.\u00a0\u00a0 The linked list is used when I have to traverse each monster object and is faster than checking every cell in the grid.\u00a0 It&#8217;s actually a great idea but I was trying to solve the monster-player collision problem without actually having a fully implemented monster-monster collision.\u00a0 It turned out that the monsters were moving into the same spot and the second monster was overwriting the first monster&#8217;s entry in the grid.\u00a0 It was weird but once I finished implementing that code the rest fell into place.<\/p>\n <p>These two problems cost me about eight hours split over Saturday night and Sunday morning.\u00a0 If I didn&#8217;t have those problems, then my game would have been that much more complete.<\/p>\n <p>I didn&#8217;t try to do anything too fancy in my code.\u00a0 I could have spent more time doing things in a more efficient way for the future, but instead I hardcoded some functions just to get it done.\u00a0 For example, I have eight different functions for the different directions in many parts of the code.\u00a0 Those could probably be pared down to one in each situation if I passed some variables in.\u00a0 I&#8217;d also like to combine the collision detection and movement between the player and the monsters.\u00a0 Maybe base them from the same Mobile class or something.<\/p>\n <h3>What I did Wrong<\/h3>\n <p>Other than those two issues that I mentioned above, there wasn&#8217;t a whole lot that I did wrong while coding.\u00a0 I did have a few too many distractions over the weekend.\u00a0 My folks came over on Saturday to swim (which is great because it was triple-digit weather) and have dinner so I lost a few hours there.\u00a0 That by itself wasn&#8217;t a problem but when I was actually coding I had the TV on which split my attention.<\/p>\n <p>I also forgot to tie the score in with anything being done by the player.\u00a0 Not a big deal, since score isn&#8217;t really much in the game yet, but it should have added some points for killing monsters and grabbing gems and whips.<\/p>\n <p>Apparently my sounds were a bit harsh.\u00a0 I used DrPetter&#8217;s <em>sfxr<\/em> to create them, but I must have used some weird settings because they sound fine through my 5.1 speakers, but they are harsh through headphones.\u00a0 I guess I&#8217;ll have to do sound through headphones next time and hope that translates through the speakers.<\/p>\n <h3>What I did Right<\/h3>\n <p>I think I was helped by trying to emulate the <em>Kroz<\/em> series of games and it wasn&#8217;t because I had a model to &#8216;copy&#8217; from.\u00a0 I think the key was that the limits on what I was setting out to accomplish were already fairly firm.\u00a0 I didn&#8217;t have to try to build in some weird functionality for the future, since I already knew where I was ending up.\u00a0 The other LD weekends started with an idea that was to be flushed out later.\u00a0 The only problem is that later usually doesn&#8217;t come and I am stuck with an incomplete game or a complete &#8216;thing&#8217; that isn&#8217;t fun.<\/p>\n <h3>What I Wanted to Do After Last Compo<\/h3>\n <p>I wanted to work on my basecode after LD48 #14, and I did that.\u00a0 I also wanted to scale down my goals, and I think I was able to manage my goals this time around by not setting them too high.\u00a0 I think it&#8217;s a win.<\/p>\n <h3>What&#8217;s Next?<\/h3>\n <p>I&#8217;d like to continue with this project and there are a few obvious things I can do.<\/p>\n <ul>\n <li>Make the code more efficient and easier to read<\/li>\n <li>Profiling execution.\u00a0 I haven&#8217;t tested lots of monsters or animated tiles yet, but it will probably suffer from performance issues.<\/li>\n <li>Level editor<\/li>\n <li>More objects and tiles<\/li>\n <li>Better level file format<\/li>\n <li>Continue adding basic functions to the basecode<\/li>\n <\/ul>\n <p>So Mortem?\u00a0 This thing&#8217;s just getting started!<\/p>\n \n <p>Tags: <a href=\"http:\/\/ludumdare.com\/compo\/tag\/ld48_15\/\" rel=\"tag\">ld48_15<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/post-mortem\/\" rel=\"tag\">post-mortem<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/postmortem\/\" rel=\"tag\">postmortem<\/a><\/p>","time":"August 31st, 2009 9:46 pm","title":"LoneStranger\u2019s Caverns Post-Mortem"}