Planet Gamedev

Ignacio Sanchez Gines

Gearsystem Emulator

by Helius at October 31, 2013 11:35 PM

So this is my latest project. After finishing and polishing my Game Boy emulator I wanted a new challenge. Something a little bit more complex. I tried the Master System and to my surprise I found that it is rather easy to emulate. The CPU (Zilog Z80) is somewhat harder but the system is quite [...]

iPhone Development Tutorials and Programming Tips

Tutorial: Utilizing The New Multitasking APIs Added With The iOS 7 SDK

by Johann at October 31, 2013 11:20 PM

Post Category    Featured iPhone Development Resources,iOS Development Tutorials,Objective-C

One of the touted features of iOS 7 has been the upgrade multitasking in iOS 7.  Using the new APIs added in iOS 7 it’s now possible to update apps that are running in the background.

Here’s a nice series of tutorials providing a nice overview and step-by-step examples of how to use the new multitasking APIs in iOS 7 – remote notifications, background fetch, and the background transfer service.

Here are the three tutorials in the series:

An Overview Of The New Multitasking Enhancements
- Working With Background Fetch
- Using The Background Service

If you haven’t seen it yet, there is a nice overview of these enhancements in WWDC 2013 Session 204 (Apple Developer login required for download)

A nice  starting point  for those looking to utilize the new multitasking interface in iOS 7.

Thanks to Tom for the submission.


Be the first to comment...

Related Posts:

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: Tutorial: Utilizing The New Multitasking APIs Added With The iOS 7 SDK

©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Geeks3D Forums

Android 4.4 KitKat and Updated Developer Tools

October 31, 2013 07:16 PM

Quote
Today we are announcing Android 4.4 KitKat, a new version of Android that brings great new features for users and developers.

The very first de...



iPhone Development Tutorials and Programming Tips

Library For Working With Dates Providing Helpers For Formatting, Parsing, Validation And Manipulation

by Johann at October 31, 2013 02:29 PM

Post Category    Featured iPhone Development Resources,iOS Development Libraries,Objective-C,Open Source iOS Libraries And Tools

I’ve mentioned a number of helper libraries for working with NSDate such as this library for grabbing locale aware dates and times and a handy collection of NSFormatter classes including helpers for showing the time between two NSDate objects.

Here’s an excellent library for working with dates called NSMoment from Yannick Loriot.

NSMoment is inspired by the Moment.js library and provides an extensive number of methods for formatting, parsing, validating and manipulating dates.

Here’s a few examples from the readme showing off some of the included formatting, localization, and calculation methods in the library:

NSLog(@"%@", [moment format:@"MMMM dd yyyy, h:mm:ss a"]); // October 27 2013, 10:49:48 AM

NSMoment *moment1 = [NSMoment momentWithDateAsString:@"20111031"];
NSLog(@"%@", [moment1 fromNow]); // 2 years ago

NSMoment *french = [[NSMoment now] addAmountOfTime:-3 forUnitKey:@"s"];
[french setLocale:[NSLocale localeWithLocaleIdentifier:@"fr_FR"]];
NSLog(@"%@", [french fromNow]); // il y a quelques secondes

You can find NSMoment on Github here.

A very useful library for working with dates.


Be the first to comment...

Related Posts:

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: Library For Working With Dates Providing Helpers For Formatting, Parsing, Validation And Manipulation

©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

OpenGL

October updates to Magnum C++11 and OpenGL graphics engine

October 31, 2013 12:21 PM

Magnum is multiplatform 2D/3D graphics engine written in C++11 and modern OpenGL, released under MIT license. Two months after the first public release, the October snapshot brings Mac OS X support, Emscripten port (C++11 code compiled to JavaScript and WebGL), new OpenGL limit and extension queries, shader compilation tests, vector math improvements, more C++11/C++1y features for better usability, thorough documentation updates, build system enhancements and introduction of API deprecation.

AMD Developer Summit 2013 OpenGL session

October 31, 2013 12:15 PM

AMD is hosting their popular Developer Summit November 11-13 2013. This year will see 20 Khronos related sessions on WebGL, OpenCL, WebCL and OpenGL. On Wednesday November 13th at 2:45pm in room PG-4034, Karl Hillesland from AMD will be discussing “Using OpenGL and DirectX for Heterogeneous Compute.”

iPhone Development Tutorials and Programming Tips

