1. Announcing Mekorama on the Web!

    Now anyone can play levels from the forum online, with one click!

    Dismiss Notice
  2. Psst! If you're new here, welcome! Please visit these pages first for information about the forum and Mekorama:

    Welcome! ¡Bienvenido! Selamat datang! Добро пожаловать! Willkommen!
    and
    Everything you want to know about Mekorama

    Dismiss Notice

Level Management Final solution for failing QR codes

Discussion in 'Mekorama 2.0' started by RobotArtist, Jan 29, 2017.

  1. RobotArtist

    RobotArtist Member

    Messages:
    4
    Likes Received:
    38
    Joined:
    Dec 10, 2016
    Let's SHRINK all the QR codes!!

    Hi! I know it's totally frustrating when a QR code for a level you crafted doesn't work because it is too dense. And a new level designer doesn't expect a code to fail, so great levels like King Of Kong fail for most users without the designer realizing it before posting. Experienced level designers know to test the QR before posting, but it adds minutes or hours to their workflow. It's a big issue, but I have a solution to make the QR codes work every time by making them less dense. It's a permanent solution! But it will require an app update.

    First, a little background. My company develops apps that use QR codes for small business promotions in the US. There are millions of small businesses here, and each of them may have thousands of promotions. The possible QR code permutations could reach 1 trillion over a few years, so we had to think strategically. We solved the problem in an elegant way, and our QR codes are surprisingly simple. Before I explain the solution, I will outline the current way QR's are handled by the Mekorama app so we are all on the same page.

    URL's, URI's, and QR codes
    We are all familiar with website URLs, and apps can use something similar, which is called a URI (unique resource identifier). Just like a website URL a URI is a string of text. But instead of linking to a webpage it is a way to send a "data description" to an app, such as the "blueprint" of a Mekorama level. These URI's are actually strings of text that describe every detail, encoded into a QR code. So when you see a QR code for a Mekorama level, it includes a blueprint for each block and behavior in that level. Within Mekorama QR codes are a brilliant way to share the "blueprints" for a level with others.

    The permanent solution
    Instead of generating QR codes based on URI's that include all the detail for every block and behavior in a level, a "tiny URL" solution should be used in the following way. Instead of encoding every detail of a level directly into the QR code, the new process will publish and store the detailed URI into a database, and assign a short reference URI to it. This new shortened URI will be used by the app to generate very simple QR codes, which is only a reference to the long-form description of the level in the database.

    This will require a couple changes, and I have further recommendations that would save tons of hours for level creators. First, the level descriptions could be indexed into a database that results in short URI's for each level, so that a QR code for a level would not include the full "blueprint" for that level, but instead a short URI address to link to the level's full blueprint.

    But let's take this further. Currently level creators publish several iterations of a level before declaring a level is "finished". Wouldn't it be fantastic if the QR code for an evolving level always linked to the latest (or final) iteration? Here's how this can be achieved. The QR code URI should be based on a hash of the level's title, combined with the unique name of the level creator. (This still allows for unlimited levels per creator). For example, if I published a "draft" level named iRobot by Robot Artist, the QR code would only link to the latest version of the level. This approach implicitly allows for level creators to perform "soft-updates" to their levels without requiring the user to do anything. And if a creator simply adds "v2" or "v3" to a level title, it will automatically create separate versions.

    There are two more things I need to address, with full respect for our growing Mekorama community.
    1) What about current QR codes?!
    2) What about security?!

    1) What about Current QR codes:
    All current QR codes will remain usable. In fact, there should be an option for any level designer to publish a "verbose" QR code that includes every block and behavior detail. That said, it should be understood that complex QR codes may fail regularly.

    2) What about security:
    I have proposed a URI handling update that will create simpler QR codes. But there's a glaring security flaw if a QR is made from a hash of a unique level's title and the creator's name. The flaw? It would be easy for someone to use the exact same level title and copy the creator's name, then publish a level that would override the previous level. It may not seem like a serious security matter, but I wanted to share some similar issues. I would be happy to share how we tackled this, let me know a good time!
     
    Frenzies and cpw like this.
  2. Gepeto

    Gepeto MekoStudio Architect Staff Member

    Messages:
    453
    Levels:
    48
    Albums:
    1
    Likes Received:
    2,510
    Joined:
    Jul 7, 2016
    Thanks. That's quite a long explanation that needs more time than I have currently. Very interesting. I will reply later to some points.

    By the way, did you read the QR Code thread?
     
    Last edited by a moderator: Jan 29, 2017
  3. explorer

    explorer Active Member

    Messages:
    55
    Levels:
    70
    Albums:
    3
    Likes Received:
    178
    Joined:
    Oct 1, 2016
    Since this is a forum dedicated to a donationware app, and as the forum rules prohibit spam, you should just post your proposed solution now, so people can read it when it's convenient to their time zone.

    Or... is this a sales pitch?

    Your proposed solution also requires someone to host a database containing the full QR codes, instead of embracing the simple distributed model and the spirit of the app. You're adding a level of complexity which, at first and second reads, seems to only have an advantage over the simplicity of Gepeto's suggestion of reading the QR Code topic in that it generates a profit for someone besides Martin Magni.

    I do look forward to reading your offered information if you're sharing in the spirit of the game, Martin Magni and this forum. Here's hoping!
     
    Gepeto and nGord like this.
  4. RobotArtist

    RobotArtist Member

    Messages:
    4
    Likes Received:
    38
    Joined:
    Dec 10, 2016
    Thank you @Gepeto for pointing me to the QR thread, I should have looked harder for an existing conversation. Should I delete this thread and contribute to the conversation there? I don't know what the best etiquette is.

    The solution above is something that @Martin Magni may be interested in for a future app update, or he may disregard it. The Bitly API could be used instead of a custom hosted URL shortening script, but you have less control with Bitly.

    Not a sales pitch :) I don't do any contract work, just our internal platform. I gave some company background only to give context for the solution I described. It didn't seem like a good idea to share our security methods on a public forum, but I could share over chat. That said, security doesn't seem too critical for this use.
     
    Gepeto and Frenzies like this.
  5. RobotArtist

    RobotArtist Member

    Messages:
    4
    Likes Received:
    38
    Joined:
    Dec 10, 2016
    Thanks for moving this thread!
     
  6. Gepeto

    Gepeto MekoStudio Architect Staff Member

    Messages:
    453
    Levels:
    48
    Albums:
    1
    Likes Received:
    2,510
    Joined:
    Jul 7, 2016
    OK... Back to this thread :)

    First, your thread is fine here as it has not the same purpose than the thread I have pointed out to you.

    So, if I understood correctly, you're suggesting that instead of having a self local and autonomous QR Code system the app should download the level data throught an URL. That's not really new and it is something that I used to do with the website Unitag.io. I wanted to generate a QR Code for a website and they generated a QR Code with a redirection link (tiny URL) to the website, not a straight one. That was a parameter so I have changed lately but it was interesting if I needed to change the final URL without changing the QR Code. The problems is that a such system applied to Mekorama:
    1. depends on a third service which adds a point of failure in the workflow. If the service is down, all the URL are down and the game would not be able to manage new levels. From what I know that's specifically what @Martin Magni tried to avoid... o_O
    2. implies to have an Internet connection when scanning the QR Code. What if I scan the Code from a device which is not connected to the Internet? (as an example that's what I often do to install levels to my kid tablet).
    3. for sure, will shrink the QR Code to a simple and tiny URL. But the code is already shrinked with all the data inside. Actually binary data are encapsulated and compressed with zlib into the QR Code. So, when reading the code there's no plain text but raw data, but it is pretty tiny.
    Dependencies to a webservice could be interesting if the final data are subject to change frequently. Here, modifications are much more about revisions than living data and it doesn't happen everytime. Then a service such like that would ask for a server (and a suitable app), maintenance, fee and competences.

    Currently you've got a card, you've got everything you need. That's pretty nice and ingenious to me. Of course, sometimes the code is small in the frame and is difficult to scan but that's not about the size of the code, that's about the draw of the code in the frame (and I agree that an update would be great about that).

    To conclude here is a quote from a private discussion I had with @Martin Magni (there is nothing private on it by the way ;)):
    That's a good thought and he seems to know pretty well what's going on in the game industry. He just didn't follow the same path and I am not sure that as the only developper of the app he can afford something more complex.

    By the way, that was a nice and interesting idea. It's just not in the idea of the game. :)
     
    Sculron, RobotArtist and Frenzies like this.

Share This Page