{"assets":[],"author_link":"author\/superjoe\/","author_name":"superjoe","cat":"MiniLD #44 \/ 7dRTS","categories":["MiniLD #44 \/ 7dRTS"],"comments":[],"epoch":1374908520,"event":"LD44","likes":6,"metadata":{"p_key":"78950","p_author":"superjoe","p_authorkey":"0","p_urlkey":"287960","p_title":"Pillagers! 7dRTS Game Development Journal \u2013 Day 5","p_cat":"MiniLD #44 \/ 7dRTS","p_event":"LD27","p_time":"1374908520","p_likes":"6","p_comments":"0","p_status":"WAYBACK","us_key":null,"us_name":null,"us_username":null,"event_start":"1377216000","event_key":"18","event_name":"LD27"},"source_url":"2013\/07\/27\/pillagers-7drts-game-development-journal-day-5\/","text":"<p>This article is copied from <a href=\"http:\/\/andrewkelley.me\/post\/pillagers-7drts-game-dev-journal.html#day-5\">my personal blog<\/a>.<\/p>\n<p>I spent a good chunk of the day trying to solve a performance problem. After approximately 100,000 bullets were fired, the framerate would drop to an excruciating 16 FPS.<\/p>\n<p>I was able to figure it out by using Google Chrome\u2019s\u00a0<a href=\"https:\/\/developers.google.com\/chrome-developer-tools\/docs\/heap-profiling\">heap profiling tool<\/a>. Here\u2019s what the heap snapshot looked like:<\/p>\n<p><img alt=\"\" src=\"https:\/\/s3.amazonaws.com\/superjoe\/blog-files\/pillagers-7drts-game-dev-journal\/day-5-memory-leak.png\"\/><\/p>\n<p>I found out that there was a memory leak in the game engine \u2013 every time a sprite was created it called<code>setInterval<\/code>\u00a0but it did not call\u00a0<code>clearInterval<\/code>\u00a0when the sprite was deleted. Ever since I\u00a0<a href=\"https:\/\/github.com\/superjoe30\/chem\/commit\/900ba7c6f5c27617d9917653ee4d63e4f043374d\">fixed the issue<\/a>, FPS has stayed at a nice and smooth 60, no matter how many objects are created and destroyed.<\/p>\n<p>Here are some other things I got done today:<\/p>\n<ul>\n<li>9pm \u2013 Miscellanous small enhancements.<\/li>\n<li>11pm \u2013 Fixed the performance issue.<\/li>\n<li>12am \u2013 Added the new thruster sound that Michael gave me.<\/li>\n<li>3am \u2013 Added Sandbox Mode.<\/li>\n<li>4am \u2013 Added more features to Sandbox Mode.<\/li>\n<li>6am \u2013 Added Ctrl+A to select all your ships. Also made WASD and J work the same as arrow keys and space.<\/li>\n<li>7am \u2013 Added dogfighting mode.<\/li>\n<li>8am \u2013 Added graphics so that ships display their targets when selected.<\/li>\n<li>8am \u2013 Added 2 more dogfighting levels. Enhanced manual piloting of Militia ship so that you can use your melee attack.<\/li>\n<\/ul>\n<p>Here\u2019s a screenshot of Sandbox mode:<\/p>\n<p><img alt=\"\" src=\"https:\/\/s3.amazonaws.com\/superjoe\/blog-files\/pillagers-7drts-game-dev-journal\/day-5-sandbox-mode.png\"\/><\/p>\n<p>Here\u2019s me playing through Dogfighting Mode and messing around in Sandbox Mode a bit:<\/p>\n<p><iframe allowfullscreen=\"\" frameborder=\"0\" height=\"281\" src=\"http:\/\/www.youtube.com\/embed\/7bFireOA96Q?feature=oembed\" width=\"500\"><\/iframe><\/p>\n<p>I have only 2 days left to work. The last day will be primarily reserved for gameplay tweaking, bugfixes, touchups, and testing. That leaves only 1 more day to make actual progress.<\/p>\n<p>These are my goals for tomorrow:<\/p>\n<ul>\n<li>Add a rotating turret to the flagship.<\/li>\n<li>Add a civilian to Level 1 and use that to explain the Move command vs the Engage command.<\/li>\n<li>Add a dogfighting level where there is an ongoing battle and you have to rack up a certain number of kills to win.<\/li>\n<li>Add more campaign levels. I reserve the right to ramp up the difficulty in the later levels!<\/li>\n<li>Pan sound effects and volume depending on scroll location<\/li>\n<li>Add some more ship classes and implement upgrades.<\/li>\n<\/ul>\n<p>Thanks to the folks in the #7dRTS IRC channel for helping me playtest today. Specifically Zapa and Orava.<\/p>\n<p>You can <a href=\"http:\/\/s3.amazonaws.com\/superjoe\/temp\/pillagers\/index.html\">try the game out now<\/a>.<\/p>\n<div style=\"float: right;border: 1px solid #eee;padding: 2px;background: #fff;\"><div class=\"iLikeThis\" id=\"iLikeThis-263862\"><span class=\"counter\"><a class=\"image\" onclick=\"likeThis(263862);\">6<\/a><\/span><\/div><\/div>\n<p class=\"postmetadata\">\n<small>\n\t\t\t\t\t\tThis entry was posted\n\t\t\t\t\t\t\t\t\t\t\t\ton Saturday, July 27th, 2013 at 7:02 am\t\t\t\t\t\tand is filed under <a href=\"http:\/\/www.ludumdare.com\/compo\/category\/minild\/7drts-minild-44\/\" rel=\"category tag\">MiniLD #44 \/ 7dRTS<\/a>.\n\t\t\t\t\t\tYou can follow any responses to this entry through the <a href=\"http:\/\/www.ludumdare.com\/compo\/2013\/07\/27\/pillagers-7drts-game-development-journal-day-5\/feed\/\">RSS 2.0<\/a> feed.\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tYou can <a href=\"#respond\">leave a response<\/a>, or <a href=\"http:\/\/www.ludumdare.com\/compo\/2013\/07\/27\/pillagers-7drts-game-development-journal-day-5\/trackback\/\" rel=\"trackback\">trackback<\/a> from your own site.\n\n\t\t\t\t\t\t\n\t\t\t\t\t<\/small>\n<\/p>","time":"July 27th, 2013 7:02 am","title":"Pillagers! 7dRTS Game Development Journal \u2013 Day 5","title_was_empty":false}