Posts

Showing posts from March, 2019

Houdini Basics

March 29, 2019 Houdini Basics Interface and Physics Youtube - SideFX Houdini For Absolute Beginners Youtube - PHYSICS For Absolute Beginners - SideFX Houdini Tutorial By: Surfaced Studio As I am on vacation over break, I just wanted to quickly check out some basic Houdini tutorials to go over for my classes next quarter. These ones seemed to cover the absolutely basics as well as getting into some of the simulation aspects I want to check out specifically using Houdini.

Simple Query System

March 25, 2019 Simple Query System Reference Data in Other Scenes Coffee Brain Games - Simple Query System This Query System idea is something I came across as another potential method for passing data between scenes in Unity. This could be very beneficial for my multi-scene setup that I am trying to create.

Unity Multiple Scenes and Controlling Loading

March 25, 2019 Advancing Tower Defense Tutorial Moving Objects and References to New Scenes Catlike Coding - Multiple Scenes and Loading Levels Catlike Coding - Object Management The Catlike Coding information on Multiple Scenes and Loading levels has a lot on how scenes are loaded in Unity and how to control that process better. I also included the link to the overal Object Management tutorial that this Multiple Scene write up is a part of. That seems like another useful overall source, that could also enhance the application of this Multiple Scene tutorial. They start by creating a new scene and moving certain objects into it. After setting this up, they correct an issue they had where recompilation messes up the pool scene. This happens because they are using a scriptable object instead of the default monobehaviour for their script. Unity serializes the private fields of Monobehaviours when compiling, but not for Scriptable Objects. This meant CreatePools would

Unity Scene Management - Fixing New Scenes to Work

March 21, 2019 Advancing Tower Defense Tutorial Moving Objects and References to New Scenes Myriad Games Studio - HOW TO USE THE UNITY SCENEMANAGER Now that I had the scenes loading properly enough, I actually needed to get all the references fixed finally. I had not altered the references since looking to implement the concept of having an all time Logic Scene, a Base Scene, and a Level Scene, so some of the references were broken when I split them up, especially between the Base Scene and Level Scene. This provided an interesting challenge since I did not want to make objects/scripts in the Base Scene public static, so I wanted to look to a way to have them communicate to each other through the Logic Scene. Currently, I think all of my GameManager functionality does not work being in the Base Scene. I am looking to split some of its functionality so that I can move the GameManager to the Logic Scene, and keep the more level related info in a new LevelManager that wou

Preserving Data Between Scene Loads in Unity

March 21, 2019 Advancing Tower Defense Tutorial Moving Objects and References to New Scenes Youtube - Unity Tutorial: Preserving Data between Scene Loading/Switching By: quill18creates I came across this video on preserving data between scenes in Unity when trying to find ways to cross-scene reference variables. This did not solve those issues, but it was helpful for understanding static variables and their uses better. Static Variables: These variables become part of the class. This is what allows them to persist between various scenes. A good practice for working with these is to make them protected, so they can not be get or set. Then you just allow other scripts to affect them by calling methods within the script that contain the protected static variable. Using static variables can lead to messy "global" style variables, or nice encapsulation. Static variables can also lead to weird errors in Unity's Editor specifically, just because of the way it

Unity Scene Management - Finalizing Scene Loading/Unloading Process

March 19, 2019 Advancing Tower Defense Tutorial Altering Scene Format Myriad Games Studio - HOW TO USE THE UNITY SCENEMANAGER Now we are going to look at fixing our scene loading so that occur with better timing and in the right order. The fading animation timing also needs fixed to work with this new scene loading setup. We want to look at ordering these operations as: complete animation, complete loading next scene(s), unload current scene. Because we are looking to do several methods in order and only want to proceed when the previous is finished, my first thought was to make them all coroutines and have an overall IEnumerator run them with yield return. As far as I've seen, yield return can be used to ensure a coroutine finishing processing before starting the next action, as scene in the SceneLoaderAsync script I am following from Myriad Games in a previous blog post. I started by removing any scene loading from the FadeOut coroutine so it was strictly dealing

Callbacks and Event Systems

