<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kevin Hsu</title>
    <description>The latest articles on DEV Community by Kevin Hsu (@kaisucode).</description>
    <link>https://dev.to/kaisucode</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F407407%2F5a34e776-9162-449a-97c1-38fa4844c737.jpeg</url>
      <title>DEV Community: Kevin Hsu</title>
      <link>https://dev.to/kaisucode</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kaisucode"/>
    <language>en</language>
    <item>
      <title>"In that enchanted place on top of the forest..." [9]</title>
      <dc:creator>Kevin Hsu</dc:creator>
      <pubDate>Mon, 31 Aug 2020 10:19:40 +0000</pubDate>
      <link>https://dev.to/enchantedforest/9-in-that-enchanted-place-on-top-of-the-forest-225p</link>
      <guid>https://dev.to/enchantedforest/9-in-that-enchanted-place-on-top-of-the-forest-225p</guid>
      <description>&lt;p&gt;*&lt;em&gt;After a lengthy fight with a mob that has 10k+ health&lt;/em&gt;*&lt;br&gt;
"Ahh... back to the comfort of the Levancer's Keep."&lt;br&gt;
*&lt;em&gt;Gets swarmed by mobs and dies&lt;/em&gt;*&lt;/p&gt;




&lt;p&gt;Hello dear readers. Although it pains me deeply to say this, I am here today to deliver the final post of the enchantedForest dev blog. This has been A Grand Journey, and we are finally at its destination. The game now contains 4 major areas, quest dealers, merchants, multiple mob types, a user account system, and... a boss fight. &lt;/p&gt;




&lt;p&gt;* spoiler warning *&lt;/p&gt;

&lt;p&gt;In the final stage of the game, our protagonist is stripped of their mana supply upon entry, and faces off against the Final Enemy. &lt;/p&gt;

&lt;p&gt;And no, this wouldn't be a proper "&lt;em&gt;Alek and Kevin coding session&lt;/em&gt;" without some grumbling about ridiculous implementations. Alek whipped up some code to set default quick access items, while I created a boss room for the gigantic "jumpydudeBoss". The background of it is a blurred screenshot of the codebase in Neovim, as it is the editor that we usually code in. Alek's instance of the boss was hanging on to the last threads of its life, with 1hp remaining before he accidentally teleported out of the room. A tragic story, considering how it took 5+ mins of constantly launching fireballs to get to that point (the boss respawns with full health if you leave). &lt;/p&gt;




&lt;p&gt;I have to say, this is quite the project. &lt;br&gt;
I'm rather fond of it, and so is Alek (I think). He says it's &lt;em&gt;"almost comparable"&lt;/em&gt; to &lt;a href="https://theland.herokuapp.com/"&gt;theLand&lt;/a&gt;, a game he created back in our sophomore year. &lt;/p&gt;

&lt;p&gt;August 31, 2020 marks the end of this summer vacation, the completion of the enchantedForest, and a long (but hopefully temporary) pause to Alek and Kevin coding projects. Also, Hogwarts starts the school year tomorrow. Just sayin'.&lt;/p&gt;

&lt;p&gt;Go play the game! Star the &lt;a href="https://github.com/awestover/enchantedForest"&gt;repository&lt;/a&gt; on Github, read our story, and see for yourself the project that we put so much time and effort into. As always, thanks for hanging out with us! &lt;/p&gt;

&lt;p&gt;Signing off for the last time; Byeeeee~&lt;br&gt;
- Kevin&lt;/p&gt;




&lt;p&gt;"&lt;em&gt;Wherever they go, and whatever happens to them on the way, in that enchanted place on the top of the forest, a little boy and his Bear will always be playing.&lt;/em&gt;"&lt;/p&gt;

&lt;p&gt;“&lt;em&gt;But, of course, it isn't really Good-bye, because the Forest will always be there... and anybody who is Friendly with Bears can find it.&lt;/em&gt;" - A.A. Milne&lt;/p&gt;




