itch.io is community of indie game creators and players

Devlogs

Devlog 6

Sacred Gambit
A downloadable game

Sacred Gambit Devlog 6

  • Just as I was trying to get back into a more structured routine, life got in the way. I’d planned to post a devlog each week and still aim to keep that up moving forward. Last week, though, I didn’t feel I’d made enough progress to justify writing one instead of spending that time working on the game itself. Anyway, enough preamble—let’s get into it!

Map Editor

  • As you might guess from the title, this is where I’ve spent most of my time lately. That said, it’s far from what I’d consider complete. I’ve mentioned before that I’d love to make the map editor accessible to everyone, so making it more user-friendly is definitely part of the plan.
  • Entering the editor is simple—just click the big "Editor" button. Once inside, it looks almost the same as regular gameplay, except without units and with some new UI elements. Core gameplay functions are disabled and replaced with editing tools. Instead of the usual activeMap, the game loads an editMapObject on top, which adds extra functionality alongside the tileSelector.
  • One major addition (affecting both maps and the editor) is spawn points, which define where units start on the map. To streamline the process, I also added a new function that makes loading all tiles at once much easier as we want all of them available.

Tile Menu

  • The most basic UI element in the editor is the tile menu, which lets you place tiles wherever you want. Just scroll through the list, click a tile to select it, then click on the map to place it—simple as that. You can also hold left-click and drag to paint multiple tiles at once.
  • In the future, I plan to expand tile placement with more intuitive and powerful tools. Some ideas include tile filling, rectangle drawing, and copy-pasting—basically, anything that makes the process smoother and more efficient.

Size Menu

  • This menu lets you adjust the map’s width and height. Use the arrows next to each setting to increase or decrease the size—holding Shift increases by 10, and Control increases by 100. Once you’ve set the desired dimensions, click the Set button to apply the changes. If you need to revert, the Reset button restores the values to the current map size.
  • Right now, the map size ranges from 1x1 to 100x100, which is mostly arbitrary but should be plenty for now.

Team Menu

  • The Team Menu lets you manage team settings in the map editor. Using the editorTeamMenu, you can adjust the number of teams, set their spawn points, and tweak their positions as needed.
  • Adding and removing spawns is simple: left-click to place a spawn point for the selected team and right-click to remove it. If you lower the total number of teams, any spawn points belonging to the removed teams will be cleared automatically, and the selected team index will adjust accordingly.
  • For a quick reset, there’s a Clear Spawns button that wipes all spawn points from the map.
  • Units now correctly load onto their assigned spawn points in standard gameplay. This ensures that team positioning works as expected when starting a match.

Pieces

  • Building on the last update where pieces now use an atlas, the function getAtlasFromType automatically assigns a default atlas based on a piece’s type. Additionally, getTeam retrieves the team from the map’s teamTable rather than just returning the index.

Serialization

  • A new serialization.cpp file has been added to handle saving and loading various game data.
  • A helper function, splitString, was introduced to break strings into individual words, making data parsing more efficient.
  • Resolution settings are now loaded from a file and automatically saved when changed.
  • HUD positions can now be saved and loaded using save/loadHUDPositions, ensuring UI elements stay where they belong between sessions.
  • Team data is now handled with save/loadTeamData, allowing teams to be properly restored from a file. Teams color is now also held as part of team data.
  • Map data serialization got a rework with save/loadMapData, cleaning up how map files are structured. This also removes tile set loading from the map file, simplifying things.
  • Spawn points and team tables now correctly save and load into the map file, ensuring that maps retain their team configurations properly.

Conclusion

  • Like I said, I was hoping to get more done over the last two weeks, but it is what it is. On the bright side, we now have a functioning map editor, which will make creating maps much easier moving forward. Here’s to a more productive next few weeks!
  • Thanks for reading, and I’ll see you next time.
Download Sacred Gambit
Leave a comment