March 18, 2019 Creating an Event System in Unity Event System with Callbacks Tutorial Youtube - Unity Tutorial: Callbacks and a (Really Awesome!) Event System By: quill18creates Following in my learning of delegates and events, I stumbled across an interesting tutorial on creating Event Systems in Unity. I just wanted to note this as something to follow up on in the future since the general concepts I got from skimming through sounded very promising and good to learn about.

Unity Programming - Delegates and Events

March 18, 2019 Unity Programming - Delegates and Events Tutorials and Definitions Youtube - Delegates - Unity Official Tutorials By: Unity Youtube - Events - Unity Official Tutorials By: Unity The scene management update has made significant progress, I am now currently loading and unloading the proper scenes at the proper times. The timing of the loading and unloading is still off however, as well as the fading animation timing is very strange. The fading error makes sense since I have the scene transition and the fading in the same method currently, so I will look to separate those and time them properly with IEnumerators. I was also told today that OnSceneLoad delegates would be a very helpful feature for me to look into to fix all my scene loading timings. The basic IEnumerator timing I was also suggested to look into was: wait until animation is done, wait until next scene is loaded, then unload scenes to be unloaded. Upon investigating delegates, I found that

Unity Scene Management - Timed Loading and Build Indexing

March 17, 2019 Advancing Tower Defense Tutorial Altering Scene Format Youtube - Unity- Scene Manager and Keeping Objects when Loading/Unloading By: Egon Everest Myriad Games Studio - HOW TO USE THE UNITY SCENEMANAGER I continued to updated the scene management of my tower defense tutorial. One of the biggest additions was that I did decide to create a single location for all of the OverlayCanvas button methods I wanted to use. This was just a script called the OverlayCanvasManager that I added to the GameManager object. This just made sense with how often different UI buttons would do similar actions, like going to the menu. This script then became the sole reference point between the Base Scene and the SceneManagerLite object in the Logic Scene. As I was working with the references between the OverlayCanvasManager and the SceneManagerLite, it became more clear that the SceneManagerLite should still directly handle all of the actual scene management. The OverlayCanva

Unity Scene Management - Creating Project SceneManager

March 16, 2019 Advancing Tower Defense Tutorial Altering Scene Format Youtube - Unity- Scene Manager and Keeping Objects when Loading/Unloading By: Egon Everest Following in the footsteps of the FAR team from a Unite 2017 talk, I wanted to update my scene management in the tower defense tutorial to match that from the talk. To begin, I wanted to create a general Logic Scene to hold all of my managers and a Base Scene to hold general assets consistent between levels. To start I needed to break up my current level scenes into their various parts since these will have all of the basics for every scene we are attempting to construct... Since the Scene Fader will be used constantly as a way to transition between any and all scenes, this was included in the Logic scene that will persist the entire time the game is open. To make this accessible to all the other scenes and scripts however, I chose to have its script create a public static instance of itself. This was copied

Unite Europe 2017 - Multi-scene editing in Unity for FAR: Lone Sails

March 15, 2019 Unite Europe 2017 Multi-scene editing in Unity for FAR: Lone Sails Youtube - Unite Europe 2017 - Multi-scene editing in Unity for FAR: Lone Sails By: Goran Saric I wanted to look into pushing the tower defense tutorial series I did from Brackeys into a more polished little game project, so one of the first upgrades I wanted to look into for the project was the suggestion about breaking up the scenes in a more efficient manner. This was mentioned as the best way to set up the overall project if you wanted to make it significantly larger but keep it very easy to build upon. This is because there are a lot of objects in a given level currently that will persist between every level and right now they are just copied into every single level. If you make an edit to any of these objects, they need copied into every other scene again. This can be minimized by using prefabs much more extensively, but having a scene solely for these objects keeps everything much cleaner

Unity ML Agents - Setup

