{"id":350,"date":"2014-05-11T17:56:25","date_gmt":"2014-05-12T00:56:25","guid":{"rendered":"https:\/\/www.crabattack.org\/blog\/hawk\/?p=350"},"modified":"2014-05-11T17:56:25","modified_gmt":"2014-05-12T00:56:25","slug":"may-11th-2014","status":"publish","type":"post","link":"https:\/\/www.crabattack.org\/blog\/hawk\/may-11th-2014\/","title":{"rendered":"May 11th, 2014"},"content":{"rendered":"<p>At long last, planning on the new sprite\/ui system has come to a close. This week has nothing really special to talk about. The majority of the remaining problems were all about filling in the last few things that hadn&#8217;t been fully documented for the latest changes (dual graph system, collision handling, scrolling, etc). Implementation\u00a0is going smoothly so far, but since I made the unenviable choice of doing it on the C++ engine side I know full well that there is going to be some heavy debugging costs later on.<\/p>\n<p>Not just that, but large\u00a0swathes\u00a0of the existing game are going to have to be updated for the new system (how maps are\u00a0managed, battle backgrounds will accessed very\u00a0differently,\u00a0map objects are going to be\u00a0handled as sprites instead of tiles, how every sprite in the game needs to be handled is changing, etc). So there&#8217;s still a lot of work ahead. On the plus side I feel like\u00a0the last parts of the core engine that I was displeased with are finally getting into order. Once this work is done I feel like I could use the engine to make future\u00a0games easily, instead of the weirdly cobbled together game-specific mess it started out as.<\/p>\n<p><strong>Unforeseen Consequences: Collisions Collide!<\/strong><\/p>\n<p>Only one design entry to talk about this week since there weren&#8217;t that many. Last week I decided to split the graph into two: one to inherit display\/position properties, and one to indicate draw order. There was one thing I hadn&#8217;t considered when I did that, which is that linking those two things is extremely useful when it comes to collisions. By having every child be within every parent with the transform graph, it\u00a0allows the property of only checking children\u00a0for a collision when it collides with their parent.\u00a0By having the layer graph order indicate draw order, it\u00a0allows collisions to be intercepted by sprites towards\u00a0the top of\u00a0the draw order- ie if the user clicks on a window that&#8217;s on top of another window, only the top window actually receives the collision. These two properties are crazy useful, but by splitting the graph I had to choose one or the other.<\/p>\n<p>At the end of the day the layer graph won out, since it&#8217;s a useful property rather than just an efficient property. But I didn&#8217;t just discard the transform graph&#8217;s filtering, I just made it an option for parents to pass collisions to children even if they themselves don&#8217;t collide (alternately, they can just encompass the entire world). Since the majority of the two graphs are identical only the few exceptions need concern themselves about this. It&#8217;s not ideal (more because these details are easily forgotten and create problems later, than from inefficiency), but it&#8217;s good enough.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At long last, planning on the new sprite\/ui system has come to a close. This week has nothing really special to talk about. The majority of the remaining problems were all about filling in the last few things that hadn&#8217;t been fully documented for the latest changes (dual graph system, collision handling, scrolling, etc). Implementation\u00a0is&#8230; <a href=\"https:\/\/www.crabattack.org\/blog\/hawk\/may-11th-2014\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">May 11th, 2014<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-350","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.crabattack.org\/blog\/hawk\/wp-json\/wp\/v2\/posts\/350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.crabattack.org\/blog\/hawk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.crabattack.org\/blog\/hawk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.crabattack.org\/blog\/hawk\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.crabattack.org\/blog\/hawk\/wp-json\/wp\/v2\/comments?post=350"}],"version-history":[{"count":1,"href":"https:\/\/www.crabattack.org\/blog\/hawk\/wp-json\/wp\/v2\/posts\/350\/revisions"}],"predecessor-version":[{"id":351,"href":"https:\/\/www.crabattack.org\/blog\/hawk\/wp-json\/wp\/v2\/posts\/350\/revisions\/351"}],"wp:attachment":[{"href":"https:\/\/www.crabattack.org\/blog\/hawk\/wp-json\/wp\/v2\/media?parent=350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.crabattack.org\/blog\/hawk\/wp-json\/wp\/v2\/categories?post=350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.crabattack.org\/blog\/hawk\/wp-json\/wp\/v2\/tags?post=350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}