Sunday, November 6, 2016

Changing Perspective

This week we started developing for EVR's first mini game. This brings me to a quote that a wise person once said: 'pics or it didn't happen.'

Screenshot 'To Prove We Are Really Developing Things' Sunday:




While Rashi Abramson and I were developing together in collaboration mode as part of Unity's new Beta program (Version 5.5), these are some of the questions we ran into and solutions discussed:

How do you compensate for testing gameplay without a 3D character to start with?


  • Here we used the roll a ball character for now and changed the camera rotation, height and angle to show a first person perspective when playing the game.


Speaking of camera angles, when you are moving in different directions, how are you able to look at your surroundings?


  • For the roll a ball tutorial in Unity, there is a single main camera that looks out in one direction the entire time. An idea I had, was what if we had four cameras instead of one above the main character, each one facing a different cardinal direction and then switching to that camera view when a key input is made?
  • The camera perspective seems to be one of the trickiest components of game play that I had not anticipated. For example, when the camera is far away from and facing the main character (as in a third person perspective) and you go too near the edge of the world, you get this weird view of what's outside the border (oblivion if there's nothing). Maybe some of you have experienced this in games before?
  • Alternatively, if the camera is too close to the character, you may not have a clear shot of the periphery, this is tied to spatial uncertainty leading to confusion and frustration. For example, if you reach a wall and that is all you see, it will be difficult to think about which way to turn because you have less cues from your environment. 


At the moment, it is possible to see beyond the green ground that we are playing on, into the gray developer's oblivion. How do we change that?


  • I haven't looked into this yet, though my initial hypothesis is that there must be some kind of spherical atmosphere you can overlay onto the plane. Some kind of image background that will help the environment tie together.


Are we going to see a VR game soon?


  • Our plan is to start out as a 3D mini game for the PC and hope to transform it into a VR game once it's ready.


What's the difference between a 3D and Virtual Reality game?


  • 3D games are played off of a screen, where you are the spectator. Whereas Virtual Reality involves wearing a sensory device such as a visual headset that has tracking sensors, which record your head movements and allows you to become a participant in the game. What you see when wearing these goggles is meant to mimic a human's field of view (114 degrees) through binocular vision. This imitation of the field of view tricks your brain into thinking you have been transported into an alternate reality. This can be very immersive and sometimes scary as it can feel a little too real at times. Leap Motion is another cool add on device placed on the front of a VR headset that allows you to use your hands to manipulate objects in the game, such as pulling levers or turning a wheel. One of the coolest things I enjoyed with the Leap Motion was actually throwing around game objects including characters and watching their emotional expressions change from calm to frightened as I picked them up. This all adds on an extra layer of mimicking reality through manipulating your surroundings.


Tuesday, November 1, 2016

Finishing Up Roll a Ball - Part 4

Hello and welcome, today we will wrap up Unity's first tutorial picking up from 'Displaying Score and Text'.

Here we add a counter to keep track of how many game objects are collected and also display the text of the score and a message whenever the game is over.

Adding a Counter:


To display text, we go to the heirarchy create menu and click on UI --> Create and voila:

AHHHH, that is too big.


Like other objects, we want to reset the transform to origin. For the UI element, instead of a regular transform box, we see the Rect Transform. This is different as it has to do with anchoring and positioning.


Zoomed in:


Now if we want to change the position of the text from the center middle of the screen, we can click on the Anchor button and now get to select from a number of options. Here we select top + left after holding down Shift + Alt.

Original Anchoring


Changed To Show Text at Top Left Corner of Game Screen:

The last step was to add a Win Text message for when all the game objects are collected.

Adding a Win Text:


Here we just repeated the steps from above, except positioned it a little offset in the positive y direction from the player object.

Building / Deploying the Game:


Then you can build your game for an OS by clicking on the executable file.




I was surprised with how easy it was to deploy for different operating systems. The default option was PC, Mac, and Linux Standalone.

They have options for mobile as well.

Here is the final game:


Completing this first tutorial was a lot of fun and has given me a lot of ideas on what I can include for my own game. Look out for the next tutorial review!


Sunday, October 23, 2016

Pushing Forward in Roll a Ball - Part 3

Before we jump back into the first Unity tutorial, I wanted to go over some things I forgot to mention last week.

That is...I finally figured out the view controls for Unity! The problem was I clicked on one of these spokes shown below, which then takes the camera perspective and places you directly facing that axis direction. So the green spoke with a 'y' on top, will give you a birds eye view (above the center of origin) of everything down below. If you click on the blue 'z' spoke or red 'x' spoke, you'll get a side angle view.

view axis controller

y-axis view

x-axis view

z-axis view

 negative y-axis view