March 15, 2019 Unity ML Agents Balancing Ball Setup Basic Project Settings Make sure the “Scripting Runtime Version” for every platform you are targeting to build is set to (.NET 4.6 Equivalent or .NET 4.x Equivalent). I had to update the project to work with Unity 2018 and it already had .NET 4.x Equivalent as the default setting for all of my platforms. Overall GameObject Hierarchy The overall platform prefab has a “Ball 3D Agent” script which needs a brain property The brain object then holds a Tensor Flow model property Setting Up Training Environments There are two ways to train your objects: in the Unity Scene Editor in by using an executable. The first example will train in the Unity scene editor. This is done by accessing the “Ball 3D Academy” object, adding “3DBallLearning” brain to the Broadcast Hub of the “Ball 3D Academy” script, and checking the Control check box. The Broadcast Hub exposes the brain to the Python process, and the Control checkbox allows that

Intro to Python Programming with Mosh - Pt. 02

Intro to Python Programming with Mosh - Pt. 02 March 14, 2019 Intro to Python Programming Tutorial - 02 Youtube - Learn Python 3 for Machine Learning & Web Development [2019] By: Programming with Mosh Progress End Time: 48:40 Next Part of Tutorial: Arithmetic Operations NOTES Strings You can use single or double quotes for strings, but there is a difference for certain applications. For example, if you want an apostrophe in your string, you need to use double quotes to define the string. An example for the reverse is that you use single quotes to define the string if you want something to be in double quotes within the string. Strings can also be defined with triple quotes. This allows you to create a multiline string. You can call a character index of a string with brackets (i.e. string[0] will return the value of the first character in that string.). An interesting feature is that you can use negative indices to start at the end of the string and count backwards.

Intro to Python Programming with Mosh - Pt. 01

March 13, 2019 Intro to Python Programming Tutorial - 01 Youtube - Learn Python 3 for Machine Learning & Web Development [2019] By: Programming with Mosh Progress End Time: 29:35 Next Part of Tutorial: Strings NOTES This tutorial covers the complete basics of Python, starting with installing it, so it is as beginner friendly as you can get. The entire tutorial will use these basic foundational teachings to lead into creating projects to show how to use what you learn in a functional sense. These projects include a shopping site, an AI system for helping a user get music to match their preference, and a spreadsheet processing program. Upon installation, it was important to “Add Python to PATH” for Windows (which I am using). I wasn’t sure if I did that since I had installed before, so I found that this references the Path in environment variables and just adds the path of your Python folder to this list. I added my Python path to this list in hopes that would resolve t

Coroutine Basics in Unity

March 12, 2019 Coroutines in Unity Resources On Coroutines Youtube - Coroutines - Unity Official Tutorials By: Unity Youtube - Introduction to Game Development (E21: coroutines) By: Sebastian Lague Youtube - Coroutines In Unity - What Are Coroutines And How To Use Them - Coroutines Unity Tutorial By: Awesome Tuts Youtube - Unity3D - 2 Ways to Start & Stop Coroutines (the good & bad ways) By: Unity3d College Coroutines are one of the tools I still don’t fully understand how to utilize in Unity so I wanted to gather some resources to really learn the basics. I am hoping this helps me use them more effectively and understand them better than as a method that lets me do something “after a while”. The resources I’ve gathered cover a wide amount of information on coroutines. There are details on the terminology used around them with the most technical aspects of how they are made up to small examples on their different uses in Unity scripts. There are also differe

Complete Beginners Python Tutorial by Programming with Mosh

March 11, 2019 Complete Beginners Python Tutorial Youtube – Complete Python Tutorial for Beginners (2019) By: Programming with Mosh I wanted to try using Unity’s ml-agent toolkit and its initial setup uses a lot of Python so I got interested in learning the basics to better navigate the toolkit and its full potential. This was one of the first tutorials I came across and its size and recency made it an attractive choice to cover a lot of ground that shouldn’t be outdated for any reason. Its size is also a bit of a drawback at over 6 hours, so I will most likely break this up and cover it in the upcoming weeks.

Unity ML Agent Setup in Windows

