My Portfolio

Showing posts with label Unity. Show all posts
Showing posts with label Unity. Show all posts

Thursday, December 2, 2021

December 2nd - Spatial Partitioning and Custom Playables with Timeline

My goal this week was to to improve the performance of my flock simulation by improving the main update loop. 

Spatial Partitioning

Currently, the main bottle neck is how I implemented the Separation method for the flock controller which needs to do a distance check against all of flocks in the scene. This quickly becomes really expensive because each additional flock added increases the number of calculations needed in update for everyone.

In order to improve this I wanted to try and implement Spatial Partitioning. How it would work would be to split the map into grids where the distance check for each flock would only be against the other flocks in the same cell and ignoring the ones outside of it.

Thursday, November 25, 2021

Nov 25th - Procedural Animation and Basic Shaders

I did some animation rigging during my last project with the Dune worm and I decided that I wanted to do a really deep dive into it. So far I've been having a lot of fun and feel like the animation rigging package could really help me create some great boss battles and more easily creating cinematic/scripted events. Here are some clips from what I've been experimenting with.

Walker-Bot

My first mini project was to try and create a walking 2-legged robot where the legs automatically move themselves after they exceed a set distance from the main body. It was amazing when I got it work and I could see the legs automatically animating themselves while manually moving the Walker-Bot around. Here is a GIF where you can see me manually moving the body with the legs procedurally animating themselves. 


Saturday, November 20, 2021

November 13th - My Team's VR Mario Showcase Project




During the PXR2021 Conference there was a goal of creating some sort of collaborative virtual reality project throughout the week. I wanted to participate because I thought this could be a fun short-term creative VR project opportunity. 

My team had students across multiple disciplines and background. Not everyone could meet at the same day/time and as a result it was only towards the last 2-3 days of the conference that we really got going with sort of VR project.

For my team we had a few students who really wanted us to help them create a Mario inspired VR experience. Using that as our creative theme and direction we made a Nintendo Mario themed Altspace world. 

Poster art by Dylan Coakes

Friday, November 19, 2021

Nov 14 - Performance and XR 2021 Virtual Reality Conference

I got an opportunity to attend the Performance and XR 2021 Virtual Reality Conference through a director at the Centre for Entertainment and Arts. The whole conference was centered around using Altspace as the VR venue. 

When I first tried VR Chat I remember getting motion sickness after a while of using it. Similarly I'm finding a bit of motion sickness in Altspace when using continuous loco-motion but I think I'm starting to build more resistance to it now. Either way, I do prefer using the teleport locomotion since I get far less motion sickness with it. At the moment I find both VR chat and Altspace to be pretty similar to one another.

I also built my first Altspace world as well.

Experiencing and Building worlds in Altspace

For my first Altspace world I decided to try and create a scene inspired from the big sci-fi movie Dune with a world that has a giant Desert Worm hopping around. 

This is footage from the Unity Editor where I first created the VR experience. However, I found that you can't just directly import the Unity scene into Altspace. There is a huge limitation where you can't use be uploading a scene that utilizes any custom C# monobehavior scripts. 

After experimenting for an afternoon, I decided to use Unity's Timeline sequencing to create this scene and trigger the sound and particle effects at the right time. Kinda sucks that you can't use scripting at all. Especially since I had spent the time rigging the worm using Unity's Animation Rigging which allowed for real-time animation. Regardless I was still able to pretty much deliver the full VR experience I intended for VR.

For the modeling I used Probuilder to create the Dune Worm.


If you want to check out this Altspace world you can using the world code : PKI578.


  

Friday, September 17, 2021

September 17th , 2021 - My One-button Game

This is my first 2D project. You can download and play my one-button game here : https://stevie57.itch.io/test

One of my classes that I'm helping in as a teacher assistant is Rapid Prototyping. Over the last week students in this class needed to create a working game revolving around the concept of one-button input only. I figured I could participate as well through creating my own one-button game which I have now completed.

==

My concept was a reaction/timing focused game where you need to catch the correct fruit using spacebar as the only input button. The correct fruit is randomly selected by the customer.


Here were some of my key personal goals for the one week project:

  • Playable build
  • Utilize Unity's new input system
  • Scene Manager using Unity Scene Assets/Scriptable objects
  • Implement Factory method for fruit creation
Playable build / Scope Management

I wanted to take an iterative approach where I would make a build as early as possible with extremely basic gameplay and then slowly add features and functionality in new builds. The goal here was to ensure that there was always a playable build that I could submit at any point even if it doesn't fully realize the project vision yet.

Version 1 - Prototype

