Enemies and Combat


Enemies and Combat

This week in development I have quite a bit to present, first enemies. I have developed two types of enemies so far, one is a normal knight that can shoot at you with its crossbow (you have to imagine the crossbow part right now) and the other is a knight that can fire 3 bolts at once. The triple shot knight fires these in a 30-degree cone so if you want to dodge these it's best to get some distance and go between the gaps. Enemies work using two colliders, one is the enemy hitbox, and one is its detection range. If the player enters the enemies detection radius it will start to chase the player and shoot at it. They won't get too close though, their goal is to keep a moderate distance from the player at all times so they can shoot effectively.

I can't believe they would shoot and John

The player can now also shoot, their shots do 10 damage, and normal knights have 30 health while the triple shot knight has 50. This took a lot longer than it should to implement. after a few hours of debugging, I ditched my shooting script and tried the one from the Invader tutorial. This proved that my script didn't work so I started from scratch and got it working. Then I found the second issue, the player's bullets were being destroyed prematurely. There were actually 2 things causing this bug, first, the player's bullets could be destroyed by hitting the player. This did not take much debugging to fix as I realised it pretty quickly. To solve the next issue I wrote a little debugging printout that would tell me what my bullets were colliding on and I noticed they seemed to be hitting an enemy's hitbox even though the bullets were a significant distance away from the enemies. Then I found when I walked into the radius where enemies can detect you, I couldn't shoot at all. This was because the player's bullets were colliding with the collider I used to see if the player was close to an enemy. To fix this I excluded the bullet layer from that collider so it could not trigger the bullet being deleted.

I have also added walls, these line the boundaries of the first two areas to prevent the player from escaping the intended area. I also added two walls in the middle to act as cover. This also allows you to split up enemies making a larger group easier to deal with. When the game is closer to completion I will add walls to the rest of the map but as most testing will be done in the second room it is the only section that requires it as of now.

John learned to fight back

This week's feedback was quite positive, I was told that players thought the projectiles were at a good speed to be able to dodge and the player's dash was good too. I was also told that the cameras might be too close in some rooms, and this will be something I'll work on to improve. This might be affected by the fact that enemies can walk into other areas where they shouldn't be, and these areas have a lot closer of a camera but if the camera distance still feels wrong when this is corrected, I will adjust this. Next week I will try to get feedback on other gameplay mechanics such as player shooting and the enemy and players' health values. These were not ready by the time my build was uploaded so they were excluded from player testing.

Thank you for reading,  Sam Geoghegan

Leave a comment

Log in with itch.io to leave a comment.