&lt;p&gt;P.S. &lt;br&gt;
Alek says we should add wings. With HJKL controls. &lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>enchantedForest[8]</title>
      <dc:creator>Kevin Hsu</dc:creator>
      <pubDate>Sat, 15 Aug 2020 01:06:39 +0000</pubDate>
      <link>https://dev.to/enchantedforest/enchantedforest-9-1c3f</link>
      <guid>https://dev.to/enchantedforest/enchantedforest-9-1c3f</guid>
      <description>&lt;p&gt;Hello. &lt;/p&gt;

&lt;p&gt;Short developer PSA here (Walkthrough post): You will have to jump off a cliff, or be horrendously mauled by a mob before being able to respawn and proceed to the next section of the Llama Plains. Worry not, for this is a feature, not a map-design bug. It is our mirrored implementation of Harry Potter being required to die before being able to destroy all of Voldemort's Horcruxes. Or at least that's what our official statement is XD. &lt;/p&gt;

&lt;p&gt;- Kevin&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>Introduction</title>
      <dc:creator>Kevin Hsu</dc:creator>
      <pubDate>Wed, 05 Aug 2020 09:05:55 +0000</pubDate>
      <link>https://dev.to/kaisucode/introduction-5c8m</link>
      <guid>https://dev.to/kaisucode/introduction-5c8m</guid>
      <description>&lt;p&gt;Welcome to This Mortal Coil of Bugs and Errors, or tmcobae for short. &lt;/p&gt;

&lt;p&gt;So you know how Sarah J. Maas has a book series that's always "A court of X and X"? A Court of Thorns and Roses, A Court of Mist and Fury, A Court of Frost and Starlight, et cetera. Well, you probably didn't know that, because this is dev.to and not tumblr. My point is, that's where the structure of this blog's name comes from. This Mortal Coil of ever-revolving Bugs and Errors, because I tend to ignore compiler warnings, possibly a future song title for Fall Out Boy, official launch date: Aug 5, 2020. &lt;/p&gt;

&lt;p&gt;I figured, since I run into so many idiotic issues while coding, and because my til.md is growing to an unmanageable size, I might as well document all of it in a proper blog and cringe about everything years after. &lt;/p&gt;

&lt;p&gt;For the next few months (I think) I'll be focusing on Ruby and its backend framework, Rails. That being said, I still have some ongoing projects that require other languages, and sometimes I might want to revisit my Archive of Very Old Notes to make a post, so this isn't just going to be a Ruby-oriented blog. In fact, the majority of posts are probably not going to be about Ruby. It's just that I'll be more inclined to use the language and its libraries whenever I have the freedom to do so, and me yelling this plan to your face right now.&lt;/p&gt;

&lt;p&gt;I feel like for a while I've always gone "whelp, wanna make a project, lemme just use Javascript for it." Desktop widgets? Coffeescript. Music Player? Javascript with Electron. Game development? Javascript all the way. Javascript has (weirdly enough) become my go-to programming language, but I've been stagnant on actually digging into the more niche parts of it. Yes, I'm still going to continue studying and using JS, but I just don't *&lt;em&gt;insert kowalski meme&lt;/em&gt;* vibe with it enough to call it my favorite, despite having used it in a fair amount of my projects. &lt;/p&gt;

&lt;p&gt;As for Ruby, I've dipped into it a while back, but never delved deep enough to consider myself even remotely competent at the language. My brief interactions with it gave off very "fun" feels though, so I'm willing to explore it a little more. Plus, you know, it just hits different when your personality/identifier is being a Ruby hobbyist. &lt;/p&gt;

&lt;p&gt;Well, the (metaphorical) night is young, I am young, and my programming career is still in its early stages. This is the programming equivalent of me moving to a new city, changing my wardrobe and hairstyle, and *&lt;em&gt;be unbound by the shackles of expectation my pre-existing identity has wrought upon myself&lt;/em&gt;*. &lt;/p&gt;