Tutorial: An In-Depth Guide To Customizing The Navigation Bar In iOS 7

by Johann at October 31, 2013 06:12 AM

Post Category    Featured iPhone Development Resources,iOS Development Tutorials,Objective-C

A few days ago I mentioned a nice library enabling you to create custom navigation bars with gradient coloring, and blurring.

While that library utilizes a custom navigation bar class there are a wide number of customizations that can be done using the iOS SDK and iOS 7 has changed a few things.

If you’ve been wondering how to create customized status and navigation bars, or been struggling to get your custom status bars to look right in iOS 7 here’s a tutorial that uncovers how to create many different styles of custom status bars and other customizations in the status bar areas.

Some of the customizations you’ll learn include:

- How to change the background color
- How to use a background image
- How to create a custom back button
- Customizing the font
- Using an image as your title
- Change the status bar style (dark/light)

Here’s an image from the tutorial showing one of the custom status bars that you’ll create – made from a background image:

iOS 7 Status Bar Tutorial

You can find the tutorial over on the Appcoda blog.

A nice extensive tutorial on customizing the navigation bar.

Thanks to Chris for the submission.


Be the first to comment...

Related Posts:

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: Tutorial: An In-Depth Guide To Customizing The Navigation Bar In iOS 7

©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Code of Honor

Stay Awhile and Listen

by Patrick Wyatt at October 31, 2013 05:42 AM

Developing games is a full-time occupation, so it is no surprise that I’ve had less time for blogging as I’ve started creating a new game. After a two-year stint helping other folks publish their games I’m back to coding and game design full-time and having a wonderful time.

But for those of you who have enjoyed my blogging about the early years of Blizzard Entertainment and the development of Warcraft, StarCraft and Diablo, and want more, I’m glad to be able to share the news: there’s a book available today about those very subjects!

Back in January, 2011, an author named David Craddock contacted me to chat about my experiences in the game industry, and what caused Blizzard to go from an unassuming startup to the dominating presence it has today.

Over the past couple of years David interviewed me and many other folks who were there from the early years of Blizzard and Blizzard North, and his book provides an intimate look at their games and the people involved.

During those formative years of my career in the game industry — Blizzard was my first job coming out of college — I discovered joy and sorrow in large measures. I still have raw feelings from some events of those times, and I still look back with fondness on many others. This book is about our naivete and hopefulness as we undertook an adventure to reinvent the game industry.

I hope you’ll enjoy the book: Stay Awhile and Listen: How Two Blizzards Unleashed Diablo and Forged a Video-Game Empire

The post Stay Awhile and Listen appeared first on Code Of Honor.

Physics-Based Animation

Automatic Construction of Coarse, High-Quality Tetrahedralizations that Enclose and Approximate Surfaces for Animation

by christopherbatty at October 31, 2013 12:36 AM

David A. Stuart, Joshua A. Levine, Ben Jones, Adam Bargteil

Embedding high-resolution surface geometry in coarse control meshes is a standard approach to achieving high-quality computer animation at low computational expense. In this paper we present an effective, automatic method for generating such control meshes. The resulting high-quality, tetrahedral meshes enclose and approximate an input surface mesh, avoiding extrapolation artifacts and ensuring that the resulting coarse volumetric meshes are adequate collision proxies. Our approach comprises three steps: we begin with a tetrahedral mesh built from the body-centered cubic lattice that tessellates the bounding box of the input surface; we then perform a sculpting phase that carefully removes elements from the lattice; and finally a variational vertex adjustment phase iteratively adjusts vertex positions to more closely approximate the surface geometry. Our approach provides explicit trade-offs between mesh quality, resolution, and surface approximation. Our experiments demonstrate the technique can be used to build high-quality meshes appropriate for simulations within games.

Automatic Construction of Coarse, High-Quality Tetrahedralizations that  Enclose and Approximate Surfaces for Animation



Object-Centric Parallel Rigid Body Simulation with Timewarp

by christopherbatty at October 31, 2013 12:34 AM

John Koenig, Ioannis Karamouzas, Stephen J. Guy

We present an object-centric formulation for parallel rigid body simulation that supports variable length integration time steps through rollbacks. We combine our object-centric simulation
framework with a novel spatiotemporal data structure to reduce global synchronization and achieve interactive, real-time simulations which scale across many CPU cores. Additionally, we provide proofs that both our proposed data structure and our object-centric formulation are deadlock-free. We implement our approach with the functional programming language Erlang, and test the performance and scalability of our method over several scenarios consisting of hundreds of interacting objects.

