# README
Lugo - The Dummies Go
The Dummies Go is a Go implementation of a player (bot) for Lugo game. This bot was made using the Go Client Player.
As this name suggest, The Dummies are not that smart, but they may play well enough to help you to test your bot.
Requirements
- Docker >= 20.10 (https://docs.docker.com/install/)
- Docker Compose >= 2.10 (https://docs.docker.com/compose/install/)
Before starting
Are you familiar with Lugo? If not, before continuing, please visit the project website and read about the game.
How to use this source code
-
Checkout the code or download the most recent tag release
-
Test it out: Before any change, make The Dummies Go to play to ensure you are not working on a broken code.
Note: this step can take a little longer at the first time.
docker-compose up
and open http://localhost:8080/ to watch the game.
-
Now, make your changes: (see :question:How to change the bot)
-
Play again to see your changes results:
docker-compose up
-
Are you ready to compete? Build your Docker image:
docker build -t my-super-bot .
-
:checkered_flag: Before pushing your changes
MY_BOT=my-super-bot docker-compose --file docker-compose-test.yml up
How to edit the bot
The only files that you may need to edit are the ones inside ./bot directory. Ignore all the other ones.
Helper functions file bot/helpers.go
You may need to change this file if you want to change the player disposition in the field. E.g. if you want to change the 4-4-2 disposition.
Settings file bot/settings.go
This file defines where the players will act based on the team state (attacking, defending, etc.) and also define the field grid.
Main file bot/bot.go
:eyes: This is the most important file!
There will be 5 important methods that you must edit to change the bot behaviour.
type Bot interface {
// OnDisputing is called when no one has the ball possession
OnDisputing(ctx context.Context, sender TurnOrdersSender, snapshot *proto.GameSnapshot) error
// OnDefending is called when an opponent player has the ball possession
OnDefending(ctx context.Context, sender TurnOrdersSender, snapshot *proto.GameSnapshot) error
// OnHolding is called when this bot has the ball possession
OnHolding(ctx context.Context, sender TurnOrdersSender, snapshot *proto.GameSnapshot) error
// OnSupporting is called when a teammate player has the ball possession
OnSupporting(ctx context.Context, sender TurnOrdersSender, snapshot *proto.GameSnapshot) error
// AsGoalkeeper is only called when this bot is the goalkeeper (number 1). This method is called on every turn,
// and the player state is passed at the last parameter.
AsGoalkeeper(ctx context.Context, sender TurnOrdersSender, snapshot *proto.GameSnapshot, state PlayerState) error
}