Got the following from Loru:
"I'm thinking of doing something that could be funny. A game like the Mickey's Fun Wheel Challenge, but at home and using the ears. The idea is to create a wireless network by using a simple router or even our own home's network. Our family or guests can connect to this network on their mobile phones and enter the navigator to play.
An emitter will send colors to the ears in sequence for each round, just like they do it in DCA. Then people have to enter the sequence in the same order as fast as possible, so they can gain more points. The best score player will get the control of the ears colors and effects during 1 minute.
We can even create an online platform to allow people to do it at home in a simple way.
We have to:
1. Think of a way of creating a server-multiuser game that can run on an internet language.
2. Control the ears through that server which has to send codes to the emitter via an USB.
Any idea will be appreciated."
Fun fact, they actually…
Fun fact, they actually transmit the colors of the Fun Wheel to the MwM devices during the Fun Wheel Challenge. Instead of watching the wheel, you can just watch your ears.
A few thoughts while reading through this.
While I initially thought about using an ESP for this as an all in one solution, I don't know how well they'd work out. The WebSockets have a max (although changeable) limit of 5 users. Using the WebSockets, we'd only need to pass around a few bytes of data and I've had a turnaround time of a few milliseconds on my testing (granted I was sitting right next to it in AP mode). Another option is using HTTP POST requests using the same concept. However with POST requests we'd need to keep track of MAC or IP addresses. With both options we can keep track of users using their MAC address for things like high scores. Additionally, POST requests are unidirectional so there's less overhead but there's way more data being passed between the device and ESP.
Once we move into something like a Raspberry Pi, that actually can also act as an IR transmitter, those restrictions are essentially removed as it can handle a hundred requests and I don't see us having more than a dozen or so people at a time anyways.
I think the hardest part for any of this is making it look pretty.
Glad you brought this up!
Good to get this thread started. Thanks.
Coming up with some interesting games that involve MWM will be another important development that will get people more interested in the tech and wanting to join in. Disney figured that out a long time ago but didn't really get around to doing much about it. But their patent application talks about treasure hunts and interactive kiosks/games. An interesting read.
On to your subject. Mousie and I have gotten our feet wet using the ESP8266 and websockets to come up with a MWM controller application that should run on most current smart phones and entertains up to 4 users at a time. Prelim data is here and here. Websockets include broadcast capabilities which would be necessary in your situation so that users are kept in sync.
It's probable that an ESP8266 will not be powerful enough to handle a whole room full of players. It can only handle a limited number of websockets and logic requirements for a game may become substantial and exceed the available memory. I've been thinking about that recently. Maybe stepping up to a Raspberry Pi and/or grabbing an older PC from a storage closet or Thrift store will be the answer.
I read that Node.js is a popular choice for a server on the Pi. I don't have experience with that product but lots of what is being written for the client side of the current projects is being composed in Javascript, which is what Node.js does. Node.js supports websockets via add-in libraries. Here's an install on Raspberry. Here's some bench marking for use with a full-scale server.
My experience is with Apache/PHP/MySQL. If development were to transition from a local server to the web, that would be a better choice and could handle commercial levels of traffic. But I think a local server would be a better choice and easier to deal with as you need not get into port forwarding through your home router.
I think you'll want to put any MWM-type game on a separate home wifi enabled network - especially if you might give the public access to it. The Raspberry Pi should be able to function as an Access Point if a wifi adapter is added - much like we're doing with the ESP8266. Putting this stuff on it's own network will avoid adding traffic to your main home network and avoid security issues you might otherwise face. I wasn't able to find data to give a ball park estimate of how many websockets the Raspberry can handle while also acting as the access point. Got to be a few more than the ESP8266 can handle.
The Raspberry will run a lot of the C code written for the Arduino if the wiring lib is installed. I'm guessing that could be made to send out the IR signals via the GPIO ports. Alternatively, there's LIRC. One way or the other.
After wandering through all of the above, I'm thinking I would start with a Raspberry Pi because they are sort of cheap and wouldn't break the bank for anyone interested in doing this hack and who doesn't have an old computer laying around that they want to turn into a server. Turn it into a standalone access point by adding a wifi adapter. Install Node.js and websocket library of choice. Write the server side and client side logic in Javascript.
Looks like Mousie beat me to…
Looks like Mousie beat me to it while composing my reply. Looks like we're on the same page.
Actually, Mica made a kind…
Actually, Mica made a kind of wheel game but with his christmas tree https://www.youtube.com/watch?v=MPHEGHLmt7c and he made also a web page were you can enter and hit like the red button and the ears turn red, he used processing software to make an interface with the arduino and send the codes to the ears, and he also used a app called xampp that makes the web server.
He failed to mention that
The link to the video is good but the video is listed as private. No can see.
If a LAMP platform is already available, then maybe the bit about Raspberry is unnecessary. Multiuser support should be possible and the bit about using Node.js for a gaming application with a small-ish number of users is probably still a good idea. Here's an example of a full server/client/websocket server setup http://usualcarrot.com/nodejs-and-websocket-simple-chat-tutorial Looks a lot like the same stuff waded through in the ESP8266 code.
For connecting to an Arduino hanging on a USB port, the SerialPort package is most often used https://www.npmjs.com/package/serialport
Jorge is right…
Jorge is right.
I made it possible two years ago in 2015, using an Apache server, a HTLM-PHP-MySQL-based game and Arduino. Even Jorge could play from Mexico while the real game was being played in Spain.
The thing is the game was not pretty stable. And it bugged too much.
I don't always have the time I would like to have to dedicate to this job. I really appreciate your answers.
I think we must start doing something "local" and make an stable version of a Wheel Game and test it with a lot of people. My job allows me to do that. I have the access to 80 Mickey Light Ears and plenty of people ready to play our game and try it out.
Back in 2015, I thought of creating a game based on Node.js and Raspberry. But I didn't have enough knowledge. So it's a great idea.
becoming clearer
First off, it's fantastic that you're working on this and trying to come up with a fun use for this tech. I'm sure this is the sort of thing people need to get them excited about MWM. And lucky you - 80 hats and people to play with???? I've only got maybe 8 devices, 2 neighborhood cats and a lot of rain to test my stuff! I'm not popular. But that's my problem. Gives me more time to work on projects and web dev.
The recommendation to use node.js and raspberry assumes that the game players will all be local. So if that's your plan, maybe that's the way to think. Just kind of a pain as you have to write a lot of the 'server' code yourself.
When you get to doing things over the Internet you have different things to worry about. Assuming that all players are using smart phones, the first gotcha is that not all carrier's LTE networks operate at the same speed. Some are faster than others. Once the signal hits the Internet, it has to be broken up into packets and routed to it's destination. Not all packets from the same message will necessarily take the same route. This leads to some packets arriving out of order. When that happens, the network interface card in the receiver has to wait for the missing packet to arrive. The more hops a packet has to make before it gets to it's destination, the more likely things may get split up. In essence, Jorge is at a disadvantage playing in Mexico against other players in France/Spain.
To make the game more equal, you'd need to have an equivalent game input in each location that measures the responses and then sends that data over the Internet to a game command center that compares the responses from the input devices from each location to determine who was the winner of any fast-response type game. The trick then would be how to synchronize the input devices at the different locations to begin accepting input at the same time. There would need to be some sort of agreed upon Real Time Clock that all devices used for sync.
Some game players try to get around these problems by choosing web servers that give roughly the same response times for all players. They use ping to see how long it takes for a signal to make the round trip to the target server. Then they pick the server that gives roughly the same ping times for most players. Those guys are using traditional computers and not cell phones. No idea how I'd use my iPhone to ping a server. Maybe that's something I need to look into.
Apache is a great work horse but is known to be bloated and slow. NGINX https://www.nginx.com/ would probably be a better choice. Not sure what you are using MySQL for, but it also is slow to establish connections unless the connection is forced to stay open in PHP, which is usually not the default for most time-share installations. I'm guessing you could probably hold any data for the game in memory instead and speed things up considerably.
PHP is an interpreted language, which will make it relatively slower than a compiled language. For optimal speed, I know programmers used to write the programs in C and then use CGI calls from the webserver to invoke those programs. Don't know if they still do that or if it matters these days. Servers have become a lot faster than they used to be.
Of course, even the Mickey Wheel game isn't very well designed. I've never been able to get access to the thing. Lesley managed to get in when we were there last time but she got dropped half way through the game and had a hard time getting back on. Cell traffic handling is often a problem at Disneyland. When it does work, it's often very slow. At least with my provider. Even though it's frustrating to a lot of the audience, most people seem to have a good time playing it. Maybe things don't have to be fair. Maybe it's just fun to be in the game with other people.
If you can send me the PHP script and any MySQL schemas, I'll take a look and see if I have any suggestions.
I think it would be fantastic to come up with some sort of game for MWM owners to play together. Could really help MWM's popularity. So keep thinking and hacking! This is something that needs to get done. The stuff I've been thinking about is more of a treasure hunt-type game. The problem I kept coming up against was the need to have signals only available after the preceding requirements had been accomplished. Otherwise, hunters could stumble upon the signals out of order and skip to the end too quickly. I think this has been solved with the ESP8266 processor as these can be activated/deactivated over wifi during the 'hunt' using a centralized game coordinating cpu.
Alternatively, the ESP8266 cam be used as an access point in a geographically dispersed game. Battery controlled ESP8266 access points could be located all over France and you could have to find and interact with them to get clues to the next stop. Login to the access point, locate where it is and send a valid wand/paintbrush code to receive directions to the next access point on your cell phone. Solve all the clues to find out where the party is. Boom. If I had friends, I might just do something like that. Unfortunately, the two local cats don't have much use for cell phones and have very short attention spans. So.....
After passing a very good…
After passing a very good time with you, my friend, I'm excited to come back to have fun with the MWM products. I would like to recover the idea and to come up with something good to play.
I was thinking of making the game able to be played from both local and remote network, so we can play together from every corner of the world or even install a small router to creater a local network and play and use the MWM devices in a place with no internet connection.
The first step, the platform. Making decisions about the code langage and platform is not an easy task. So let's start knowing the game and its rules.
Here's a video of a complete game.
{"preview_thumbnail":"/sites/default/files/styles/video_embed_wysiwyg_preview/public/video_thumbnails/GVFd8a49U3I.jpg?itok=8kuYRX4U","video_url":"https://www.youtube.com/watch?v=GVFd8a49U3I","settings":{"responsive":1,"width":"854","height":"480","autoplay":0},"settings_summary":["Embedded Video (Responsive)."]}
We have all the color sequences for one of the games. The time each turn lasts and even Base and Time Bonus points!
As I would like it to look like the one in Disneyland, I made an investigation. Here are some of the codes of the original user-side of the game.
http://funwheelchallenge.com/
INDEX.HTML
WEBFONT.CSS reveals the Family Font
which I have added to this post just for you! It's a gift! Smile!
MAIN.CSS reveals the Image folder, which I have added, too. Smile again!
It seems like they're using JS, as main.js ->
I think we have something to begin with.