AI 训练

Gymnasium 风格训练环境

这个版本把核心战斗循环做成 Python 环境,AI 可以用标准的 reset / step / render 流程训练移动、近战、冲锋和拾取策略。

安装

git clone https://github.com/Yuzhirou-419/tombfall-webgame.git
cd tombfall-webgame/ai-training
python -m pip install -e .

快速运行

from tombfall_env import TombfallEnv

env = TombfallEnv()
obs, info = env.reset(seed=42)

for _ in range(1000):
    action = env.action_space.sample()
    obs, reward, terminated, truncated, info = env.step(action)
    if terminated or truncated:
        break

print(info)

训练文件