The game you are trying to view has ceased development and consequently been archived. If you are a member of this game, can demonstrate that it is being actively developed and will be able to keep this profile up to date with the latest news, images, videos and downloads, please contact us with all details and we will consider its re-activation.

You're enjoying an immense battle against imaginary foes while camping in the woods near your home when suddenly you get a weird urge to rush home. When you get there, you find your parents missing and the supper still cooking in the fireplace. Where are they? What's going on? Your journey in a world about to go through a historic event starts here. You are The Kid.

Post news Report RSS WeekendWhut #1: (Ranged) combat

Welcome to the first ever edition of WeekendWhut (tm, copyright, etc) where I talk about what I achieved over the weekend!

Posted by on

WeekendWhut #1

Hello everyone. I am trying to get development back up to speed and as a part of that, I intend to do a news post every weekend talking about what I did over the course of said weekend.

So, without further ado, let's kick off our first ever WeekendWhut! This week, I worked primarily with the combat system.

Going medieval on mobs, ranged style!

Ranged combat was totally missing until yesterday. I've built my base combat system so that it was easy enough - mechanics wise - to bring ranged combat in. I didn't need much changes or additions in the combat or targeting mechanics, but I did spend a while tweaking the animations and stuff.

ranged combat animation states


This is what the animation states for ranged combat currently look like. Messy messy, but works somewhat..

So, with the animations in place and the needed code additions and changes done, I took it for a little test drive.

ranged combat no target


As I said, ranged combat uses the same mechanics that were already there for melee combat, with slight changes and/or additions. As such, determining the target, hit/miss, inflicted damage, etc all worked pretty much out of the box.

ranged combat


ranged combat


While we're here..

While I was working with the combat system code, I decided to add a check if there is anything in between the attacker and the target that would block the attack. This is easy enough, I just added a simple function that takes the origin point, the target point and the intended target as parameters and returns whether or not there is something else in the way. It does this by doing a simple ray cast between the points and checking what the ray hits.

ranged attack obstructed


Again, this works the same in both ranged and melee combat modes.

melee attack obstructed


It ain't no Skynet..

With the environment now being able to restrict where you can attack your targets from, this calls for a need to start working on the enemy AI at some point. As of now, the enemies just look for a spot near their target that is within their attack range. If their attack ends up being blocked by environment, they don't currently care: they'll just keep attacking and failing at it miserably.

This of course needs to be worked on, I wouldn't want just anyone being able to trick the mobs into a spot where they can't hit you (although that more often than not also means that you can't hit them either!).

So, when an enemy's attack is blocked by something, they need to look for a new spot near the player and head off there. This is just a small part of what I will need from the mob AI, though, so I'll have to think about the big picture first.

Until next time!

-saku / underRadar Games

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: