Devlogs
Devlog 5
Posted March 09, 2025 by Cadex
#Sacred Gambit #Devlog
Sacred Gambit
This week was all about structural improvements and foundational work. With these changes in place, next week should see more exciting new features and content rather than just fixes and polish. Let's dive into the details:
HUD
- Heads up, HUD stands for Heads-Up Display.
- The HUD can now be hidden and shown in key moments. For example, it automatically hides when you open the info display or when a battle concludes.
Before
After
HUDObject
- New object alert! Introducing
HUDObject
, a new base class for HUD elements.
- Any object that inherits from
HUDObject
gains HUD-specific functionality.
- These objects override
update
and draw
functions for custom interactivity.
- By default,
HUDObjects
can be repositioned on the screen by holding Alt. While holding Alt, the objects highlight to indicate they are movable.
- Each
HUDObject
has its own font for easy styling and a boolean for drag logic.
Turn Transition
- Turn transitions now make turn changes more noticeable.
- When a turn ends, a transition graphic appears, displaying the relevant team's color and text.
- The graphic stays centered briefly using the
timeCreated
variable. During this time, player control is locked, and the AI delay is increased at the start of its turn for smoother pacing.
Combat Display
- The attack display and target display have been combined into one unified
HUDObject
.
- Their functions are now merged since they always appear together.
- Attacks that deal no damage are now dimmed to highlight their ineffectiveness.
Action Display
- The action display now inherits from
HUDObject
.
- Moving this
HUDObject
correctly brings its buttons along for the ride.
- Fixed an issue where transparent parts displayed the wrong color.
- Added
generateButton
to actionDisplay
, ensuring new buttons have consistent styling and positioning.
Info Display
- Combined
getPrevUnit
and getNextUnit
by adding a direction parameter.
- Switching to a spent unit no longer shows its move range.
- Fixed an issue where cycling units failed to update
selectedPiece
correctly.
- You can no longer cycle units while your selected unit is mid-move.
Tile Selector
- Added
getTilePos
and getTileUnder
to tileSelectorObject
to improve ease of use and pave the way for future non-mouse controls.
- The tile selector now follows your selected unit during movement and updates the tile display accordingly. Undoing movement also undoes these actions.
- Moving a unit now leaves behind an after-image, showing where the unit started — great for keeping track of where you started.
Pause Menu
- Added a pause menu, accessible via the Escape key.
- For now, it holds debugging buttons, but it will eventually house options for leaving battles, adjusting settings, and more.
Tiles
- Introduced the
masterTile
class, which consolidates all tile-specific data.
- Tiles now reference their
masterTile
and its selected textures for improved data flow.
- Each tile now stores its map position in its hull, laying the groundwork for future optimizations and features.
- Tiles now pull their textures from a texture atlas, enabling animated tiles!
- Implemented a proof-of-concept for special tile effects — more to come here.
That's hot!
Misc.
- Added
generateTextureFromAtlas
to objectPiece
to streamline texture creation for animation.
- The selected tile handler now references the actual tile object instead of just a map position.
generatePieceDisplay
now uses a pointer to the selected piece rather than relying on selectedPiece
.
- Began internal documentation to improve structure and prepare for eventual CadEngine public documentation.
- Map loading now logs its steps for better visibility.
- Made the black chess pieces a little darker for improved visual contrast.
Organization
teamTable
has been moved to mapObject
for improved organization.
- Assets have been organized into clearer folders.
- Moved generate functions to their respective objects for better structure.
- Created a new header file to consolidate public objects, functions, and variables.
- Introduced separate files for Piece and Tile data to improve code clarity.
Next Steps
With these structural updates complete, next week's focus will shift back to expanding features and gameplay content. Expect progress on new mechanics and core systems.
Thanks for following along! Cadex out.