Devlog 4


Sacred Gambit Devlog 4

I should really make the scope of these updates smaller...

Exciting update today — not just because there’s a lot to cover, but because this build will be used for the first playtest!

It’s been nearly a month since I last stepped back to reorganize, measure, and log my prog. With that in mind, I’ll be focusing only on the major highlights this time around.

If you plan on reading this all in one sitting, make sure you’re in your comfortable chair (as opposed to your uncomfortable one, of course).

Menus

Starting things off, we’ve got a fancy new background that (hopefully) strikes the right balance between pleasing movement and not being too distracting. Overall, the main menu’s looking cleaner than before — it even comes with a nice little fade-in featuring the CMD "logo" (if you can even call it that). There’s probably still some room to tweak the colors, but either way, I’d call it an improvement.

Speaking of improvements, buttons are now vastly superior to their former selves. Previously, they were completely static, with zero responsiveness. Thanks to some tweaks to the CadEngine, they’re now a bit more robust. Buttons now support hover functionality which, while simple, makes a huge difference in how they feel.

Since the buttons are just text with no frame, I also added an underline to a few that might have been a bit less obvious. The end goal is for buttons to have much more distinct and stylized designs, but we’re not quite there yet — so you’ll have to stick around to see where that goes!

One of these new buttons links directly to my shiny new Discord! With more robust buttons comes more possibilities.

On a more technical note, tucked away in the (admittedly pretty barebones) settings menu, you’ll find the resolution toggle. It cycles through a few resolution options — mostly there for testing — though it could end up being useful for someone. It also now keeps the window centered on the screen, so if you’re using a 16:9 1080p monitor, it should seamlessly switch into borderless fullscreen as one of the options.

Tutorial

Still within the realm of menus is the tutorial section. While it doesn’t cover absolutely everything, it should give you all the need-to-know basics to get started. I’m not going to go into wild detail explaining the section that’s literally built to explain things — and I think that just makes sense.

First up, it covers the core of the game — your win condition, lose condition, and the general goal. After that is a page for controls, though let’s be real — you’re mostly going to be left and right-clicking.

Lastly, there’s a rundown of the most important parts of the user interface. There are definitely a few other bits I could’ve explained, but I stuck to what felt necessary — partly to save my own time, and partly to make sure this actually made it in before the deadline.

Pieces

Pieces didn’t get a ton of changes this time around — well, unless you count the fact that they can now die. Yep, that’s right, pieces are now mortal. Kind of a big deal, since that’s, you know, necessary for the game to actually work.

I also gave their stats a bit of a tune-up to (hopefully) make them a little better at killing each other, since they were honestly pretty lousy at it before. Balancing stats is going to be a lifelong journey, so I’m not going to pretend these numbers are good — we’ve got to start somewhere though. From my limited testing, they seem to do the job, and that’s good enough for now.

Technical Tidbit

Since these pieces use “grey-packed” textures (basically, their color gets applied programmatically), I ran into a fun little issue. CadEngine handles textures in a memory-saving way — if you try to load the same texture again, it just hands you the already-loaded one instead of loading a duplicate. Normally great, except this meant all my chess pieces of the same type ended up the same color.

Fortunately, the fix was pretty simple — I just pass a flag into the load function to tell it I need a unique texture, and problem solved. It does use a bit more memory this way, but it’s miles better than re-modulating every single piece’s texture every frame.

Piece Identity

Right now, being a pawn, rook, or bishop doesn’t actually mean anything — at least not yet (with the king being the one exception). That said, each piece does now know what type it is, and even better — they can spell their own type name! Crafty little creatures.

Each piece also has a built-in mugshot — or maybe it’s a portrait, depending on your perspective. Either way, these come into play in the info display, which we’ll get into a bit later.

Map

Moving into the map — where the game really starts to take shape — you’ll probably notice there’s now a border around it! It might not be the most beautiful piece of programmer art I’ve ever made, but it definitely helps cut down on that “floating in the void” feeling while playing.

