YetAnotherSpieskowcy / Carcassonne-Engine

Other
0 stars 1 forks source link

Allow to compare between PlacedTile and Tile without converting #129

Closed Lenetis closed 1 week ago

Lenetis commented 1 month ago

Resolves #122

Also added a way to compare only features of two different PlacedTiles, without converting to Tile

bstrzelecki commented 1 month ago
panic during request execution: "invalid memory address or nil pointer dereference"
- stack trace:
goroutine 44 [running]:
runtime/debug.Stack()
    /nix/store/mzg3cka0bbr5jq96ysymwziw74fnk22m-go-1.22.1/share/go/src/runtime/debug/stack.go:24 +0x5e
github.com/YetAnotherSpieskowcy/Carcassonne-Engine/pkg/engine.processWorkerInput.func1()
    /home/mabat/Repos/zpb/Carcassonne-Engine/pkg/engine/engine.go:55 +0x5e
panic({0x7f395f226700?, 0x7f395f3364c0?})
    /nix/store/mzg3cka0bbr5jq96ysymwziw74fnk22m-go-1.22.1/share/go/src/runtime/panic.go:770 +0x132
github.com/YetAnotherSpieskowcy/Carcassonne-Engine/pkg/tiles.Tile.Rotate(...)
    /home/mabat/Repos/zpb/Carcassonne-Engine/pkg/tiles/tile.go:91
github.com/YetAnotherSpieskowcy/Carcassonne-Engine/pkg/tiles.Tile.Equals({{0xc1003711d0?, 0x0?, 0x0?}}, {{0xc0001680b0?, 0x0?, 0x0?}})
    /home/mabat/Repos/zpb/Carcassonne-Engine/pkg/tiles/tile.go:21 +0x185
github.com/YetAnotherSpieskowcy/Carcassonne-Engine/pkg/game.(*board).addTileToBoard.func1({{0xc0001680b0?, 0xc256f2e440?, 0xc10031f410?}})
    /home/mabat/Repos/zpb/Carcassonne-Engine/pkg/game/board.go:340 +0x10f
slices.IndexFunc[...](...)
    /nix/store/mzg3cka0bbr5jq96ysymwziw74fnk22m-go-1.22.1/share/go/src/slices/slices.go:107
github.com/YetAnotherSpieskowcy/Carcassonne-Engine/pkg/game.(*board).addTileToBoard(0xc0feac5d80, {{0xc256f2e440?, 0x7f38cc1315b8?, 0x18?}, {0x1?, 0x0?}})
    /home/mabat/Repos/zpb/Carcassonne-Engine/pkg/game/board.go:339 +0x399
github.com/YetAnotherSpieskowcy/Carcassonne-Engine/pkg/game.(*board).PlaceTile(0xc0feac5d80, {{0xc27290f580?, 0x7f38cc1315b8?, 0xc035d3b880?}, {0x5a3e?, 0x5f0b?}})
    /home/mabat/Repos/zpb/Carcassonne-Engine/pkg/game/board.go:318 +0xae
github.com/YetAnotherSpieskowcy/Carcassonne-Engine/pkg/player.(*player).PlaceTile(0xc1003493b0, {0x7f395f248118?, 0xc0feac5d80?}, {{0xc27290f580?, 0x7f395f07447b?, 0x7f395fb2e6c8?}, {0x7?, 0x0?}})
    /home/mabat/Repos/zpb/Carcassonne-Engine/pkg/player/player.go:89 +0xe7
github.com/YetAnotherSpieskowcy/Carcassonne-Engine/pkg/game.(*Game).PlayTurn(0xc0feaad340, {{0xc27290f580?, 0xc100362420?, 0xc000162660?}, {0x4?, 0x0?}})
    /home/mabat/Repos/zpb/Carcassonne-Engine/pkg/game/game.go:245 +0x31a
github.com/YetAnotherSpieskowcy/Carcassonne-Engine/pkg/engine.(*GetLegalMovesRequest).execute(0xc0fff4fd70, 0xc0fff14310)
    /home/mabat/Repos/zpb/Carcassonne-Engine/pkg/engine/requests.go:297 +0x332
github.com/YetAnotherSpieskowcy/Carcassonne-Engine/pkg/engine.processWorkerInput(0xc0e4d7ae18?)
    /home/mabat/Repos/zpb/Carcassonne-Engine/pkg/engine/engine.go:62 +0x72
github.com/YetAnotherSpieskowcy/Carcassonne-Engine/pkg/engine.worker(0x0?)
    /home/mabat/Repos/zpb/Carcassonne-Engine/pkg/engine/engine.go:69 +0x125
created by github.com/YetAnotherSpieskowcy/Carcassonne-Engine/pkg/engine.StartGameEngine in goroutine 17
    /home/mabat/Repos/zpb/Carcassonne-Engine/pkg/engine/engine.go:141 +0x1f4
bstrzelecki commented 1 month ago

1.json

bstrzelecki commented 1 month ago

OOM kill: 2.json

bstrzelecki commented 1 month ago

Player 2 has 8 meeples on the board at the end of the game: 3.json

Lenetis commented 1 month ago

@bstrzelecki all unit tests are passing. How can I reproduce these issues?

bstrzelecki commented 1 month ago

You can try using python agent.

Lenetis commented 3 weeks ago

Tested on https://github.com/YetAnotherSpieskowcy/Carcassonne-Neural-Network, branches:

I couldn't reproduce any issues with the details you provided