Skip to content

Game rules implementation#2

Open
XioZ wants to merge 24 commits intomainfrom
christopherWilliams98-multi-agent
Open

Game rules implementation#2
XioZ wants to merge 24 commits intomainfrom
christopherWilliams98-multi-agent

Conversation

@XioZ
Copy link
Collaborator

@XioZ XioZ commented Nov 7, 2024

  • LegalMoves()
  • Play()
  • Delta()

)

// GameState represents the dynamic state of the game at any point. stuff that will change during the game, (everything except the map - which is static), and at some point even the rules.
type GameState struct {
Copy link
Collaborator Author

@XioZ XioZ Nov 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please rename to State since it's already in package game to be consistent with Go's naming conventions (externally it'll be used as game.State)

@XioZ
Copy link
Collaborator Author

XioZ commented Dec 4, 2024

Comment on lines 28 to 43
// Assign territories to players
totalTerritories := len(gs.Map.Cantons)
//territoriesPerPlayer := totalTerritories / 2 // 13 territories per player

// Initialize ownership and troop counts
for id := 0; id < totalTerritories; id++ {
playerID := (id % 2) + 1
gs.Ownership[id] = playerID
gs.TroopCounts[id] = 1 // Start with 1 troop per territory
}

// Players have remaining troops to place
gs.PlayerTroops = map[int]int{
1: 27, // 40 - 13
2: 27,
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider extracting this as a method inside State

@XioZ
Copy link
Collaborator Author

XioZ commented Dec 12, 2024

  • write a mock for MCTS that simply plays LegalMoves()[0]
  • run LocalEngine with TrainingController using the mock to play a game from start to finish
  • fix Init() and Play()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments