snakai 有AI的贪吃蛇
snake is running! our project final goal is to build a snake game driven by Reinforcement Learning.
贪吃蛇出动!远期目标是实现强化学习驱动的贪吃蛇游戏。
Setting / 设置
language: Python3
package-name: snakai (snake + ai)
Start / 开始
# create env and active it
python -m venv snakai_env
source snakai_env/bin/activate
# install
pip install snakai
# or `pip install -e .` in dev mode
# run snake using QLearning based strategy.
run_snake -s qlearning
# `run_snake -s rule_based` to run in rule-based strategy, or `-s manual` to playing the game...
# `run_snake -h` to see all params
Attention: if you want to run
qlearningbased strategy, you need train it firstly.
Just go to qlearning-strategy and run thescripts'script to train the model.
Currently, about 13 minutes is needed.
you will see following screen if no exception.
screen by the fantastic ScreenToGif
Progress / 进度
-
draw snake based on curses. 绘制贪吃蛇(控制台) ✅✅✅
从 https://gist.github.com/sanchitgangwar/2158089 下载了一个示例,照着学习。
- 完成 package 构建 & 配置上传到 pypi
-
rule-based strategy. 基于规则的AI ✅🔲🔲
- 完成一个基于规则的策略。目前看比较笨。之前调研的时候发现有用
哈密顿连通图之类来做,后续可以试下。 - 另外,还准备试下
A*算法,之前说好要在博客介绍一下 A* 算法的
- 完成一个基于规则的策略。目前看比较笨。之前调研的时候发现有用
-
RL-based strategy. 基于强化学习的AI [little milestone] ✅🔲🔲
- 目前做了基于
Q-Learning的策略。具体见 qlearning-strategy. - 后续准备优化 & 尝试 Deep Q-Learning
- 目前做了基于
-
unity or some other game-engine driven snake? 基于其他游戏引擎的贪吃蛇? 🔲🔲🔲
日志
- 2021.08.08: 完成 qlearning 的基础版本。到此,最基础的策略都已经实现了!
- 2021.01.03: 再次重新组织代码结构,完成了策略逻辑和绘制逻辑的拆分
- 2019.12.28: 有空重新组织了代码结构,完成了绘制逻辑和状态逻辑的拆分;写了snake游戏的开发关键
Metadata
Release files for snakai 1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| snakai-1.1.tar.gz | 21.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| snakai-1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 50.1 kB
Release files / snakai-1.1.tar.gz
| Download URL | snakai-1.1.tar.gz |
|---|---|
| Size | 21.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bfd17d1c1b258231a73652d82e5b04b3236a8c3fcaf58deac95ff949a9f0d0ed
|
|
BLAKE2b-256 checksum How to use checksums |
489af41d146ab680abe27b58355f897d41c4cb136aca947ac67b511be64def9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.10
|
Release files / snakai-1.1-py3-none-any.whl
| Download URL | snakai-1.1-py3-none-any.whl |
|---|---|
| Size | 28.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b7dd23f244a441f65f25c55fec1af66dd864f85099660452ff6fe4830609248
|
|
BLAKE2b-256 checksum How to use checksums |
28ef1a2684f6374f28bd8bc6f624f0eddbfe82bf5288d9a41b2a69189d810837
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.10
|