Posted August 3, 20204 yr Hey all, I started looking into reverse engineering the Super Mario products and would like to start a discussion about the topic. As was brought up before, Mario uses the known Lego BLE protocol to communicate, so it's not really difficult to make that happen. My own implementation can talk with Mario and get the following info so far: Game state changes Idle Game started Goal reached Time running out (15s left) Time up End-screen no longer visible (or something like that, happens 9s after Time Up/Goal reached) Coin counts (Mario apparently has several different coin counters for different things) Regular enemies Double Jump enemies Multi-jump/boss Walking Flying/Cloud Turntable ?-Box Time Bonus Pants-Type Scanned Tag Current surface type he's on Interestingly enough, it appears that Mario doesn't notify me about special events like stars, mushrooms, etc. Does the official app display anything when you happen to get a star? Now I'm looking into the barcodes. They consist of 5 colored stripes that repeat a bunch of times. There are (from what I can see so far) 8 colors (Red, Green, Blue, Yellow, Pink, Purple, Light Green, Light Blue). So far, all my tags start with Red and Green, the remaining 3 stripes are different. Here's a list of what I have so far: Maybe you guys can share some other tags you already own, the goal of course is to find a pattern and decode them or even generate new tags. At this point it's not known to me if Mario can recognize unknown but well formed tags and pass them via the BLE connection or if he will refuse to read them altogether. The Internal ID columns represent what numbers Mario will send via BLE when the given tag is scanned, I suppose there is some connection between the color pattern and the number, but that's not a given a this point. So yea, I was hoping to get some discussion going, trying to get some secrets out of him :) Bonus footage, a little video of the data being sent by Mario, not overly exciting, but you can kind understand how it works... (Warning, quite technical) https://www.dropbox.com/s/fy8nfec3vxofk1n/2020-08-03_18-38-24.mp4?dl=0 Edited August 3, 20204 yr by Diamondback2010
August 3, 20204 yr Author Okay, after fiddling around for a bit and looking at some basic facts: Colors don't repeat There are at least 8 colors There appears to be no checksum as a change of 1 changes only one column Only three columns actually hold data (the other two are always the same) I tried some basic encoding math and ended up with something that works. The colors have an inherent order needed for encoding, the order is as follows: Blue Pink Yellow Purple Cyan Lime Now, the trick here is, it's actually one color more than that, there's a (as of now) secret color between Pink and Yellow. I can't say what it is, but as soon as you assume 7 data colors, everything makes sense. Decoding works like this: Take the three data stripes (green and red are some sort of header or unused bytes or something), then take a look at the color list and pick the first appearing color from your data. Example: Bob-Omb has colors: (Green, Red), Blue, Yellow, Cyan So now, look up the "value" of the first color (Blue), it ends up as 0 as it's the first color of our list. As we used up the blue color, all the other color values shift by one. The second color is Yellow, it used to have a value of 3 as it's the fourth color, however, due to Blue being removed, its value is now 2. Last color is Cyan, which originally had a value of 5, but now due to shifting sits at 3. That gives us overall 3 numbers for our stripes, 0(a), 2(b) and 3(c). The final step is a specific formula to convert these values into the actual ID of the tag: ID = 30a + 5b + c + 1 In our case: 30 x 0 + 5 x 2 + 1 x 3 + 1 = 14
August 4, 20204 yr 1 hour ago, Diamondback2010 said: So now, look up the "value" of the first color (Blue), it ends up as 0 as it's the first color of our list. As we used up the blue color, all the other color values shift by one. The second color is Yellow, it used to have a value of 3 as it's the fourth color, however, due to Blue being removed, its value is now 2. Last color is Cyan, which originally had a value of 5, but now due to shifting sits at 3. That gives us overall 3 numbers for our stripes, 0(a), 2(b) and 3(c). The final step is a specific formula to convert these values into the actual ID of the tag: ID = 30a + 5b + c + 1 In our case: 30 x 0 + 5 x 2 + 1 x 3 + 1 = 14 Awesome progress! Here are some more barcodes for reference. It looks to me like Spiny and Beetle have the same barcode (sorry it's a little blurry).
August 4, 20204 yr Author Awesome! Thanks a lot! Can you quickly confirm that these are the correct colors?
August 16, 20204 yr Images of all the barcodes can be found on Brickset: https://brickset.com/parts?query=Flat%20Tile%202X2,%20W/%20Sticker Also I saw a video where someone printed their own barcodes so it's possible, but seems like color accuracy is critical.
August 17, 20204 yr Hi guys, isn't this something for the Mindstorms Forum as well? Sounds to me ... they have an awful lot of info over there ... Just an idea. Best and have fun! Thorsten
January 7, 20214 yr Hi guys, I printed the page 2 of this pdf, and tried to use the bar codes with Mario. It seems to me that it recognised only the middle column, since it did nothing special on the others. But I think I have another problem : I used a laser printer, and the printed colors are not well melted. Here are 2 photos of the printed King Boo's bar code, that I took with my microscope : https://zupimages.net/viewer.php?id=21/01/eiw0.jpg https://zupimages.net/viewer.php?id=21/01/74cr.jpg Did someone try to print that page ? Did it work well ? Edited January 8, 20214 yr by Myosotis
March 5, 20214 yr On 10/21/2020 at 8:01 PM, Szczepan said: Here are all barcodes for Mario. Hello, Will there be available an Document update with the Barcodes introduced since August 2020 ? Jo
March 11, 20214 yr For some reason I thought the colors corresponded with the visible light spectrum, Red, Orange, Yellow, Green, Blue, Indigo, Violet, you know, Roy G. Biv
April 16, 20213 yr These codes seem to work fine for me (assuming the non working ones are supposed to be non working) Since the recent update, several of the 'non working' page do now work. Big thanks to Szczepan for this work
February 20, 20223 yr Hello, At Bricklink there is listed Tile 3068bpb1883. when you zoom the Picture, you will notice that there is no Green-Red Start Pattern. Seems to happen also at 3068bpb1910, 3068bpb1914, 3068bpb1918 & 3068bpb1911 Has anybody more informations about this ? Jo Edited February 20, 20223 yr by BrickTronic
February 22, 20223 yr On 2/20/2022 at 4:33 AM, BrickTronic said: Hello, At Bricklink there is listed Tile 3068bpb1883. when you zoom the Picture, you will notice that there is no Green-Red Start Pattern. Seems to happen also at 3068bpb1910, 3068bpb1914, 3068bpb1918 & 3068bpb1911 Has anybody more informations about this ? Jo The actual photos of the part in question do include the green-red pattern at the beginning which suggests to me that Lego's renders are simply not an accurate representation of the exact pattern.
March 18, 20222 yr Hello, Who has this Tiles and is willing to scan them and share the readouts :3068bpb1883., 3068bpb1910, 3068bpb1914, 3068bpb1918 & 3068bpb1911 ? Maybe by using Pybricks-Code Web-Page and the Mario/Lugi Bricks at Port 1 (Sensor-Type 0x49) Mode 0 (see here) Jo
May 31, 20231 yr I did some work on this a couple years ago and have kept the tiles updated. https://github.com/mutesplash/legomario
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.