my projects

these are some projects that i have worked on either personally or because of university.


8-Puzzle Lego Robot

Collaborated with Shyam, October 2022 — January 2023

Skills involved: Microcontroller programming with C, Data Structure and Algorithms

ROB_0 in action!ROB_0 in action!

The sliding puzzle is a well-known example of action planning. The puzzle consists of a 3x3 field in which 8 tiles are arranged in a position. The tiles can be moved horizontally or vertically towards the vacant space. The task is to move the tiles in the starting position successively until the target position is reached (see Figure 1). In each position there are at least two and at most four shift possibilities. If we assume an average of three possibilities, this results in a search tree with a branching rate of 3. With a typical solution path of length 20, this results in a total of 320, which is about 3.5 billion nodes in the lowest level of the search tree.

Initial and Goal states of 8 Puzzle!

The search algorithms A*, IDA*, and IDS were tested and applied in this project. This article gives a solid explanantion of each of the algorithms. Each of them were implemented in C, and flushed to the microcontroller used to control the robot. Now, for the fun part, here are some images of the robot!

This is how ROB_0 looks likeThis is how ROB_0 looks like


"Helper" tool for RotMG

July 2023

Skills involved: C++

Realm of the Mad God (RotMG) has been described as a "massively-multiplayer cooperative bullet hell shooter" with an 8-bit pixelated art style. Players control characters who have been transported to the realm of Oryx (the titular Mad God) to become food for his many minions and abominations, which the players must dispatch. Central to the design of the game is the fact that character death is permanent. Upon death, the player's character is lost along with all of its carried equipment, although the player can store a number of items for safekeeping in a limited-capacity vault away from danger. Different character choices in class also help make the game more diverse and help to support teamwork.

So imagine grinding for hours, collecting gear and experience, just to die because of "skill issue". Or maybe due to fatigue. Now, if you're on Windows, you could use a "helper" tool, to avoid these unwanted deaths. But unfortunately, i am on MacOS and the aforementioned tool was unavailable in MacOS. Besides, i was very curious to see how these tools actually work. So i went ahead, opened Visual Studio Code and started building the project, piece by piece, iteratively. The easiest way was to implement a system that could monitor the pixels in the display. In the game you would have HP bars, indicating how much Health Points your character has. If it gets to 0, it basically means you're dead.

HP bar of a character in RotMGHP bar in RotMG

Usually, the common process is as follows, as you control your character in the realm and fight monster, you normally would take damage from the bullets shot from these monsters (if you are unable to dodge them). Bullets from monsters deal damage, which in return reduce your HP. When your HP is quite low, you have a few options:

  • Return to base: by pressing a certain key, you will be teleported back to your base which is a safe haven.
  • Drink HP pots: by pressing a certain key, your character will drink a HP pot which regenerates HP. So more HP to fight!
  • Die: risk it all and hope you can dodge those life threatening shots. If your HP drops to 0, you're gone

This is where the "helper" tool comes in handy. It defines a region (where the HP bar is located) to constantly monitor. This monitored region is around 20-30% HP. The condition to trigger a "Return to base" is the color of the pixels in the monitored region. If the color in the region is gray, white, or red, the "Return to base" is triggered. A more thorough explanation of this can be found in my GitHub repo.

Note: the correct term for this is called Hacking, it is against the game's Terms of Service. The purpose of this project was to learn how tools out there like this work, but I do not recommend it at all. It takes the fun away from the core concept of the game ;)