Custom QRCodes (and URLs)

So you want to advertise your SandBoxd game to an audience. There are a couple of ways to do that. You could advertise the URL of you game (ie https://www.sandboxd.com/games/XXX) or even add the ?launch=1 parameter to automatically launch the game on load. Although this is sufficient for some cases, the average user does not like typing in large URLs on mobile and certainly not ones with parameters on the end. We do have an alternative.

SandBoxd offers a qrcode builder that creates a qrcode to point directly to your game along with a short URL at the bottom in case the user does not have a qrcode scanner. Upon scanning/typing the URL, the user will be launched directly into the game. For developers we automatically generate this image on the left navigation bar of your game using your game's unique identifier as the parameter gameid. You should notice a URL in the form of bxd.bz/XXXXX.

What you may not have known is that the qrcode generator also allows you to input arbitrary data to forward to your game. The data you supply will be available in the data URL parameter in the same way the location API works. The use cases for passing arbitrary data are limitless, but perhaps the most common case is to have a player automatically join a room in a multiplayer game with other people nearby. For this case you would pass the room id as the data parameter.

To generate a URL with arbitrary data you can include a data parameter in the qrcode generating URL. We've included a qrcode playground below for convenience. Try playing around with the data field and see how it affects the URL.

Image Generation Code: https://www.sandboxd.com/qrcode?gameid=68&data=123&size=300

One thing to note is, although we do allow arbitrary data to be encoded, you should really try to encode positive integers. Supplying integer data allows us to encode the data much more compactly - resulting in smaller URLs. Additionally our compact encoding scheme only uses the letters a-z to make it as fast as possible to type on a mobile device.

You can control the render size of the qrcode image by adjusting the size parameter.

Feel free to embed SandBoxd generated qrcodes anywhere you like or even generate them dynamically.