{"id":703,"date":"2010-10-16T22:36:25","date_gmt":"2010-10-17T04:36:25","guid":{"rendered":"http:\/\/www.philhassey.com\/blog\/?p=703"},"modified":"2010-10-16T22:36:25","modified_gmt":"2010-10-17T04:36:25","slug":"dynamite-day-16-fixing-stuff","status":"publish","type":"post","link":"https:\/\/www.philhassey.com\/blog\/2010\/10\/16\/dynamite-day-16-fixing-stuff\/","title":{"rendered":"Dynamite: Day 16 &#8211; Fixing Stuff"},"content":{"rendered":"<p>So, today my main goal is to build a few levels for this game!  Rah!  (My title for this post was originally &#8220;Building Levels&#8221;).  But as it turned out, I did very little of that.  Instead, I improved and fixed a bunch of broken things.<\/p>\n<p>But first, I added in <a href=\"http:\/\/zlib.net\/\">zlib<\/a> compression of the level data.  This will keep my <a href=\"http:\/\/www.sqlite.org\">sqlite3<\/a> database nice and small.  Worked super easy, took about 2 or 3 extra lines of code.  I might even use zlib for my rewind feature, just so I&#8217;m not using 2MB of memory for no good reason!<\/p>\n<p>So, I keep on coding here, and I&#8217;m finding that in some oddball edge cases the pathfinding code is failing.  This is kind of painful.  I may have to write up my own A-Star implementation.<\/p>\n<p>.. time passes ..<\/p>\n<p>I did, and it seems to be pretty solid and fast.  I even made it pretty &#8220;generic&#8221; so it might be useful in the future.  Maybe I&#8217;ll do a post with the code, as I&#8217;m pretty pleased with how it came out.  I use STL containers for all the internals and it seems pretty zippy even in bad cases.<\/p>\n<p>The next mess I decided to clean up was my rendering engine.  As it was, I was making some 10&#8217;s of thousands of GL calls.  Really.  During playing the game this meant I was using about 63% of the CPU.  I adjusted my code to use large VERTEX_ARRAY batches, and whatnot, and got it down to a handful of GL calls.  Now I use about 8% of the CPU.  We&#8217;re talking about a 8x gain in speed here.  Definitely worth it.<\/p>\n<p>So, I didn&#8217;t get done what I wanted to get done today, but I got a ton of other pretty important stuff wrapped up, so I&#8217;d call it a win.  I&#8217;m taking off Sunday, and Monday is the IGF deadline.  I&#8217;m going to try and get something submitted, even if it&#8217;s a very basic game.  Who knows, maybe they&#8217;ll like it!  I&#8217;ll definitely be sending in updates to them almost daily until the game is done, so I&#8217;m hoping the judges will actually see the game when it is in a more finished state.<\/p>\n<p>-Phil<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, today my main goal is to build a few levels for this game! Rah! (My title for this post was originally &#8220;Building Levels&#8221;). But as it turned out, I did very little of that. Instead, I improved and fixed a bunch of broken things. But first, I added in zlib compression of the level [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[116],"tags":[],"class_list":["post-703","post","type-post","status-publish","format-standard","hentry","category-dynamite"],"_links":{"self":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts\/703","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/comments?post=703"}],"version-history":[{"count":2,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts\/703\/revisions"}],"predecessor-version":[{"id":705,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts\/703\/revisions\/705"}],"wp:attachment":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/media?parent=703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/categories?post=703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/tags?post=703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}