Skip to main content

KEIS Sprint 6

  This sprint, I worked on improvements to the enemy AI, solving the issue of players having to search for the last few stragglers at the end of a wave to move on, and making the Weapon HUD functional!

Enemy Auto-Chase

Throughout the project’s development thus far, all enemies’ AI were initialized to the Wandering state upon spawn, meaning that they would navigate to random nearby points, waiting until the player entered their sight radius before chasing and attacking. This sprint, we decided that we want enemies to instead start in the Combat state. Thankfully, due to the way that I set up the enemy AI in previous sprints, this was easily accomplished by initializing the AI state to Combat upon spawn, and plugging in the player character as the attack target.


Super Easy!


This worked great for the light enemies, who would now immediately book it toward the player. However, this implementation had some undesired effects on the behavior of ranged enemies.




With ranged enemies, their Combat behavior consists only of “Shoot at the player if you can see them” and “Melee the player if they are too close”. There is no behavior for repositioning if the player is out of sight. Before the change to the enemy AI, this worked fine, because the enemies would only enter the Combat state once they had line of sight. However, now that they are entering the Combat state before they have line of sight, they’re simply standing in place until they can see the player. Next sprint, I plan on reworking the ranged enemy behavior trees to move towards the player (with the same logic as the light enemies) if they do not have line of sight. Otherwise, shoot the player. If I want to get a little fancier, I could use the Environment Query System to check points around the ranged enemies for line of sight of the player, so that they could take different angles instead of just beelining towards the player. However, we have a lot of enemies active at once, and so EQS can get quite expensive if I’m not careful.


Wave End Enemy Culling

One problem that we consistently observed throughout playtests was that as players would near the end of the wave, sometimes a couple stragglers would be hanging out in areas that the player already cleared out. This would cause them to have to spend a lot of time searching the map trying to find the last one or two enemies that might have gotten stuck somewhere. 


In order to combat this, I developed a system that would wait until the enemy count reached a certain threshold, and then every time an enemy was killed, check to see if all the other enemies were offscreen. If they were, they would be culled and the wave would immediately end.


The on-screen check consists of two parts: a screen-space check, and a line of sight check.


This set of nodes is essentially grabbing the player’s viewport, then the world location of the enemy, and using the handy World Location To Screen Location node to check if the enemy is within the rectangle projected by the player camera.



The second check is much simpler, here I check to see if the player has line of sight of the current enemy. This is to prevent an enemy from being culled if the player is nearby but simply just turned around.



Finally, the last check I make before culling the remaining enemies is seeing if all of them were marked as off screen and not in LOS. This ensures that the enemy culling only ever happens when absolutely necessary. If there is still an enemy within reasonable range of the player, the game will wait until that enemy dies before performing this check again.

Weapon HUD

Last sprint, I implemented a HUD element that was meant to show the player’s currently equipped weapon. However, I only got to the implementation of the actual art, not the switching of the icons to reflect the current weapon, so it always showed the handgun to be equipped no matter what weapon was actually held. This sprint, I got around to making it properly reflect the held weapon and its ammo.


The logic here is pretty simple. I mapped all the possible held weapons to a unique texture, and then when the weapon is switched, I grab its texture and apply it to the UI. Super easy! I do the same thing with the ammo icon as well.



Updating the ammo count is also very easy, there’s an event dispatcher in the ActorComponent that handles shooting which fires every time the ammo count needs to update (which is when ammo is consumed, added, or the weapon is switched and a different ammo count needs to show). This made updating the UI very easy!


Comments

Popular posts from this blog

CAGD 373 Blog Post 4

This sprint I was assigned a modular set to create the basic interior rooms out of, with three different textures for the walls. (a Square Brick Texture, a Cement Texture, and a Metal Wall Texture) The actual modeling itself was as basic as it gets, I just made a few different shapes and sizes of wall along with a doorframe, with a couple floors and ceilings to complete the set. The interesting stuff this week was the textures, all of which I made in designer! The brick texture was probably the most complicated, and the one I’m most proud of. Starting with a brick generator, I used some gaussian spots to add some variance to the shape of bricks (using the spots to “cut out” chunks of the perfectly square bricks) and that worked pretty well! After that, I used a grainy looking noise map to fill in the black part of this mask to add in the noisy texture of mortar between bricks Next, to add some color variation to the bricks, I used a flood fill node, which was able to identify all the...

Idle WitchCraft Sprint 4

  This sprint, I started by implementing alternate success conditions for certain scenarios. This means that for some scenarios, there will be multiple different stat checks that can lead to different outcomes, and potentially different scenarios down the line. Two different outcomes of the scholar’s exam scenario. One for high intelligence, and one for high charm! This was an interesting programming challenge, as I had to figure out how to associate these alternate conditions with the data table that is currently holding all the scenario information. The interesting thing about these alternative outcomes is that they function as almost half a scenario. They have no intro dialogue, but they do have a unique stat check, outcome dialogue, and list of scenarios to unlock on success. Because of this, I decided that I would copy the current scenario into a new struct. That way, I could “swap out” certain pieces of data at runtime without having to fill my data table with duplicate inf...

CAGD 373 Blog Post 5

  Judgement day nears! And sadly I don’t have too much to show for this week as finals in other classes have swallowed up most of my time. However with most of them finally out of the way I’m clear to focus all my time towards this project over these next couple of days! The real meat of my texturing work this week is this Exterior Trim Sheet. I tried to group together as many models with similar-ish materials as possible so that I could get textures applied efficiently. Here I’ve created a trim sheet consisting of metal, tree bark, wood, a beige stone texture that worked pretty well for the pipes, and a separate, rougher metal texture for the motors found just outside the facility doors. I spent a lot of time compiling a list of all the models in our project along with reference images, so that way I could organize them into texture sets based on similar materials/texturing needs This plan should help to really accelerate the texturing pipeline over the next couple of days, so t...