Devlog 3


Sacred Gambit Devlog 3

Make sure you set aside some time because I'm gunna start yapping.

Map

Most of the work that has been done is within the map. The main goal here is to get everything set up for combat. I also went ahead and made it so you can move the camera with middle mouse button and not just WASD for convenience.

Tile/Piece Display

Expanded the displays so the names wont hang off the edge of the window, as well as room for more information later. The piece display window now has appropriate coloring and shows the HP of the selected unit.

Path Display

When you select a piece it will now display the range you can attack from the edge of your movement. The current implementation leaves a bit to be desired, such as it highlighting outside of the map, highlighting some spaces you cant really attack due to an ally blocking you from stopping in some places, and also it doesn't have ranges beyond 1 displayable. You can no longer place a unit stacked on a friendly unit but you are still able to move through them (this is why the attack range is off). The movement range is now colored according to the team of the selected unit, so if you select an enemy it will be drawn in red and so on. After we have decided where we want our piece to move, we can move on to attacking. This will happen automatically after we click to move, or we can click our current position to attack from where we are.

Action Display

Hopefully you remember this guy, he didn't get a whole lot of love here but he does provide some necessary functionality. The code for loading the buttons has been rewritten to be more dynamic and flexible. Particularly so that it can read the context of the state of who we have selected on top of just the who. Attack and Wait actually function as they should now. Attack allows for an alternate way to attack from our current position beyond just clicking ourself. Wait will now set the status of the selected piece to "spent" (more on this later). These options are only available to units that are under your control. Unlike the previous options, Info is available on every piece on the board. While it currently only opens a blank window, this will be the best place to get a detailed overview of everything about a particular piece. More than likely you will become familiar with the layout of this page if you want to be the best tactician possible. With that in mind I will put a good amount of effort in making the page legible and easy to look at.

Attack Display

One of the completely new features here, the Attack Display. If you hope to reach this guy, you are going to have to learn how. After you have moved and entered the attack phase, you will have to select a target within your attack range. This will however have to be a valid target. The list of stats that show up when you select a target are based on your selected piece and target. The damage and hit percentages are pre calculated based on each pieces stats.

Target Display

This is the mirror half of your target display that shows the information about the target. Use this in conjunction with your attack display to get a quick overview of how the fight will play out. Once you feel confident you want to commit to this attack, click on the target again to initiate combat. Doing so will also set your unit to be spent.

Combat

A turn of combat consists of the aggressor attacking, the defender responding, assuming they are alive to do so (death no implemented yet). In the event either party is eligible for a double attack, that attack will come last. To preform a double attack your speed must be at least double that of your opponent. Currently the damage and hit formulae are simple, and will likely remain simple. Damage is calculated as attacker's strength minus defenders defense. Hit chance is attackers dexterity minus defenders agility. Critical hits are possible and are based off the units skill stat. Once combat commences numbers or text will pop up above the relevant units displaying the damage they took or why they did not receive damage. This approach is not very robust or interesting, making it easy to miss what happened. I plan on expanding the visual style and clarity as time goes on, currently though the main goal is get the logic and functionality in place.

Pieces

Pieces now have the relevant combat stats assigned to them allowing for combat to be possible. The distribution of stats are not fully decided so these are just place holding. They also belong to a team which determines what colors they are displayed in, who they are allowed to attack, and potentially what win conditions are available to them. As previously mentioned, pieces can be "spent" meaning they have done all they can this turn, and will have to wait until next turn to act again (turn system not yet implemented). A yellow square will appear on the bottom left of a unit to indicate its spent state. This indicator is not very elegant, but again these things will be replaced with time. There is also a health gauge attached to pieces to display their current health. This wont give you an exact number does serve as a easy way to tell how healthy a unit is. I find this helps make keeping track of damage from combat easier, but I also will likely make it optional once there is more visuals to help aid that. On a more technical side, I am achieving these attached indicators quite easily by leveraging the ability to override the draw functions of objects in the CadEngine.

Misc.

One thing that maybe be hard to notice without any visual aspect (impossible as far as I know), is that we have touched up sprites Digital Arcana made! Some other features I focused on were are quality of life things for me when writing code. Firstly is just a simple enumerator so when I reference a team, I can type it like teams::ENEMY instead of having to recall what number was arbitrarily decided to be for the enemy team. Using this in conjunction with a constant expression array of pairs and connected lookup function that hold the colors of different teams and things like the default text color, increases my consistency, productivity, and on top of that, changing colors later is super easy and applies across the board. Sorry that sentence was really long. I made these two short for good measure. Also some time went into reorganizing the code after it was made to work. This included a horrifying single function that was over 500 lines of code in itself. I was a little bit disgusted by my own actions after stepping back to and taking stock of the situation. It has been resolved and I swear it was just a complex problem I was tackling and I just wanted to prove the approach would work! Perhaps the last notable thing was moving the code for loading things from files into better spots instead of just sitting randomly in the middle of my map file. I am hoping for longevity in this project so I see value in making the code easy to follow and approach for future me and perhaps even others who may be subjected to my work.

Conclusion

Thanks for coming along with me on another update. I am once again delighted about how the project is coming along, and the pace of it. I suppose in someway I should be thankful for the "opportunity" to spend as much time as I am able to on this, but i think perhaps more so this is just the escape I need at this time. Regardless I will continue on toward getting something you all can get your hands on, likely the next update will be once the turn system and the info menu are "fully" in. If I don't scope creep the update as I sort of did with this one, it shouldn't be long, Farewell for now. 


  Video

Get Sacred Gambit

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.