Object-Centric Parallel Rigid Body Simulation with Timewarp

iPhone Development Tutorials and Programming Tips

Open Source iOS Component For Creating Customizable Status Bar Notifications

by Johann at October 30, 2013 08:27 PM

Post Category    Featured iPhone Development Resources,iOS UI Controls,iPad,iPhone,Objective-C

About a year ago I mentioned a nice component for easily creating simple notifications that reside in the status bar area.

Here’s an excellent component that called JDStatusBarNotification from Markus Emrich built for the same purpose but bring the customizations to another level.

With JDStatusNotifications you can create status bar notifications with custom fonts, custom coloring, custom durations and more with some nice animation.

Here is an image from the readme showing several customized JDStatusBarNotification examples:

JDStatusBarNotification

You can find JDStatusBarNotification on Github here.

A nice component for status bar notifications.


Be the first to comment...

Related Posts:

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: Open Source iOS Component For Creating Customizable Status Bar Notifications

©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Game From Scratch

LibGDX Tutorial 6: Motion controls

by [email protected] at October 30, 2013 08:01 PM

In the previous tutorial we looked at handling touch and gesture events.  These days, most mobile devices have very accurate motion detection capabilities, which LibGDX fully supports.  In this example we will look at how to handle motion as well as detect if a device supports certain functionality and to detect which way the device is oriented.

 

This project revolves around a single code example, but there are some configuration steps you need to be aware of.

 

First off, in order to tell LibGDX that you want to use the compass and accelerometer, you need to pass that as part of the configuration in your Android MainActivity.  In the android project locate MainActivity.java and edit it accordingly:

package com.gamefromscratch;

 

import android.os.Bundle;

 

import com.badlogic.gdx.backends.android.AndroidApplication;

import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;

 

public class MainActivity extends AndroidApplication {

    @Override

    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        

        AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();

        cfg.useGL20 = true;

        cfg.useAccelerometer = true;

        cfg.useCompass = true;

        

        initialize(new MotionDemo(), cfg);

    }

}

 

The meaningful lines are 

cfg.useAccelerometer = true;

and

cfg.useCompass = true;

 

These lines tell LibGDX to enable both.

Next we need to make a couple of changes to your Android manifest.  This is a configuration file of sorts that tells the Android operating system how your application performs and what permissions it requires to run.  You could literally write an entire book about dealing with Android manifests, so if you want more information read here.  The manifest is located at the root of your Android project and is called AndroidManifest.xml.  There are a couple ways you can edit it.  Simply right click AndroidManifest.xml and select Open With->.

ManifestEditAs

 

I personally prefer to simply edit using the Text Editor, but if you want a more guided experience, you can select Android Manifest Editor, which brings up this window:

Java motion android AndroidManifest xml Eclipse Users Mike Dropbox Workspace

This is basically a GUI layer over top of the Android manifest.  Using the tabs across the bottom you can switch between the different categories and a corresponding form will appear.  If you click AndroidManifest.xml it will bring up a text view of the manifest.  Use whichever interface you prefer, it makes no difference in the end.

There are two changes we want to make to the manifest.  First we want the device to support rotation, so if the user rotates their device, the application rotates accordingly.  This is done by setting the property android:screenOrientation to fullsensor.  Next we want to grant the permission android.permission.VIBRATE.  If you do not add this permission calling a vibrate call will cause your application to crash!

 

Here is how my manifest looks with changes made:

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

    package="com.gamefromscratch"

    android:versionCode="1"

    android:versionName="1.0" >

 

    <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="17" />

    <uses-permission android:name="android.permission.VIBRATE"/>

 

    <application

        android:icon="@drawable/ic_launcher"

        android:label="@string/app_name" >

        <activity

            android:name=".MainActivity"

            android:label="@string/app_name"

            android:screenOrientation="fullSensor"

            android:configChanges="keyboard|keyboardHidden|orientation|screenSize">

            <intent-filter>

                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />

            </intent-filter>

        </activity>

    </application>

 

</manifest>

