|
Getting back into the swing of regular updates might take a bit to get used to, but here we are for our second consecutive week. Most of this week ended up being spent on getting action interrupts to function properly, which was a bit more involved than one might expect. The primary roadblocks that came with the system were as follows: Actions had to be able to stop no matter what was currently happening in them, each effect needed to be able to be interrupted separately from one another, interrupted effects needed to have their own cleanup logic to make sure that they ended in stable states, effects needed to be able to specify when they are able to be interrupted and when they aren't, and actions needed to be able to handle what happens when some of the current effects can be interrupted but others cannot. Mostly, dealing with these requirements meant setting up a bunch of extra structure within my action system. Actions can specify move tags to be set or removed on an interrupt, as well as effects to trigger. Each effect type now specifies what happens when they are interrupted, and visual effects on the grid can now be cut short if needed. Movements that have been queued now have priority values attached to them, and I can force clear all movements of below a certain priority when needed. This allows me to tell actors to stop moving as part of an action while not getting in the way of things like queued knockback or vital return movements in the event of well timed interrupts, like so: It might be hard to tell what's happening here with my temp art, but the first step-sword attack executes as normal, but the second is hit by an enemy attack after advancing into enemy territory, but before their slash comes out. The interrupt system tells the player to stop all actions and immediately queue up a movement to return them to their starting point, while removing the tags that allow them to enter the enemy tiles during the action. With the new functionality of the movement priority system, if the enemy's attack had a knockback effect on it, the knockback movement would be applied immediately after the player finishes moving back to their starting tile.
Besides the interrupts, I did begin work setting up architecture for the cards themselves, but there's not really anything I can show visually on that front yet. Now, I was going to discuss my design thoughts on the cards and deckbuilding system as a whole, but a website glitch deleted the writeup I made, so I no longer have the time to do that at the moment. That will come with next week instead, where hopefully I will have the card system architecture figured out and maybe even a basic version of the draw phase up and running. See you next time. Needless to say "A week or two studying for job interviews" isn't quite what happened. I have spent the last five months or so deep-diving into learning netcode and throwing together a project as a proof of concept for online multiplayer systems. The end result was a new portfolio piece that I can use to show I know what I'm doing when it comes to working with online systems. I didn't share my progress with this project on here because quite frankly there was very little to show visually and my weekly updates would have mostly been a bunch of trial and error. That being said, I will probably add a page to the site for code samples and share it there in the future. Now, having gotten that taken care of, I have since started on my next actual game project. For this one I wanted to try my hand at making a game in a style similar to one of my favorite game series from my childhood: Megaman Battle Network. I've tried many times to explain what type of game Battle Network is to other people, but its kind of hard to pin down with our usual gaming genres. There are very few games like it, using a hybrid turn-based/action combat system where the player starts a turn by drawing a hand of cards that represent different attacks and actions. After choosing which cards they want to use, the game transitions into the action phase what the player can move around a grid and use said cards in the order they were selected while doing their best to avoid attacks from their enemies. While in the action phase, a gauge slowly fills up at the top of the screen, and when it is full the next turn begins with a new draw phase. The grid-based movement makes the game very easy to control, while the wide variety of card effects and the momentary pause for the card selection phase can produce a great amount of strategic gameplay. There have been a handful of games that have come out over the years that have been inspired by this old GBA series, but at least in my experience none of them have quite managed to hit the same gameplay sweet-spot. Probably the most notable of the bunch, One Step From Eden, makes good on the action gameplay and the deck-building aspects of the original, but lacks a bit more of the overall strategic gameplay because there is no draw or card selection phase to slow things down. Your cards are delivered to you in shuffled order one after the other, leading to a much more hectic-feeling combat system as you continuously sling out attack after attack. I want to do things a bit closer to the source material here, but I'll talk about my game design thought processes and decision making as we get further into the project. For now, here's a breakdown on what I've managed to get done in the roughly 3-4 weeks I've been picking away at the game so far. As you can see, we have a grid divided into sides, we have actors on the grid, those actors have health displayed, and can move around freely on their side of the grid. Of note, I programmed the grid itself to allow for variable sizes, not sure if I'm going to use that feature in the long run, but it was easy enough to add in case I ever wanted to mix things up a bit, like so: In addition to the basic movement mechanics, I have also gotten our action system almost fully up and running. Each action is made up of a chain of effects that string together in sequence. The system was specifically designed to be modular, with each effect basically acting as a building block from which I can create just about any action I can think of. The chains are also able to branch based on the results of individual effects, as well as apply or remove tags to the actor that is performing them, giving the system even more flexibility. Thus far I have made a base set of effects to work with, including but not limited to: damage patterns, projectile creation, telegraphing effects, branch conditionals, and forced movement. Here are a few basic examples with a breakdown of the effect sequences that make up the actions: Telegraph attack to row in front of user > Project damage ray effect to find first viable target in telegraphed area > apply damage and knockback effect on hit Spawn projectile at user's position > On projectile hit, activate damage field centered on point of impact Based on the "Step Sword" attack from Battle Network.
Record position > Apply "Invade" condition to user to allow them to enter enemy tiles > Advance forward 2 spaces > Deal damage to column in front of user > Return to recorded position > Remove "Invade" condition And so on. Though the system is very flexible, it is currently a little cumbersome to create the actions, so I will probably invest in making an editor tool to streamline the process in the future. For now though, that's where we're at. The last thing I need to get the action system fully functional is to make sure that actions can be interrupted, for instances when an actor gets staggered while in the middle of trying to perform their own action. After that is done, I'll be moving on to the card architecture next. Whether or not I can get that half of the system fully up and running by then, I'll go into detail on my design considerations next week. By the way, since I don't actually have a name for this one yet, for the time being I'll be referring to the project as either "Battlegrid" or my randomly generated project codename: "Halberd". See you next time. Did not intend for these last bunch of updates to all be doubles, but that's how my free time ended up working out. Anyway, I managed to clear off the last two tasks off my list, so this will be my last update for this particular project. At least for a good while anyway, never know if I'll loop back around and finish the job later on. For now though, let's get into the details. First up, I've got a pause menu now: I had to tweak my viewport settings a bit and add some functionality to my camera manager to get the fade to work properly with UI layers, but besides that it's a pretty simple matter of setting the world timescale to pause, while setting the pause manager itself to only be active when the timescale is 0. Fun fact about Super Metroid's pause menu: the game is still running and accepting inputs while the fade to black is happening. As such, it is possible to cross the barrier to enter another room while in the middle of pausing. In this situation, the game cancels the pause sequence and instead transitions rooms, starting the fade at whatever value it was already at. My system unfortunately can't support that sort of interaction without adding in quite a large chunk of functionality, so I elected to simply disable the door triggers while pausing.
I didn't end up getting the map screen fully functional, but I was satisfied that I had gained all the knowledge I needed for how to set up UI, so I elected to move on. Now, for the sound system... I can't exactly "show" the work I did here without recording actual videos, so I'll just do my best to explain what I did instead. The sound manager runs with two object pools, one for creating AudioStreamPlayer objects, which handle global sounds, and one for AudioStreamPlayer2D objects, which handle spatial sounds. When you want to create a sound, you pass the audio manager a reference to the file you want to play as well as whether or not it's a looping sound, where to play the sound from, and what object, if any, you want to attach it to. The manager gives you a reference to the sound emitter so that you can stop it manually if needed, and when the sound finishes playing, it uses the "Finished" signal to return itself to the proper pool. I also created an "AudioTrigger" script, which holds a dictionary of sound files that you can retrieve through name strings, and attached that to the object that I want to play sound effects (the player, in this case). With the audio trigger present, I can do things like trigger footstep sounds from the player's animation whenever the sprite's foot hits the ground, or start and stop the spin jump sound effect whenever the player enters/exits the relevant state. Besides that, there's not much else to say. I also set up music to play and made it so that it can transition between songs properly when changing rooms, as well as learned how to properly loop music rather than having it fade out/in whenever the song "ends". And.... that's about it. at some point I will loop back around and clean up my code so that I can post this project as part of my work samples, but for now I have accomplished my goal of learning how to bend the Godot engine to my will. Current plans are to take a week or two to do some other studying for job search purposes, then I'll be back to start work on my first "real" Godot game. See you next time. Didn't have time to write a blog post last week, so this week you get a double update. For the past two weeks I've been working on the map and saving systems. There's really not much to say about the save functionality, other than the fact that it employs Godot's resource system, which turns out to be very simple to use in that capacity. Basically I just made a resource class that contains all the data I want to keep track of, and then I copy that data from/into the actively running game to save or load. I had to rework a few systems to allow for mid-game loading, but that's about as far as the system goes. I can't really show it in action within the scope of my .gif maker either, so I suppose you'll just have to take my word that it works as intended. Now as for the map... I decided that the best way for me to implement Metroid's specific style of map was to use tilemaps. Rather than just using a single tilemap and changing each cell based on whether the map tile has been revealed, explored, or still unseen, I went with several tilemaps stacked on top of each other. The "hidden" layer is on top, followed by "revealed", "explored", and "occupied". This makes the map itself a little bit of a pain to set up, since I have to draw several different versions of the same geography, but it does make things much simpler at runtime, allowing me to simply hide individual tiles on each layer as the player discovers more of the map. The map itself is currently hidden in game, and will remain that way until I can get the pause menu up and running, but I did also get the mini-map working. I considered just using a second camera pointing at the map proper and projecting it onto the HUD, but I found it difficult to maintain the proper visual with that approach. Instead, I made use of another small tilemap on the HUD. This tilemap looks at the current state of the full-sized map and simply swaps out the tile sprites to reflect the map state in the player's immediate vicinity. A simple timer hooked up to a visibility toggle gets me the effect for the blinking tile on the player's current position. I ran into a little bit of trouble getting the map to play nice with the instant-load system I have hooked up for debug, but it turned out that I was accidentally using C# syntax for one of my for loops instead of GDScript. Turns out it's hard to drop 10 years worth of muscle memory, who would have guessed?
With these two features in a state that I'm satisfied enough with, we're just left with Sound and the Pause menu for implementation. Getting pretty close to the end here now, and my brain is already at work trying to churn up ideas for what comes next. See you next time. Alright, it's been a hot minute since the last time I was able to give an update. Life got a bit hectic so I had to take a bit of a hiatus from my project work in order to deal with everything, but now I should be more or less back on my normal work schedule. So this update is probably roughly equivalent to 2 weeks of actual dev work spread out across a little over a month, and what have we done during that time? Well, I introduced the concept of "Rooms" to the codebase, which store data for the tile sets and trigger volumes of a small chunk of environment as well as map coordinates (which will come in handy later). They also indirectly hold information on their neighboring rooms via the newly added transition triggers I made, which in turn allows us to move from room to room. And that's really what I spent the bulk of the time working on; room transitions. In Metroid, when the player walks through a door, they don't just simply appear in the next room, the game pauses, everything fades to black except for the door itself, the camera pans in the direction of the new room, and then everything fades back in before gameplay resumes. This process hides any load jitters while also being pretty visually appealing at the same time, but each step of that process involves a new system that I had to make. Pausing the world is relatively simple thanks to Godot's timescale and Processing type options, just need to select the top-level node and tell it to pause, and set a few choice objects to be able to continue to run their update loops even when the timescale is paused. The fade involves attaching a giant black rectangle to the camera and adding scripts to allow it to transition from one color to another over time, and the actual camera movement only needed some slight adjustments to the camera manager system I set up as part of my last update. In order to get the whole sequence put together, I also had to figure out how callback functions work in Godot, which luckily ended up not being that much different from what I'm used to in Unity. Technically I could have just used signals to get functions to fire when I need them, but having to connect and disconnect to signals repeatedly every time I ran through the process seemed like a lot more work than just passing in a callback function. There's a little more magic happening behind the scenes when it comes to placing the rooms in the proper position in the world and making sure the player's movement and height are carried over between room transitions, but that's just some simple math at the end of the day.
Now, as for what's next.... 14 weeks is actually a pretty short amount of time when it comes to game development, but the fact of the matter is that this project was supposed to be a relatively short one. Theoretically I could keep chipping away until I more or less recreate the whole game, but the point of this exercise was to familiarize myself with the Godot engine before I move on to working on something of my own. To that end, I have made a list of topics/features that I want to cover before I can declare this project over. Here's what we have left: - Mini-map - Pause Menu - Save/Load - Sound and Music I've determined that basically everything else on the feature list I originally wrote up is either something I have already figured out how to do during my time with the engine, or something that the engine doesn't meaningfully effect the implementation of. As such, those won't be much help as a learning tool, and I'd be better off spending my time elsewhere. So all things considered, we're actually pretty close to the end here. I've been doing some thinking about the project I'll be starting up once I'm done with the Metroid stuff, and I'll talk some more about that when we get there. For now, next thing on the docket is the map functionality. See you next time. Okay technically we missed a progress check-in last week, but I've been busy with job search matters so I had to put this project on the back-burner for a little bit. This past milestone has been all about our game's camera: getting it to follow the player, controlling where it can and can't go, and handling transition behaviors. The good news here is that I learned that Godot has a lot of really nice built in camera functionality. It's got smooth follow, tracking bounds, and even built-in deadzone options. The bad news is that it turns out I couldn't use most of these features for my purposes and had to write my own camera manager instead. So why is that? The short answer is that the default functionality of the godot camera was at odds with the camera design of Super Metroid. This was mainly evident in two areas: tracking and bounds. For Camera Tracking, Godot has set up its cameras to use a very common design for side-scrollers known as a deadzone. The idea is that if you are in the middle of the screen, you can move slightly to the left or right before the camera actually starts moving to follow you. This makes the camera feel more dynamic and more smooth than if it simply always tried to keep the player in the exact center. Super Metroid doesn't do that though, rather the camera moves slightly ahead of the player as they move in a particular direction, moving them to the "back" half of the screen to allow them to see farther forward. This makes sense for a game where your primary attacks are projectiles, as it gives you warning for things ahead of you so that you can better engage at range. For this purpose, I built the camera manager to have the camera track an invisible point that moves in whatever direction the player is going, up to a defined limit in each direction. For the camera bounds, Godot has some built-in variables that you can set to tell the camera not to pan past a certain point. This works fantastically, the only problem is that if you ever try to change the bounds of the camera, say when going through a screen transition, the camera instantly snaps to be inside of the new bounds rather than transitioning to it smoothly. Technically Metroid's camera deals with this in two different ways depending on the specific trigger. Either the camera will simply do a slide transition to its new desire bounds, or the camera will have a ratchet effect applied to it, where moving closer to the bounds shifts the camera as normal, but trying to move away will have it remain in place. As you can see, I got it all working, it simply took a bit longer than expected. Anyway, hope you all enjoy the little primer on camera design. Next up I'll be moving on to real room transitions with all the added fun of scene/asset loading.
See you next time. Couldn't think of a stupid joke for the title this week. Anyway, I started off things by reviewing my list of goals for this project and I ended up cutting a number of things from the queue. My primary goal here isn't to recreate the entirety of Super Metroid, but to use existing designs in order to get used to using Godot. to that end, I removed things from my todo list that I have already figured out how to do in the engine, which will reduce the amount of time I need to spend on this training arc before I can start building something for real. As for the actual implementation work for the week, I didn't run into any real surprises. First up, I finally added death effects for my enemies, though I did have to use the morphball bomb explosion effect as a placeholder, at least until I can find and slice up the real enemy death explosions. The real explosions in the game do a better job of hiding the sprite pop, but functionality wise this one is done. Next was getting enemies to drop items when they die. Again, this was pretty simple in itself; I defined all the different types of drops, made them increment the player's stats when collided with, and set up data resources so that enemies can define their own drop rates for each type of item. Thing is, Metroid actually has a bit of a system when it comes to item drops: items don't drop if the player is full on that particular resource, and the drop rates of other items that the player is missing are boosted. I did not replicate the behavior exactly as it appears in the games, but I made a close approximation. When an enemy wants to drop an item, the Drop Manager looks at the player's current status. It only takes into account drop weights of resources that the player is currently not full on, skipping over those that are already topped off, and thus making sure that only things that the player needs will spawn. While I don't truly have logic for missiles, super missiles, and power bombs up and running yet, I did still create the full suite of ammo drops as well.
And.... that's about it for this week. Next up, I'm planning on shifting my attention to Godot systems that I'm less familiar with, specifically camera control and scene transitions. Once I get the ability to swap rooms working, hopefully I can start to figure out how save data works in this engine. See you next time. Another week down with a good amount of progress made. Following up from last week, my primary goal was to finish the player's damage interaction, which meant I had to set up a few extra systems. First up, we need a way to actually keep track of the player's health, so that means setting up some UI. I created a UI Manager script, defined a basic "UI Screen" to hold shared functionality, and then went about making the HUD from there. Luckily, unlike many of my past experiences with the art assets I'd been able to find myself, the sprites for the UI chunks I had needed minimal amounts of work in order to get in to "game-ready" state. So, after looking up some basic guides on how to use the UI nodes in Godot, I threw together my replica of the Super Metroid HUD. Not bad, eh? I'm not planning on implementing grapple beam, reserve tanks, or X-ray visor for this little project of mine, so I left those bits out of my setup. Next step was actually getting those values hooked up to real player stats, which... lead me to rearrange some of my architecture first. Previously, I just had the player, level, and enemies thrown under an empty node for organizational purposes, but I ended up finally making myself a real "Game Manager" script to exercise more control over how the program runs. Instead of just using Godot's built in "_ready" function to set up values at game start, I introduced Initialization functions to key scripts and had the Game Manager trigger those in correct load order. In simpler terms, I needed to be able to make sure certain values were set within the player instance before I could hook up my new "Player Status" script and properly connect the HUD to that. Speaking of Player Status, that script is effectively just a data holder used to keep track of stats. At the moment it holds the player's max and current health, as well as max and current ammo counts for missiles, super missiles, and power bombs, but it will eventually hold data on what power-ups have been collected and what items are equipped. Basically, this thing will be what I eventually turn into save data once I start working on that system. For now though, it has been properly hooked into the HUD, which updates the relevant fields as necessary. Energy tanks are shown/hidden based on what the player's max health is, and the icons for your various types of ammo are set to hidden if you can't hold any of that ammo yet. And of course, this all updates in real time as the player's stats change. As you might be able to see from the clip above, I also got my i-frame flash working as intended. That one was thankfully as simple as I thought it would be.
For next week, current goals are to get enemy drops working so that there's actually a way to make those numbers go up instead of just down, and also finally maybe make proper hit and death effects for my poor enemies. See you next time. Back to work after the new year. There's not a whole lot of visual progress this week in comparison to earlier updates, but I still got a decent amount of work done. Under the hood I made it so that weapons actually apply damage to enemies instead of just instantly killing them, made them die properly when their health hit zero, and added in functions that allow entities to modify incoming damage values. I also setup damage property flags to represent different types of incoming damage and made it so that enemies can be set to be immune to specific damage types. That will come into play relatively soon when I start adding in bombs, missiles, and different beam types. With that set up, I also added a little bit of polish to the damage sequence so that we now get that classic sprite flash when something gets hit by an attack: The system I made for this should be pretty versatile, able to take in lists of colors, frame counts, and duration to create looping effects. In theory, it should work perfectly for when I get i-frame visuals up and running. Speaking of player damage, I also made it so that enemies can damage players and even apply knockback to them. I had to at least stub in invincibility frame logic to prevent them from applying damage continuously, but I will be adding visuals to let the player know when they're active in the near future. That's about it for progress this time, because I actually spent a good portion of the week getting sidetracked by research. While trying to figure out the best way to handle collision detection for enemies, I stumbled across a post talking about physics optimization and kinda fell down a rabbit hole for a bit. Evidentially Godot has systems called "servers" that handle all of the engine's rendering, physics, and computations under the hood. While the Node system is very user friendly, it's not the most efficient in terms of processing, and so it can start to hold you back when you have a large number of nodes active at the same time. You can apparently get around this issue by polling the servers themselves instead of just using Nodes. This video does a pretty great job of showing the differences in the two approaches: It's not quite as simple as they make it sound, especially if you want bullets with non-linear/non-standard movement, but the potential performance gains are pretty obvious. Now, this isn't exactly important for my work on this project because the number of live physics objects in any given scene will always be low, but it's pretty vital information for some of my future plans.
We'll talk more about that when I start getting closer to checking everything off my todo list for Metroid though. For now, my next goals are to finish sprucing up my enemy damage effects (VFX for hit and death), adding visuals to the player's i-frames, and then starting set up the HUD so that we can actually see how much health the player has. See you next time. Ended up missing my update last week because I lost a significant amount of dev time to a nasty stomach bug, and holiday obligations ended up interrupting me on more than one occasion, so these two weeks effectively combine into a single week's worth of work. So what did we get done? I fixed a few bugs that cropped up with my tile destruction system, as well as implemented basic architecture for enemies and created our first enemy. I wanted to stick with something simple enough for my initial foray into enemy implementation, so I decided to go with one of the first enemies you encounter in Metroid; the Geemer. Or at least that was the plan, but because of my struggles with Super Metroid Sprites, I ended up using the Metroid Fusion equivalent of the same enemy design. It's called an "Owtch", which really is a top-tier name. Now, it's not that I couldn't find sprites for the Geemer this time around, just that they were cut up in a way that was a bit nonsensical and putting them together would have been a small nightmare. Besides, the Owtch does exist in Super Metroid so it still counts. As far as enemies go, these guys just move along flat surfaces, following the geometry of the terrain as they encounter walls or ledges. Very simple to the player, relatively painless in terms of coding. For something like this you just need move forward and have one raycast downward and one facing forward to check for walls or cliffs. If it finds one, play an animation to smooth the transition and update which directions the enemy thinks is "forward" and "down" so that the new surface becomes its "ground". Godot seems to have some interesting quirks with raycasts, such as them not being able to properly detect surfaces on the first frame the enemies exist, or needing to create a "query" object in order to actually use them, but besides that they behaved mostly as expected. Most of my issues involved two main factors: getting the sprites to properly reorient themselves to the surface they are attached to, and getting the enemy to properly re-attached to a surface after it encounters a cliff (the movement shown in the gif on the right). The former issue is born from the fact that I only actually have sprites for when the Owtch is upright or attached to a left wall. For ceilings and right walls, I need to carefully time a sprite flip when the transition animation finishes. You can probably see a little bit of popping in the gifs above when the enemy finishes rounding the top-right corner. I have since fixed that particular issue but didn't have time to grab new screenshots before making my post. The second issue involves the fact that when the enemy encounters a cliff, there is a frame or two when it's in the middle of it's transition animation where it's not technically touching the ground at all, and early on in my tinkering it thought it was just constantly encountering cliffs when this happened, leading the enemy to spin in place in the air. The solution to this one was to shift the source of my ground-detection raycasts based on what part of the transition it is in. when it knows its firmly attached it searches from the back edge of it's hitbox, but while its in the process of transitioning around a corner it looks from the front edge instead. Luckily, it seems the way I set up the movement logic on these guys plays nice with the destroyable terrain. I'm going to need to add in some safety checks to make sure the destructible blocks can't reform on top of an enemy, but I was honestly going to have to deal with that for the player anyway. With all that working, I added actual health tracking to enemies, made it so that projectiles can actually hit them, and made it so that they can die properly. Still need to add death VFX of course, as well as making it so that enemies can hurt the player as well. Those will probably be in my next list of goals. That being said, this should be my last update for the year. The holidays are basically upon us and I'm not going to be able to spend much time at a desk.
Happy Holidays to anyone reading, and see you next time. |
Archives
April 2025
Categories
All
|
RSS Feed