March 11, 2019 Setting Up Using ML Agents in Unity Windows 10 Setup Unity – Machine Learning Unity – Windows Installation I was interested in trying out Unity’s machine learning agents toolkit so I started attempting to get everything setup and installed today. I have no prior experience with Python, so that took a bit of getting used to. I had some trouble setting up initially as I followed the link in the documentation for the Python download which led me to get Python 3.7, but Python 3.6 is what is used in the installation notes. When I went to install the TensorFlow component, I couldn’t get that to work in 3.7. Afterward I went back and got Python 3.6 and setup a 3.6 environment and got the same error initially, but then got it to work after actually activating the ml-agents environment (so I may have been able to solve the error in Python 3.7 with this change). Otherwise the setup went rather smoothly. The excessive use of Python encouraged me to look into some tutorials

Wwise Integration with Unity

March 10, 2019 Using Wwise with Unity Game Audio Youtube - Wwise and Unity: Getting Started with Unity & Wwise, Part 1 Youtube - Wwise and Unity: Ambient Sound Sources, Part 2 By: WestSideElectronicMusic Wwise is a powerful audio editing tool specifically molded towards producing game audio. It also has strong integration with the Unity game engine that makes working between the two much smoother. These tutorials help show the basic integration steps to make sure the two softwares can communicate with each other, and then starts to get into the basics of using WWise to produce interesting audio for your games. Between the two of them, we covered adding in a simple footstep sound effect and a torch sound effect. The footstep audio was done to show the minimum required to add audio into Unity through Wwise. It was mostly important to note the need for creating audio effects in Soundbank objects in Wwise, then generating the objects to import into the Wwise editor in Unity.

Unity Player Pref Editor

March 8, 2019 Unity Player Prefs Editor Script Editor Script Unity – Player Prefs Editor in Unity By: Romejanic As I was finishing my Unity tower defense tutorial, I wanted to look into deleting player pref values to do bug testing for the level unlocking system. When I searched how to do this, I came across this very helpful Unity editor script that gives a few very basic functionalities dealing with player prefs in Unity. This tool lets you set or get the values assigned to player pref variables you’ve created. This can be useful to double check exactly what a player pref is set at currently. It also has an option to delete the value assigned to a specific player pref, or just delete all player pref values. This gave me the exact option I needed, as well as giving a nice option for checking how the game works for a new player just starting the game.

Tower Defense Tutorial - Brackeys - Ep. 28

March 8, 2019 Tower Defense Tutorial Episode 28 – Winning Levels Youtube - How to make a Tower Defense Game (E28 WINNING LEVELS) - Unity Tutorial By: Brackeys Ep. 28 This tutorial sets up the system for what happens when the player beats a level. We began by creating a UI panel for all of the UI that should appear when the player completes a level. Once we had that setup, we looked into creating some functionality for this screen. This started by creating a RoundsSurvived script to just place on any round counting objects (one in the game over and level won screen) to display the text properly. As an added effect, we wanted to animate the round counter to count up from 0 to give it more of an impact than simply displaying the number. To get this round counter animation effect, we used an IEnumerator for its ability to WaitForSeconds. We created a while loop that would count from 0 to the number of rounds the player survived one at a time, with a WaitForSeconds of 0.05 each t

Tower Defense Tutorial - Brackeys - Ep. 27

March 7, 2019 Tower Defense Tutorial Episode 27 – Unlock Levels Youtube - How to make a Tower Defense Game (E27 UNLOCK LEVELS) - Unity Tutorial By: Brackeys Ep. 27 This tutorial gets into creating a system for locking/unlocking levels. We started by going into our LevelSelector script and creating an array of UI Buttons. This would hold all of the buttons that allow you to select a specific level on the level select screen. We then added a for loop to go through all of these buttons and intitialize them as non-interactible buttons. To go along with making the buttons non-interactible, we added a Button Disable animation. This was a simple animation that makes the button much more faded out than normal to make it clear that it is non-interactible. To make sure this effect is removed in an interactable state, we added an alpha animation for every other button animation state to just set the alpha back to 1. Next we needed a way to keep track of the player’s progress to determi

Tower Defense Tutorial - Brackeys - Ep. 26

