Dev Log Update: Enhanced Go Game Features



We've made a couple of significant improvements to the Go game:

1. Make Komi Your Own! (Configurable Komi)

  • What's New? You can now change the "Komi" value! Komi is the extra points White gets at the end of the game to make up for Black playing first. The default is usually 7.5, but now you can set it to what you prefer in the "Settings" menu.
  • Why? Different Go communities or specific game variants use different Komi values. This change gives you more control and flexibility to play the game your way.
  • How it Works:
    • There's a new "Komi" input field in the Settings.
    • The game will use whatever value you set there when it calculates the final scores.
    • Your chosen Komi will also be saved if you save the game or export it as an SGF (Go game record) file. When you load a game, it will remember the Komi that was set for that game, and you can choose to continue with that or adjust it.

2. Smarter and Faster Game (Zobrist Hashing for Ko & AI)

  • What's New? We've added an advanced internal system called "Zobrist Hashing". Think of it like giving every unique board position (who's turn it is, where all the stones are) a special, unique "fingerprint" number.
  • Why is this cool?
    • Better Ko Detection: The "Ko" rule (which prevents endlessly repeating a board position) is now more reliable. The game uses these fingerprints to instantly know if a move would recreate a forbidden earlier board state.
    • Smarter AI: For the "Hard" and "Expert" AI opponents, this is a big deal. When the AI is thinking about its next move, it explores many possibilities. With these fingerprints, the AI can remember if it has already analyzed a specific game position. This means:
      • It doesn't waste time re-thinking things it already figured out.
      • It can use its thinking time more effectively, leading to stronger moves.
  • How it Works (the gist):
    • When the game starts, it generates a huge set of random secret numbers – one for each possible stone (black, white, or empty) at every spot on the board, plus one for whose turn it is.
    • As you play, the game combines these secret numbers based on the current board state to create the "fingerprint". This fingerprint changes instantly and efficiently with every move.
    • This fingerprint is then used for the Ko check and by the AI to speed up its decision-making.

Overall Impact:

These updates make the Go game more customizable with the Komi setting. The Zobrist Hashing feature, while a bit "under the hood," significantly improves the game's internal logic for rule enforcement (Ko) and boosts the performance and intelligence of the more advanced AI levels.

Files

go.zip Play in browser
1 day ago

Leave a comment

Log in with itch.io to leave a comment.