B.A.M. | Sprint 3 | 9/24-10/08

      Battle-Auxiliary Mechanoids, or B.A.M., is a mecha strategy action game my team and I are developing for our Advanced Production class at Chico State. I am one of three Programmers in our 14 person team. This post details my work process across our second Sprint.

    My work this Sprint involved finishing up the map and player Robot spawning, setting up the projectile system to be used in the future, starting on the in game HUD, and ultimately refactoring and expanding the Hero's jetpack system.

Fixed Map

    By the end of last Sprint I had gotten the map and Robot spawning system mostly complete, but I soon realized there was a fatal error. Some of the icons weren't displaying in the correct locations, almost as if they had swapped positions with each other. I was testing my map icons in a less informative pattern than I thought it was, which delayed my figuring out the issue, but it soon became apparent that my math for converting the in-world actor locations to on-screen icon locations was completely off. Unreal's UI design viewport places the origin at the top left corner, moving down increasing the X axis and moving right increasing the Y axis. Unreal's level viewport, equating at a top down perspective, places the origin at the bottom left, moving up increasing the X axis and moving left increasing the Y. In short, the X and Y axes are swapped and the up-down axis is inverted when moving between the two. I had been aware of and was accounting for the inversion of the up-down, but I wasn't aware that the X and Y axes were effectively swapped. As such, the resulting positions on the map UI ended up mirrored and rotated 90 degrees as to the actual level. Thankfully, this error was explained to me during out class's code review and it was an easy fix.

Projectile Destroying Lower-Health Building and Destroying
on Collision With Higher Health Building

    The next thing I worked on was setting up a projectile system with a functional real-time trajectory guide to show the player where the projectiles will go. The first part of the projectiles is the ability to actually deal damage to entities in the scene, which spurred us to create an attachable health component to standardize health. My lead programmer Cai took this task and I helped organize and add on to it, designing how it communicates with other objects. As part of its damage system, a projectile continues on its path if it hits something and deals enough damage to kill it, reducing its current damage amount by the amount it dealt to the hit object.

Trajectory Guide

    The part that was particularly complex for me was the trajectory path. I've quite little experience with line traces in Unreal and had never even heard of splines before, so this was quite interesting to figure out and learn. The projectiles will be used in the future, so as a part of this, I made the projectile shooting system a component so that it can be placed dynamically on enemies, the player, or other scene objects. This caused a few interesting hiccups when it came to how to pass the projectile data from the parent object to the component, but I got a fairly clean system down.

Event-Bound HUD Updates

    After completing the projectile system, I turned to the in-level HUD, adding first progress bars to track the Hero's health, the Robot's health, and Hero's jetpack fuel level. This UI logic was all pretty simple, updating each element by binding events to dispatchers that fire in the health component and hero when the health or fuel values change.

Jetpack w/ HUD

    However, the jetpack fuel display required that the jetpack have fuel that limits how much the player can use it, which had not yet been implemented. In fact, the jetpack had previously been implemented as a one-time boost instead of a jetpack at all, which meant I needed to implement that behavior alongside the fuel system. This didn't end up too complex, but it required to me learn more about Enhanced Input Actions and timers in Unreal. As it works now, the player holds the jump button to use the jetpack, releasing the button to stop. Using it consumes fuel which refills when not in use. Should the player use all their fuel at once then they must wait for it all to refill before they can use the jetpack again. Both the speed the player flies up at and fuel refill speed are upgradable.

Comments

Popular posts from this blog

B.A.M. | Sprint 2 | 9/10-9/24

BG3 Goblin Camp Scene | Sprint 2 | 11/5-11/12