I'm pretty happy with this approach and it worked well for this project. One immediate benefit was that it allowed me to identify and fix an error really early on with my scripts that was preventing me from building a playable game. The issue was with an editor script. The game plays and works perfectly fine while in Editor but fails when you try to build it. Trying to create an earlier playable build allowed me to troubleshoot this without the pressure of needing to submit it during the last day.


Utilize Unity's new input system
So far I really like Unity's new input system. However, I feel like there is still a lot to learn when it comes to using this and will need to continue to experiment with the input callbacks. 

Scene Manager and using Unity Scene Assets
I feel that my previous projects did not handle scene loading and managing very well at all. It has previously always turned into a mess with the different scenes that need to be loaded/unloaded. I tried creating my own solution but there was aspects of it that were beyond my ability to program at the moment.

Luckily, I found some online references to Ryan Hipple scene manager demonstration which I've been using since.

Implement Factory method/pattern for fruit creation
It was much easier implementing the factory pattern then I thought. However, I don't really see how using factor pattern process for fruit creation is better than instantiating Gameobjects using prefabs. Regardless, I'm happy I was able to implement a working solution of the factory design pattern.

Conclusion
Happy with my project and personally think its pretty amusing to watch someone play it as its pretty hard.

For Art, I ended up purchasing Aesprite to make drawing pixel style faster. It's been a pretty easy and fun to use tool.

I can probably also use scriptable objects more instead of assigning/injecting dependencies.

From a programming difficulty perspective it hasn't been too hard. I've been able to implement the designs and use my previous experience to quickly build this prototype.

However, the project is heavily dependent on events to communicate between systems. Towards the end this did become a bit of a mess and I'm going to try and better manage the complexity through better re-naming in the future.

Saturday, September 11, 2021

September 11th, 2021 - I've got a job now

I've been hired on as a teacher assistant for the Centre of Entertainment Arts in the Advanced Game Design program and I am now no longer job-less. 

Woo !

Just finished my first week as a teachers assistant(TA) and it hasn't been too bad. I'm helping out in mostly beginner programming classes. So far I'm enjoying it since I do find some enjoyment in teaching and I get to talk about programming which most people don't really want to hear the details about or understand.

However, the part that most excites me about my job as a teachers assistant is that I gain access to the programs library of different game design and programming courses and a chance to interact with experts and veterans who have created/shipped games. The game design courses should be pretty interesting to check out since I've only focused on programming so far. Hopefully, overtime this will make me a more versatile game developer and allow me to make better games.

I've seen some of the portfolio pieces for graduates from the advanced game design program and have been pretty impressed with some of them. 

I don't have any game projects to showcase today but here's a short experimental clip of a VR experience inspired from Inception. Inception is one of my favorite movies and I remember one of the most visually stunning scenes was when they manipulate the world physics in the dream world so that the city bends in on itself. My goal in this VR project was to recreate that effect and for me to see what it might feel like myself. 




Monday, August 16, 2021

August 16th - Field of view with gizmos combined with Linear algebra

Here's a short video on a NPC character changing their head direction to face the VR player when they enter their field of view. 

One of my main focus for the last week and a half has been on gaining a better understanding of linear algebra and learning how to use Unity's Gizmos/Handles for visualization. This was a short little exercise to put it all together.

Linear Algebra

The best resource I've found that has been the most helpful is a math series for game developers by Freya Holmer. The video series provides a great breakdown of math concepts such as vectors, vector normalization, dot-product/cross-product, local vs world space, trigonometry and more. I've also been supplementing what I learned during this series with the free linear algebra online courses at khan academy

I've been no means mastered the math but I now have a basic understanding of the concepts and most importantly know what to look up if I need it.

Design Patterns

I've also been learning/reviewing design patterns. The best resource for this has been Refactoring Guru. It's explanations are very clear with great examples in a variety of different programming languages. I can see myself revisiting this website again in the future for when I need a refresher on a specific pattern or looking for information.

Animation Rigging

I really like Unity's new animation rigging package. The ability to override an existing animation creates an endless opportunity for unique custom emergent animation in my opinion. This is especially the case for VR. I've played around with it quite a bit and its not too hard to use as well. 

I also did an older but still good course on Unity's Animator and animation controller. I'm not planning to specialize in character animation but at the moment I feel like I could do the basic work of setting up animations in Unity.

Thursday, July 15, 2021

VR Food Truck Prototype Game - July 15th

This is an overview of the VR Food Truck Prototype game which was built for Oculus Quest using Unity 2021. Recently we had to deal with a killer heat wave in Vancouver. During that time it was so hot I couldn't stand cooking in the kitchen and dealing with more heat so food was all about take-out and delivery. Thus the concept of VR food delivery game using a cannon to send you the food.