The changes have been bolded above.  You want to be careful when you request additional permissions as they will be shown when the user installs your application.  Too many permissions and people start getting scared of your application.  Of course, if you need to do something that requires a permission there isn’t much you can do!  As to the screenOrientation value, this tells Android which direction to create your application as.  There are a number of options, Landscape and Portrait being two of the most common.  fullSensor basically means all directions supported.  This means you can rotate the device 360 degrees and it will be rotated accordingly.  On the other hand, if you select “user”, you cannot rotate the device 180 degrees, meaning you cannot use it upside down.  You can read more about the available properties in the link I provided earlier.

There is one last important thing to be aware of before moving on.  Your android project will actually have two AndroidManifest.xml files, one in the root directory another in the bin subfolder.  Be certain to use the one in the root directory, as the other one will be copied over!

 

Ok, now that we are fully configured, let’s jump into the code sample:

package com.gamefromscratch;

 

 

import com.badlogic.gdx.ApplicationListener;

import com.badlogic.gdx.Gdx;

import com.badlogic.gdx.Input.Orientation;

import com.badlogic.gdx.Input.Peripheral;

import com.badlogic.gdx.graphics.Color;

import com.badlogic.gdx.graphics.GL10;

import com.badlogic.gdx.graphics.g2d.BitmapFont;

import com.badlogic.gdx.graphics.g2d.SpriteBatch;

 

public class MotionDemo implements ApplicationListener {

private SpriteBatch batch;

private BitmapFont font;

private String message = "Do something already!";

private float highestY = 0.0f;

 

@Override

public void create() {

   batch = new SpriteBatch();

   font = new BitmapFont(Gdx.files.internal("data/arial-15.fnt"),false);

   font.setColor(Color.RED);

}

 

@Override

public void dispose() {

   batch.dispose();

   font.dispose();

}

 

@Override

public void render() {

   int w = Gdx.graphics.getWidth();

   int h = Gdx.graphics.getHeight();

   Gdx.gl.glClearColor(1, 1, 1, 1);

   Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);

 

   batch.begin();

 

   int deviceAngle = Gdx.input.getRotation();

   Orientation orientation = Gdx.input.getNativeOrientation();

   float accelY = Gdx.input.getAccelerometerY();

   if(accelY > highestY)

      highestY = accelY;

 

   message = "Device rotated to:" + Integer.toString(deviceAngle) + " degrees\n";

   message += "Device orientation is ";

   switch(orientation){

      case Landscape:

         message += " landscape.\n";

         break;

      case Portrait:

         message += " portrait. \n";

         break;

      default:

         message += " complete crap!\n";

         break;

   }

 

   message += "Device Resolution: " + Integer.toString(w) + "," + Integer.toString(h) + "\n";

   message += "Y axis accel: " + Float.toString(accelY) + " \n";

   message += "Highest Y value: " + Float.toString(highestY) + " \n";

 

   if(Gdx.input.isPeripheralAvailable(Peripheral.Vibrator)){

      if(accelY > 7){

         Gdx.input.vibrate(100);

      }

   }

 

   if(Gdx.input.isPeripheralAvailable(Peripheral.Compass)){

      message += "Azmuth:" + Float.toString(Gdx.input.getAzimuth()) + "\n";

      message += "Pitch:" + Float.toString(Gdx.input.getPitch()) + "\n";

      message += "Roll:" + Float.toString(Gdx.input.getRoll()) + "\n";

   }

   else{

      message += "No compass available\n";

   }

 

   font.drawMultiLine(batch, message, 0, h);

 

   batch.end();

}

 

@Override

public void resize(int width, int height) {

   batch.dispose();

   batch = new SpriteBatch();

   String resolution = Integer.toString(width) + "," + Integer.toString(height);

   Gdx.app.log("MJF", "Resolution changed " + resolution);

}

 

@Override

public void pause() {

}

 

@Override

public void resume() {

}

 

}

 

When you run this program on a device, you should see:

Appresults

 

As you move the device, the various values will update.  If you raise your phone to be within about 30 degrees of completely upright it will vibrate.  Of course, this assumes that your device supports all these sensors that is!

 

The code itself is actually remarkably straight forward, LibGDX makes working with motion sensors remarkably easy, its just actually understanding the returned values that things get a bit more complicated.  The vast majority of the logic is in the render() method.  First we get the angle the device is rotated in.  This value is in degrees with 0 being straight in front of you parallel to your face.  One important thing to realize is this value will always have 0 as up, regardless to if you are in portrait or landscape mode.  This is something LibGDX does to make things easier for you, but is different behaviour than the Android norm.

