|
A destination on the Interweb to brighten your day (now get back to work!)
Friday, June 8, 2012
Supercharge and Automate Your Android Phone with On{X}
June 8th, 2012Top StorySupercharge and Automate Your Android Phone with On{X}Let's say every time your significant other sent you a text that said "Where are you?", your phone automatically replied with your location. Or maybe you want your phone to automatically send an "I'm on my way" text when you leave work. Or, perhaps in an effort to get in better shape, you tell your phone to bug you if you haven't been to the gym in the last three days. All of these (and many more) handy, automated processes are possible with on{X}. Here's how it works. In this post, we'll walk through how to use on{X}'s easy to use pre-made rule templates to get your phone to do things automatically, like remind you to take an umbrella if it's going to rain. Here's how to get more out of on{X} using those "recipes", and if you're so inclined, we'll also walk through how to code your own JavaScript instructions for your phone. About on{X}On{X} is a rule-based automation app developed by (of all people) Microsoft that works with your Android phone. On{X} currently offers nearly a dozen recipes to automate your phone. Like other automation apps they depend on a trigger (the time or a change in location, for example) to create an action (a notification on your phone or opening an app). Some of the best pre-baked recipes include these automated instructions:
As you can see, the app works as a kind of personal assistant—reminding you to do things—and can cut down on repetitive (time wasting) actions like opening your calendar when you get to work. Each of these rules are customizable and you can also dig into the code to create new rules based on them. Similar to Tasker, another app that can automate really cool things, on{X} allows you to easily create rules on the on{X} website, which then sync to your phone. The on{X} recipes interface for adding or editing rules is extremely intuitive (akin to webapp automator ifttt), so it's easy for anyone to add a new automated action to their phone. As an added bonus, if you know how to code in JavaScript, you can edit or create brand new rules to your liking. Set Up On{X}Before you start using it, you have to complete a few simple steps to get started with on{X}:
Visit the recipes page on the on{X} site, click on the ones you want to add, and hit the "add" button. Voila! The recipe will be pushed to your phone. It's that easy! Well, almost that easy. In order for your phone to know, for example, that you've reached home, or left work, you may need to do some slight customizations. Customize On{X} RecipesEditing an on{X} recipe is easy. You can change any variable that's highlighted, and you can select other options then add the rule to your phone. Take the "When I arrive home remind me to buy milk" recipe, for example. It's kind of silly to be reminded to go out for milk once you're already home, so you can change that rule by clicking on it, then changing "arrive" to "leave" via the drop-down and "home" to your "work" latitude and longitude coordinates (Bing Maps conveniently displays latitude/longitude when you look up any address). Change the "milk" prompt also to whatever it is you're supposed to remember to pick up. Then hit "Add" and the rule is immediately activated on your phone. Similarly, you can change the time, message, apps, website, and most other details in these recipes. So instead of: Launching the music app while walking, you can launch the maps app when you're driving. Instead of texting your wife you're on your way when you leave work, you can text anyone when you arrive at the airport. Just plug in your own details for those highlighted variables. This super-simple customization is the app's biggest selling point. Find More On{X} Recipes from Other UsersUsers can also code their own recipes and share them with others (after on{X} approves the recipes). With the service being brand new, there aren't a lot of shared recipes just yet, but you can find some code examples and a good bit of coding discussion in the on{X} forums. Some useful recipes include:
To add these recipes to your phone, go to "write code" in your on{X} menu on the website, then paste in the code from one of these recipes. Edit the variables to match your preferences (e.g., your location or time) and then simply save the script to have it sent to your phone. Modify On{X} Recipes by Editing the CodeBecause the code behind all of the on{X} recipes is just one click away, you can use the recipe templates as a base for coding your own rules in JavaScript. You can also look up code examples in the on{X} documentation. (If you're just starting out coding, see our Learn to Code Night School and other resources for getting started with the basics if any of the terms are confusing.) Let's say you want to know every morning if your commute is going to be longer than normal. There's no standard template for that, but you also don't have to start from scratch. The "Show me the Aquarius horoscope every day at 9:00 AM" is very similar—instead of the horoscope, you're asking your phone to show you what traffic will be like. The on{X} documentation shows there are feeds for news, traffic, and weather in addition to the horoscope feed. Click on that horoscope recipe's "< > code" link at top right to get a look at the script. Then click "create new rule from source code" to start editing the code. Peeking at the horoscope code, variables that you can change are your horoscope and the time for the notification. Delete the horoscope sign variable (line 3), since we don't need it, and change the time (line 4) to for whenever you want to get your traffic alert (e.g., half an hour before you usually leave home for work or before you head home). For the console logging ("console.log" on line 8), change the text from "Started script: Show me the horoscope every day" to "Started script: Show me the traffic to work every day". Next, we don't want to show the daily horoscope, so delete the "showHoroscope" function (lines 10 through 25). Then in place of what we've deleted, we'll insert the code to set the traffic coordinates and get the traffic feed. The on{X} documentation has instructions and an example for using the traffic feed. Copy the lines that start with "// get the traffic for I-90 ramp in Bellevue to I-5" and include the array called "wps" that sets your traffic start and end points. Paste them into the horoscope template, where the variables are declared. Edit the location coordinates to be your start and end points (home and work, for example. Again, Bing Maps can quickly get you an address' latlong coordinates). Finally, copy the traffic feed function from the documentation ("feeds.traffic.get") to the code in place of the "showHoroscope" one. This code displays a notification on your phone with driving distance in miles and duration in minutes. (If you don't care about the driving distance, you can delete this part of the notification.content: "distance=' + traffic.totalTravelDistance + '".) Click "save and send to phone" to create your rule. Thus at your designated time, you'll get the estimated travel time between your two locations, which should take into account traffic conditions. You can publish your rule for on{X} to consider making public for others to use. This is just one example of how you can create new rules by copying and editing code from the documentation or what others have shared. You can also start from scratch if you like, building on a basic "Hello World" example code. (By the way, I've added the full recipe on Pastebin. It could definitely use some work, like showing traffic warnings. If you have any improvements, let me know.) On{X}: Full of PossibilityRight now, on{X} is very much a beta app. The recipe templates are really intuitive to use, and the open API makes it easy to code and share rules, but there are still limits to what you can do. Some essential controls—such as ringer volume/vibration, Wi-Fi and GPS signal, and screen lock—are still missing. But these are sure to come and, for now, there's still lots you can do and explore with both the recipes and the JavaScript API. Got any ideas for cool on{X} recipes? Share them with us in the comments. |
|
How Unreal Engine 4 Will Change The Next Games You Play
June 8th, 2012Top StoryHow Unreal Engine 4 Will Change The Next Games You PlayA couple of months ago a game developer who works on a very well-known video game walked out of a secret demonstration of Epic Games' new Unreal Engine 4 and told me it was the most impressive thing he'd ever seen in his gaming career. The Unreal Engine tech doesn't just run games made by the people who make that engine (Gears of War.) It's also licensed to tons of major studios. Unreal Engine 3 is what BioWare used to make Mass Effect and what Rocksteady used to make Batman Arkham City. Many major games are made with Unreal, so if developers are excited about the next Unreal, the one that will probably power many games on the next Xbox and PlayStation that are shipping in late 2013 or so, that's big, right? Several weeks later, I saw the same demo that developer saw. I saw the next-generation of video game graphics running on a PC that was powered simply by an Nvidia GeForce GTX 680 graphics card, something you can buy now but that trounces the performance of the Xbox 360 and PlayStation 3. I braced myself...but I was not blown away. As impressive as the technology of the Unreal Engine 4 is, Epic Games' first demonstration of this new tech is geared toward professional video game creators, not gamers. Show a regular gamer the debut UE4 demo side by side with last year's Unreal Engine 3 Samaritan demo and they'll probably say the latter looks better or at least just as good. And why not? The version of UE3 running Samaritan is what runs this E3's extraordinary and presumably next-gen Star Wars 1313 game. What's so great about UE4, then? What can the tech shown in the debut UE4 demo do for games? Those were the questions I posed to Alan Willard, the technical artist at Epic who has given the UE4 demo to live crowds of developers and reporters more than 90 times. These are his answers: It will change the lighting of our games, making everything look more real…The key detail here is the UE4 enables "real-time dynamic global illumination," which, well, he'll explain it… Click to view "Think of shining a spotlight down on the floor," Willard says. "Without [real-time dynamic global illumination] all you see is a circle on the floor where the spotlight hits. With it, you see the pillars on the side and a subtle illumination on the ceiling beyond. One of the tiles is green so there's a little bit of green bounce to the wall behind it because of that. A major part of the global illumination is that we're not only hitting things, but we're inheriting them as we bounce and cast on to the surrounding environment. "Maybe as a tech demo you could have done it on an Xbox 360 with nothing else going on, but now we have a full engine that has AI, navigation and all that stuff plus full, real-time dynamic global illumination. It's going to be one of those things people just really haven't seen before as part of a cohesive whole with all the other parts of the engine playing into that and feeding off of that everything can look potentially light years better with titles that are developed for that with that in mind." A more concrete example… "Light is an important part of the environment for almost any game. Gears of War, for example, in the Trenches multiplayer map, there's a whole sandstorm that comes in. If you add real-time global illumination, suddenly you're not just obscuring the player's view, you can change the entire lighting environment. You can change how everything looks. You can do that really easily. Think of knocking down a wall and having light spill and truly illuminate the room beyond and not have to be a fully-scripted thing. The wall got knocked down at a completely unexpected moment, and everything still works." And another… "[Imagine] I'm doing a real-time strategy game and it's mostly static environment with buildings, but I've got full time-of-day. And that just works cohesively, and I can see inside the buildings, and all of that. I think things like that are going to go a long way towards changing what people expect to see out of games." Fire and smoke will be way better, too…"Look at fire and smoke effects," Willard says. "Smoke effects are a little easier to do with the previous generation of particles because they tend to be very large and voluminous. There's a lot of known tricks to make it look like it's rolling. But what isn't easy to do is massive sprays of sparks and the kind of chaotic motion you see a bonfire has, with all its little sparks that come up. That's the type of thing where the simulations that we're doing with our particle system and the sheer number that we can create in a scene really go a long way toward selling [the scene] and making things feel like there's fluid motion and a volume to it without having to just obscure the camera. "Things like blizzards and wind blowing dust through the room; all of that stuff is much more convincing when you don't have to smash the player over the head with it, when you can fill the space with subtle motions and different motions based on depth, because you just have so many particles available you can really get that volume of flow. "It's not just boom and there's a million bright sparks. That looks good for a tech demo, but the places where I think it'll really get used is to fill in an explosion with a ton of pieces of debris instead of a big boom with some sparks and some smoke. You really can scatter things and have a lot more depth and volume to sell things." And the people who make games will have less of their time wasted…The new engine lets developers change settings in their games on the fly (see the tweaking of a character's jumping height in the UE4 demo). There's less need for game creators to wait around for the game code to re-compile. That gives them more time to tweak and create, Willard says. "The ability for the developer to iterate quickly means that they're spending more time developing a good game instead of waiting for a game to compile," he says. "It's an increase in productivity across the board more than anything. "The gamer is not going to know that the developer has been able to change the jump height 10 times in five minutes, but they will get a game where it's potentially much more tweaked because [the developers] were able to tweak quickly instead of, 'I changed the jump height; let's wait 10 minutes for a build to compile and then play.' Instead, it's 'change, change, change, change, it's good, move on to the next thing.' "[In older engines], if you wanted to change the relationship between your weapon damage and how long it'll take to kill a creature, you may spend a couple of days iterating, but if you have to spend a lot of time waiting for a build every time, you're talking one change, waiting 15 minutes for the compile to complete, and then play the game, get to the point where you can test it, test it, exit the game, change, compile…now, since all of that can be done very quickly within the tools, it's 'Make the change, play, when it compiles, finish, shoot the guy, and then escape, make the change, play.. the iteration time is down to 30 seconds instead of 15 minutes. Our ability to kind of roll through and see how the game is playing out is much faster." In fact, the people making games can do each other's jobs and fill games with many more small surprises.The "Kismet" tool in UE4 makes it easier for anyone who is using the engine to click on an element in game-say, a pillar or chair or bookcase-and add properties to it within seconds. Ideally, Willard says, this allows developers to create more "whimsical" game worlds that are more full of surprises tucked into every little thing. "The fact that I can evaluate at any moment where the player [will be] and what he's doing, and make decisions in my script based on that, completely in concert with what the AI is doing… that's going to be huge," Willard says. "I could say: 'I'm going to convert this pillar into a blueprint [in the Engine] and add some sort of trap to it.' It means I can really go in and start enhancing my world with interaction that just would not have been possible without a technical artist, a designer and a programmer and now any one of those three can do all of it, provided they have the assets handy. The fact that I can just go in and say, 'If you're within X distance of this thing, start to glow and take my distance to it, normalize it zero to one and then just lerp [oscillate] between two different brightness values, so as I reach for something it gets hot'…that would have been something do-able but very difficult for anybody except a gameplay programmer. And he wouldn't have known how to set up the assets, but now any one of the three could do it." You just won't be able to play games like this soon, probably not even late next year when new consoles launch.As likely as it is that we're getting a new Xbox and PlayStation in late 2013, we probably won't even be playing UE4 games then. "We anticipate quite a few people shipping titles early in the lifespan of the next generation of consoles using UE3 and then using UE4 for their next project," Willard says. During the previous transition, relatively early games such as BioShock used Unreal Engine 2 modified with parts of 3. Willard doesn't think that'll happen this time. "The architectural changes from 3 to 4 are greater than those from 2 to 3. But I can certainly see quite a few developers deciding mid-development to shift their focus from current to next generation and it makes sense to just stay with [UE3], do higher resolution textures, increase their polygon budget, increase the number of characters on screen and things like that…" So, really, don't hold your breath for the first UE4 title. "I'm sure everyone wants to know when they'll want to see the first UE4 game, but we don't have an answer for that. We don't know when we're going to ship anything we're working on for it. We don't know when our licensees will. And we don't make any restrictions. If a licensee finishes their game first, that's happened before." |
|