Another addition to help the overall feel is camera smoothing. Now, panning and zooming slide into place instead of snapping around all rigid and jerky. Since it uses delta time, everything moves at the same pace regardless of your frame rate.

Resting Place

Where do chess pieces go when they die? To the side of the board, of course! Now that pieces can actually die, they needed somewhere to end up. To keep things feeling authentic, I made sure to stick pretty close to how it works in real life. This also makes it easy to get a quick visual on how many enemies you’ve cut down — and how many of your own you’ve lost along the way.

Teamwork and Control

More technical stuff here — the team system got a slight update, so the game can now track which teams are your allies. This opens the door for more complex team dynamics down the line.

There’s also a new flag that lets the game temporarily take control away from you — both the tile selector and the camera. This kicks in whenever it’s someone else’s turn (spoiler alert — that can actually happen now) or if you’re in a menu.

Tile Selector

Much like the map he lives in, the tile selector got a few feel-good tweaks. His movement is smoothed out now, and he’s officially banned from wandering off the edge of the map — a necessary intervention.

On a more fun note, because I needed something a bit more relaxed to work on at the time, I gave him some badass particles to leave behind as he moves. Trust me, he’s earned it — this guy works harder than anyone else.

He even finally got his own custom object type (a long time coming, to be honest). Still not my favorite, though.

Combat Display

This is another element making use of grey-packing — this time to show a little team spirit by rendering the health bars of selected pieces in their team color.

Once again, I found myself needing a break, so I added some extra visual flair to the double attack indicator — now with more particles. Mmmm particles.

This next part isn’t technically display-related, but it is combat-related. After pieces became mortal, they still had a bad habit of landing retaliatory blows after death. And while I do respect that level of dedication, I couldn’t just let that slide from a gameplay perspective.

Info Display

While the info display isn’t exactly new, it’s certainly not used to having anything useful in it. Now, though, it will actually show you information about the selected unit — novel idea, right? Currently, it shows the name, type, mugshot, and stats of the unit. Those of you paying attention will notice the icons representing the stats. I won’t claim they’re perfect or look amazing, but long-term, I think it’s a better solution than just text.

If you take a peek at the message in the bottom of the display, you’ll see I plan on adding contextual information there in the future.

And here’s a little treat for those of you reading — you won’t find this in the tutorial page. If you use the left and right arrow keys in this menu, it will cycle through all the living pieces. Now don’t say I never did anything for ya.

Action Display

Not a whole lot new here — in fact, it’s probably the least touched of anything. That said, it’s now capable of ending your turn with its new “end” button. This button will appear when you select an empty tile, so you don’t have to go through and select all your units to make them wait individually.

Now, you might be thinking, “Wait? End my turn? Since when can I do that?” And to answer that, we’re going to have to move on to the next section.

Turn System

You guessed it — the turn system has now been implemented, and it’s undoubtedly a core element of the gameplay. It does pretty much what you’d expect, but that doesn’t necessarily mean it’s all simple. We need to figure out when the turn should be over, and right now, if all your units have moved, it’ll automatically end your turn for you. I’m thinking this might become an optional feature in the future, though, as I can see how it could annoy some players. As mentioned earlier, you can also use the “end” button from the action display to end your turn immediately.

This system is designed to keep the back-and-forth flow of a turn-based game running smoothly. When it’s your turn again, the camera will return to your first unit and wait for your next move. Now, to get into the how of it coming back to your turn, you will need to practice your patience as that is in a later section.

Turn Display

This guy just serves as a bit of extra information, showing you which team’s turn it is and how many turns have gone by. Simple as can be, which is exactly why I didn’t bother explaining it in the tutorial section.

Ending Battle

Not just one, but two entirely new systems comin' at ya — or is it three? Honestly, I’m not sure anymore… Similar to the Turn system, it would be hard to have a game without it. The main mechanism through which this works is a victory check and a loss check. Currently, there’s only one of each, but down the line, I’d like to support different game modes with unique win conditions and ways to lose.

If you want to win in this iteration, you’ve got to defeat all the enemy units. Losing is easier, though — all you need to do is lose your king!