Next we get the orientation of the device.  Orientation can be either landscape or portrait (wide screen vs tall screen).  Next we check the value of the accelerometer along the Y access using getAccelerometerY().  You can also check the accelerometer for movement in the X and Z axis using getAcceleromterX() and getAcceleromterZ() respectively.  Once again, LibGDX standardizes the axis directions, regardless to the devices orientation.  Speaking of which, Y is up.  The means if you hold your phone straight in front of you parallel to your face, the Y axis is what you would traditionally think of as up and down.  The Z axis would be in front of you, so if you made a push or pulling motion, this would be along the Z axis.  The X axis would track movements to the left and right.

So then, what exactly are the values returned by the accelerometer?  Well this part gets a bit confusing, as it measures both speed and position in a way.  If you hold your phone straight out in front of you, with the screen parallel to your face, it will return a value of 9.8.  That number should look familiar to you, it’s the speed a body falls due to gravity in meters per second.  Therefore if your phone is stationary and upright, its 9.8.  If you move the phone up parallel to your body, the value will rise above 9.8, the amount depends on how fast your are moving the phone.  Moving down on the other hand will return a value below 9.8.  If you put the phone down flat on a desk it will instead return 0. Flipping the phone upside down will instead return -9.8 if held stationary.  Obviously the same occurs along the X and Z axis, but instead that would indication motion left and right or in and out instead of up and down.

Ok, back to our code.  We check to see if the current accelY value is the highest and if it is, we record it to display.  Next we check what value the orientation returned and display the appropriate message.  We dump some information we’ve gathered out to be displayed on screen.  Next we make the very important call Gdx.input.isPeripheralAvailable().  This will return true if the users device supports the requested functionality.  First we check to see if the phone supports vibrating and if it does, we check if the phone is over 7.  Remember the value 9.8 represents straight up and down, so if its 7 or higher its within about 35 degrees of vertical.  If it is, we vibrate by calling vibrate(), the value passed is the number of milliseconds to vibrate for.

Next we check to see if the device has a compass.  If it does, you can check the position of the device relative to polar north.  Here are the descriptions of each value from Google’s documentation:

Azimuth, rotation around the Z axis (0<=azimuth<360). 0 = North, 90 = East, 180 = South, 270 = West
Pitch, rotation around X axis (-180<=pitch<=180), with positive values when the z-axis moves toward the y-axis.
Roll, rotation around Y axis (-90<=roll<=90), with positive values when the z-axis moves toward the x-axis.

You can read more about it here.

Finally we draw the message we have been composing on screen.

There is only one other very important thing to notice in this example:

public void resize(int width, int height) {

   batch.dispose();

   batch = new SpriteBatch();

   String resolution = Integer.toString(width) + "," + Integer.toString(height);

   Gdx.app.log("MJF", "Resolution changed " + resolution);

}

 

In the resize() method we dispose of and recreate our SpriteBatch().  This is because when you change the orientation of the devices from landscape to portrait or vice versa you invalidate the sprite batch, it is now the wrong size for your device.  Therefore in the resize() call, we recreate the SpriteBatch structure.



Geeks3D Forums

ASUS GPU Tweak Streaming V1.0.3

October 30, 2013 04:27 PM

Quote
ASUS GPU Tweak Streaming V1.0.3
Share gameplay live !

GPU Tweak Streaming is a utility for setting up high-quality live streaming
video from your desktop or webcam. With GPU...

iPhone Development Tutorials and Programming Tips

Tutorial: Guide On Using The iOS 7 UI Transition API To Create Custom View Transitions

by Johann at October 30, 2013 06:14 AM

Post Category    Featured iPhone Development Resources,iOS Development Tutorials,Objective-C

Previously I mentioned a nice library allowing you to implement many custom transitions that utilizes the iOS 7 transitions API, and previously mentioned a tutorial from Yari D’areglia on custom view transitions prior to the realease of the iOS 7 SDK.

Here’s a new tutorial from Yari explaining how to utilize the new UI transition API found within iOS 7.

The tutorial does an excellent job of explaining how to use the new objects and protocols of the transitioning API, and implementing a custom animation.