March 6, 2019 Tower Defense Tutorial Episode 26 – Fading Youtube - How to make a Tower Defense Game (E26 LEVEL SELECT) - Unity Tutorial By: Brackeys Ep. 26 This tutorial gets into creating a level select menu for the player. This would require its own scene, so we duplicated the Main Menu scene as a place to start since it’s already fairly empty. We started by setting up the hierarchy of UI assets for the level content selection area. It was noted that this is a general way to setup a scrolling menu for selecting objects in Unity. The hierarchy is as follows: UICanvas Title Levels ScrollRect Content We then added a button to our Content UI object, and gave that object a Grid Layout component. This allows Unity to place everything in an even grid layout for you. We also added a Content Size Fitter. This helps allow the object it is attached to scale to fit the content placed in it. We also made sure to move the pivot anchor point of this UI object to the top of

Tower Defense Tutorial - Brackeys - Ep. 25

March 5, 2019 Tower Defense Tutorial Episode 25 – Fading Youtube - How to make a Tower Defense Game (E25 WAVE SPAWNER 2.0) - Unity Tutorial By: Brackeys Ep. 25 This tutorial focuses on updating the wave spawner to be a more useful and versatile tool. One of the first changes was to have the next wave spawn some time after the previous wave has been killed off instead of having it on an overall set counter. We create a public static int, EnemiesAlive, to constantly hold this value of how many enemies are alive in the current wave. We then let the Die method in the Enemy script and the EndPath method in the EnemyMovement script remove one from this value before destroying the enemy object. Since we are already referencing this in multiple somewhat unrelated areas, I think there might be a nicer way to reference one method somewhere that destroys the enemy gameobject as well as removing one from this global counter. Another issue I am already noting here are that there might be

Tower Defense Tutorial - Brackeys - Ep. 24

March 4, 2019 Tower Defense Tutorial Episode 24 – Fading Youtube - How to make a Tower Defense Game (E24 FADING) - Unity Tutorial By: Brackeys Ep. 24 This tutorial focuses on creating an overall fading effect for the game. We created an empty gameObject, SceneFader, and added a UI Canvas to that, which we then added a UI image to that is just a black image. Then we added a SceneFader script to our SceneFader object to handle the fade effects. We used IEnumerators to handle the fading methods. We used the IEnumerator for its ability to wait certain amounts of time. The IEnumerator FadeIn uses a yield return 0; line in its while loop so that it updates at the same rate as update (every frame). Yield return 0 basically tells it to wait a frame. We created a variable of type AnimationCurve, which gives us access to a curve we can manipulate by changing its shape or adding/removing points to control how a value fluctuates. We used this to control the FadeIn IEnumerator. We then d

Tower Defense Tutorial - Brackeys - Ep. 23

March 2, 2019 Tower Defense Tutorial Episode 23 – Enemy Health Bars Youtube - How to make a Tower Defense Game (E23 HEALTH BARS) - Unity Tutorial By: Brackeys Ep. 23 In this tutorial we created health bars for the enemies. We began by creating the foundation for the UI asset. We created a new World Space canvas, added a child UI Image object as our health background, then childed a UI image to that that would be our actual health bar. The BG was given a transparent black color, while the health bar was a fully opaque light green. We then childed this full group of UI assets to our Enemy prefab. The position needed fixed when this was applied, and the scaling reset so I had to reset that manually as well. This created a health bar that would follow our enemies now. We would need a bit of a tracking script if our enemies rotated (so the health bar would not), but currently the enemies don’t rotate at all so this is not necessary. To make our health bar actually do something, w

Tower Defense Tutorial - Brackeys - Ep. 22

March 1, 2019 Tower Defense Tutorial Episode 22 – Main Menu Youtube - How to make a Tower Defense Game (E22 MAIN MENU) - Unity Tutorial By: Brackeys Ep. 22 In this tutorial we created the Main Menu scene for the game. We duplicated the original game scene to start, and deleted out everything except the Light, Main Camera, and Environment. Then we only kept the Ground Plane from the environment. We then added a Standard Turret Prefab to be a central object for our menu. We then edited the sky box to something other than the Unity default. We selected Solid Color for it, and used the color picker to pick the top most color of our ground plane so the sky matched this very final gradient of color. This made it seem like the background was one solid, endless color gradient for the most part. We then created a World Space canvas with text fitted to it for our PLAY text. We placed this on top of the turret prefab in our menu. We then wanted to make this text clickable, so we just a