Once you achieve one of these feats, you’ll be greeted by the “battle recap.” The name makes it sound a bit more grand than it really is right now. At the moment, it just shows if you won or lost. A little more time in the oven, and this element will be much more refined.

Computer Players

I won’t lie — this part is the reason I needed so many particle breaks. When I was about to dive into this section, I quickly realized even the interactions with the map from the player’s side needed better organization. Reusing the functionality of what was there was going to be impossible given the state it was in. But I persevered, and I’m fairly proud of how it turned out.

Once you end your turn, the computer player takes over and starts commanding its units. It will exhaust all its units before passing the turn to the next player, whether human or otherwise. The system allows for unique AI per piece. For example, the king shouldn’t charge into battle first — we’ll leave that to the pawns. While this setup will allow for more complex strategy down the road, currently, all enemy units share the same simple AI.

The basic AI in this build does the following: it starts by adjusting the camera for a better view, then selects a unit and shows its move range. The AI will look for a target, move as close as it can, and adjust the camera again. If it can't find a target, it moves on to the next unit. If it still can’t reach the target after moving, it’ll wait in place. When it does reach you, it will select a target, initiate combat, and move on to the next unit.

While a lot of work went into getting this functional, more time and effort are needed to make the AI compelling. Primarily, the pathfinding needs work. Right now, they tend to line up, making them easy targets... Still, they serve their basic purpose and have decent functionality. The movements are paced so that you can follow along, and you can speed it up with the spacebar if you wish. Honestly, I added that feature for my own sanity while testing.

A few other points of interest: initially, the pathfinding wasn’t creating traceable paths to points where we first ran into obstacles, like enemy units. So, if I wanted to find a path to an enemy, it just didn’t exist. This was a small tweak to my pathfinding code, but it took me a while to figure out the why. Also, I wasn’t storing the actual paths before, as I only needed to know if a path was possible — that changed with AI. Lastly, when searching for available paths, it’s primarily derived from the piece’s movement distance. I’ve added an additional “seeking range,” which can act as an aggro range of sorts. Right now, it’s set to the entire map. You can run, but you can’t hide.

Misc.

Many things have changed that don’t quite warrant their own section, so I’ll mention them here. Just yesterday (the day before this playtest goes live), I found a bug where you could attack your currently selected unit. It was a somewhat specific situation, but I found it interesting. I almost left it in to see if anyone else would find it — maybe there are more bugs like this out there?

I also spent some time setting up the environment to make public releases easier. Hopefully, I’ll find some more time for playtests that make sense, though I don’t foresee anything too soon.

There were some major performance issues related to UI elements. Honestly, I had gotten so caught up in getting things up and running that I put optimization on the backburner — and it really got away from me. We’re talking about a 2D low-res game dropping to sub-100 FPS, but now I’m hitting over 3000 FPS across the board. Unfortunately, I don’t have a good built-in way for end users to check their FPS, but this upcoming playtest isn’t focused on that anyway.

All of the borrowed art has been removed, and we’re now working with all original assets. As you might expect, I don’t consider myself an artist in that regard, so please forgive me if it’s lacking in flair. If you really hate my style, I’m not using any data packing methods, so you could dive into the resource folder and play around with the files. Just keep in mind, modifying them could break something, but as long as you don’t change the image size, you should be fine.

Conclusion

After all this talking, I’m going to keep talking just a little longer. Reflecting on what I’ve done here, I feel good about it. I’m excited to finally get something out into the public sphere, as it’s not something I’ve done before.

I’m not sure anyone is going to find this build fun on its own — it’s definitely lacking content, and I’m fully aware of that. It’s missing a lot of the aspects that would give the combat real purpose, like leveling up, loot, and progression. My hope in sharing this is that people will be able to see the vision and potential behind it. If they’re willing to share what they think could improve it or what they’d like to see, that would be even better.

After putting this all together and reading through it, I’m thinking about adding images in the future. Maybe even a video, at least to break up all this text. It's definitely something to consider for the future.

Once again, this is Cadex signing off. Hope to see you in the next one.

Get Sacred Gambit

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.