{"id":13672782,"url":"https://github.com/calebman/flappy-learning","last_synced_at":"2025-04-28T03:33:00.507Z","repository":{"id":39376468,"uuid":"210273451","full_name":"calebman/flappy-learning","owner":"calebman","description":"flappy-learning with tensorflow.js","archived":false,"fork":false,"pushed_at":"2022-12-11T06:49:00.000Z","size":3095,"stargazers_count":5,"open_issues_count":24,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-11T11:44:56.524Z","etag":null,"topics":["typesc"],"latest_commit_sha":null,"homepage":"https://demo.chenjianhui.site/flappy-learning/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/calebman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-23T05:43:55.000Z","updated_at":"2022-01-20T18:18:26.000Z","dependencies_parsed_at":"2023-01-26T17:30:19.845Z","dependency_job_id":null,"html_url":"https://github.com/calebman/flappy-learning","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebman%2Fflappy-learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebman%2Fflappy-learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebman%2Fflappy-learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebman%2Fflappy-learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calebman","download_url":"https://codeload.github.com/calebman/flappy-learning/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251246394,"owners_count":21558762,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["typesc"],"created_at":"2024-08-02T09:01:48.088Z","updated_at":"2025-04-28T03:32:55.500Z","avatar_url":"https://github.com/calebman.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"https://resources.chenjianhui.site/flappy-learning-logo.png\"/\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cstrong\u003e用机器学习玩转FlappyBird\u003c/strong\u003e\u003c/p\u003e\n\n## 项目简介\n\n基于用户生产游戏数据并根据反向传播算法生成决策模型参与游戏，游戏引擎与AI基于**Vuejs**+**TypeScript**+**Tensorflow.js**实现，**[点此在线预览](https://calebman.github.io/flappy-learning/)**\n\n相关博客[点此进入](https://chenjianhui.site/2019-09-06-machine-learning/)\n\n### 流程设计\n\n![](https://resources.chenjianhui.site/2019-09-06-run-flow.png)\n\n1. 玩家通过玩游戏生成游戏数据，这里将采集游戏在每个时间点的**小鸟高度、障碍物高度、小鸟距下一个障碍物的水平距离**作为输入，以这个时间点**玩家的操作**作为输出\n2. 将游戏数据统一存储到浏览器的LocalStorage统一管理\n3. AI利用玩家产生的游戏数据基于反向传播算法建立决策模型\n4. AI进行游戏测试\n\n### 界面设计\n\n界面左右分成两块内容，左侧为游戏界面，右侧为控制台界面，训练模型列表右侧有一个❓图标，点击可打开教学提示，下面描述一下如何训练一个FlappyBirdAI参与游戏\n\n![](https://resources.chenjianhui.site/flappy-learning-web-page.png)\n\n1. 点击**创建一个新的模型**完成必要信息填写，这里主要是关联神经网络以及训练迭代次数的一些配置\n2. 在新的模型行中点击教学（或**按空格**）开始游戏，此时左侧游戏开始，玩家**按J跳跃**，游戏进行过程中左侧模型训练框中的数据量会不断增加，这些数据将持久化在**LocalStorage**中并作为AI的**训练数据**\n3. 当玩家认为数据量达到预期时（建议大于3000）可终止游戏，点击训练按钮开始**训练决策函数模型**，此时右侧会弹出训练进度图表\n4. 训练完成后游戏将由AI接手自动开始，右侧行会记录AI的最高得分\n5. 模型训练完成，玩家可以点击数据预测使用玩家生成的游戏数据样本交与AI进行**预测分析**，预测完成后将给出AI预测结果与玩家输入预期不符的数据列表\n\n### 模型训练效果展示\n\n这里我人工玩了3万左右的数据量，相当于过了2500个障碍物，小鸟的最高得分是2400，具体运行效果如下\n\n![](https://resources.chenjianhui.site/2019-09-06-flappy-bird-learning-example.gif)\n\n### 开发计划\n\n- [X] 参照[FlappyLearning](https://github.com/xviniette/FlappyLearning)完成游戏引擎开发\n- [X] 完成用户游戏数据采集器与其持久化模块 \n- [X] 引入[Tensorflow.js](https://www.tensorflow.org/js)基于游戏数据训练决策模型并使用其参与游戏\n- [X] 完成数据预测模块，便于对模型预测结果进行分析\n- [ ] 分析AI参与游戏的能力，优化AI使其能够更好的适应游戏\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalebman%2Fflappy-learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalebman%2Fflappy-learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalebman%2Fflappy-learning/lists"}