Here’s a video showing the simple app you’ll build in the tutorial:

You can find the tutorial over on the Think and Build It site here.

A nice straightforward guide on using the new UI transition API.


Be the first to comment...

Related Posts:

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: Tutorial: Guide On Using The iOS 7 UI Transition API To Create Custom View Transitions

©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Gamasutra Feature Articles

Harnessing the power of motion control in video games

October 30, 2013 04:00 AM

Developers with experience in the field of motion controls give insight into how studios should go about tackling motion systems. ...



iPhone Development Tutorials and Programming Tips

LIbrary For Creating Various Customizable iOS 7 Style Minimalistic Progress Indicators

by Johann at October 29, 2013 09:54 PM

Post Category    Featured iPhone Development Resources,iOS Development Libraries,Objective-C,Open Source iOS Libraries And Tools

I’ve mentioned a couple of libraries for creation minimalistic style progress indicators such as this library for creating iOS 7 style download indicators, and this library for creating Safari style line progress indicators.

Here’s an excellent library that puts together several different styles of minimalistic progress indicators called MRProgress from Marius Rackwitz.

Each indicator is customizable and easy to use.

The progress indicators include:

- iOS 7 app store style download progress indicators
- Thin navigation bar line style progress indicators
- Checkmark and cross indicators
- Circular navigation indicators

Here’s a set of images from the readme showing examples of different included indicators:

MRProgress

You can find MRProgress on Github here.

A nice library for creating proess indicators.

 


Be the first to comment...

Related Posts:

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: LIbrary For Creating Various Customizable iOS 7 Style Minimalistic Progress Indicators

©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

#AltDevBlogADay

Easy Collaboration with Object URLs

by Marc Flury at October 29, 2013 08:45 AM

At DROOL, we’ve recently started using URL “links” to our game objects that we can easily share via e-mail.  It’s simple and probably not a unique solution.  But it’s been useful and feels like a feature every engine should have.   It was quick and easy to implement, but the most time was spent working around some minor annoyances.

Our need for “Object URLs”

Brian (the DROOL artist) lives in Providence, Rhode Island, and I live in Seoul, South Korea.  Because of the distance (and 14 hour time difference), our opportunities for liquid communication via voice and video chat are limited and we often resort to e-mailing each other about development issues.

Like most game engines, our assets are divided into files, each containing multiple objects (meshes, animations, sounds, etc.).  For our first game, THUMPER, we’ve accumulated hundreds of files and thousands of objects.  During development, there could be an issue with any one of those files or objects.  For example, Brian might have a rendering problem and send me an e-mail like this:

SUP FLURY.  There is a rendering problem with bug_eyed.mesh in gameplay/resource/bugs.objlib.  I’m not sure if there’s a problem with material settings or a code issue?

Writing e-mails like this isn’t hard, but we send hundreds of e-mails to each other every month.  Even in this simple example, there’s opportunity for the sender to mistype file and object names.  And the receiver has to navigate to the appropriate file, search the file for the object, and open the object editor.  Wouldn’t it be nice to avoid this error-prone and manual labor?

Now we do, with “Object URLs” that directly reference our files/objects.  These links can be pasted into an e-mail by the sender and clicked by the receiver.  For example, Brian’s e-mail now looks like this:

SUP FLURY.  There is a rendering problem with http://drool.ws/gameplay/resource/bugs.objlib?obj=bug_eyed.mesh.  I’m not sure if there’s a problem with material settings or a code issue?

When I click that link, the DROOL editor is launched, the “bugs.objlib” file is opened, and the editor for the “bug_eyed.mesh” object is opened automatically.

Registering a Custom URL protocol

The first step is to register a custom URL protocol for your editor’s executable.  For example, the “http” protocol is associated with your web browser.  For the DROOL engine, we defined a custom “drl” protocol and associated it with our editor’s executable.  Full details for multiple operating systems are described here, but these quick steps assume you’re using Windows:

  1. Copy the text below into a text editor.
  2. Replace all the drl protocols with your own custom protocol.
  3. Replace C:\\path\\to\\your\\editor.exe with the path to your editor’s executable (don’t forget to double backslashes).
  4. Save the text as a file with the .reg extension (e.g. custom_url.reg).
  5. Run the file via the command line or by double-clicking in Explorer.  You’ll have to click through some security warnings.
