GithubHelp home page GithubHelp logo

witroom / douzero_for_hlddz_fullauto Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vincentzyx/douzero_for_hlddz_fullauto

0.0 1.0 0.0 114.06 MB

将DouZero用于欢乐斗地主自动化

License: Apache License 2.0

Python 99.87% Batchfile 0.13%

douzero_for_hlddz_fullauto's Introduction

DouZero_For_HLDDZ_FullAuto: 将DouZero用于欢乐斗地主自动化

  • 本项目基于DouZeroDouZero_For_Happy_DouDiZhu

  • 环境配置请移步项目DouZero

  • 模型默认为ADP,更换模型请修改main.py中的模型路径,如果需要加载Resnet新模型,请保证游戏路径或文件名中存在关键词 "resnet"

    self.card_play_model_path_dict = {
        'landlord': "baselines/resnet_landlord.ckpt",
        'landlord_up': "baselines/resnet_landlord_up.ckpt",
        'landlord_down': "baselines/resnet_landlord_down.ckpt"
    }
  • 运行main.py即可

  • 在原 DouZero_For_Happy_DouDiZhu 的基础上加入了自动出牌,基于手牌自动叫牌,加倍,同时修改截屏方式为窗口区域截屏,游戏原窗口遮挡不影响游戏进行。

  • 请勿把游戏界面最小化,否则无法使用

说明

  • 欢乐斗地主使用 窗口 模式运行
  • 如果觉得这个项目有用,请给一个Star谢谢!
  • 本项目仅供学习以及技术交流,请勿用于其它目的,否则后果自负。

使用步骤

  1. 先使用 debug_screenshot.py 确认自己的屏幕缩放比

  2. 修改 main.py 中屏幕缩放比为自己屏幕的缩放比

  3. 点击游戏中开始游戏后点击程序的 自动开始

  4. 如果需要自动继续下一把,点击单局按钮,使其变为自动

自动叫牌/加倍原理

用DouZero自我博弈N局,对于随机到的每种手牌,随机生成若干种对手手牌,把该牌型和赢的局数扔进一个简单的全连接网络进行训练,得到手牌与胜率之间的关系,最后根据预期胜率,以一定阈值进行叫牌和加倍。

潜在Bug

  • 有较低几率把王炸识别为不出

鸣谢

其他

欢迎加入QQ群交流自动化相关:565142377 密码 douzero

也可以在原作者DouZero_For_Happy_DouDiZhu 的QQ群交流

douzero_for_hlddz_fullauto's People

Contributors

vincentzyx avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.