VR Food Truck Gameplay Trailer


Game Overview
This is a time based game so you are simply trying to get as high a score as you can before it runs out. You gain points by sending a sandwich with the ingredients the customer wants inside.

I like to think of this as a VR version of Overcooked which was a cooking game that I really liked.

Loading Scenes Asynchronously and Object Pooling
One of my learning goals for this project was to better manage loading within the game. To create a more seamless experience for the player I have a screen fade that occurs during game transitions. The screen fades to black and then levels are loaded asynchronously. During the period where the screen is black I have all the needed object pools and other game objects loaded. The goal is to make it so that any screen tearing/skipping or loading goes unnoticed by the player as a result.

Unity XR Toolkit and Action-based Input
This is my first time implementing Unity's XR Interaction Toolkit with the new action-based input system. I found that its pretty intuitive and not too difficult to use. I added additional functionality to the scripts to make this VR game work.

Sandwich and Topping System
The Sandwich system relies on a gameobject with a sandwich handler and gameobject with a topping handler. The topping gameobjects are created in an object pool at the start of the scene and retrieved from the pool when the player goes to grab a topping. How the topping interacts with the sandwich is simply through checking for the sandwich handler when the topping collides with other objects. If the topping collides against a object with a sandwich handler, the topping is set to inactive and calls the add topping method in the sandwich and passes on a string for what topping needs to be added.

The sandwich keeps track of what toppings have been added to it in a list<string> . A customer can then check this list in the sandwich handler to see if the toppings it currently has matches the customers own personal list for sandwich toppings.

Customer System
Customers are initialized upon loading the game level and sent in a Queue<customer> and set to inactive. Current customer is set to active and then they send their list of topping requests to the player topping request UI canvas. One unique challenge here was that I didn't want the customers to overlap with their spawn positions so when they are assigned a spawn location they check it against a list of used spawn locations. If the random spawn location they were assigned is used, the script generates a new spawn location number until it gets one that is unused.

VR Canon
The VR canon is controlled with a simple lever that uses Unity's configurable joint and locks its position and rotation to mimic a lever. The cannon aim is adjusted based on how you move the lever and it is is calculated by transforming the current position of the lever against its maximum and minimum range.

Conclusion
Overall I feel that this project went very smoothly with good separation between systems and that the scripts and classes are well organized. I was able to apply a lot of the lessons I learned from previous VR projects and I can see myself using the asynchronous scene loading with screen fading for future projects as well. 

Monday, June 14, 2021

Furniture VR Design Prototype - June 14th


Here is a prototype I made using VR to design a space. 

Inspired from the Global VR/AR summit I attended last week.  It was mentioned how 3D models will be used more in online shopping because it gives you a better sense of what you are buying than a 2d image.

If providing 3d models becomes the standard and widely available it would make it easy to use Augmented Reality or Virtual Reality to help consumers decide whether they want it or not. 

VR Interactions and Save/Load System

Created the prototype using Microsoft MRTK for the VR interactions in Unity. The scrolling menu specifically was a very cool tool that's available through MRTK. 

The save/load system was something I implemented for the first time. It was implemented through storing the furniture rotation, position and scale information in a game save data class. Using the JSON utility you can then transform the save data class into a JSON file as long as all the data information is serializable.  



Sunday, February 14, 2021

Desert Climbing VR Project and VR Archery

Recently completed two VR projects since the last update. One was the Desert Climbing VR project. Here is a video along with my key learnings:

Desert Climbing VR Project

Key Learnings

Faster Prototyping - Use free assets

I made the 3D models myself and realized that it took up a lot more time then I thought it would in the end. Ultimately this slowed down the time it took to make a prototype of some of the features. It made me realize that it would be better to use free assets in the Unity store or other websites to add some basic visuals and move through the building process faster.

Dialogue system

I made the dialogue system myself and its triggered through listening to button inputs on the Quest 2 controller. The Dialogue uses scriptable objects which store or reference the text and images needed which are inserted into a basic UI Canvas. It was only after making it that I realized that the system I built makes it difficult to do things like display multiple images and etc. If I were to try it a second time I would try and use Unity's timeline instead which might provided a lot more flexibility and faster implementation. I enjoyed using Scriptable Objects and can see how they are a great tool for any game developer.

Biggest Challenge

It was my first time implementing a VR climbing mechanic and there were challenges dealing with character body collisions with rock protrusions as well as the hand poses themselves when grabbing the rock. Perhaps I'll find a solution in the future but I realized that automated hand poses for grabbing objects would be pretty useful in increasing realism. Turning off the hand doesn't really help since seeing your hands is a big part of climbing.

