Skip to content

Commit

Permalink
[doc] Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
g3force committed May 30, 2019
1 parent f4d16d8 commit 93ff003
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,54 +48,62 @@ List of new features:

### FAQ
#### How to start a new game?
* Reset match (button)
* Go to Settings (top left button)
* Start new game
* Select team names
* Switch sides, if necessary (button)
* Select division (button switch)
* Set goalkeeper id
* Select division, if necessary (button switch)
* Set goalkeeper ids
* Choose which team will start with kickoff
* divB: set ball placement capability

#### How to end a game?
Press 'End of Game' button during stop.
* Stop the game
* Make sure you are in the second half, extra second half or in shootout
* An 'End of Game' button should show up on the top

Purpose: Notify team AI about end of game and log it in log files.

#### How to give a goal?
New Event (button) -> Select Goal -> Insert parameters
If an autoRef has send a 'possible goal', this event can be accepted on the right.

To add a goal manually:
* New Event (on the top)
* Select Goal
* Insert parameters
* Add

#### How to correct the current state of a team?
Most of the state can be changed with the edit buttons.
This should only be used in case of misbehavior! Goals, yellow cards, etc. should be given through the respective events ('New event' button)
Most of the state can be changed with the edit buttons. Either in the settings modal, or in the team overview.
This should only be used in case of misbehavior! Goals, yellow cards, etc. should be given through the respective events ('New event' button) or in the manual view.

#### How does the undo button work?
With every interaction in the UI and every new game event from an autoRef, the current state will be copied. The last ~20 states will be saved. Undo rolls the state back to the previous state.
The state will be persisted with each change. After a crash or restart, the whole history will be restored.
#### How to revert a change?
The game control allows to revert certain actions like game events or stage changes. For these actions, a revert button will show up in the protocol table.
The button reverts this line and all following.

#### How to disable certain game events?
Go to 'Configure Behaviors' (button) and select the game event in the dialog.
Go to 'Configure Behaviors' in the settings modal and select the game event.
A game event can be set to be:
* Always accepted
* Only accepted when there is a majority between all connected autoRefs
* Only accepted when there is a majority between all connected autoRefs (if only one autoRef is connected, it will always get a majority)
* Ignored (logged as an ignored event in the table)

#### How does the continue button work?
Based on the current game events, the next command will be determined.
This command is sent, when the continue button is pressed.
The next command is also shown in the top right corner.
The button shows the command that it will trigger.

#### How can I see if my team is connected?
Open connections to teams are shown as an icon next to 'Team Yellow' and 'Team Blue'.
If there is no connection, no icon is shown.

#### How to override/cancel a game event from an autoRef?
All game events that happened since the last running state are listed on the left side with a button to remove this game event again.
Active connections to teams are shown as an icon in the team overview.

#### The controller crashes on start. What can I do?
Try deleting the history.json file in the working directory. It may got corrupted.
Try deleting the gc-state.json file in the working directory. It may got corrupted.

## Integration into your own framework
The game-controller can easily be integrated into your own AI framework, if you do not want to implement your own controller for testing purposes.

Download the release binary from the Github release and run it from inside your framework. Then, attach to the WebSocket API that is used by the UI as well. The API is defined in [internal/app/controller/events.go](internal/app/controller/events.go).
Download the release binary from the Github release and run it from inside your framework. Then, attach to the WebSocket API that is used by the UI as well.
The API is defined in [internal/app/controller/events.go](internal/app/controller/events.go).

If you don't want to run the controller in real time, you can change the time acquisition mode:

Expand Down
Binary file modified doc/screenshot_interface.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 93ff003

Please sign in to comment.