&lt;p&gt;And it might be a tad bit dumb to post this on the very first entry for this blog, but this is my way of holding myself accountable. Having profoundly announced this to my personal corner of the vast, vast internet should be able to provide decent motivation in the upcoming months. &lt;/p&gt;

&lt;p&gt;This blog is mostly going to be me bitc- sry, complaining about the everyday headaches that occur during my programming journey. Buckle up, cause you are about to observe a whole lot of breakdowns, shoddily assembled solutions, and 3am ramblings. &lt;/p&gt;

&lt;p&gt;- Kevin&lt;/p&gt;

</description>
      <category>programmers</category>
      <category>learning</category>
    </item>
    <item>
      <title>enchantedForest [6]</title>
      <dc:creator>Kevin Hsu</dc:creator>
      <pubDate>Mon, 27 Jul 2020 09:46:51 +0000</pubDate>
      <link>https://dev.to/enchantedforest/enchantedforest-6-2787</link>
      <guid>https://dev.to/enchantedforest/enchantedforest-6-2787</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4a0gyhw40e8wgziqaqpv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4a0gyhw40e8wgziqaqpv.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After a 3.5-hour conference call of intense programming (dubbed war council by yours truly), the enchantedForest now has proper background images (the ones posted here were drawn by me) AND plot-relevant dialogue written by Alek. Although it is debatable whether the in-game dialogue is canon to our 20,000-word WIP story. Or maybe the game is canon and our novel with a 20k word-count is fanfic. It's open to the reader's interpretation I guess. Anyway, in those 3.5 hours, we accomplished A Great Deal of Thingamabobs, as Alek would say. &lt;/p&gt;

&lt;p&gt;There were many mentions of using "very hacky methods" and terrifying the crap out of each other, an intro message with code taken from the questBanner functions, and implementation of coin caps cuz you can't &lt;em&gt;possibly&lt;/em&gt; carry that many coins (no we don't talk about credit cards here). We also came to the realization that the mobs weren't actually reading from the stats JSON and fixed that. &lt;/p&gt;

&lt;p&gt;One issue we encountered was that the players could kill the mobs in the room BEFORE receiving the quest from an NPC, and completing that quest is the requirement for accessing the portal to exit the tutorial room. Some ideas we came up with include: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Player does 0 damage before talking to the npc&lt;/li&gt;
&lt;li&gt;Cancelling attack keys&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Temporarily replacing the player.projectiles array with a -1, causing a trivial error whenever the game tries to insert a fireball object into player.projectiles&lt;/p&gt;

