Skip to main content

Show HN: A full AR helicopter action game built as a Snap lens https://ift.tt/3tYNAOp

Show HN: A full AR helicopter action game built as a Snap lens I built a complete game using Snap's AR platform in about 6 weeks. I'd been intrigued by Snap's AR ambitions and wanted to kick the tires on their platform. The YouTube video description contains a link to the Lens: https://ift.tt/3nYHo5b... How to play: - Joypad y axis moves the helicopter along the ray pointing from the camera. You can therefore tilt the phone up to fly "up". - Altitude is also controlled by aiming the phone. The helicopter tries to match the altitude of a point that is fixed in front of the camera. So you can move up by aiming up or by actually lifting the phone higher. - Joypad x axis strafes. - If you lose track of the helicopter, a blue arrow will appear after about 5 seconds. - Blow up enemies and try to stay alive :) How it works under the hood: - Loads of JavaScript. Lenses are surprisingly programmer-friendly. As a non-artist, this is great. Almost everything can be driven completely by code, although most creators opt to use pre-made components with minimal scripting. - The game uses a custom physics engine with OBB-based collision detections that I wrote from scratch. Snap now has integrated physics that seem to be based on PhysX (i.e., the same as Unity's) but this was released well into my development process after I had already rolled my own. - I opted not to use environmental mesh reconstruction because it is performance intensive and gives dubious results on lower-end phones. When I started development, it was only enabled for Lidar-based phones but is since available everywhere. - I instead detect horizontal planes using an API that Snap hasn't really documented. I found a snippet of code in their API docs and opened up the Lens Studio .exe to find the names of the other plane events I needed. - Planes are used to create collision boxes that extend to the floor so the helicopter can bump into furniture. - AI-controlled enemy helicopters plot routes using a heightmap generated from the plane data to avoid colliding with obstacles when possible. Takeaways: - This has arguably become my favorite AR prototyping platform. Much faster idea-to-PoC iteration time than anything else out there. - The platform is surprisingly full-featured. - The Lens Studio Editor is remarkably polished and, despite some bugs here and there, is very stable. - The deployment story is second to none. Deploying to the phone involves a single click and is done over the Internet (no need for any tethering or wireless pairing). - Debugging on-device is still challenging (all you can do is log a few lines) but I was assured that an actual debugger is coming soon. - Economic viability: unfortunately, it is not really possible to directly monetize lenses. Most creators contract with brands to create branded lenses. Future plans: - I'll definitely be keeping an eye on Snap's ecosystem. - No plans for any more full-fledged lenses but I do have some ideas for prototypes I'd like to try in anticipation of commercially viable mixed reality HMDs hitting the market soon (e.g., Meta's Project Cambria). - I may update the game with a tutorial mode and a co-located multiplayer mode (co-op play or PvP) provided I get the necessary support from the Snap dev team. Hope you enjoy and are inspired to dive into AR if you haven't already :D https://www.youtube.com/watch?v=O_1dJ_x7vXw January 26, 2022 at 01:27AM

Comments

Popular posts from this blog