top of page
image_2022-01-31_211839.png

Harmonious Fate: The Process

Harmonious Fate is my most ambitious project to date. One of the many trials I encountered that I didn't think about before starting was just how hard it is to make a restrictive, turn-based combat system. But, no matter the struggle. I learned a ton. There are still some features of the game that are currently being worked on such as adding abilities and advancing the AI even further. But, here is the starting point and how we got where we are now.

Harmonious Fate Code: Bio

Movement

Harmonious Fate Code: Welcome

Movement was an evolved process from the very beginning. It started out simple enough, but slowly needed more and more added to make sure the player understands what their options are and what they should do next.


The complex part is that a normal platformer just has a player press a button and their character moves in the desired direction. With a Tactical-RPG, it has a lot more restrictions in what the player can and to make sure players don't break the game, you have to keep them from doing what you don't want them too. This means instead of just a button press, I needed to show the player where to press and limit it to only let them move there next.

​

The scale I used in Unity was very important for these calculations because I scaled everything to be 1 unit in Unity. This allowed me to do simple checks and math without needing weird to pull distance scales or set strange values. Essentially, every tile is 1 square unit within Unity. So, when it checks the next move tile it checks to see which tile is exactly one unit in both the positive and negative x and z directions.

​

I also had to store what tiles were being selected to move to. So I simply used an array to store all the movements the player had made. If the player clicks a tile already in the array then it reverts itself back to that tile and resets the number of movement left to what it was on that tile.

Harmonious Fate Code: Text

Attacking

Harmonious Fate Code: Welcome

Attacking was an interesting part and what made us stand apart from popular TRPG's. We wanted to implement a skill check so it wasn't all random chance percentages. There still was some random values and doing well only increased your odds, only sometimes guaranteeing a hit. However, this skill check was a rhythm arrow press that correlated to the visual nature of the attack.

​

Each character has a special arrow press combination that goes with their basic attack. This matches their movements during their attack animations and the timing of this was an interesting mechanic that I had to learn to code correctly. The arrows close in as it comes closer to the right time to press them and I achieved this by directly tying the size of the arrow frame to the frames remaining until it is time to press it. Depending on when the player presses it it will give them 4 different ranks which all increase or decrease their chances at hitting the target.

​

At the end of the segment it adds the bonuses from how well the player did and adds it to the base percent chance to hit an attack. A successful attack deals a random amount of damage within the characters damage range and a miss deals zero damage. 

​

A large portion of this code is random number generators and algorithms which I find to be my strong suit. If you'd like more in depth talk about it, I highly encourage you to reach out and talk to me.

Harmonious Fate Code: Text

Camera

Harmonious Fate Code: Welcome

The camera was integral to the feel of the game and a lot more went into it then meets the eye. Our game is a 3D TRPG in a world populated by 2D graphics. This was a stylistic choice done on our part to keep a retro vibe and imitate one of my favorite art styles in games to this date with the Paper Mario series. So, one simple trick that needed to be added was billboarding all the assets to the camera. This allowed us to keep up the illusion that the 2D assets aren't flat while still letting us move the camera.

​

The camera moves to 5 predestined angles that are coded with algorithms for where it should move too next depending on it's current position now. This was a fun experiment that took a few days to get the smoothness that I wanted with it and have it work with any level of zoom the camera offers. Now that it could move the players could properly inspect the battlefield.

Harmonious Fate Code: Text

Artificial Intelligence

Harmonious Fate Code: Welcome

AI is unfortunately much too big of a topic for me to fully delve into here. This was actually where a majority of the work went into in this project that wasn't working on base mechanics. The AI is pretty barebones currently with plans for improvement in the future to their decision making. I actually call it SBAAI which stands for Slight Below Average Artificial Intelligence because the enemies only target the closest character currently.

​

Most of the focus on the first go was making sure their pathing worked correctly and bug fixing there. In short, an enemy selects a target within it's movement range. It makes a short array list of the possible tiles they can move to around the targeted character and checks to see if there is already an enemy or a character there. If not, it selects the closets tile that is open. It then checks to see if it needs to move further along the x axis or the z axis. This helps prevent them from getting stuck on each other. It then moves along said axis tiles until it hits something or it has reached it's maximum distance it needed to move to get to its target. Then it changes directions and does the same thing moving when needed.

​

All in all the pathing and decision making could be explained in much more detail but that would take a while. This is yet another discussion that I could explain much better in a focused setting an not on a webpage so feel free to reach out.

Harmonious Fate Code: Text
bottom of page