&lt;p&gt;(^ the last idea is absolutely horrible I'm so proud of myself for coming up with that)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the end we implemented two solutions. Alek disabled the attack keys prior to the acceptance of the tutorial quest, while I made the server grant the admin account a completed quest list that included "tutorial" on player spawn (this is to allow more convenient testing). &lt;/p&gt;




&lt;p&gt;Notable dialogue during the war council: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Alek: no actually making the if statement check for typeof strings won't wor-&lt;br&gt;
Kevin: try catch&lt;br&gt;
Alek: ...&lt;br&gt;
Alek: fine but only this one time&lt;br&gt;
Kevin: only this one time huh. Oh wait you had another try catch statement in that line there&lt;br&gt;
Alek: that's not me I did NOT write that&lt;br&gt;
Kevin: oh... in that case i am so, so sorry *laughs guiltily*&lt;/p&gt;

&lt;p&gt;*me while writing the try-catch statement*: i am just &lt;em&gt;indulging&lt;/em&gt; in ALL the bad practices today &lt;em&gt;yeaaaahhhhhhhh&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;blockquote&gt;
&lt;p&gt;Alek: wait no restart the server&lt;br&gt;
Kevin: *restarts the server*&lt;br&gt;
Alek: log the output from the developer console&lt;br&gt;
Kevin: *logs output from the developer console*&lt;br&gt;
Alek: now restart it again&lt;br&gt;
Kevin: okay now you're just in denial *restarts again without changing anything*&lt;br&gt;
Alek: did you type the variable correctly?&lt;br&gt;
Kevin: you know what? to satisfy your paranoia i'm even going to open this up in incognito mode and cycle through the whole process again&lt;br&gt;
Alek: at this point I'm just desperate&lt;/p&gt;

&lt;p&gt;me freaking out over another bug and realizing: &lt;br&gt;
"huh its my turn to be in denial now isn't it"&lt;/p&gt;
&lt;/blockquote&gt;




&lt;blockquote&gt;
&lt;p&gt;Kevin: at our current rate of committing stupid things we're going to end up with about a thousand commits on the repo&lt;br&gt;
Alek: i'm fine with that honestly&lt;/p&gt;
&lt;/blockquote&gt;




&lt;blockquote&gt;
&lt;p&gt;Alek: *pushes to master without testing his changes*&lt;br&gt;
Kevin: did you actually just do that&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;And yes, the war council thing is a reference to Madoc from &lt;em&gt;The Cruel Prince&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;Lastly, here is a &lt;em&gt;gorgeous&lt;/em&gt; screenshot of a bug I accidentally created: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg4z72a3ut4amob9x8jtk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg4z72a3ut4amob9x8jtk.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for hanging out with us~&lt;br&gt;
- Kevin&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>developer</category>
    </item>
    <item>
      <title>Project Elpis #2: *annoying genji voice* I need healing</title>
      <dc:creator>Kevin Hsu</dc:creator>
      <pubDate>Fri, 17 Jul 2020 00:17:25 +0000</pubDate>
      <link>https://dev.to/elpis/project-elpis-2-annoying-genji-voice-i-need-healing-1lhn</link>
      <guid>https://dev.to/elpis/project-elpis-2-annoying-genji-voice-i-need-healing-1lhn</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NQ3-Y81b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/20sh3lx8ve4nz48vj5nw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NQ3-Y81b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/20sh3lx8ve4nz48vj5nw.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Hi guys! My name is Kevin, and this is my first post on Project Elpis. &lt;/p&gt;

&lt;p&gt;My tasks for this week are still WIPs cuz I have some other time-sensitive projects to work on rn, but I thought I'd write this up anyway since I have enough stuff to talk about at this point. &lt;/p&gt;

&lt;p&gt;I've been tackling the inventory and item usage system, and despite it being the same topic as the update I made to the Enchanted Forest (another game I've been working on), using Godot makes it a lot different. Sure, it's simpler than using JS with JQuery, but I'm also less accustomed to GDScript and Godot in general. It brings a new perspective to things, and although I miss the freedom in making everything from scratch, I can also see how Godot makes development waaay faster. Plus, looking back they kinda had me at built-in-collisions and animation trees. &lt;/p&gt;

&lt;p&gt;As of the moment, I have inventory slots up and running, as well as picking up items and using it to modify player stats (potions and crystals). For now I'm just dunking everything in a dictionary, but as the project grows on I'll put a json-reading system in place. &lt;/p&gt;

&lt;p&gt;I'm still debating whether I should implement a drag-and-drop sortable inventory system or just go with an immutable one, but honestly I'm lazy and an unsortable inventory system isn't THAT horrible. Like, a) I'm not entirely confident that I can create a pleasant user experience for drag &amp;amp; drop sorting, and b), I could always add a quick auto-sort system and try to keep the number of items down, which would probably be better game design anyway. &lt;/p&gt;

&lt;p&gt;Also, we're still working out the storyline for the game, but once we make a decent amount of progress on that we'll make an intro post about the project. &lt;/p&gt;

&lt;p&gt;Until next time, and thanks for reading. Byeeeee~&lt;br&gt;
-Kevin&lt;/p&gt;

