饥饿饥饿河马 自动播放 (2017)
Hungry Hungry Hippos Autoplay (2017)

原始链接: https://www.mikekohn.net/micro/hungry_hungry_hippos.php

## 饥饿饥饿河马自动游戏及Alexa控制 - 项目总结 该项目源于希望与更喜欢其他棋盘游戏的同事一起玩饥饿饥饿河马的愿望。Michael Kohn构建了一个系统来自动化游戏玩法,甚至可以通过Amazon Alexa进行控制。 该系统使用W65C265SXB微处理器,并用65C816汇编编程来操作河马。图像处理使用Playstation 3摄像头和一台上网本上的C++代码来识别球的位置。伺服电机通过巧妙的风筝线和冰棍棒机制(使用PowerHD 6001HB伺服电机以提供足够的强度)连接到河马,然后“扫”向球。 作为扩展,该系统通过ElectricImp作为互联网端点与Alexa集成,允许语音命令控制游戏。图像处理避免使用OpenCV等库,而是依赖于自定义算法来检测棋盘和球。微控制器源代码可用,并基于以前的项目,如PANCAKE-ROM。链接了演示自动游戏玩法和Alexa控制的视频。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 工作 | 提交 登录 饥饿饥饿河马自动播放 (2017) (mikekohn.net) 8 分,由 austinallegro 发表于 3 小时前 | 隐藏 | 过去 | 收藏 | 4 条评论 aaronbrethorst 发表于 28 分钟前 | 下一个 [–] 我认为《饥饿饥饿河马》这款棋盘游戏教会了我广告是谎言。它实际上并非“乐趣乐趣乐趣,吨吨吨”。https://www.youtube.com/watch?v=lBYcWhQae98 回复 abstractspoon 发表于 39 分钟前 | 上一个 | 下一个 [–] 对现代的悲哀控诉: 1. 受邀与朋友玩实体游戏 2. 只想玩一款无人问津的游戏 3. 决定自己玩 4. 发现很费力 5. 完全将人类从等式中剔除 6. ??? 回复 firefoxd 发表于 29 分钟前 | 上一个 | 下一个 [–] 死亡拥抱? 如果您需要帮助,请发送邮件至我的个人资料。回复 itqwertz 发表于 3 小时前 | 上一个 [–] 看起来很棒!现在加上人工智能,你就能登上 Hacker News 首页!!回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文


Hungry Hungry Hippos Autoplay

Posted: June 10, 2017

Introduction

A group of my coworkers play board games during lunch time on Fridays and at one point invited me to play. Unfortunately all they play is a bunch of modern hipster games when I wanted to play Hungry Hungry Hippos. No one wanted to play with me so I decided to build circuitry that would take their place. Pushing the plastic lever eventually got really tiring so I decided to just make the game play by itself.

The microprocessor of choice for this project is the W65C265SXB with the code written in 65C816 assembly. The image processing is done with a Sony Playstation 3 camera connected to a small Intel Atom based netbook with code written in C++. After getting the autoplay working I figured I'd do a quick extra credit project and made the hippos controllable through Amazon's Alexa (the Echo Dot). To connect the SXB to Alexa an ElectricImp was used.

The source code below for the W65C265SXB board can be assembled with naken_asm.

Related Projects @mikekohn.net

6502: W65C265SXB Projects, C64 Java, Atari Java, Apple IIgs Java, Tape Data Recorder, PANCAKE-ROM, Apple IIe Robot, W65C832

Video

A video of the Hungry Hungry Hippos game auto-playing. The first part of the video shows the image processing on the netbook, the second part is just a single ball, and the last part is the hippos fighting over a few balls. There's a little delay from when a hippo swipes that it waits before trying again. https://youtu.be/YcaVS7d7cN4

A video of Hungry Hungry Hippos controlled by Alexa through an ElectricImp. https://youtu.be/JB0nCFxV3PQ

Pictures

Hungry Hungry Hippos with a servo motor

This is a closeup of the green Hungry Hungry Hippo with a servo motor.

Hungry Hungry Hippos with the electronics.

Here's the Hungry Hungry Hippos board along with all the electronics. Above the board is a Sony Playstation 3 USB camera attached to a microphone stand. To the far right is the W65C265SXB board. The breadboard next to it is simply there to provide 5v to all the motors.

Explanation

The hardest part of this project was getting the motors to pull the levers down. I tried a few different configurations of servo motors and DC motors and finally was able to get it (fairly) stable by putting an eyehook below the lever and attaching it to a servo with kite string. The servo has a popsicle stick on it to extend the length of the arm to make the circumference of the swing to be long enough to pull far enough on the string. Everything is hotglued together so it can be taken apart easily so I can reuse these motors. Even with this setup I tried using two different servos that seemed equivalent, but the only one that was strong enough to pull lever down was the PowerHD 6001HB.

I wrote all the image processing code in C++. The code basically looks for the blue color of the board and draws a bounding box around it. It then finds the center of that bounding box and scans up, down, left, right until it hits a hippo head. That bounding area is the hot spot where the code will then look for balls. If a ball is infront of a hippo head, a yellow bounding box is drawn infront of it. I know I'm going to get asked this question so I'll answer it here: no, I did not use OpenCV for this. The algorithms were pretty simple really and weren't hard to do without a library.

The microcontroller I used is the W65C265 which allowed me to salvage a bunch of code from the PANCAKE-ROM project. I origianally wanted to use the Mensch board but it was a little easier to just develop on the W65C265SXB and by the time it was done I didn't feel like trying it on another board. Actually, that might have just been another 20 minutes of work.. owell :(.

After getting the autoplay to work I thought it might be fun to try controlling the board with Alexa. The complex part with Alexa is she needs an "endpoint" on the internet to talk to. This ended up being a perfect use for the ElectricImp. So my speech goes to Amazon's cloud, Amazon's cloud uses my "skill" to talk to the Imp's cloud, the Imp's cloud talks to my ElectricImp, and my Imp sends a command to the SXB board. To set up the Alexa "skill", I pretty much copied what I had already done with a previous project: Alexa TV Remote.

Source code

hippo_servo.asm

Copyright 1997-2025 - Michael Kohn



联系我们 contact @ memedata.com