Jump to content
  • Advertisement
  • entries
    44
  • comments
    19
  • views
    2432

Day 36 of 100 Days of VR: Getting Our FPS Game Running in VR

Josh Chang

641 views

Welcome back to Day 36! Yesterday we set up our mobile device to be able to play VR device and there’s nothing quite like that experience, especially if you’re the one that “made it”.

If you’ve made it this far in the journey, but you haven’t tried using the Cardboard or other VR devices, I highly recommend trying it once!

Now… with my pitch out of the way, let’s talk about what we’re going to do today!

We finally started working in VR, today, we’re going to try and convert our simple FPS into a VR experience.

This will be a multi-day progress. Today, I want to:

  1. Do some Asset clean ups for our app so we don’t have to spend forever building
  2. Set up our Google VR tools
  3. Play our game

Getting the Project GitHub Repository

Before we get started. I realize that not everyone (or anyone) followed me step by step to get to Day 36.

In our Simple FPS game, we have reached a complete prototype so I’ve decided to make a Github Repository of our game before we start adding the VR components in. Specifically, after doing some manual cleanup work in Step 1.

Now anyone can start following along to build our VR application.

You can find my Simple VR First Person Shooter GitHub repository here.

Step 1: (FAILED/SKIP) Clean Up Un-Used Assets

If you haven’t tried switching to the Android platform in our simple FPS game, you might notice, that it… takes… FOREVER.

I’ve tried building the app (and I waited 10+ minutes). Thank goodness for the Unity previewer, I would not know what to do if I had to build my app on my phone every single time!

Luckily, I found that Google/Unity does have a solution for this. Google has Instant Preview. Unfortunately, which loads the game into our phone while also playing on the editor. The bad news is that this only appears to be for the Daydream Viewer so I’m going to hold off for now.

However, let’s see what we can do to optimize this!

When I say optimize, I really mean get rid of our un-used assets! Looking at what we have, we have 1 GB worth of files! That’s not good!

IMPORTANT NOTE

Unfortunately, this didn’t exactly work. I tried to export all our dependencies and then import it into a new project and there were some problems.

It turns out, things like Layers and Tags do not get preserved so if we wanted everything to work, we had to manually add everything back in.

Instead, I used the files I exported into a new project as a reference and then manually removed assets from a copy of our project (that’s what I get for not having source control!)

Also from testing with a before and after build time, I believe that un-used assets DO NOT improve our build and runtime, so the only useful thing that came out of Step 1 was that I:

  1. Cleared some clutter so we can find files more easily now
  2. Made the project smaller so people can download it from Github faster, so not a complete loss!

Step 1.1: Exporting our Assets

Let’s get rid of our old un-used files! How? Well, a quick search on how to get rid of unused assets in Unity.

All we need to do is:

  1. Select our scenes, which in this case is just Main
  2. Right-click and click: “Select Dependencies”
  3. Export our assets by going to Assets > Export Package… and save your package somewhere.

Warning: This will not export Editor scripts and plugins, which in our current situation, is not a problem.

Now at this point, we have 2 choices:

  1. Delete everything and re-import the assets that we exported or…
  2. Create a new project and import our exported project

I’m going to do the 2nd choice and make a new project.

Step 1.2: Importing our Exported Assets

We’re going to create a new project and import everything we just exported. To do that:

  1. Select File > New Project…
  2. Call your file whatever you want, but I’m going to call mine First Person Shooter VR

And now we’ll have a fresh new Unity project:

Now we need to re-import everything we exported.

  1. Go to Assets > Import Package > Custom Package and find the .unitypackage that we just created
  2. Afterwards, just choose to re-import everything

Step 2: Set Up Our VR Tools and Settings

The next thing we need to do after we have our new project is that we need to import the Google VR SDK and configure our Unity.

I’m going to be lazy and just refer us to Day 35: Setting Up Google Cardboard In Unity.

Just do the exact same thing in downloading the SDK and setting up our Unity configuration.

Note: In the repo, I already included Google VR SDK 1.100.1 and the necessary changes for Player Settings. I assume the PlayerSettings are project-based and not computer-based, but if it’s not, follow the instructions in Day 35.

Step 3: Playing Our Game

At this point, we should be almost ready to play our game!

At this point, we have:

  1. imported the Google VR SDK
  2. Switched to the Android platform
  3. configured our PlayerSettings to the appropriate settings to run a Google Cardboard app

The last thing we need to do that’s specific to our Game Project is that we try to build in Build Settings… we run into a problem to resolve incompatibilities between Color Space and the current settings.

To fix this, we just need to change our Color Space from Linear to Gamma. To do that:

  1. Go to File > Build Settings > Player Settings > Other Settings > Color Spaces
  2. Change Linear to Gamma

With this setting in, we’re ready to build our game.

To do that, I recommend running the development build to build our app.

Contrary to what the name sounds, development build DOES NOT make our build faster, instead it allows us to have access to useful debugging settings gives us access to the Profiler and Script Debugging.