</description>
    </item>
    <item>
      <title>enchantedForest[4]</title>
      <dc:creator>Kevin Hsu</dc:creator>
      <pubDate>Fri, 03 Jul 2020 00:17:36 +0000</pubDate>
      <link>https://dev.to/enchantedforest/enchantedforest-4-29d5</link>
      <guid>https://dev.to/enchantedforest/enchantedforest-4-29d5</guid>
      <description>&lt;p&gt;Today (well technically last night) I dumped most of the Neovim plugins we use into the server configs. Originally I tried to keep the dotfiles on the server to a bare minimum since it had limited storage, buuuuut I decided to just screw that and install ALLLLLLL DE pLUgInS. As Genya Safin from the Grishaverse once said, &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I also shouldn’t have a second buttered roll with my breakfast every morning, but sometimes one must indulge."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;However, I didn't feel like installing everything twice for both of our accounts, so I followed &lt;a href="https://jdhao.github.io/2019/11/10/install_config_neovim_system_wide/"&gt;this link&lt;/a&gt; and set the configs across the system for all users. Cheers to deoplete and Ctrl-/ commenting. &lt;/p&gt;

&lt;p&gt;Anyways. &lt;/p&gt;

&lt;p&gt;In today's session, Alek and I created a Trello board to have actual task management, as our README.md at this point is about 450 lines. Found a bug on the merchant pop-up dialogue disabling movement, filed it on the Trello board, and (very unfortunately) labelled "clean up code" under the "Nice to have" category. Alek got started on adding checkpoints and portals to the tilemap using Tiled, while I worked on revamping our HUD for a more pleasant interface. &lt;/p&gt;

&lt;p&gt;Initially I wanted to jump back to 4 months ago and punch myself in the face for writing the monstrosity that exists in the code base, but then I realized that besides a few naming issues it honestly wasn't THAT bad. Most of the HUD migration could be done by simply moving around the html, with some JQuery portions that required minor tweaks, and then a bit of re-purposing old functions to group the item and quest systems together. Overall it went okayyyyyy. &lt;/p&gt;

&lt;p&gt;Lastly, Alek mentioned something about some strands of code being "a work of art", so stay tuned for an art exhibit with that sweet, gorgeous code in our next developer journal *thumbs up*. &lt;/p&gt;

&lt;p&gt;Signing off for now&lt;br&gt;
- Kevin&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>enchantedForest[1]</title>
      <dc:creator>Kevin Hsu</dc:creator>
      <pubDate>Thu, 18 Jun 2020 20:15:37 +0000</pubDate>
      <link>https://dev.to/enchantedforest/enchantedforest-1-4aol</link>
      <guid>https://dev.to/enchantedforest/enchantedforest-1-4aol</guid>
      <description>&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;ipdb&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="n"&gt;blah&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;blah&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;blah&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;blah&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="s"&gt;"_id"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;mongo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;()]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This beautiful, coherent piece of code is what makes up the foundation of our MongoDB back-end. &lt;/p&gt;

&lt;p&gt;We've decided on using MongoDB paired with Flask as our back-end to store user data and provide game-state saving. Players will be able to interact with a "monolith" at certain predetermined save points and send their game state in JSON format to our server, which is another reason why we decided to go with MongoDB instead of MySQL. &lt;/p&gt;

&lt;p&gt;As Alek said: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"What is MongoDB? So it's like you have a json. And then there is a json inside of that (those are called collections). And then inside of the collection, it's like, there's another json inside of it. And in the json spec, it literally says, if &lt;code&gt;x&lt;/code&gt; is a json, then &lt;code&gt;{"x": x}&lt;/code&gt; is a json, so you can have jsons all the way down."  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;(Our server is a Digital Ocean droplet running CentOS 7)&lt;/p&gt;




&lt;p&gt;In addition, as a PSA to all other fellow MongoDB beginners out there, please note that database names are case-sensitive (this took us a while to figure out). &lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
  </channel>
</rss>
