<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[Ascender: The Blog]]></provider_name><provider_url><![CDATA[https://ascendergame.wordpress.com]]></provider_url><author_name><![CDATA[Ascender The Game]]></author_name><author_url><![CDATA[https://ascendergame.wordpress.com/author/ascenderthegame/]]></author_url><title><![CDATA[DEVLOG#05 &#8211; Irritating Implementation of Platforming Predicament, Part I: Basic Character&nbsp;Control]]></title><type><![CDATA[link]]></type><html><![CDATA[<p>Hello Ascenderians!</p>
<p>I’m Chalcedony, the programmer of Ascender, also a part-timer in devlog writing. Programming Ascender has been a great challenge for me as none of my previous projects are of this level of difficulty. Having said that, I would like to share how complex to code Ascender is, a task that might look simple, but really it isn’t.</p>
<p>As you might have known by now, Ascender is a 2D explorative metroidvania-like game, with a dash of RPG elements. Well, there is actually so much to code. Besides the usual main menu, pause function, etc., which are found in almost all games, some of them are (in no particular order):</p>
<ul>
<li>Character movement (how he moves, including his skills such as double jump, wall jump, etc.)</li>
<li>Environment (moving platforms, floor switches)</li>
<li>Inventory</li>
<li>Dialogues (managing who talks what given current condition, e.g. possess an item, undergone a quest, different talk between night and day)</li>
<li>Quest and event system (trigger cutscene or unlock quests when certain condition occurred)</li>
<li>Camera movement</li>
<li>AI for monsters (mainly bosses)</li>
<li>Input management (interfacing different input methods: keyboards, joysticks)</li>
<li>Rune system</li>
</ul>
<p>FYI, rune system is an element unique to Ascender. Think of it as a crossover between jigsaw and skillset manager… You gain the abilities by placing the jigsaw pieces! This feature is so *<strong>IMPORTANT*</strong> that it deserves its own page… Keep your eyes peeled for information on future updates!</p>
<p style="text-align:center;"><a href="https://ascendergame.files.wordpress.com/2015/09/runesystem.png"><img loading="lazy" data-attachment-id="51" data-permalink="https://ascendergame.wordpress.com/2015/09/18/irritating-implementation-of-platforming-predicament-part-i-basic-character-control/runesystem/" data-orig-file="https://ascendergame.files.wordpress.com/2015/09/runesystem.png" data-orig-size="1366,768" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="runeSystem" data-image-description="" data-image-caption="" data-medium-file="https://ascendergame.files.wordpress.com/2015/09/runesystem.png?w=300" data-large-file="https://ascendergame.files.wordpress.com/2015/09/runesystem.png?w=1024" class="alignnone wp-image-51 aligncenter" src="https://ascendergame.files.wordpress.com/2015/09/runesystem.png?w=392&#038;h=221" alt="runeSystem" width="392" height="221" srcset="https://ascendergame.files.wordpress.com/2015/09/runesystem.png?w=392&amp;h=221 392w, https://ascendergame.files.wordpress.com/2015/09/runesystem.png?w=784&amp;h=442 784w, https://ascendergame.files.wordpress.com/2015/09/runesystem.png?w=150&amp;h=84 150w, https://ascendergame.files.wordpress.com/2015/09/runesystem.png?w=300&amp;h=169 300w, https://ascendergame.files.wordpress.com/2015/09/runesystem.png?w=768&amp;h=432 768w" sizes="(max-width: 392px) 100vw, 392px" /></a>In-game rune system</p>
<p>Ascender is a platformer game, and I’ll be nice to copy-paste Wikipedia about the definition of platformer games (after all, that’s what all programmers are master at – copy-pasting).</p>
<p>A <strong>platform game</strong> (or <strong>platformer</strong>) is a <a href="https://en.wikipedia.org/wiki/Video_game">video game</a> which involves guiding an <a href="https://en.wikipedia.org/wiki/Avatar_%28computing%29">avatar</a> to jump between suspended platforms, over obstacles, or both to advance the game. (taken from <a href="https://en.wikipedia.org/wiki/Platform_game" rel="nofollow">https://en.wikipedia.org/wiki/Platform_game</a>)</p>
<p>Now, there is this guy named Rodrigo who wrote about platformer types. The original article can be found in <a href="http://higherorderfun.com/blog/2012/05/20/the-guide-to-implementing-2d-platformers/" rel="nofollow">http://higherorderfun.com/blog/2012/05/20/the-guide-to-implementing-2d-platformers/</a> . Summarised, depending on the implementation, there are four ways to create platformer games.</p>
<ol>
<li>Tile-based (e.g. Lode Runner)</li>
<li>Smooth tile-based (e.g. Megaman, Super Mario, Metroid, Contra)</li>
<li>Bitmask (e.g. Worms)</li>
<li>Vector (e.g. Braid, Limbo)</li>
</ol>
<p style="text-align:center;"><a href="https://ascendergame.files.wordpress.com/2015/09/platformer.png"><img loading="lazy" data-attachment-id="54" data-permalink="https://ascendergame.wordpress.com/2015/09/18/irritating-implementation-of-platforming-predicament-part-i-basic-character-control/platformer/" data-orig-file="https://ascendergame.files.wordpress.com/2015/09/platformer.png" data-orig-size="1024,256" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="platformer" data-image-description="" data-image-caption="" data-medium-file="https://ascendergame.files.wordpress.com/2015/09/platformer.png?w=300" data-large-file="https://ascendergame.files.wordpress.com/2015/09/platformer.png?w=1024" class=" wp-image-54 aligncenter" src="https://ascendergame.files.wordpress.com/2015/09/platformer.png?w=480&#038;h=120" alt="platformer" width="480" height="120" srcset="https://ascendergame.files.wordpress.com/2015/09/platformer.png?w=480&amp;h=120 480w, https://ascendergame.files.wordpress.com/2015/09/platformer.png?w=960&amp;h=240 960w, https://ascendergame.files.wordpress.com/2015/09/platformer.png?w=150&amp;h=38 150w, https://ascendergame.files.wordpress.com/2015/09/platformer.png?w=300&amp;h=75 300w, https://ascendergame.files.wordpress.com/2015/09/platformer.png?w=768&amp;h=192 768w" sizes="(max-width: 480px) 100vw, 480px" /></a>The four means of implementing platformer games</p>
<p>Pop quiz. Which approach did we take?</p>
<p>Answer: Look at those masterpiece created by our artists! Of course they won’t go easy on us programmers – we have to implement their wildest dreams! By far only option 4 satisfy them.</p>
<p>Having chosen option 4, there is one critical question before we proceed any further. Will you use an existing physics engine, or will you write your own physics engine? For those who are feeling bold, option 2 may yield better result, but for time-constrained project like we have right here, we took the first approach and use Unity as the game engine.</p>
<p>Now I shall introduce you the very first element we have to implement: How the character moves. Moving left and right on a flat surface is as simple as it gets, you just have to apply acceleration until you hit some maximum velocity so your character won’t run too fast.</p>
<p>The problem begins with <strong>slope</strong>. Let me give you pointers by showing some cases that you <strong>*MIGHT*</strong> want to consider if you’re going with physics.</p>
<p style="text-align:center;"><a href="https://ascendergame.files.wordpress.com/2015/09/case1.png"><img loading="lazy" data-attachment-id="52" data-permalink="https://ascendergame.wordpress.com/2015/09/18/irritating-implementation-of-platforming-predicament-part-i-basic-character-control/case1/" data-orig-file="https://ascendergame.files.wordpress.com/2015/09/case1.png" data-orig-size="763,211" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="case1" data-image-description="" data-image-caption="" data-medium-file="https://ascendergame.files.wordpress.com/2015/09/case1.png?w=300" data-large-file="https://ascendergame.files.wordpress.com/2015/09/case1.png?w=763" class="alignnone wp-image-52" src="https://ascendergame.files.wordpress.com/2015/09/case1.png?w=390&#038;h=108" alt="case1" width="390" height="108" srcset="https://ascendergame.files.wordpress.com/2015/09/case1.png?w=390&amp;h=108 390w, https://ascendergame.files.wordpress.com/2015/09/case1.png?w=150&amp;h=41 150w, https://ascendergame.files.wordpress.com/2015/09/case1.png?w=300&amp;h=83 300w, https://ascendergame.files.wordpress.com/2015/09/case1.png 763w" sizes="(max-width: 390px) 100vw, 390px" /></a></p>
<p style="text-align:center;"><a href="https://ascendergame.files.wordpress.com/2015/09/case2.png"><img loading="lazy" data-attachment-id="53" data-permalink="https://ascendergame.wordpress.com/2015/09/18/irritating-implementation-of-platforming-predicament-part-i-basic-character-control/case2/" data-orig-file="https://ascendergame.files.wordpress.com/2015/09/case2.png" data-orig-size="802,205" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="case2" data-image-description="" data-image-caption="" data-medium-file="https://ascendergame.files.wordpress.com/2015/09/case2.png?w=300" data-large-file="https://ascendergame.files.wordpress.com/2015/09/case2.png?w=802" class="alignnone wp-image-53" src="https://ascendergame.files.wordpress.com/2015/09/case2.png?w=390&#038;h=100" alt="case2" width="390" height="100" srcset="https://ascendergame.files.wordpress.com/2015/09/case2.png?w=390&amp;h=100 390w, https://ascendergame.files.wordpress.com/2015/09/case2.png?w=780&amp;h=200 780w, https://ascendergame.files.wordpress.com/2015/09/case2.png?w=150&amp;h=38 150w, https://ascendergame.files.wordpress.com/2015/09/case2.png?w=300&amp;h=77 300w, https://ascendergame.files.wordpress.com/2015/09/case2.png?w=768&amp;h=196 768w" sizes="(max-width: 390px) 100vw, 390px" /></a></p>
<p style="text-align:center;">Slopes, expectation vs. reality</p>
<p>Running on those slopes launches your character into the air? Hey, snap out of it, physics! Now how do we cope with this problem? Use raycast! That way you can prevent jumping off the slope problem.</p>
<p style="text-align:center;"><a href="https://ascendergame.files.wordpress.com/2015/09/raycastground.png"><img loading="lazy" data-attachment-id="55" data-permalink="https://ascendergame.wordpress.com/2015/09/18/irritating-implementation-of-platforming-predicament-part-i-basic-character-control/raycastground/" data-orig-file="https://ascendergame.files.wordpress.com/2015/09/raycastground.png" data-orig-size="557,203" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="raycastGround" data-image-description="" data-image-caption="" data-medium-file="https://ascendergame.files.wordpress.com/2015/09/raycastground.png?w=300" data-large-file="https://ascendergame.files.wordpress.com/2015/09/raycastground.png?w=557" class="alignnone size-medium wp-image-55" src="https://ascendergame.files.wordpress.com/2015/09/raycastground.png?w=300&#038;h=109" alt="raycastGround" width="300" height="109" srcset="https://ascendergame.files.wordpress.com/2015/09/raycastground.png?w=300&amp;h=109 300w, https://ascendergame.files.wordpress.com/2015/09/raycastground.png?w=150&amp;h=55 150w, https://ascendergame.files.wordpress.com/2015/09/raycastground.png 557w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p style="text-align:center;"><a href="https://ascendergame.files.wordpress.com/2015/09/raycastnothing.png"><img loading="lazy" data-attachment-id="56" data-permalink="https://ascendergame.wordpress.com/2015/09/18/irritating-implementation-of-platforming-predicament-part-i-basic-character-control/raycastnothing/" data-orig-file="https://ascendergame.files.wordpress.com/2015/09/raycastnothing.png" data-orig-size="563,211" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="raycastNothing" data-image-description="" data-image-caption="" data-medium-file="https://ascendergame.files.wordpress.com/2015/09/raycastnothing.png?w=300" data-large-file="https://ascendergame.files.wordpress.com/2015/09/raycastnothing.png?w=563" class="alignnone size-medium wp-image-56" src="https://ascendergame.files.wordpress.com/2015/09/raycastnothing.png?w=300&#038;h=112" alt="raycastNothing" width="300" height="112" srcset="https://ascendergame.files.wordpress.com/2015/09/raycastnothing.png?w=300&amp;h=112 300w, https://ascendergame.files.wordpress.com/2015/09/raycastnothing.png?w=150&amp;h=56 150w, https://ascendergame.files.wordpress.com/2015/09/raycastnothing.png 563w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p style="text-align:center;">Raycasting helps on ground detection</p>
<p>In fact, raycast might be a good solution for many problems you might encounter in developing a platformer game. Detecting switch? Shooting a projectile? Pushing blocks? If none other works you should look into raycasting. Take a look at this example showing how you <strong>*must not*</strong> push a block.</p>
<p style="text-align:center;"><a href="https://ascendergame.files.wordpress.com/2015/09/kotak.gif"><img loading="lazy" data-attachment-id="57" data-permalink="https://ascendergame.wordpress.com/2015/09/18/irritating-implementation-of-platforming-predicament-part-i-basic-character-control/kotak/" data-orig-file="https://ascendergame.files.wordpress.com/2015/09/kotak.gif" data-orig-size="323,184" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="kotak" data-image-description="" data-image-caption="" data-medium-file="https://ascendergame.files.wordpress.com/2015/09/kotak.gif?w=300" data-large-file="https://ascendergame.files.wordpress.com/2015/09/kotak.gif?w=323" class="alignnone wp-image-57" src="https://ascendergame.files.wordpress.com/2015/09/kotak.gif?w=384&#038;h=219" alt="kotak" width="384" height="219" /></a></p>
<p>Hey, I’d like to tell much more, but look at the time! I’ve written too much for today, so let’s talk about the other game elements later! Now it’s your turn to write your thoughts on the comment box below, and hit subscribe! That’s all, folks, thanks for reading!</p>
<p>Chalcedony</p>
]]></html><thumbnail_url><![CDATA[https://ascendergame.files.wordpress.com/2015/09/raycastnothing.png?fit=440%2C330]]></thumbnail_url><thumbnail_width><![CDATA[440]]></thumbnail_width><thumbnail_height><![CDATA[165]]></thumbnail_height></oembed>