gfx/pv fix
This commit is contained in:
1 parent
8b81dc6dc2
commit
be7e064421
6 files changed
+15
-10
No files matched your search
+1
-1
@@ -46,7 +46,7 @@ Many thanks to these additional authors:
|
||||
* "bale-go" for development and continued work on the 'calibrated rank' AI and rank estimation algorithm.
|
||||
* "Dontbtme" for detailed feedback and early testing of v1.0+.
|
||||
* "nowoowoo" for a fix to the parser for SGF files with extra line breaks.
|
||||
* "nimets123" for the timer sound effects.
|
||||
* "nimets123" for the timer sound effects and stone graphics.
|
||||
* Jordan Seaward for the stone sound effects.
|
||||
* "fohristiwhirl" for the Gibo format parsing code.
|
||||
|
||||
|
||||
@@ -161,6 +161,7 @@ class Game:
|
||||
except IllegalMoveException:
|
||||
self._calculate_groups()
|
||||
raise
|
||||
with self._lock:
|
||||
played_node = self.current_node.play(move)
|
||||
self.current_node = played_node
|
||||
if analyze:
|
||||
|
||||
@@ -230,7 +230,7 @@ class GameNode(SGFNode):
|
||||
polmoves = self.policy_ranking
|
||||
top_polmove = polmoves[0][1] if polmoves else Move(None) # if no info at all, pass
|
||||
return [
|
||||
{**self.analysis["root"], "pointsLost": 0, "order": 0, "move": top_polmove.gtp()}
|
||||
{**self.analysis["root"], "pointsLost": 0, "order": 0, "move": top_polmove.gtp(),"pv":[top_polmove.gtp()]}
|
||||
] # single visit -> go by policy/root
|
||||
|
||||
root_score = self.analysis["root"]["scoreLead"]
|
||||
|
||||
+11
-7
@@ -153,11 +153,11 @@ class BadukPanWidget(Widget):
|
||||
source=f"img/dot.png")
|
||||
if innercol:
|
||||
Color(*innercol)
|
||||
inner_size = stone_size * 0.75
|
||||
inner_size = stone_size * 0.8
|
||||
Rectangle(
|
||||
pos=(self.gridpos_x[x] - inner_size, self.gridpos_y[y] - inner_size),
|
||||
size=(2 * inner_size, 2 * inner_size),
|
||||
source=f"img/last_move_ring.png",
|
||||
source=f"img/inner.png",
|
||||
)
|
||||
|
||||
def eval_color(self, points_lost, show_dots_for_class: List[bool] = None) -> Optional[List[float]]:
|
||||
@@ -376,7 +376,6 @@ class BadukPanWidget(Widget):
|
||||
game_ended = katrain.game.ended
|
||||
current_node = katrain.game.current_node
|
||||
player, next_player = current_node.player, current_node.next_player
|
||||
stone_color = STONE_COLORS
|
||||
|
||||
with self.canvas.after:
|
||||
self.canvas.after.clear()
|
||||
@@ -448,14 +447,13 @@ class BadukPanWidget(Widget):
|
||||
def draw_pv(self, pv, node, up_to_move):
|
||||
katrain = self.katrain
|
||||
next_last_player = [node.next_player, node.player]
|
||||
stone_color = STONE_COLORS
|
||||
cn = katrain.game.current_node
|
||||
if node != cn and node.parent != cn:
|
||||
hide_node = cn
|
||||
while hide_node and hide_node.move and hide_node != node:
|
||||
if not hide_node.move.is_pass:
|
||||
if False: # TODO
|
||||
self.draw_stone(*hide_node.move.coords, [0.85, 0.68, 0.40, 0.8]) # board coloured dot
|
||||
pos = (self.gridpos_x[hide_node.move.coords[0]],self.gridpos_y[hide_node.move.coords[1]])
|
||||
draw_circle(pos, self.stone_size, [0.85, 0.68, 0.40, 0.8])
|
||||
hide_node = hide_node.parent
|
||||
for i, gtpmove in enumerate(pv):
|
||||
if i > up_to_move:
|
||||
@@ -474,7 +472,13 @@ class BadukPanWidget(Widget):
|
||||
board_coords = (self.gridpos_x[coords[0]], self.gridpos_y[coords[1]])
|
||||
sizefac = 1
|
||||
|
||||
draw_circle(board_coords, self.stone_size * sizefac, stone_color[move_player])
|
||||
stone_size = self.stone_size * sizefac
|
||||
Color(1,1,1,1)
|
||||
Rectangle(
|
||||
pos=(board_coords[0]-stone_size,board_coords[1]-stone_size),
|
||||
size=(2 * stone_size, 2 * stone_size),
|
||||
source=f"img/{move_player}_stone.png",
|
||||
)
|
||||
Color(*STONE_TEXT_COLORS[move_player])
|
||||
draw_text(pos=board_coords, text=str(i + 1), font_size=self.grid_size * sizefac / 1.45, font_name="Roboto")
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ LINE_COLOR = [0, 0, 0]
|
||||
POLICY_COLOR = [0.9, 0.2, 0.8]
|
||||
STARPOINT_SIZE = 0.1
|
||||
BOARD_COLOR = [0.85, 0.68, 0.40, 1]
|
||||
STONE_SIZE = 0.5
|
||||
STONE_SIZE = 0.505 # texture edge is transparent
|
||||
VISITS_FRAC_SMALL = 0.1
|
||||
|
||||
GHOST_ALPHA = 0.5
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 115 KiB |
Reference in new issue
Block a user