Skip to content

0.9.1

Latest

Choose a tag to compare

@karlb karlb released this 16 Aug 08:38

The game runs again on current Python, numpy and pygame, installs via uv, and network games can be joined again.

Installation

  • Packaged as an installable tool with a castle-combat console script. uv tool install, uvx, pipx install and pipx run all work from the repository; setup.py, requirements.txt and the launcher script are gone.
  • Sources moved into a castle_combat package and the game data with them, so it no longer has to be started from the repository root.
  • Depends on pygame-ce instead of pygame, which ships wheels for current Python versions instead of falling back to a source build without font support.
  • Requires Python 3.10 or newer, and the dependencies declare lower bounds (numpy 1.26.4, pygame-ce 2.2.0, twisted 22.10.0).
  • The macOS py2app build files were removed.

Fixed: getting the game started

  • Colorized sprites got the wrong tint under numpy 2, no map could be set up, the new game menu crashed, building near walls and placing castles on the Conquer map raised NameError, and 3- and 4-player river games raised TypeError. All fixed.
  • Closing the window did nothing; it now quits.
  • Fullscreen showed the 800x600 artwork in a corner of the desktop with the Help and Options buttons off the background. The display is now created with SCALED, and fullscreen can be switched at runtime from the Options menu or with alt+enter instead of only on the next start.
  • Switching sound off stopped the music but left the cannon and wall hit samples firing for the rest of the session.

Fixed: playing

  • Cannons now change hands with the ground. A player who loses the wall around a cannon loses the use of it, and a cannon an enemy walls in starts working for them, recomputed once per round the way Rampart does it. Previously a cannon kept firing for whoever built it no matter what happened to the territory under it.
  • Enclosing a castle painted the player's ground over three of its four squares, leaving only the top left corner showing; whole castles are now redrawn.
  • Switching to the big cannon at the right or bottom edge of the field crashed.
  • The server address field could not be typed into: every printable key raised an error and the window stopped repainting. The keypad Enter now closes the field like the main one.

Fixed: network games

  • No client could join a network game. Logging in failed on the password hashing, and sending a player failed because the unjellyable registration still named the pre-package module path.
  • One player's connection dropping threw everyone back to the menu. A player who leaves now frees their slots before the game starts, and is eliminated once it is running.
  • Clients no longer decide on their own that a phase is over, that a shot may not happen, or which castles to confirm at the end of the select phase. Each of those was a way for a client to desync or crash while the host played on.
  • Clients are now told when a shot frees its cannon, and grunt positions survive the trip over the wire instead of arriving as zeros.
  • The screen between two phases waited on the host's key press, so an unfocused host window held up to three other players four times a round. The host now moves on by itself after fifteen seconds.

Changed

  • Settings are stored as JSON under XDG_CONFIG_HOME instead of pickled to $HOME/.castle-combat.config. Existing configs are not migrated: the old file is ignored and the defaults come back, so custom key bindings have to be set once more.
  • Added a LICENSE file.

Development

  • Added a test suite covering, among other things, whole playthroughs, a real client connecting over the loopback interface, and a replay that rebuilds a game from the host's broadcasts and checks the client agrees.
  • Added ruff with a pinned rule set, a pre-commit hook that runs it, and a .git-blame-ignore-revs entry for the reformatting commit.
  • Removed the hot-reload machinery, the leftover Python 2 code and idioms, the dead get_opts(), multiply_alpha() and the debug prints.

Full Changelog: 0.9.0...0.9.1