top of page

Trials and tribulations within The King's Dungeon

Updated: Apr 11, 2022

You can check out the game here: https://adam-danial-krb.itch.io/ggs-2-build-4-the-kings-dungeon


The game was made using a game engine called "Stencyl" which is a relatively quick and simple engine that can be used to slap things quickly with little coding knowledge needed.

Key Features within The King's Dungeon

There were a few cool and really interesting things that I managed to implement into the game. Some of them took longer than I expected but hey, at least I got them in and working fine in the end. Some of these features I'm really proud of being able to implement and not only working from a technical point of view like coding and stuff, but I got to put them in and actually make the game how I had it envisioned from the start.


Enemy Follow and Attacks


So the game is basically you are an adventurer that discovered a dungeon filled with monsters. Progress through the dungeon, floor by floor until you reach the end. Fight monsters in the dungeon and progress, things like that. Now, I'd like to highlight the enemy follow behavior because although I said Stencyl quick engine to use to slap things together, I really mean that it was simple. The engine itself is fairly simplified to make it easier for people who don't know or can't code to be able to make a game themselves. The problem with that is, at times, that simplification can lead to making some mechanics that is supposed to be easy in other engines like Unity, rather difficult. But nevertheless, I got it working the way I wanted it to.





So how I got it to work was by first of all making the enemy follow the player. Pretty straight forward stuff. You just make sure the enemy follows the player's position. The animation switching from left to right when the enemy is walking, not the easiest but, I had a similar behavior that I used for another project in Stencyl for a player character and modified it accordingly. So now they can move and walk properly while looking good with the proper animation.


The hard part about this whole behavior was in fact, the actual attacking. That itself took quite awhile as I wanted to make sure that enemy didn't move while they were attacking. I wanted this so that:

  1. The enemies didn't look like they were floating in mid air while attacking

  2. To give the players a chance to dodge their attacks

I managed to achieve my desired results by making sure that the enemy's walking behavior was disabled while it was attacking, which sounds simple enough in theory. But, when actually trying to do it in Stencyl was a pain and a hassle as I had these 2 behaviors separate and trying to access them from one another was both rage inducing and painful to do. Hey, at least it worked. Slapped on the appropriate animations when the enemy attacks, checked to make sure that the proper animation will play when facing 1 direction and spawned an invisible project when the guy swings, just like that, ba ding ba dong, you got a functioning walking and attacking enemy.


Open door to enter next floor


This next mechanic kinda seems like a simple one but wasn't that easy to make in practice. So basically, I wanted to have this door that opens each time the player kills all of the enemies included in a stage. This helps with letting players catch their breath after fighting off enemies in 1 floor and they can proceed to the next one when their ready, instead of just throwing them into the next one right after they are done.





To make this work was kinda tricky. Basically, I had to again do the whole access a behavior from another behavior in Stencyl, which in of itself was already tricky, but this time I had to do it with the level. So, I checked to make sure that when all enemies in a level was killed, you open the door. Checking the enemies to be dead was easy, but tying that notion to a game object in a level when it was done was the tricky part. Luckily it worked. I managed to get the door animation to play and open when all enemies in a level was killed and how I transfer the player to the next floor when the enter the door was by using something called a region. The region basically checks if all enemies are killed, then bring player to the next stage.


Trigger Enemy Spawn


Dungeon filled with monsters. Normally, you'd just leave the enemies out in the open and let them come to the player character once they were close enough. That normally works in most games with wide open spaces. But as for mine, not so much. Since I had a small area that the player can move around in, putting all enemies already in that space is actually really unfair, and based off my playtesting for the game, I was right. So, to combat this, I implemented in a trigger space that would spawn enemies in intervals once the player enters it.





I tackled this one by first, using a region that triggers when the player enters it. So whenever the player enters this specific region, then and only then start spawning enemies. I even managed to tie it with cool glowing magic circle on the floor to grab players attention, like, "Hey, what's that?" kind of feel. So they'll go and stand on it and trigger the spawn.