Now once you’re ready, let’s build our game! Make sure your phone is connected to your computer.

  1. Go to File > Build Settings…
  2. Enable Development Build
  3. Click Build And Run
  4. You can save the APK anywhere.

Now enjoy the long wait~!

Conclusion

That’s it for today!

Today we cleaned up a bit of our project and then set up the game so that we can run our app directly from our phone.

The build is long and horrendous, which is unfortunate. There are a couple of solutions available, but I’m going to look at them some other day.

We can also play the game directly from Unity. If we were to play the game right now, we’ll encounter problems.

From a technical limitation:

  1. We can’t move
  2. We can’t reload anymore

To actual technical problems:

  1. The enemies are all black color
  2. We don’t have any of our UI’s anymore

I’ll have to investigate these things and solve them one at a time, but I can finally say, we’re here! We’re finally working in VR!

That’s what we’re going to try and tackle the next couple of days. It’s going to be a fun one!

Day 35 | 100 Days of VR | Day 37

Home



0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Advertisement
  • Blog Entries

  • Similar Content

    • By Nick Griffith
      I'm making a 2d platformer game as a learning experience, and I need a character and some backgrounds.
      This game will make minimal revenue, because it'll be a free mobile game.
      I'll give you more details if you respond.
      Thanks.
    • By GameDev.net
      Search GameDev.net directly from the Unity Editor with the GameDev.net Search plugin!
      Customize your search for all content on GameDev.net, only the latest, or the most relevant. Or, narrow your search to specific GameDev.net content:
      Blogs Articles Forums News Contractors Projects and more!
    • By Heretic Arts
      Hello, 
      We are an American based videogame development team that crafts games utilizing neural networks, handcrafted art, studio quality audio, and immersive storytelling to provide the player with an unforgettable experience. Our current team comprises of a Software Engineer, Designer, Producer, Audio Engineer, and a systems admin. Obviously we are missing an art staff! Now, that being said, we have outsourced our concept art for the game to an experienced artist. We are wanting talent to join us to take it the rest of the way with animation and art. If you are interested in joining the team and feel that you are ready to work along a committed team, send a sample of your work and contact information to HereticRecruitment@HereticArts.com. 
      Job Specifics: 
      General: 
      Unpaid. This is normal. We all have fulltime careers outside of the team, but if there is money to be made upon release, it will be split evenly - no questions asked.  All expenses are paid by Administrative Team (GSuite account). So no worries - We want someone to join, have fun and create with us! Expectations of meeting weekly (via internet) and taking direction from producer.  Open minded  
      Skill sets: 
      Experience in designing and creating character art.  Full adobe suite.  Maya experience preferred.  Experience with developing for the Unity Engine.  Willing to work with design team to incorporate their ideas into art.  Knowledge of game design documentation and how it pertains to art creation.  In depth sprite animation knowledge. 
    • By GameDev.net
      GameDaily.Biz spoke to Improbable about its new shortcuts to multiplayer game development for Unity and Unreal. 

      Improbable helps game developers build believable online worlds with its bespoke technology, SpatialOS. Now, that task is much easier and accessible for those building games on the technology with the recent release of the SpatialOS Game Development Kit (GDK) for Unity. With these kits, Improbable hopes that developers find it easier to create vast, dynamic and unique worlds.
      This GDK for Unity includes a 200-gamer, first-person project that allows developers to experiment and tinker with their ideas for what their vision of a multiplayer game will look like.
      GameDaily.Biz met with Improbable’s Head of Product Marketing, Paul Thomas, and Head of Comms, Daniel Nye Griffiths, to speak about the SpatialOS GDK for Unity, as well as the upcoming launch of the SpatialOS GDK for Unreal Engine.
      In its first week, the SpatialOS GDK for Unity achieved over 2,000 developer sign ups to use it. “What we're trying to do is basically make it really fast for people to build multiplayer games,” said Thomas. “It comes with all the multiplayer networking so that developers don’t have to do any multiplayer networking. It comes with feature modules to allow [easy] solutions to common multiplayer problems, like player movement and shooting. And it comes with a cool starter project where you have 200 players in a free-for-all scenario. You can obviously use the power of SpatialOS to scale that project up to more players, with NPCs, and things like that. It gives people a really good base to start building multiplayer games.”
      There are several games currently in development or early access that utilize SpatialOS. The first into Early Access was Spilt Milk Studios’ Lazarus, a space MMO where the player becomes a pilot in a universe that ends every week, complete with a map that’s twice the size of Austria. Additionally, Bossa Studios released its survival exploration game Worlds Adrift into Steam Early Access earlier this year.
      Also using SpatialOS is Scavengers from Midwinter Entertainment, a studio founded by former 343 Industries studio head and Halo 4 Creative Director, Josh Holmes; the game is heavily inspired by his Halo 5: Guardians’ multiplayer mode, Warzone. Right alongside that company, Berlin-based Klang Studios is working on Seed, a simulation MMO that, according to its developers, lets players “interact and collaborate to create a world driven by real emotion and aspiration.”
      According to Thomas, for those looking to use the SpatialOS GDK for Unity, there is no limit to  what their games can do with Improbable’s tech.
      “What we're doing is expanding the possible gameplay you can do. Traditionally, when you make a multiplayer game, you're constrained by one single server. So you can say you have a 64-player game with a handful of NPCs or you could have a world that's 3km by 3km. With Spatial, you can go beyond that, test a much broader canvas to start thinking about different gameplay.”
      “You can go for a massive online persistent MMO with 10,000 players and hundreds of thousands of NPCs, something very, very vast and big like that. But you can also have smaller experiences. For example, there's a lot of interesting space in just extending what you see in the Battle Royale genre and session-based gameplay.”
      Thomas continued: “Our partners at Automaton have a game in development called Mavericks. The interesting thing there is they have a Battle Royale with 1,000 people, but what I really find interesting is the gameplay mechanics they've put in, like footprints so you can track people. They've added a cool fire propagation mechanic so you can start a fire that  spreads across the map and changes the world. Or you can add destructible buildings and things like that.”
      “So I think even looking at smaller scale games, we add a lot of value in terms of the new gameplay you can start adding. I'm just interested to see what people do with this extra power - what they can come up with.”
      While Battle Royale games and MMOs are obvious standouts for genres that best fit with SpatialOS, Thomas introduced some other ideas of genres that could benefit from the technology.
      “I also think there's a space for very interesting MMORTSs as well,” he said. “An RTS where you have persistent systems, like telling AIs to do things and then coming back to them a week later and seeing what's happened is an interesting space.”
      “I also see interesting mobile experiences that could come up. Having these worlds where you lay down some interesting things and then come back a few weeks later to see how they've evolved and changed, and the massive player interaction. Say for example with Pokemon Go, we can actually roam around the world and battle on the streets. I can see something like that working very well. Again, these are just ideas we've had and talked to people about. It's about giving people that flexibility and the ability to explore these ideas.”
      Klang’s Seed
      Griffiths added the possibility of events in a game that will have a massive, rippling, and lasting impact on its world as something that has people excited. One example he gives is how someone on one side of the map can do something that’ll have a knock-on effect for the rest of the world in real time.
      “There's a whole bunch of different angles you can take, some of which are about much larger player numbers or a much larger map, but there are other things you can do which are taking a relatively constrained game experience, a smaller map, a smaller number of players and adding richness to the game as well.”
      In fact, this is something that Thomas refers to as a “persistent in memory database,” meaning that for every object in the game world, there’s a history. Two examples cited by Thomas: “...a player could chop down a tree and that tree stays disappeared forever. Or a player can kill a big monster that was raiding a town and that town no longer gets raided by that monster, and this changes the dynamics of the world. Worlds can have a history. That means players can have a lot more meaning in these MMO worlds.”
      “Normally in MMOs, they're kinda like roller coaster rides: you go into a dungeon, you kill the boss and that guy respawns. It all resets,” Thomas continues. “But in Spatial MMOs, you could have these persistent effects that should change the gameplay meaningfully for all the rest of the player base.”
      “The other one I think that is interesting is the level of dynamism that you could have. So because you can have so much more server-side compute, you could potentially have NPCs roaming around the world changing their mind and deciding all of a sudden, 'oh, we're going to attack this player's base' or 'we're gonna go attack this town' and they have a lot more range and emotion and intelligence to them that you'd not see in other MMOs.
      “Normally in MMOs, NPCs sit there tethered. You go near them and they come and attack you, you run away, and they go back to where they were. In a Spatial MMO, that NPC can trace you across the whole map or a group of them can decide to get together and attack someone..”

      Bossa Studios' Worlds Adrift
       

      Next week, Improbable plans to launch its SpatialOS GDK for Unreal Engine, which will have a big focus on ease of use for access to Unreal, as well as a big emphasis on porting your projects to SpatialOS.
      “One of the things we'll be trying to push is a porting guide so you'll be able to take your existing Unreal game, move it onto SpatialOS and then you can grow to expand it with new and extra gameplay,” says Thomas. “ You can bring across your existing Unreal game and it feels very, very native and similar to Unreal if you're familiar with Unreal.”
      Griffiths continued, explaining how testing these experiences includes free cloud deployments, to a certain point. “If you're developing in SpatialOS in other ways, we provide a sandbox environment so you can get your game running. When you’re happy, you can port it over and sort of experiment with it in a free sandbox environment with a small number of cores to get started.”
      Based on what we learned, Improbable’s SpatialOS GDK for Unity will give developers enhanced flexibility to produce more in depth and engaging videos games. That said, we look forward to catching up with the company in the near future to see how this exciting technology is being used in the different games that we play.
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!