Now my biggest concern was when you switch into these views, there is no obvious way of going back to the way you were viewing before, such as looking down but an an angle (this shows more of the scene). It took a massive amount of clicking to figure out that you had to select the camera and then double click on a Mac or right click on regular mouse that turns the cursor into an eyeball. Then you can drag that 'eye' in any direction until you reach your preferred viewpoint.



Why didn't I just google what the controls were for adjusting the view? This felt like an intuitive problem and I wanted to figure it out on my own. Sometimes I'm stubborn like that.

Today we are picking up from section Collecting the Pick Up Objects.

Things that we would play around with include setting a trigger to our game objects, so when you collide with them, they are set as inactive and removed from the scene.

Some other things that were changed in the tutorial include the following...

Script side functions for player script:
-CompareTag
-SetActive

Dashboard side, check off box:
-IsTrigger

Add Physics component to our Pick Up prefab:
RigidBody
-Gravity
-Kinematic



Afterthoughts:

Now when thinking about how am I going to apply this knowledge from the tutorials, to creating a game that many users can play, some questions occur:

When you are creating a game, are you generating everything on one scene? Or are you maybe tying together separate scenes?

For example, you are in a room with closed doors and opening one door will cause a loading screen and then it call another scene to open. 

There are so many different kinds of video games out there. I would think they are all programmed quite differently.

I'm thinking of large mapped regions and how to program the game in a way that doesn't bog down the server and cause delays or even crashes.

Sunday, October 16, 2016

Let's Get This Ball Rolling - Part 2

This is a continuation review of the Roll a Ball Unity tutorial: 'Setting up the Play Area'.

Today's Goal: Create a wall so that the ball or 'player' does not fall off the 2D plane or 'ground' and also to populate the ground with objects the player can pick up.


Tip: Each new game object that is created needs to have its position reset to origin or 0,0,0.


Otherwise you will have created an object that is way out there in space and you will have a lot of trouble finding it :-p

One neat thing is, just how there are project directory folders to organize content under the 'Project' tab...Game Objects can be used to store other Game Objects meaning they can be used as folders.

Back to wall building, we do this by building one wall at a time...


Until we get this:


Now that the four walls are up, we can watch the ball collide with them:


Now we are ready to add the game objects or cubes, then start spreading them around the play area.

We do this by creating a new 3D object named 'Pick Up' and raise it 0.5 in the Y axis, so that it levitates off of our plane.

Wait...what is this? O_____O

(Instructor's cube on left, mine on the right)


Am I missing something or are my laptop graphics that bad? Let's find out.


Hmmm...

In the future, I'll be working off of a desktop with upgraded graphics for developing purposes and will make sure to list those specs (as well as the RAM, processor, etc.).

Back to our game objects!

Last week we used physics to make the ball roll. Now we are adding physics to the pickup objects to make them spin and look interesting.



How will this happen? We write a script to change the Rotation transform X, Y, Z position by one point with each frame that updates.

Then we sit back and watch the magic happen.


From there, we make this cube a prefab and set it as the parent to all of the cube objects (or 'children') that we create. When changes are made to the prefab parent, all of the child game objects will be updated at the same time.

Rules to Follow:
"Test early and test often."

Sunday, October 9, 2016

No Better Time Than Now...Moving the Ball - Part 1

There is no perfect beginning to any great adventure. Looking upon this enormous blank canvas, hand quivering with hesitation of applying the first stroke.

Planning for Enodia VR began in January, 2016. What is Enodia VR? It is nothing but an idea at the moment. Though I have been working towards making it an actual product. Until I have something more concrete, I will wait to share those details.

While at CoderDojo yesterday, I had some free time since not many kids showed up, so I decided to take the plunge into Unity.

Roll a Ball Tutorial 1


There is the progress made so far. It looks like one of the main programming languages for this game engine is C#.

Programming the game physics is one of the coolest aspects of game development. Applying forces of movement and gravity to objects is incredibly exciting.

So far the learning curve seems steep. One of the challenges I would run into is accidentally changing the camera perspective to a sideview and then going back to the beginning of the tutorial because I no longer had a bird's eye view.

Every time I would start over, things did become easier as I uncovered more of Unity's features by exploring the buttons and remembering the steps, from changing the box layout to adding components and modifying their scripts / parameters.

One silly mistake I made was when I added the code for accepting user input from the keyboard arrows to move around the ball and kept hitting 'enter' and then 'play', only to find the ball wasn't moving. This was super frustrating, until finally I saw a parameter outside of the script itself that said 'speed: 0'. Well, that would explain it.

Sometimes learning new technical skills really exposes my primate genes. That is...the button mashing and blaming the computer when things don't go as expected. Then the lightbulb goes on and suddenly the world makes sense again.