Not only that I managed to trigger enemies to spawn when the player enters the region, but also, enemies now spawn in a timed and procedural manner. Enemies would seem to spawn in at random times, one at a time, followed by the 2 varieties that were present in the game. A flying eye and a skeleton. So, "Adam, why is this important? Why highlight this? You got things to spawn. Big deal.", I hear you say. Well, this is cool because now I can fill up my levels with more enemies and after the player kill one, another would be there, ready to kill the player character.


This helps my issue of wanting to ramp up the difficulty in my game with more enemies per level but now I don't have to worry about overcrowding the level with too many enemies and overwhelm the players all at once.


Special Attack and Bar


Like I said in the beginning, this game was inspired by Devil May Cry 5. More specifically, Vergil in Devil may Cry 5. The only character that I can play and am good at playing in the game. I wanted to emulate that kind of power in my game and I did this by including a special attack like Vergil's Judgement Cut End into my game. Although a much more simplified version of it.





So, this special attack works by letting the player hit and kill enemies. Each time the player hits and enemy, the special attack bar on the top left of the screen will build up. Once the bar is full, press V and the player character will do a heavy ground smash that kills enemies within it's range.


Making the special attack was easy enough to be honest. Just build up a number counter in the background and after a certain number of hits, the special attack is ready. Pretty straight forward to say the least. The hard part was actually translating that background counting onto the Player HUD. Actually making a bar that goes up each time the player hits an enemy was really difficult. I wasn't sure if was meant to be that difficult, but it was. Funny or not.


I had issues with making the bar to increase in the beginning, then the special attack would not register. After that, the bar would overflow after attacking when it's full. It was a whole bag of problems in its own right. However, after hours of staring at the screen and coming up with Frankenstein ideas to merge code blocks together from other projects and behaviors, it finally worked the way I wanted it too. Was really proud when I finally got it to work at 2 a.m. in the morning.


The King Boss Fight


What does every DMC or hack and slash game have? A super challenging and engaging boss battle. I've wanted to implement this into The King's Dungeon since the start of the project and I finally got it in the way I wanted by the 4th iteration build of the game.





So, how does one make a boss character? Good question. I honestly had no idea when I began the project. From most of my understanding playing games, a boss should test the player's skills that they have gathered after playing the game and be like this test or final challenge in a game. But how do I make it into something that is challenging but also engaging was a whole other problem that I had to figure out.


While researching boss fights one day, I came across a video titled "The Vergil Effect - How to Make a Good Rival" by The Digital Dream Club. This video talked about how in DMC 3, or Devil May Cry in general, a good rival is often a character in game that matches the player in both strength and style in game. Basically, a good boss fight in games can be when a boss character matches the player's in terms of what they can do and how they do it. It gives the players the want to improve themselves in order to beat this other person like them and establish that they are the superior.


With that idea in mind, I got to work building my boss character in The King's Dungeon, which is the King, to be like the player. I gave the King the same move sets as the player has which is a sword swing and a special attack. This tells the players that, "Hey, this guy is like me. Okay then, let's see who's better" kind of attention. To make it fair, I reduced the speed of the King to be slightly slower than the player's and also added a rest behavior to the King. Which is after a certain amount of time chasing, the King will stop chasing and just remain idle for a short time. Giving the players the chance to deal some damage to the guy if they couldn't while he was chasing them around.


I also added in a trigger for the King so the boss fight will only trigger once the player enters a specific area in order for them to ready themselves for the final battle. I added in health bar HUD display for the King as well to tell the player how close the King was close to being defeated. With that done, I tested the boss fight out with a few players and it worked out quite well. The King from my observation was something that was engaging and challenging to fight in a way and it wasn't too difficult or impossible to beat. I personally have managed to beat the King a total of 3 times which is a design practice that I took from one of the developers from Dark Souls if I wasn't mistaken, which is "A boss should be able to be beaten by the designer at least once in order for it to be put into a game".


With that being said, low and behold, I give to you the final Boss of the King's Dungeon, the King which functions and fights just the way I wanted it to.

Kommentare


©2021 by Adam Danial. Proudly created with Wix.com

bottom of page