Adding Story

Adding story was a fun creative challenge. It made me think more deeply about the mechanics of the game and helped with setting up scenes. 


VR Archery - Chinese New Year Inspired


I was thinking about what I should do for my next project and my wife gave me some inspiration. I decided to do a VR Archery game inspired by Chinese New Years. I'm pretty happy with it since I applied what I learned previously and it allowed me to gain more time on the game design itself. There's a lot more I could do to improve it as well.

Key Learnings

Decoupling systems 
I used scriptable objects to connect systems and components but even now as I look back I realized I could have done a better job of that. This was the first time I set up a spawn system with enemies and used coroutines to do it. An unexpected challenge would be overlapping spawns which I could solve by having the spawn points have their own spawn manager instead of using just one. 

I was excited that I was able to load levels using scriptable objects. This made making new levels with different parameters really easy.

XR Interaction Toolkit
I feel that I learned a lot about the XR interaction toolkit with this project when it comes to extending the features through overriding the base functions. Really useful and I can see how I could have avoided some spaghetti code in previous projects through using this.

Challenges
The stumbling blocks were challenges that I didn't realize would be there during the initial planning process. One for example was destroying game objects with XR grab interactables. Turns out that the current XR Toolkit throws errors when you do this and I found a solution on a forum post to clear the colliders which helped. Unique specifically to XR toolkit.

I tried Object pooling as well but because I used coroutines, when you turn the enemy inactive they ended up being respawned. I solved this through removing the enemy from the list after they spawn so that they don't return to the list as an inactive object.

Wednesday, January 27, 2021

January 27th 2021 - Working on Quest 2 Projects

 Last month I got a Oculus Quest 2 and I've been working on VR projects since. This is a quick summary of those projects.

VR Flower Explainer 

Updated and recreated the Flower Explainer Project to work with the Quest 2 Input system. I used Unity's XR Input system to make game objects interactable.

VR Gun Mechanics


I wanted to create a VR Fire Extinguisher Training experience and thought that the mechanics for using a VR Gun could translate over pretty well. There are a ton of tutorials for how to create VR guns so these tutorials were easy to find. 

VR Fire Extinguisher Training


Built using my skills from previous projects to create this. Main challenge became state tracking for the fire extinguisher as I wanted it to only work if you are holding it up in your left hand, unlatched the key holding it and holding the nozzle. I also used spatial sound for this one along with a video that's played in game which I haven't done before.

Unity Shader Graph - Toon Shading and other effects




Visuals are definitely an area of weakness in my skillset. I took a week to explore Unity's Shader graph in URP. Did some tutorials on toon shading which I think might be a way to improve the visual appeal of my projects moving forward. I've always loved cell shading and the art style of games like wind waker but I'm not sure I'll use toon shading for all my projects.

Regardless, after doing several tutorials I've found that the outline effect might be something that I'll keep as it can highlight what objects are interactable in a VR experience. 


Sunday, April 26, 2020

April 26th 2020 - Hard surface modeling

Been chugging away on the blender 3d modeling tutorials on CG cookie and started trying out hard surface modeling. I decided that with the corona virus issue going on and just staying home most of the time that a good project would be to recreate my new home and create a virtual tour of the space.

I want to create the virtual home tour project in Unity while creating all the assets in Blender. This has been my main focus and it's given me a reason to better learn how to use Unity. I have a better understanding of the different interfaces and how to change the settings dealing with environment lighting, material and textures. The light explorer function in unity is something new and is really useful for more easily adjusting lighting.

Video capture - 360 video
I've also discovered that the old tool that I used to use, Unity Recorder, has been decommissioned and no longer available. Looking for a new solution I downloaded the demo version of Video Capture in the asset store and liked how well it worked and purchased the Pro version which is on sale. Took quite a bit of time learning how to use it but so far I'm finding it to be much better than Unity Recorder with some interesting features that I think will enable me to make better 360 videos.



Getting better at character modeling is still a focus and I'm trying to practice doing faces. Should be sculpting more faces but I feel I've gotten better at doing eyes and eyelids. 

I still need to practice human mouths and noses a lot as I'm not sure what I still feel like I don't know what I'm doing in sculpting yet.


The current tutorial focus is hard surface modeling which I only started after creating the vast majority of assets for my Virtual Home tour. The approach and skills I'm learning from the tutorial are already showing me better ways to approach modeling which is a nice surprise.



All in all, I feel like I've been making pretty good progress on getting more skilled.