{"author_name":"Julio","cat":"LD #36","comments":[],"epoch":1472521020,"likes":1,"metadata":{"p_key":"3472","p_author":"Julio","p_authorkey":"501085","p_urlkey":"38933","p_title":"Post Mortem Et Lipsum Dolor Sit Amet","p_cat":"LD #36","p_event":"LD36","p_time":"1472521020","p_likes":"1","p_comments":"0","p_status":"UPD5","us_key":"501085","us_name":"Julio","us_username":"Julio","event_start":"1472169600","event_key":"35","event_name":"LD36"},"text":"<p><strong>My excuse<\/strong><\/p>\n <p>The one thing I needed to make my game complete was to\u00a0be able to tell when you&#8217;ve hit an obstacle or thing.<\/p>\n <p><img class=\"aligncenter size-full wp-image-580592\" src=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2016\/08\/Screen-Shot-2016-08-29-at-6.07.27-PM.png\" alt=\"Screen Shot 2016-08-29 at 6.07.27 PM\" width=\"473\" height=\"267\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2016\/08\/Screen-Shot-2016-08-29-at-6.07.27-PM-300x169.png 300w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2016\/08\/Screen-Shot-2016-08-29-at-6.07.27-PM.png 473w\" sizes=\"(max-width: 473px) 100vw, 473px\" \/><\/p>\n <p>Pretty simple, right?\u00a0Add a collider to each thing and then check if the player&#8217;s\u00a0thing is\u00a0touching any other thing. Unity&#8217;s physics engine makes this as painless as it can be.<\/p>\n <p>But\u00a0that\u00a0didn&#8217;t work for me. Even when my objects were touching one another, they still\u00a0failed the\u00a0collision check every time.<\/p>\n <p>Can you guess why? I&#8217;ll give you Unity pros a second to figure it out.<\/p>\n <p>Yes, all the objects had proper box colliders.<\/p>\n <p>Yes, the collision areas were overlapping properly.<\/p>\n <p>No,\u00a0they weren&#8217;t on separate layers.<\/p>\n <p><em>The\u00a0problem is\u00a0that\u00a0colliders are not updated synchronously.<\/em><\/p>\n <p>They only get updated when the physics engine does its thing; that is, on <a href=\"https:\/\/docs.unity3d.com\/ScriptReference\/MonoBehaviour.FixedUpdate.html\">FixedUpdate()<\/a>. And my game doesn&#8217;t use FixedUpdate() or even Update(). It&#8217;s turn based; all iterations of the game loop are triggered by the Next button.<\/p>\n <p>So when\u00a0you click Next, the mule moves forward, touches\u00a0the obstacle\/relic\/whatever, and the game immediately checks if they&#8217;re touching; but they actually aren&#8217;t, because even though their positions have moved, the colliders haven&#8217;t yet.<\/p>\n <p>I don&#8217;t know what the right thing to do is in my situation. Maybe I should store the locations of the obstacles in an array. Maybe I should use colliders and refactor the game logic to run in FixedUpdate. Either way, LD36 is over.<\/p>\n <p>&nbsp;<\/p>\n <p><strong>What I learned<\/strong><\/p>\n <ul>\n <li>unorthodox gameplay mechanics means you&#8217;ll end up spending more time on\u00a0design and iteration<\/li>\n <li>simulations are a terrible idea\u00a0for game jams &#8212; good thing I discarded\u00a0that idea early on<\/li>\n <li>I&#8217;m\u00a0a million times more productive outdoors, with no chores or cat to distract me<\/li>\n <li>(from looking at other entries) having unique art is\u00a0wayyy more important than having unique gameplay<\/li>\n <li>stick to a color palette dammit<\/li>\n <li>work with your engine&#8217;s strengths<\/li>\n <li>some bookbinding trivia<\/li>\n <\/ul>","time":"August 29th, 2016 8:37 pm","title":"Post Mortem Et Lipsum Dolor Sit Amet"}