#game #representation #wire #com #type #decoding #battlesnake

battlesnake-game-types

play.battlesnake.com 的游戏类型

18 个版本 (破坏性)

0.17.0 2023 年 1 月 22 日
0.16.0 2022 年 11 月 20 日
0.15.0 2022 年 2 月 26 日
0.10.0 2021 年 9 月 25 日

#212游戏

Download history 13/week @ 2024-03-13 5/week @ 2024-03-27 6/week @ 2024-04-03

69 每月下载次数

Apache-2.0

170KB
4K SLoC

战斗蛇游戏类型

crates.io

一个用于表示战斗蛇游戏中游戏类型的包。

使用方法

最常见的使用是解码和编码线表示数据。

use battlesnake_game_types::wire_representation::Game;
let g: Result<Game, _> = serde_json::from_slice(&body);

在包文档中还有其他有用的工具。


lib.rs:

用于处理战斗蛇的 battlesnake 的类型。目标是提供模拟工具和快速表示,以便开发高效的 minmax/MCTS。你可能最感兴趣的是 CellBoard 类型,它实现了所有必要的特性,用于 minmax/MCTS,并且比使用线表示更快,在我们的基准测试中,我们发现我们的紧凑表示在模拟中比线表示快约 33%。

Gnuplot not found, using plotters backend
compact start of game   time:   [2.7520 us 2.7643 us 2.7774 us]
                        change: [-9.0752% -8.5713% -8.0468%] (p = 0.00 < 0.05)
                        Performance has improved.

vec game start of game  time:   [4.1108 us 4.1303 us 4.1498 us]
                        change: [-12.869% -9.2803% -5.8488%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild

compact late stage      time:   [14.098 us 14.152 us 14.209 us]

vec late stage          time:   [21.124 us 21.337 us 21.592 us]
Found 14 outliers among 100 measurements (14.00%)

依赖关系

~1.7–2.7MB
~54K SLoC