REGEDIT4
[HKEY_CLASSES_ROOT\drl]
 @="URL:drl Protocol"
 "URL Protocol"=""
[HKEY_CLASSES_ROOT\drl\shell]
[HKEY_CLASSES_ROOT\drl\shell\open]
[HKEY_CLASSES_ROOT\drl\shell\open\command]
 @="\"C:\\path\\to\\your\\editor.exe\" \"%1\""

Since we’re a two person team, my “deployment” method was to simply check this .reg file into source control and tell Brian to run it on his machine.  Large teams probably already have a way to deploy scripts like this to every team member’s machine.  Large teams might also have multiple editors installed on each machine (for different source branches or projects).  For brevity, I’m skipping over these issues here.

URL Format and Parsing

Now that your URL protocol is registered, you can test it by typing a link starting with your protocol (e.g. drl://test) into your web browser.  You might have to click through another security warning, but your executable should be launched and the full URL will be passed to it as a command line argument.  Now your next coding task is to parse the URL into a file name and object, open that file, and open the object editor automatically.  I’ll leave the details to you, but if you already support double-clicking your editor files in Windows Explorer, then you’ve already done 90% of the work.

My URL parsing is bare bones to minimize overhead.  I just used standard C string functions to extract the file and object name and I don’t worry about properly encoding/decoding special characters (all our file and object names are alphanumeric without spaces anyway).  But I did follow the standard URL “query string” syntax so that if I do use a legitimate URL parsing library, it will be trivial to extract the values.  You can use any format, but I prefer something that is short while still being human-readable.  Our format is simple:

drl://relative_path_to_file?obj=object_name

Making URL Links “Paste-able”

At this point, I thought I was finished with URL protocols, but I discovered that unlike standard http:// protocol URLs, if you paste a URL with a custom protocol (like drl://) into most e-mail clients (like Gmail), they don’t automatically get turned into “click-able” links when you send the e-mail.  Of course, you can manually make links with custom URLs into click-able links by using your e-mail app’s GUI, but that is not quick and easy enough for me.  I just want to paste the link and send it!

After some research, I learned that custom protocol URLs aren’t automatically click-able in most e-mail clients for security reasons.  Unfortunately, the standard workaround is a bit gruesome.  The “done thing” is to use a standard http:// URL that sends the user to a webserver, then the webserver redirects to the desired custom protocol URL.  It’s sad to complicate our tool chain with a webserver like this, but that’s what we’ve done.

So now this URL: http://drool.ws/relative_path_to_file?obj=object_name

Gets redirected here by our webserver: drl://path_to_file?obj=object_name

Now everything works.  There are many ways to redirect a URL, but probably the easiest way is to use Apache’s mod_rewrite and a regular expression rule.  I recommend that you don’t do any actual parsing of your URL in your webserver, just do a simple find/replace and then redirect.  I prefer to keep all the parsing in my editor and involve the webserver as little as possible.

UPDATE: As commenter F Fulin suggested below, an alternative to redirecting is to use a standard, but out-dated, protocol (e.g. gopher://) instead of a custom one.  If your e-mail client automatically highlights links using a protocol (and you don’t need to use it for anything else) you can hijack it and avoid redirecting.

More Editor Integration

Once you have this much working, everything else is gravy.  Now that we can go from an Object URL to a specific file/object in our editor, the obvious next step is to make it easy to extract Object URLs from our editor.  When you right-click objects in our editor, the context menu has a “Copy URL” option.  Selecting that copies the Object URL for a particular object to the clipboard.

Copy URL
Object URL copying in action

Other Applications for Object URLs

The convenience of Object URLs has already paid off in other ways.  Like most game engines, when we detect an error, we print out an error message to standard output.  Including the relevant Object URL(s) in our errors makes them more useful and actionable.  Conveniently enough for me, in the Visual Studio Output window, http:// URLs are automatically click-able.

It’s typical for a large team to have a server that continuously grinds through game files and objects, potentially producing errors for each object based on certain validation criteria.  On a large project, you might have thousands of object-related errors at any one time.  From my experience, it’s challenging to manage this process.  Artists and other content creators might not appreciate the importance of these errors and it’s hard to keep the overall error count under control.  If you include Object URLs with these errors, I suspect that everyone on the team will appreciate the added convenience and will be more likely to fix their errors promptly.

This was also posted to the DROOL Development Blog.

iPhone Development Tutorials and Programming Tips

iOS Component Providing Search With Autocompletion And Map Marking Using Google Places

by Johann at October 29, 2013 06:13 AM

Post Category    Featured iPhone Development Resources,iOS UI Controls,iPad,iPhone,Objective-C

Several months ago I mentioned a handy library for easily setting up a UITextField with autocompletion using a datasource.

Here’s a handy library that utilizes the Google Places autocomplete API providing a search component with auto completion for places called SPGooglePlacesAutoComplete originally by Stephen Poletto using an updated fork from Chris Chen.

In addition to allowing you to search through places you can easily create a CLPlacemark for marking an MKMapView.

Here are a couple of images from the readme showing the included demo in action:
SPGooglePlacesAutocomplete SPGooglePlacesAutocomplete

You can find SPGooglePlacesAutocomplete on Github here.

A very handy library for apps utilizing apps.


Be the first to comment...

Related Posts:

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: iOS Component Providing Search With Autocompletion And Map Marking Using Google Places

©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.



Gamasutra Feature Articles

Best practices for VR, from seven devs working with the Oculus Rift

October 29, 2013 04:00 AM

...

iPhone Development Tutorials and Programming Tips

Nice Easy To Set Up Open Source iOS Carousel View Component

by Johann at October 28, 2013 10:54 PM

Post Category    Featured iPhone Development Resources

I’ve mentioned a couple of nice open resources for making scrolling carousel style views such as this example showing how to make a coverflow style carousel using UICollectionView, and a tutorial showing how to create an infinite scrolling view.

Here’s a nice easy to use component for creating sliding carousels called AHCarousel from Sania Ahraf.

AHCarousel provides a very clean-looking carousel with the capability of interacting with each carousel item as a UIButton, and zooming on the currently selected item.

Here’s an image from the readme showing the included example in action:
AHCarousel

You can find AHCarousel on Github here.

A nice quick to set up carousel component.


Be the first to comment...

Related Posts:

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: Nice Easy To Set Up Open Source iOS Carousel View Component

©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

OpenGL

GpuTest 0.6.0 Released

October 28, 2013 02:51 PM

GpuTest is a cross platform OpenGL benchmark for Windows, OS X and Linux. This new version of GpuTest comes with the support of OS X 10.9 Mavericks (OpenGL 4), and brings minor changes in the user interface.



iPhone Development Tutorials and Programming Tips

Component For Creating Text Fields and Text Views With Slick Animated Floating Descriptions

by Johann at October 28, 2013 02:15 PM

Post Category    Featured iPhone Development Resources,iOS UI Controls,iPad,iPhone,Objective-C

A couple of weeks ago I mentioned an open source text field component with an animated floating description.

Here’s another library called RPFloatingPlaceholders that builds upon the same ideas.

RPFloatingPlaceholders contains both UITextField, and UITextView sub-classes so you can make single and multi-line text entry views. The description labels can pop in above the text entry, or move the text entry downwards with the label in places. Also supported is color customization.

Here’s an image showing RPFloatingPlaceholders from the readme in action with the downward animation:

RPFloatingPlaceholders

You can find RPFloatingPlaceholders on Github here.

A nice way for creating descriptive text fields.


Be the first to comment...

Related Posts:

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: Component For Creating Text Fields and Text Views With Slick Animated Floating Descriptions

©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Top iOS Development Resources For Week Ended October 27th, 2013

by Johann at October 28, 2013 06:00 AM

Post Category    Featured iPhone Development Resources,News

Welcome back to our feature of the most popular new and updated resources mentioned on the site in the last week.

This week’s top resource is an excellent open source tool for easier debugging of user interfaces with a fantastic hierarchy viewer and more.

Here are the resources:

1. Hierarchy Detective – An open source  user interface debugging tool featuring a 3D UI element viewer, and fast interface element search.  (share on twitter) (featured here)

2. FuzzyAutocompletePlugin – An Xcode 5 compatible plugin that improves Xcode’s autocomplete by adding in fast fuzzy matching.  (share on twitter) (featured here)

3. MLFoldingClock –  An open source library enabling numbers with unique folding transitions based on bezier curves.  (share on twitter) (featured here)

Thanks for reading!


Be the first to comment...

Related Posts:

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: Top iOS Development Resources For Week Ended October 27th, 2013

©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.