TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Hacking Flappy Bird with Machine Learning

243 点作者 sarvagyavaish超过 11 年前

22 条评论

habosa超过 11 年前
I really want to build a Lego Mindstorms robot (or similar) that watches my phone with a webcam, holds a stylus, and plays Flappy Bird. I have played enough (high score 194) that I am pretty sure I know the right strategy, I just want to take human error out of the equation.<p>Are there open source vision libraries that are low-latency enough to play this in real time? Assuming the robot could keep up with some regular servos. Would be a very interesting project.<p>Edit: I&#x27;m thinking I could run an Android emulator, and then use MonkeyRunner with Python OpenCV processing my monitor to do the work. Anyone who has any relevant experience please reply, I&#x27;d love to hear if this is feasible.
评论 #7246079 未加载
评论 #7246599 未加载
评论 #7246373 未加载
评论 #7265384 未加载
评论 #7246117 未加载
dwetterau超过 11 年前
Neat AI approach to play it. When this first blew up 5 or so days ago I threw together a simple javascript bookmarklet that played the game at: <a href="http://www.mrspeaker.net/dev/game/flappy/" rel="nofollow">http:&#x2F;&#x2F;www.mrspeaker.net&#x2F;dev&#x2F;game&#x2F;flappy&#x2F;</a><p>It&#x27;s really poorly formatted and has unused code in it but it was fun to automate and watch. <a href="http://pastebin.com/yTmdWgfC" rel="nofollow">http:&#x2F;&#x2F;pastebin.com&#x2F;yTmdWgfC</a><p>To use it just install the bookmarklet, click on it and then start the game. Press space to make it die.
brandonb超过 11 年前
Very cool! It&#x27;s remarkable that you can get a good score with effectively only two features: vertical distance from the lower pipe and horizontal distance from the next pair of pipes.<p>I suspect you could cut the training time by an order of magnitude with a different optimization algorithm, or just by varying alpha. For example, have you considered trying something like a line search? <a href="http://en.wikipedia.org/wiki/Line_search" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Line_search</a>
评论 #7246064 未加载
potash超过 11 年前
How hard would it be to solve this deterministically?<p>Can someone comment on the game&#x27;s physics? I am assuming:<p><pre><code> - constant horizontal velocity - gravity - flapping implemented via impulse - collisions are handled with bounding boxes </code></pre> Maybe someone who knows something about optimal control (ODE) say whether this is analytically solvable? Of course there&#x27;s still the practical stuff (numerical integration, I&#x2F;O lag) to deal with but I&#x27;m optimistic.
评论 #7246274 未加载
评论 #7249452 未加载
Blahah超过 11 年前
By far the most interesting &#x27;flappy bird&#x27; post so far.
primaryobjects超过 11 年前
Neat. You could also probably do this with a genetic algorithm. Thinking out loud here:<p>- Have a neural network with 6 inputs for:<p><pre><code> - player x - player y - acceleration speed - acceleration direction - next pipe mid-point x - next pipe mid-point y</code></pre> - Two outputs of 0 or 1 for click or no-click<p>The fitness score would be how close the player is to the pipe mid-point. Hopefully, this would cause the bird to stay as close as possible to fly between the pipes. The genetic algorithm would select the best neural network that knows when to flap based on the current input state.
评论 #7247663 未加载
评论 #7246482 未加载
fogleman超过 11 年前
I&#x27;d like to see a two-dimensional chart that plots Click vs Do Nothing for the two input parameters. (Vertical distance from lower pipe and Horizontal distance from next pair of pipes)
评论 #7246123 未加载
pilooch超过 11 年前
Reinforcement learning (RL) is the future of real-world AI. Bear my words ;) RL has been around for a long time, it is the mix of optimal (in the optimization sense) decision making along with machine learning (ML). It does benefit of most recent advances in ML. As such it is likely to power the next batch of &#x27;intelligent&#x27; applications and services.
fogleman超过 11 年前
The GIF shown on this page makes it look like the input space could simply be pipe height and bird height.<p><a href="https://github.com/zachhuff386/flapbot" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;zachhuff386&#x2F;flapbot</a>
mrtksn超过 11 年前
I was waiting for something like this, but I expected somebody to build a flappy bird playing robot :)<p>Do you know some good literature for machine learning 101? Where to start?
评论 #7246002 未加载
评论 #7246053 未加载
ronaldx超过 11 年前
The video seems jerky in a way which suggests the engine is taking longer to make decisions at certain points in the cycle.<p>Is that plausible? Or just my imagination?
bjd超过 11 年前
How funny is it that I find this post by searching for monkeyrunner and opencv? When I was looking into this for the same silly reason.
shurcooL超过 11 年前
This reminds me (vaguely) of the AI I made for a worm-in-tunnel game long ago.<p><a href="https://dl.dropboxusercontent.com/u/8554242/available-for-2-weeks/wormFX_2003.swf" rel="nofollow">https:&#x2F;&#x2F;dl.dropboxusercontent.com&#x2F;u&#x2F;8554242&#x2F;available-for-2-...</a><p>(It&#x27;s there in the background of the main menu.)
bamos超过 11 年前
Cool post! Minor typo: Monekyrunner -&gt; monkeyrunner
judk超过 11 年前
If you learn that all actions `a` from state `s_i` have very low reward, does that propagatet backward to `s_j,a` that feed into `s_i`?
FlyingLawnmower超过 11 年前
Beating the unbeatable with science. I like it.
nathan_f77超过 11 年前
Had the same idea when I first played the game, but didn&#x27;t do anything about it. Well done for doing it!
vinchuco超过 11 年前
good job! now you have to do it with <a href="http://corpsmoderne.itch.io/flappy-space-program" rel="nofollow">http:&#x2F;&#x2F;corpsmoderne.itch.io&#x2F;flappy-space-program</a> and deal with the complications
kookiekrak超过 11 年前
can you build one for this? <a href="http://kookiekrak.itch.io/flappy-pipes" rel="nofollow">http:&#x2F;&#x2F;kookiekrak.itch.io&#x2F;flappy-pipes</a>
评论 #7246283 未加载
geek90超过 11 年前
Awesome work!
kevonc超过 11 年前
impressive work man!
dpanah超过 11 年前
Tre sweet