KiloKit Controller Package

From EQUIS Lab Wiki

Jump to: navigation, search

Contents

Important Terms (Quick Reference)

KiloKit: The package containing all necessary files to build applications compatible with the controllers. This package can be located on the repository.

NTEO_Bluewire: The outside framework which needs to be added to XCode projects for them to accept controller inputs. This is located with the Kilobeat Unity package on the repository.

CoreBluetooth: Apple framework needed to support Bluetooth communication. Can be added to the project from within XCode.

Pre-Build Warning

Building KiloBeat iPad Applications from Windows (Don’t Do It)

One of the more time-consuming problems with the initial process involved projects being built from Windows failing to compile in XCode. Despite the rest of the process following the correct steps, this seemed to result in some errors. There are issues with post process build pipelines not executing silently on Windows then ending up with missing or corrupted things on the Mac. You can develop your project on Windows then copy it on Mac OS and build the XCode Project with Unity from there. If you are encountering errors regarding symbols being undefined for the current architecture (armv7), this is likely a result of a post-process issue with Unity, or the use of an outdated version of the Kilobeat SDK. Screenshots of these errors have been included in the SVN for reference.

Building from Unity

Once you have finished a build for your Unity project, you may attempt to build from Unity ON A MAC (this is crucial for utilizing the NTEO_Bluewire framework. See above section for details). Ensure you are targeting the correct device (iOS or PC/Mac) and then check your Player Settings.

For PC/Mac:

-At the time of writing communication between the controllers and a PC/Mac is not directly possible without use of a workaround (more on that later). You can however build projects which will accept communication from an iPad/iPhone. Assuming that the proper objects are included in your scene, you should be able to build your project as per usual. Once built from Unity, you should be able to run your application and await input from the iPad/iPhone.

For iOS:

-Make sure to change the bundleidentifier located under the OTHER SETTINGS/IDENTIFICATION subheader. If you do not do this here, you will have to do so in XCode following every new build, so it is just as easy to do this now.

-Ensure the architecture that you are targeting is ARMv7. This cannot be changed prior to the Unity 5 update, though I am unsure as to whether it will be possible for versions after 5.0. This architecture is needed for the NTEO_Bluewire framework.

-Target Device and Target iOS version can also be changed within Unity. While these shouldn’t matter while only working with the singular device, they may become relevant if features are added which cannot be supported by other devices/iOS versions. Should not currently present a problem but is something to keep in mind for future developers.

-You may also change your applications icons within these settings. This is not necessary, but will make your specific project easier to locate.

-Most of these settings can be changed within XCode if you forget, however changing within Unity may save you so time over multiple builds. Once you have ensured your Player Settings are correct, you may build your project. You will be prompted for the location of your build as per building for PC/Mac. This will create a folder containing your XCode project and all necessary support files. You can then open your built project using XCode. For specific details regarding adding KiloKit communication within your project, refer to the document equis_kilokit_doc on the repository, located with the other files.

Building from XCode

Once you have finalized and built from Unity you will be greeted with an XCode project. The amount of steps required within XCode have actually been severely reduced, meaning that as long as you have completed all suggested steps within Unity, there are only 4 main steps for creating your build from XCode.

1) Ensure that you are using a valid Developer ID. Without a valid ID, you will not be able to target iOS devices from XCode. Since Bluetooth communication is not supported by the XCode simulator, this will mean that you will be unable to test your application. The lab has a Developer ID you may use. The login info is stored within the Repository in the same location as the Kilokit files. This ID will need renewed sometime during the summer so beware. Contact Nick about renewing it.

2) Once you are sure you have valid credentials, you may start to assemble your project. Firstly, you will need to add the CoreBluetooth framework to your project. To do this, Select the General tab within XCode and scroll down to the section labelled “Linked Frameworks and Libraries”. From here scroll to the bottom of this section until you see the + icon. Click on this to bring up a list of possible frameworks to add to your project. Scroll through this list until you see CoreBluetooth, select it and then click Add.

3) Add the NTEOBluewire framework. Once again click the + icon under Linked Frameworks and Libraries, only this time we are going to add from another source. Click the “Add Other…” button and locate the NTEOBluewire framework in the location that you had saved it. This framework can be retrieved through the repository in the same location as the other files.

Once you have completed these steps, you should be able to build the project by selecting “Product” from the taskbar, then clicking on Run or Build, depending if you want to run the application at the given time.

Additional Info

Additional images and email transcriptions have been included within the KiloKit folder on the repository. Please consult those files for additional details.