<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Andras Naszrai on Medium]]></title>
        <description><![CDATA[Stories by Andras Naszrai on Medium]]></description>
        <link>https://medium.com/@naszrai.andras?source=rss-3e58b3b55920------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wn4V1kHcsCmwGd7kz-7qiQ.jpeg</url>
            <title>Stories by Andras Naszrai on Medium</title>
            <link>https://medium.com/@naszrai.andras?source=rss-3e58b3b55920------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 04:40:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@naszrai.andras/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Identity management, access control and social networking in Gear VR apps]]></title>
            <link>https://medium.com/@naszrai.andras/identity-management-access-control-and-social-networking-in-gear-vr-apps-943230e53e99?source=rss-3e58b3b55920------2</link>
            <guid isPermaLink="false">https://medium.com/p/943230e53e99</guid>
            <category><![CDATA[identity-management]]></category>
            <category><![CDATA[samsung-gear-vr]]></category>
            <category><![CDATA[identity-and-access]]></category>
            <category><![CDATA[oculus]]></category>
            <category><![CDATA[game-development]]></category>
            <dc:creator><![CDATA[Andras Naszrai]]></dc:creator>
            <pubDate>Wed, 21 Mar 2018 20:31:59 GMT</pubDate>
            <atom:updated>2018-03-22T21:03:35.549Z</atom:updated>
            <content:encoded><![CDATA[<p>This is the next story in my series about Project Annaroza, and it will be about identity management and access control.</p><p>I’ve been doing quite some legwork before I decided to officially start Project Annaroza. That involved the creation of some proof of concepts and lots of investigation and research on different topics, including multiplayer and character control in VR. During that investigation I’ve found that it’s pretty easy to create multiplayer in Unity, but if I do not pay special attention to make everything work in multiplayer right from the beginning it is also quite easy to lose track of things and mess it all up. Now before I start with the actual game content I want to implement matchmaking for the multiplayer, but before I could have matchmaking and multiplayer, I need some means to identify my users and allow them to have a friend list, so that they can select a friend to start a match with.</p><p>Now my todo list contains the following four main items, from which I will solve the first two in this episode</p><ol><li>Have identity management and access control in place</li><li>Have connections between users, like a friend list</li><li>Implement matchmaking by selecting a friend to play with</li><li>Implement the game itself</li></ol><h3>Why custom made identity management is not a good idea?</h3><p>TL;DR: It is simply too complex to be solved easily, and a problem that is already solved by others.</p><p>When you create a multiplayer game, your biggest concern is your user base, and that is actually true not only for games, but also for any multiuser software or cloud service. You always have to protect your users’ data, not only because they are mad if they find out that someone hacked their account, but also for a few other reasons. First of all, law is on your users’ side and they can sue you if you do not protect their personal data. Then you should also consider other events, since someone stealing information is not the only thing that can happen. If for example your user database crashes and the data is corrupted or damaged, that can make your users unable to log in, and the same is true if your login server is targeted with a DDoS attack it is not properly protected. If the users cannot log in, they will abandon your game (or service or whatever) and do something else with their free time.</p><p>Of course data theft can be prevented by proper encryption, database corruption and damage can be mitigated by creating backups and replicas, and there are ways to protect your login server from DDoS attacks as well, but to do all that you have to be a security expert, or you have to hire one. If you want to implement your own user database and login server, you have to heavily invest your resources in strengthening the infrastructure and your user database and login server. That is something you probably don’t want to do, so let’s see what other options are there.</p><h3>Login with Facebook</h3><p>Online games and services used to have their own user management and authentication/authorization solution created with hard work and lots of money, but since Facebook there is a new trend. Facebook provides a login service for other applications, making it possible to instantly use Facebook for all your user logins and stuff. How does it work? Well, in a nutshell, you just integrate the Facebook API (provided by Facebook itself) in your game or application, and then you can prompt the user to login with Facebook. After that the user provides his Facebook credentials once, he is authenticated by Facebook using those credentials, and your app gets the result of the authentication. If the user provided wrong credentials, your app gets an authentication error from Facebook and knows that the user cannot proceed with using the application. It’s completely on you at this point how you want to handle that, you can allow reattempts on the login, or simply close the application, or maybe allow the user to use it anonymously, as I said, it’s up to you. If, on the other hand, the authentication is successful, your app receives a token from Facebook, that can be used in the future to authenticate the user without requiring him to provide his credentials again.</p><p>This is a very popular way to handle login nowadays, and works very well with Unity, but with VR, sadly not. The issue is that when you prompt the user for the Facebook credentials, the actual UI with the username and password input fields is created by the Facebook API, and it is not prepared to work with the stereoscopic camera of the VR. It is just a basic screen space UI, which (you might remember from my earlier post about UIs) simply does not work in VR because of how it is rendered. To make it worse, even if the screen space UI would work, it would still wait for user input through the regular virtual keyboard of your phone. At this point, let me just quickly remind you about something important, your phone is stuck in the Gear VR, and you have no possible way to interact with its touchscreen. If you remove your phone from the Gear VR the application is shut down, so you are again not able provide input using the virtual keyboard of your phone.</p><p>How is it possible that login with Facebook does not work with Gear VR, which is powered by Oculus, which has been acquired by Facebook in 2014 so practically is their own product? Probably it has something to do with Oculus’ own social network, the Oculus platform.</p><h3>The Oculus platform</h3><p>So what is it exactly? The Oculus platform is the clean, soft bed where your Oculus VR apps sleep. That is the lobby you see when you put your phone into the Gear VR and it automatically starts up the Oculus app. It uses the Oculus platform to authenticate you, as a user, to keep track of your friends and your apps in your library, and basically everything related to you as an Oculus user. When you buy your Rift or Gear VR, you have to register yourself as a user of the Oculus platform in order to be able to play games or view experiences. As a developer, if you want Oculus users to be able to play your game, you have to release it in the Oculus store, through the Oculus platform.</p><p>When you develop an app that is supposed to run on Oculus devices you have to fulfill some special requirements of the platform. The first thing to make sure about is that your users cannot launch your app from anywhere outside the Oculus platform. This means they cannot just find it in their phone’s menu and launching it by tapping on it. The only way to start your app will be to start the Oculus app, look for your app in your library, and start it from there. That has an interesting implication if you think about it a bit. When the user starts the Oculus app, it authenticates the user, so when your app is started from the library, he is already logged in and verified. If only there would be a way to somehow get the logged in user from the Oculus platform… wait, there is! You just have to integrate with the Oculus platform using its Unity SDK.</p><p>So let me quickly summarize what you get from the Oculus platform, and why it’s enough for most of you as it is enough for me</p><ol><li>You can use their user database to keep track of your users</li><li>It makes sure that the user is authenticated and verified before your application is even started</li><li>It provides a way for you to check if the user is entitled to use your application</li><li>In addition it gives rooms, matchmaking, leaderboard, presence, friend list, voice chat, in-app purchase and a few other things, should you need it</li><li>Yes, there are far less users registered in the Oculus user database, compared to Facebook’s or Google’s, that’s true. But hey, all the users that want to be able to run games on Gear VR have to register themselves with Oculus. That means that practically all the potential users that could play with a Gear VR game are registered, so at the end you are not missing out on anything by relying on the Oculus platform.</li></ol><h3>Other runner-ups</h3><p>There are quite a few authentication service providers, who give you what Facebook does with its “Login with Facebook”, like Microsoft, Google, Twitter, Amazon and MySpace, just to name a few. These all work just fine with regular applications and websites, but presumably I would run into very similar problems even if they would be supported by some Unity integration, which I am not entirely sure about. They are perfectly working federated identity providers, but the effort that is required to integrate them with my game compared to what I have to do to make it work with the Oculus platform is overwhelming.</p><p>Another approach would be to use AWS Cognito, create my user pool and implement a <a href="https://www.digitalocean.com/community/tutorials/an-introduction-to-oauth-2">simple OAuth flow</a>. Then I would need a website where my users can register and probably that’s it. This solution would be quite robust and secure, but still requires more work and provides less benefits than just integrating with the Oculus platform, which I had to do anyway if I want to distribute my game through Oculus store.</p><h3>Integration with the Oculus platform</h3><p>Let’s see the steps required for the integration with the Oculus platform. Unfortunately I did not manage to test the integration from play mode in the editor, I had to test it by building the application and running it on my phone, so this guide will contain steps not only for the integration, but also for building and uploading binaries to the Oculus developer dashboard.</p><ol><li>Download and import the Oculus platform SDK from the Unity asset store, <a href="https://assetstore.unity.com/packages/tools/integration/oculus-integration-82022">here</a>, or from Oculus’ website, <a href="https://developer.oculus.com/downloads/package/oculus-platform-sdk/">here</a></li><li>Now you have to install the Oculus Runtime, because the Oculus Platform SDK will try to call some functions in it, and if you don’t have it in place you will receive DllNotFoundException for LibOVRPlatform64_1.dll or LibOVRPlatform32_1.dll, depending on which architecture your windows is for, 64bit or 32bit (I don’t know what it needs on Mac). Sadly, you can install the Oculus Runtime only as part of the Oculus Software, which is for the Rift originally, but the Oculus Platform SDK needs it so you have no choice here. You can get the installer <a href="https://www.oculus.com/setup/">here</a>. If you have Windows 10, chances are the installer refuses to start, in that case you have to run it in Windows 8 compatibility mode. That should do the trick!</li><li>Ok, now download the Oculus Utilities for Unity from <a href="https://developer.oculus.com/downloads/unity/">here</a>, and import it. If it asks if you want to upgrade your Oculus plugin, say yes.</li><li>Now you can see two new menus on your menu bar in the Unity Editor, one is called Tools, and contains a few possible actions for Oculus, the other is the Oculus Platform, which only has the Edit Setting option</li><li>Now you have to register a developer account on Oculus developer dashboard, <a href="https://dashboard.oculus.com/">here</a>. This account will be used to register your app with Oculus, which is a required step if you want to integrate.</li><li>Create an app page on the Oculus developer dashboard. To do that, follow the “Creating an App Page” part of <a href="https://developer.oculus.com/distribute/latest/concepts/publish-create-app/">this guide</a></li><li>Now you should find your application under your organization on the sidebar of the Oculus dashboard, and you should find a Getting Started API item under your application. Click it, and it will redirect to a page where you will find the App ID allocated for your app by Oculus. This is a very important ID, since it will be used by the Oculus platform in every platform call to identify your application and make decisions based on that. Just to give you an example, if you have, say, 10 friends on the Oculus network, but only two of them bought your app, if you query your friend list from the Oculus platform inside your application, then it will return only those two friends, who bought the application, based on its App ID. In other words, the Oculus platform will filter your friend list and return only those friends, who can actually play the game with you, and this is done solely based on your App ID. Now copy that App ID somewhere, where you will find it later on.</li><li>Ok, next step is to set up your Unity Editor. Go to Oculus Platform &gt; Edit Settings (the menu created by importing the Oculus Platform SDK package), and that will open up the Oculus Platform Settings window. Copy your App ID into the Gear VR App ID field (or into Oculus Rift App ID field, if you are developing for Rift), and make sure that the Use Standalone Platform checkbox is not checked.</li><li>And finally the last thing missing is to implement the mandatory entitlement check in your application. You can find more on what the entitlement check is, and on how to implement it <a href="https://developer.oculus.com/documentation/platform/latest/concepts/pgsg-unity-gsg/">here</a>. In a nutshell, it checks if the user is authorized to use the application (i.e. bought it through the Oculus Store), and this check has to be performed in the first scene of your game (usually a main menu or lobby), and within 10 seconds after the game is started.</li></ol><p>At this point your user is logged in, authenticated, and you can be sure he is entitled to play your game. What comes next is how you build your app, and upload it to the Oculus developer dashboard and test it out on your Gear VR.</p><ol><li>There are certain settings the Oculus Store expects you to include in your AndroidManifest.xml when you develop for Gear VR. You can make sure manually that those are set, but if you are as lazy as me, you don’t want to spend time on that. Luckily, there is one click solution to set all those at once. When you installed the Oculus Utilities for Unity earlier, a new Tools menu appeared in the Unity Editor. By clicking the Tools &gt; Oculus &gt; Create store-compatible AndroidManifest.xml menu item, it does what is says and generates a store-compatible AndroidManifest.xml in your Assets/Plugins/Android folder. Click it!</li><li>Now you have to build your app with File &gt; Build Settings and clicking the Build button. In theory you cannot Build and Run at this point, because in the store-compatible AndroidManifest.xml the LAUNCHER category is removed, so it is not possible to launch your application just like that anymore, you need the Oculus app to do that for you. It is not really a problem though, since right now you just want to upload your first alpha binary to the dashboard, and you can change things back later to be able to Build and Run again. Don’t worry about that now, since the important thing right now is that you have your almost-store-compatible .apk!</li></ol><p>Before you could upload the .apk, you have to resign it with jarsigner, because Unity signs the .apk packages with v2 signature, but the Oculus Store can only handle v1 signature. Don’t ask me why, but let’s hope they will handle that issue (they didn’t, for a long time). To re-sign it with v1 signature, you need to do some magic, and that is explained in <a href="https://www.youtube.com/watch?v=VeCqUPaRYfM&amp;t=578s">this video</a>. Just to give you the basics</p><ol><li>As far as I remember this whole process requires openssl to be installed on your machine, so either you can find and install the latest version now (for windows <a href="https://www.cloudinsidr.com/content/how-to-install-the-most-recent-version-of-openssl-on-windows-10-in-64-bit/">here is how</a>), or you can go to the next step and do the install when you get the first error saying that openssl is missing.</li><li>Now first you need to remove the current signature files from your .apk. If you don’t know how ot change the contents of your .apk, read my previous post on “The permission misery” <a href="https://medium.com/@naszrai.andras/the-permission-misery-17c68a815eb9">here</a>. The files you have to remove are /META-INF/CERT.RSA and /META-INF/CERT.SF.</li><li>Then you need a keystore which you can use for your new signature. It is all explained in the video I linked, watch it, but in the end you will issue a command similar to this in your command prompt “<strong>keytool -genkey -keystore your_keystore_name.keystore -alias your_alias -keyalg RSA -keysize 2048 -validity 36500</strong>”, where you have to replace your_keystore_name and your_alias with some real names you see fit. This command generates a new file with .keystore extension and you have to answer some questions during the process. When you have your keystore generated save its location somewhere, where you will find it.</li><li>The last thing to do is to sign the .apk with v1 signature. You will need your new keystore for that, and the jarsigner utility that is shipped with the Java JDK. If you are not sure you have it in place, check it in the /bin subfolder of your Java JDK install directory. If everything’s in place you have to issue another command in your command prompt, which is as follows “<strong>jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore your_kestore_name.keystore your_app.apk your_alias</strong>”. Again, details are in the video, but in short you have to specify which algorithms to use, which keystore to use, which .apk to sign and finally the same alias you provided for your keystore earlier.</li></ol><p>Now in theory your .apk is fully compatible with Oculus Store, so let’s go and upload it! <a href="https://developer.oculus.com/distribute/latest/concepts/publish-uploading-mobile/">Here</a> you can find a description on how you can do that, but in short</p><ol><li>You log in to your Oculus developer dashboard page <a href="https://dashboard.oculus.com/">here</a></li><li>Navigate to the builds section of the app page you created earlier (in the sidebar to the left: Manage &gt; the organization you created &gt; the app you created &gt; Manage Builds)</li><li>Here you will find a button that says Upload Build or something. Click it, and you will see four channels you can upload to at the bottom of the page: Store, RC, Beta and Alpha.</li><li>You can upload the binary to any channel, but the suggested workflow is to upload the first binary to the Alpha channel, since it symbolizes the lowest possible completeness, and we are at the beginning of the development, really. So upload the binary to the Alpha channel using the context menu with the icon with three dots. When the .apk is uploaded the Oculus Store runs its automated checks, and if everything is fine it gives you a success, otherwise you’ll get a list of issues you have to take care of.</li><li>When your .apk is uploaded successfully, you can invite people to join as alpha testers, <a href="https://developer.oculus.com/distribute/latest/tasks/publish-release-channels-add-users/">here is how</a>. I found it useful, since otherwise you cannot test things like friend list and matchmaking, because you have basically no users.</li></ol><p>Now that your .apk is uploaded to the Oculus Store, you don’t need the store-compatible AndroidManifest.xml until you decide to upload the next version of your application, so you are free to remove it from Assets/Plugins/Android manually, or by using the menu in Unity Editor and clicking Tools &gt; Oculus &gt; Remove AndroidManifest.xml. When you build next, you can choose to Build and Run again, and test any new development easily, without having to resign the .apk and upload it again to the Oculus Store.</p><h3>Using the Oculus Platform SDK</h3><p>Using the Oculus Platform SDK is pretty easy and straightforward. You have two mandatory steps right after your app is started, one is to initialize your Platform, and the other is the entitlement check and both are covered in the guide I linked for the entitlement check earlier in this post.</p><p>About all the other functionalities you get from the platform SDK, they can all be utilized the same way as the entitlement check. You have to make a call to the given function, then immediately call OnComplete on it to add a callback function, because the whole SDK is designed to work asynchronously from what I’ve seen so far. The callback function receives a Message object as parameter, and you can check the execution status with the IsSuccess or IsError methods of that Message before you do anything. If the message is a success, you can start to dig up its contents based on what kind of function you called, but if it is an error, you have to handle that for yourself.</p><p>At this stage I decided to use the Oculus platform to implement the first two items on my list</p><ol><li>Have identity management and access control in place</li><li>Have connections between users, like a friend list</li></ol><p>I hope you enjoyed my post, thanks for the read! Next time I plan to write about multiplayer and matchmaking, but before that I have to get another set of phone and Gear VR, so it’s pretty safe to expect some delay. Until that just have fun and play around with VR, cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=943230e53e99" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The permission misery]]></title>
            <link>https://medium.com/@naszrai.andras/the-permission-misery-17c68a815eb9?source=rss-3e58b3b55920------2</link>
            <guid isPermaLink="false">https://medium.com/p/17c68a815eb9</guid>
            <category><![CDATA[samsung-gear-vr]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[oculus]]></category>
            <dc:creator><![CDATA[Andras Naszrai]]></dc:creator>
            <pubDate>Tue, 13 Mar 2018 10:52:52 GMT</pubDate>
            <atom:updated>2018-03-13T10:52:52.843Z</atom:updated>
            <content:encoded><![CDATA[<p>This is the next story in my series about Project Annaroza, and it will be about how I investigated why my app asked for permissions it didn’t require.</p><p>When I am in the process of making friends with some new technology I did not use before, I usually see patterns of the <a href="https://betterexplained.com/articles/understanding-the-pareto-principle-the-8020-rule/">Pareto principle</a> emerge eventually. It is a very generic principle and in my case it typically translates to flavours like “80% of the work is done in 20% of the time” or to turn it around “20% of the work, usually the investigation of some annoying side effect or bug or faulty configuration, eats up 80% of my time”. This time it was the unwanted permission requests…</p><p>When I built my game the first time and ran it on my phone and in my Gear VR headset, to my surprise it asked for permissions to photos, media files and all those things, and also to make phone calls. It was really strange, since I didn’t have anything in my project but an empty canvas, so I decided that I will get to the bottom of it.</p><h3>First round of google search</h3><p>Lots of threads can be found about permission issues with Unity on various forums, but in a nutshell what you can probably find is one of the followings</p><ol><li>Unity generates these permissions based on what you have in your project. Maybe you wrote some code that needs these permissions. I quickly eliminated this one, since my project had no code at all.</li><li>You might be using some package that asks for these permissions, you should check your android libraries in the temp folder of your project and see the AndroidManifest.xml in those. None of them tell you how, so here’s how I did it. Android packages have the .aar extension and they are essentially .zip archives (this is actually pretty common, and extensions like .apk, .jar, .docx, .xlsx and many other work the same way). You can find your .aar packages in the /Temp/StagingArea/android-libraries subfolder of your project folder, and the easiest way to check what’s inside an .aar package is to simply change its extension to .zip and access its content like you would with any other .zip archive. I had only two packages so for me this was a quick thing to do, and it showed me that none of those had anything in their manifests about these permissions. During this step you might find that the Temp folder is missing, that is because it’s only there when you have the project open in Unity. Even that is not enough though, you have to build the project with File &gt; Build Settings &gt; Build, to have the StagingArea and its contents.</li><li>Next idea is to check the target SDK version. If it is below 4, Unity automatically generates these permissions into the manifest. I thought maybe I made a mistake and forgot to set the SDK version, but I didn’t. I use version 24, as I wrote in a previous post about my process to set up the environment. And of course if I think about it, Oculus integration requires SDK version 19 or higher, and if you set a lower SDK version you simply cannot build your project for VR. Since I was able to build it with no problem, I should’ve known that my SDK version was set properly.</li><li>Then they said it must be the Unity Analytics service, since it needs every kind of information about the platform the game runs on, so it asks for these permissions. I just quickly looked at my services settings and saw that Analytics is enabled. I was happy to see that I found the guilty setting in my Unity setup, so I disabled analytics, rebuilt the project and ta-daaaaaa, it still asked for those permissions. I just re-enabled the analytics service.</li></ol><h3>Next step: masking the problem</h3><p>None of the above worked, so I decided to mask the problem by disabling the ask for permission phase completely, since I was completely sure I don’t need those permissions for my game, and if anyone sees that a game asks for permission to make a phone call will probable delete it instantly.</p><p>Luckily it is possible to disable the ask for permissions phase by creating an AndroidManifest.xml in you Assets/Plugins/Android folder, that includes this tag:</p><p><em>&lt;meta-data android:name=”unityplayer.SkipPermissionsDialog” android:value=”true” /&gt;</em></p><p>The problem with that is essentially what it does. It disables asking for permissions completely, so if you need permission for something in your game, it will crash at that point because it will not get that permission. I knew this was a temporary solution at best, and I need a permanent one, but I ran out of ideas, so I decided I will deal with it later.</p><h3>A different approach</h3><p>After a couple of weeks I thought it’s time to take a look at this issue again, but from a different angle. To quickly conclude what I knew at that point</p><ol><li>None of the depencies asks for the permission</li><li>It is not in my main AndroidManifest.xml, so my code does not need it either</li><li>It is not caused by Unity Analytics</li><li>It is not because of my SDK version settings</li></ol><p>The most annoying part of this was that I couldn’t find those permissions in any of the manifests, just in the final one that was in the .apk package. I started to look around for a way to peek into the build process of Unity, to find the step where the permissions get into the manifest. Luckily it is easier than I thought, since Unity uses Gradle to build the project, and in the Build Settings window you can select the option to “export package”, which essentially exports the whole gradle project and you can use an external tool to build it for yourself. This is where the Android Studio came in handy, which I installed when I set up my environment, just to have a way to install Android SDK. The main purpose of Android Studio is actually to manage your android project and it has built-in capabilities for building an Android project with Gradle, so that’s what I did. I have identified the gradle task called processReleaseManifest in my project as the one that probably compiles the final manifest, and I was right. I had the beautiful build log that gave me some answers finally.</p><p><em>uses-permission#android.permission.WRITE_EXTERNAL_STORAGE<br>IMPLIED from C:\unity_projects\FB-auth\export\FB-auth\src\main\AndroidManifest.xml:2:1–35:12 reason: com.oculus.Integration has a </em><strong><em>targetSdkVersion &lt; 4</em></strong><em><br>uses-permission#android.permission.READ_PHONE_STATE<br>IMPLIED from C:\unity_projects\FB-auth\export\FB-auth\src\main\AndroidManifest.xml:2:1–35:12 reason: com.oculus.Integration has a </em><strong><em>targetSdkVersion &lt; 4</em></strong><em><br>uses-permission#android.permission.READ_EXTERNAL_STORAGE<br>IMPLIED from C:\unity_projects\FB-auth\export\FB-auth\src\main\AndroidManifest.xml:2:1–35:12 reason: com.oculus.Integration requested WRITE_EXTERNAL_STORAGE</em></p><p>So actually, Unity implied those permissions because of the Oculus integration, which it identified as having target SDK version less than 4! Ha-haaa, I got it! But what exactly is it?</p><h3>The solution</h3><p>It took me some time, but I finally managed to piece it together. When I installed Unity, I opted to install the Oculus package with it. When I found that oculus integration causes the problem, I checked the OVRPlugin.aar in the android libraries of my project again, and I was after the target SDK in its manifest. Well, it was set to 19. Then I remembered that in one of my previous, “experimental” projects I have downloaded the newest Oculus Unity package, and I had no permission issues with that. I decided to look into the manifest of that OVRPlugin.aar as well, and finally I found it. In the problematic package, the target SDK wasn’t in the proper tag, and that is why Unity didn’t find it, and thought it’s not set. So the solution was what customer support usually says first, install the latest version!</p><p>I know the solution won’t be so simple every time when someone’s app is asking for permissions it shouldn’t require, but I hope I could give some ideas on where to look and how to investigate what causes the unwanted behaviour, so, Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17c68a815eb9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Virtual Reality UI with Unity]]></title>
            <link>https://medium.com/@naszrai.andras/virtual-reality-ui-with-unity-6e3d02f671e4?source=rss-3e58b3b55920------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e3d02f671e4</guid>
            <category><![CDATA[samsung-gear-vr]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[virtual-reality]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[ui]]></category>
            <dc:creator><![CDATA[Andras Naszrai]]></dc:creator>
            <pubDate>Sun, 04 Mar 2018 20:53:58 GMT</pubDate>
            <atom:updated>2018-03-04T20:53:58.881Z</atom:updated>
            <content:encoded><![CDATA[<p>This is the next story in my series about Project Annaroza, and it will be about how I created a UI/lobby for my game.</p><p>Since I want to make it online multiplayer with one-on-one matchmaking, I decided that I will probably need some kind of a menu or lobby, where the players can set up their matches. I probably want to show them some data about their profile, match history would be nice, some statistics maybe, like win rate, then I want them to be able to friend each other and have a friend list from which they can choose someone to play a match with, and probably a few other stuff as well.</p><p>In Unity there is a pretty easy way to create such a thing for your game and I will quickly explain how, but I won’t go into details because there are tons of very good tutorials on Unity’s learning portal, <a href="https://unity3d.com/learn/tutorials">here</a>, and on many other places on the internet. Then I will also tell you why this is not working with VR by default, and what has to be done differently to make it work. After that I will explain some key concepts like raycasting, collision and a few other things, to finally get to the point where I can explain what I actually did, and why I did it.</p><h3>How it is done properly in Unity</h3><p>For this kind of stuff Unity has the Canvas + EventSystem duo, where the first one is for the graphic elements of the UI, like labels, images and buttons, and the other one is to handle events like hovering over something or clicking on something. The second one implies that a third component is involved in all this, namely a pointer, which in most cases is simply the mouse pointer. So what you do is you create a canvas, put your menu items on it, write some scripts for what should happen when certain things are clicked or otherwise interacted with on your UI, assign those scripts to events that are handled by the event system, you can mess around with handling state changes of buttons, you can even animate them pretty easily if you want, and basically your UI is ready. If you are interested in more details look around <a href="https://unity3d.com/learn/tutorials/s/user-interface-ui">here</a>.</p><h3>Why it’s not that trivial in VR</h3><p>When in a regular 3D game, the UI is rendered in screen space, as I learned it is called a non-diegetic UI, which means it does not exist in the game world, but it adds something to the context of the game and provides value to the user otherwise. The two ways to do it in Unity are screen space overlay and screen space camera. Those two are slightly different, but essentially they are the same in that they both render the UI on top of everything that’s in the game world, and cannot be used in VR because our eyes cannot focus on something that is so close to them.</p><p>So the way to do it in VR is to use world space UI instead, which behaves like a generic game object, it is part of the game world like a billboard or wall, and if movement is not disabled the player character can practically walk around it in the game. That is solved, and the event system works the same way as with any other UI, so we have only one thing left, a pointer. If you target PC you can still use the mouse pointer, but I’m sure you remember my project is for the Gear VR that uses a phone, so there is no way to use a mouse. There are practically two different solutions, one is to use a controller, which can work like a laser pointer in the game, while the other is the gaze pointer, meaning that the center of your view is the pointer and you can point at something by looking at it. Gear VR has no controller packed with it, you have to buy it separately, so I chose the gaze pointer because it is available for everyone even if they didn’t buy the controller.</p><p>Now that it’s sorted out you have to do some magic with importing the Oculus Utilities and the Oculus Sample Framework (or maybe the second one contains the first one as well, I don’t remember), and use things like OVRCameraRig, OVRRaycaster, OCRGraphicsRaycaster, OVRInputModul, OVRGazePointer and probably a few other stuff I forgot and you have to set them up properly to make it work. While this is not the end of the world and can be explained in a <a href="https://www.youtube.com/watch?v=9wZWSz6_gpU">24 minutes video</a>, I don’t really like it. It looks like forcing a non-VR solution on a VR setup and though it is working fine and aligns perfectly with Unity’s UI solution I thought I could just go back to the basics and do it my way.</p><h3>Basic concepts and building blocks</h3><h4>1. Raycasting</h4><p>It is very important that you understand what raycasting is, but not only because of my UI solution. It is important because it is one of the most versatile tools you have in Unity. The concept is very simple but very powerful at the same time: you can draw a straight line from a given point in a given direction to a given length. What can it be used for? Well, anything and everything! You can determine what the user is looking at, you can determine what is hit by a shot, you can see if one character has line of sight to another, you can measure distance, and you can do a myriad of other things. There are a few things to note when you use raycasting</p><ul><li>The longer the ray is, the more it costs in terms of performance</li><li>The overall cost increases kind of exponentially (but definitely worse than linear) with the number of rays you cast</li><li>You have to make sure the ray collides only with things you want to hit (we have tools for that, so don’t worry)</li><li>There are different kinds of raycasters (Graphics and Physics), you have to use the proper one</li></ul><p>For more details on raycasting there are pretty good writings on Unity’s learning portal, I highly recommend to give those a read. Also don’t miss <a href="https://unity3d.com/learn/tutorials/topics/physics/physics-best-practices">this one</a> because it covers multiple things I mention here.</p><h4>2. Graphics and Physics</h4><p>So there is a Graphic Raycaster and a Physics Raycaster. The first is meant to be used with UIs to hit graphic elements on a canvas, like buttons, and it does not collide with game objects. It is used internally by Unity’s UI solution with the canvas and the event system, so that when you click you practically cast a ray from the camera through the mouse pointer and so the ray hits the canvas where you clicked, as far as I understood. From there the event system registers the click event and if there is any script attached to the hit UI element that handles the event, it is triggered.</p><p>The other one is used more in-game, when for example you shoot a bullet from your gun and you want to see what it hits. You just cast a ray from the muzzle to the direction the gun is pointed and see what the ray hits first. Objects that need to be hit by Physics rays have to have a collider so that the ray can collide with it!</p><h4>3. Colliders and collision</h4><p>Colliders are basically surfaces that can be hit by other colliders and rays, you can read about them <a href="https://docs.unity3d.com/Manual/CollidersOverview.html">here</a>. For example if you have a snooker game, each ball has to have a sphere collider, otherwise they could not collide and bounce and would simply go through each other. For us their ability to collide with rays is more important right now, and as I said earlier a Physics ray collides with everything that has a collider. If that is not the way you want it, you have to make effort to make sure you hit only those things you want. That is done using layers.</p><h4>4. Layers and Tags</h4><p>For every game object you place in your game world you can decide to which layer it belongs to. You can use the built-in default layers, but you can create your own layers as well. And when you cast a ray with Physics Raycaster you can define a layer mask that tells Unity which layers can be hit by the ray and which cannot. You can find a guide on layers <a href="https://docs.unity3d.com/Manual/Layers.html">here</a>. It is a very good tool to decrease the number of false hits (and smarter people than me recommend you using it), but you might want to restrict even further what is interesting for you when you cast a ray, and you can do that with tags.</p><p>Similarly to layers, you can add tags to your game objects and there are default tags, provided by Unity, and you can create your own tags if you want. So when you cast a ray, it will hit the first thing that is on the proper layer, and then you can check if the hit object has the proper tag and act accordingly.</p><h3>My solution for a UI</h3><p>It is kind of a hybrid solution, because I really like the canvas and the graphic elements that come with it, but I don’t like the event system and the pointer and the graphics raycasters because all those have to be overridden if you want them to work with VR. So here’s what I did</p><ol><li>I have created my world space canvas and buttons and other UI elements as I would in any game</li><li>I have removed the event system from that has been added there by Unity when I created my canvas, because I won’t need it</li><li>I have added a box collider component to every UI element that can be clicked or hovered and aligned its scale to be as wide and tall as the UI element (X and Y dimensions) and made it very thin, like 0.02 units on the Z dimension</li><li>I have created a scripts for hover and click and attached them to the proper UI elements, to define what they should do when clicked or hovered</li><li>I have defined a new layer called MainMenu and set all menu elements with a collider to belong to that layer</li><li>I have created a Menu Controller script and attached it to the camera (just a note here, you don’t have to use the OVRCameraRig provided by Oculus because every regular camera is replaced with a stereoscopic camera for VR by Unity automatically if the VR support is enabled in the player settings).</li><li>The Menu Controller script casts a 10 units long ray (because the UI is closer to the camera than 10 units for sure), that is set to collide only with objects on the MainMenu layer, from the camera into the direction where the user is looking, using a Physics Raycaster, that can be done by getting the rotation of the camera transform and multiplying that with Vector3.forward. The script does this once every frame, and calls the hover method on whatever is hit, and once whenever the “Fire1” button is pressed to call the click method on what it hits (we will get back to the “Fire1” button in a second, just bear with me).</li><li>I also made sure in my Menu Controller script that if nothing is hit, the hover state is cleared from any menu item that may have it, and again the hover state is cleared from the old menu item when the user moves his gaze to look at a new menu item.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*PtJRzeL3LWsOqJiVgm6MlA.png" /><figcaption>Menu item with box collider</figcaption></figure><h3>About the “Fire1” button</h3><p>It is important to note that you can find every kinds of articles about how you need OVRInputModul or some other library to handle the default controller of the Gear VR, which is the touchpad on its right side, but you actually don’t. The touch events are registered as if the “Fire1” button was pressed and you can simply handle them with Input.GetAxis or Input.GetButton in your Update method.</p><h3>UI design for VR</h3><p>The result of the above procedure is a UI that has the same look as any other UI created with Unity, but you don’t have to integrate half a dozen VR specific scripts to make it work, which might be totally acceptable for others, but was too complicated for me. UI design for VR has slightly different principles though, due to the different perspective of the VR camera. If you are interested in more details I highly recommend you to read <a href="https://docs.viromedia.com/docs/design-principles">this article</a> where they explain the differences compared to traditional UI design, and you can read about other very important rules in design for VR as well.</p><p>Long story short, the wide, flat UIs look cool on a flat screen, but in VR you have a 360 degrees circle around you instead of a flat screen before you and the wide, flat UI is not the way to go. Besides that, you translate distance completely differently in a VR space, which also makes it a bit hard to properly place wide UI elements.</p><p>The ideal place for a UI in VR is somewhere between 5 to 10 meters from the camera in a 90 degrees angle or so. It cannot be too tall, too, because moving your head to be able to read what is high up or deep down is very inconvenient. The ideal solution would be to create a curved UI which is on the inner surface of a sphere with 5 to 10 meters radius.</p><p>Sadly, you have to be far more adept with Unity than I am to be able to do that, but luckily you can find amazing solutions in the Unity asset store if you search for curved UI. I don’t want to buy anything from the asset store while I am just doodling, so what I did was basically to divide and cut my UI canvas into three narrower canvases with the same height as the original big one, and rotated the two on the sides so that they face the camera, and it did the trick.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*pxl7L_jKWmhPZptgnKKm3Q.png" /><figcaption>The segmented UI with three canvases</figcaption></figure><h3>Text input with Gear VR</h3><p>This was again something I did not foresee, because it is so natural that you have a keyboard in some form, but if you think about it with Gear VR you don’t really have one. You obviously cannot use a physical keyboard, but you cannot use the virtual keyboard on the phone, too, because you are in VR. But since I needed a search box I had to figure out something. To be honest I didn’t check for any built-in solution (probably you can find some in the asset store) because I like the canvas + collider + physics raycasting combination so much, and I like to be consistent throughout my code and generally avoid <a href="https://blog.codinghorror.com/code-smells/">oddball solutions</a>. I simply created my own keyboard using a canvas and a few text elements, assigned all of that to a new layer called Keyboard, and created a few scripts to handle hover and click. So whenever the user clicks on a text input field, I pop up the keyboard, the user can provide text input by looking and clicking at the keys on the keyboard, and when they hit the “Done” button, I send the input text for processing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*dJUoNoEwrK59sM2z1d1mgg.png" /><figcaption>The world space virtual keyboard</figcaption></figure><h3>Advanced scripting</h3><p>To make things easier in your scripts you can create an abstract class, you can call it say MenuItemControl, with virtual methods for hover and click, where you can implement a default behaviour. Then you can create subclasses of the abstract class for the different UI elements and override the default hover and click behaviour based on your needs and attach those to your menu elements.</p><p>The benefit in doing so is that in your Menu Controller script, where you do the raycasting, you don’t have to know what type of element you hit, you just have to make sure that only your menu items are on the layer that collides with your ray. Then whatever you hit, you just get the MenuItemControl component on it (you can do that because subclasses can be found also as their supreclass) and call its hover or click method. This way you introduce inheritance in your scripts, which can be kind of an advanced concept for someone not familiar with object oriented programming, but you can avoid some long and probably nested if-else and switch-case structures in your raycasting code, and overall your code will be cleaner.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e3d02f671e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up the environment (Gear VR and Unity)]]></title>
            <link>https://medium.com/@naszrai.andras/setting-up-the-environment-233bcfc97446?source=rss-3e58b3b55920------2</link>
            <guid isPermaLink="false">https://medium.com/p/233bcfc97446</guid>
            <category><![CDATA[virtual-reality]]></category>
            <category><![CDATA[samsung-gear-vr]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[game-development]]></category>
            <dc:creator><![CDATA[Andras Naszrai]]></dc:creator>
            <pubDate>Mon, 26 Feb 2018 18:47:11 GMT</pubDate>
            <atom:updated>2018-02-27T17:33:26.131Z</atom:updated>
            <content:encoded><![CDATA[<p>This is the first story in my series about <a href="https://medium.com/@naszrai.andras/project-annaroza-8bee42d6078b">Project Annaroza</a>, and it will be about setting up the development environment.</p><p>When you start a software project you typically make some decisions about which technologies will be used, like programming language, IDE, database engine, things like that. In this case it turned out that the most important thing you have to choose is your game engine, because games are not written in pure code, like other software. There are highly specialized tools and frameworks to help artists and game developers to focus on the game instead of the code, called game engines. For those who are experienced with at least one engine the decision might be easy, but for a newbie like me this is a tough question and I wanted to do my homework before jumping into something.</p><h3>Choosing a game engine</h3><p>I didn’t want to buy an engine, given that it’s a hobby project and it’s far from certain that it will actually result in something. I have the most experience working with java, so if it can be scripted with that, that’s definitely a plus. If java is not possible, then C# or maybe javascript are preferred. I just don’t like C and C++, not that they are bad or something, I just simply don’t trust myself enough to free up all that memory... Then the third criterion is because I am a programer and not a game developer or an artist, I needed an engine which heavily supports scripting and has a very steep learning curve. And last but not least, the amount and quality of documentation, trainings and support was definitely a very important item on my list.</p><h3>And the winner is…</h3><p>I have started by heavy googling, looking up phrases like “best free game engine” or simply “game engine”, just to get a view on the options. I’ve found basically two types of articles, those that were praising some smaller game engine and those that talked about the trinity of Cryengine, Unreal Engine and Unity. I decided that small engines are probably not for my case, so I focused on the big ones.</p><p>The wisdom I could find on the internet said that Cryengine has the best graphics but worst support and learning curve, Unity has the best support and flexibility, it’s the easiest to learn, and it is somewhat behind the other two in terms of graphics, while Unreal Engine is somewhere in between. I have tried all three and decided that I agree with what they say on the internet, at least regarding flexibility and learning aspects. Cryengine and Unreal Engine can be scripted in C++ and probably Lua, which are not my favorites, so at that point it was quite obvious that I should go with Unity.</p><p>Then I heard about Lumberyard, a new AAA game engine developed by AWS, whom I like very much for the cloud services they provide, and wanted to give it a shot. Well, it is in beta. Not that it’s bad or something, I’m pretty sure it will be a great game engine since it is based on Cryengine and developed by AWS, it is simply not ready yet and clearly has issues.</p><p>I went with Unity.</p><h3>Other tools</h3><p>It will be an online multiplayer game, so I will have to store the user data somewhere. After some googling I found that there is no preferred DB engine for Unity, and I have to solve that for myself, which made it quite simple. I very much like AWS’ cloud services as I mentioned earlier, so I decided to use the classic API-GW + DynamoDB combination, which can be accessed through HTTPS using the builtin WWW class of Unity3d. The important part here is the API-GW, which gives you the option to access your database through a regular REST API. Of course the DynamoDB has its own REST API, but I’m not sure what I’m going to need from my DB later on. I might want to switch to a relational database at some point, and the API-GW gives a good abstraction layer and makes it possible to swap database without having to touch the game code. I tried it, and it worked like a charm.</p><h3>Selecting a VR platform</h3><p>It took some thinking, but here is how it went down… I am not sure where this project will end up, as I said many times already, so right now I don’t want to spend hundreds of USD on VR glasses, but I need something for testing the game. There is the Cardboard from Google, but I want to be more serious than that, no offence meant. I happened to have a Samsung phone that is compatible with the Samsung Gear VR, and I trusted that the products of Samsung are working flawlessly together, and well, it is powered by Oculus. Oculus is famously well supported in Unity, so I thought: what could go wrong? Gear VR it is!</p><h3>Would I choose a different headset now?</h3><p>It was around half a year ago when I chose Gear VR, and there have been some interesting changes on the VR landscape that deserve a few words. First of, there is a fair rival for the Gear VR, called Daydream, from Google. It supports a wider range of Android phones, not only Samsung models, and it is somewhat cheaper.</p><p>There is also an upcoming line of standalone VR devices, coming for an affordable price, like Oculus GO and its competitors like Lenovo Mirage Solo and a couple of others. These seem to be a good option if you don’t have a high end Android phone, and I probably want to get one as well.</p><p>If you are interested in the topic there are tons of articles about it all around the internet, read on!</p><h3>Before the actual setup guide</h3><p>It is very important for me that you understand the actual message in this post. I am not saying that you should choose Unity and Gear VR, and I am not saying you shouldn’t. That’s not the point here. I cannot tell anyone which game engine or VR headset to use or target, and none of them pays me for the advertisement, so here is my advice…</p><p>Do your research, check your options, try as many as you can, yes it is a long process, it took me like six months, but that is the only way to make a proper decision. It is easier to follow in someone else’s footsteps sometimes, but your preferences and your project might be totally different, so find out for yourself what is best for you and your project! And if you did, and if you did it the hard way, be a nice guy and write a guide about it for the benefit of the community!</p><h3>Setting up Unity for Samsung Gear VR</h3><p>Oculus support is kind of integral in Unity, but my primary target is Samsung Gear VR, and although it is powered by Oculus, it runs on Android mobiles, so that adds somewhat to the complexity. I may be silly, or maybe some things are evident to others which casued me some headache, but I could not find a step by step guide that just worked. I have found several, slightly different guides from which I managed to learn the necessary steps and created my own guide.</p><ol><li>First you need Unity, <a href="https://unity3d.com/">here</a>(I have checked the option to install Oculus SDK along with Unity, but I am actually not sure it is needed)</li><li>Essentially you will develop for Android, so you need a Java Development Kit, aka JDK. It is very important that you note down somewhere for yourself where you installed the JDK, because you will need that path later on. You can get one from <a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">here</a>.</li><li>And of course you need an Android SDK, which was a bit trickier for me. The easiest solution was to install Android Studio, which also installs the Android SDK (to be honest I don’t remember why I did it this way, but I did). You can get it <a href="https://developer.android.com/studio/index.html">here</a>.</li><li>If you start Android Studio (do not create a project!), there is a dropdown on the welcome page called Configure. In that dropdown select Project Defaults, then Project Structure, and there it is your Android SDK location. Note that down next to your JDK location!</li><li>Open up Unity and create a new 3D project</li><li>In Unity editor, go to Edit &gt; Preferences, that pops up the preferences window. Look for External Tools, and copy your JDK and Android SDK locations to the appropriate fields. You can close the Preferences window, you don’t need it anymore.</li><li>Then again in Unity, go to File &gt; Build Settings, that pops up another window. In the platform list select Android and click the Switch Platform button. (If you do this on a non-empty project this takes time, be patient!)</li><li>When the platform switch is completed change the texture compression to ASTC to support Gear VR. It is a mobile platform and a VR platform, so you need this compression for better performance as far as I understand, but I don’t know the exact implications, and you can probably experiment with other compressions as well. This one worked for me.</li><li>Now click on Player Settings, make sure the android settings are up in the Inspector window, and look for the Other Settings section. Here you have to set basically three things, the Package Name, the Minimum API Level and the Target API Level.</li><li>The Package Name should be something like “com.something.something”, e.g. com.my.game. Until you just play around this does not really matter, but you should probably use proper package names if you want to release your game!</li><li>Set the Minimum API Level toanything over 19. I used 24, which is Android 7.0.</li><li>To make it simple the Target API Level can be the same as the minimum.</li><li>Then at the bottom of the player settings there is a section for XR Settings, here you have to check the Virtual Reality Supported checkbox. This will change things like how cameras behave in your game to provide the stereoscopic view for the VR experience and probably a couple of other things like compensation for chromatic aberration. Now you have to add Oculus to the list of Virtual Reality SDKs with the little plus sign and you are done here.</li></ol><p>You are almost ready, so just bear with me here! The next thing you need is an Oculus signature file, to get that do the followings</p><ol><li>You will need your device ID. It is confusing because it is not the IMEI and not any other number or ID that can be found in the Settings on Android, it is something else and you need app to get it. So get the Gear VR Device ID app from Play Store, install, open and there you’ve found your device ID. There are probably other apps that can get your device ID, I tried a few, and for me only this one worked.</li><li>Register and log in on Oculus’ website <a href="https://developer.oculus.com/osig/">here</a>.</li><li>Enter your device ID and download your signature file.</li><li>Now in Unity, under Assets, create a Plugins folder, and an Android folder inside that, and another Assets folder inside that, and copy your signature file there. If you did it right, your signature file is in Assets/Plugins/Android/Assets</li></ol><p>Now your development environment is ready, and the only thing you need to do is to put your phone into developer mode. It is kind of a funny process, here is how it goes</p><ol><li>Open up Settings on your phone and go to About Device &gt; Software Info</li><li>Here you have to tap seven times on Build Number, then turn the phone over, and it’s very important, around the short edge, 5 times, then say “dev mode“ 3 times… ok I am just messing with you, but seriously, you need to tap on Build Number seven times. You will know you are doing it right when after like the third tap you start seeing popup messages about how many taps you have left until developer mode enabled.</li><li>Now again open up the Settings on your phone, and you should see a new menu called Developer Options. Go there, and enable USB debugging.</li></ol><p>Finally you are all set up for Gear VR development, so try it!</p><ol><li>Do something in your Unity project, place a cube in front of the camera or something</li><li>Connect your phone to your PC with a USB cable</li><li>In Unity go to File &gt; Build &amp; Run</li><li>Now Unity compiles your game, signs it with your signature file, copies it to your phone and starts the app. It is possible that you get some errors during compile and if you do, google them, you will most certainly find something on Unity forums or somewhere!</li><li>If you see a request to place your phone into the Gear VR, you should do that and see how beautiful your cube is in VR!</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=233bcfc97446" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Project Annaroza]]></title>
            <link>https://medium.com/@naszrai.andras/project-annaroza-8bee42d6078b?source=rss-3e58b3b55920------2</link>
            <guid isPermaLink="false">https://medium.com/p/8bee42d6078b</guid>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[virtual-reality]]></category>
            <dc:creator><![CDATA[Andras Naszrai]]></dc:creator>
            <pubDate>Sun, 25 Feb 2018 18:17:36 GMT</pubDate>
            <atom:updated>2018-02-25T18:17:36.617Z</atom:updated>
            <content:encoded><![CDATA[<p>I have recently started a game project at home, for fun, without being qualified for such a project. After a few weeks of messing around I thought it would be even more fun if I documented it in the form of weekly posts, just for everyone to see how I stumble across the minefield of game development.</p><h3>Why am I not qualified?</h3><p>As I wrote in my bio I am a software architect and I am working in software engineering for almost 10 years. I have always been a big fan of video games ever since I first played Prince of Persia on a PC which was probably an IBM 286 or 386, for whoever still knows what that means. I was 7 years old at the time, and played lots of video games since that. When 3D games started to improve in the ’90s and I became somewhat bigger I always thought it must be so cool to create a game like those, and maybe if I learn enough I can make one myself. I was in highschool when I wrote my first game in Turbo Pascal, after one year of programming classes. It was nothing fancy, no 3D graphics, actually no graphics at all. I just used the 90×25 character matrix that was the default, non-graphic display in Turbo Pascal, wrote A at the start of the first line, B at the start of the second line, C and D in the next two, and I prompted the user for a bet on which one will be the winner. When the user placed his bet the race started, and the game moved each character towards the right side of the screen with a random amount of positions every second. In my defence computer programming in my school at that time was about the implementation of mathematical algorithms for sorting, interpolation and stuff like that, internet started to be a thing in Hungary (where I lived and live ever since), so I had no possibility to learn game design or computer graphics or anything I could use to make my game pretty. So it wasn’t much, but it had the feeling of a game. After that basically life happened, I went to study software engineering on a university, then I had to find a job and make a living and I just forgot about my ambitions as a game maker. Then suddenly 10 years later here I am, I still have no experience in game development, I know nothing about computer graphics, but at least I am quite good at software engineering.</p><h3>What is the game about?</h3><p>I was happy with my life and probably travelling home from work when this idea of a new MMORPG formed in my head. I started to work out the design, present the idea to my friends and everyone said it would be the best game ever created. I tried to get investors to get funding and be able to hire the 20 people I needed, but nobody is really eager to give 2 million USD to someone who has no experience in the video game industry. I have also considered Kickstarter and other crowdfunding options but I have basically nothing but my idea, so it’s highly unlikely that I could convince 100 000 people to donate me money. So I thought let’s do something smaller. I decided to make a turn based strategy game… that is online multiplayer… and in VR. Just to keep it simple.</p><h3>Why do I think it is interesting for others?</h3><p>Maybe others are in the same boat, maybe others can learn from my mistakes, maybe I can explain things that experts think are evident, but ordinary people like me have absolutely no clue about. And ultimately, I think a blog is not about things that interest people, it is about things someone wants to write about.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bee42d6078b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>