Dev Blog

Password Managers

July 8, 2019

Password Managers

LifeHacker – Lifehacker Faceoff: The Best Password Managers, Compared

By: Thorin Klosowski


KeePass Homepage


Youtube – KeePass Tutorial 2017

By: Papercut

As someone that works a lot with computers, it’s been way too long for me to not look into password management to keep everything secure. I happened to come across the top article from LifeHacker here today and decided to finally look into setting something up. Using that as my starting point, KeePass looked like a cool option since it was free and open source.

KeePass seems pretty cool, but being open source it also wasn’t as user friendly as some of those other options, so I looked into some basic tutorials for getting it setup. The one I found above was very straight forward and it ended up being much easier to get KeePass basically setup than I thought it would.

While KeePass was pretty easy to setup its basic capabilities, there are some things I still need to look into getting around. One of those major factors is that it stores your information locally, so I’ll need to delve deeper into some options for sharing the information if I need passwords for things like my email on another computer or device.

Creating a First Person Camera Controller in Unity

July 3, 2019

Creating Basic FPS Camera Controller

FPS Controller in Unity

Youtube – How to construct a simple First Person Controller with Camera Mouse Look in Unity 5

By: Holistic3d

This first tutorial is a good example for setting up the most basic type of first person camera in Unity. Since the project I was using didn’t need a character at all and I was just attaching this directly to the camera, I needed to make some slight modifications to have it setup properly. This is because I didn’t have a parent object to apply the second type of rotation to. This just required me to set both rotations in both directions at the same time (since setting one and then the other to the exact same object had the second rotation constantly overriding the first).

This camera had a slight issue though where it moved relative to wherever the mouse starts on the screen. While I was just creating this camera controller for debugging purposes for an AR project, this would be an issue to investigate in the future if you actually wanted to use the controller for a game. Just implementing something simple using the mouse’s initial position relative to screen space somehow.

Outline Shader in Unity

July 3, 2019

Outline Shader Tutorial in Unity

Youtube – Shader – Smooth Outline – [Tutorial][C#]

By: N3K EN

As someone with very minimal shader experience in Unity still, this step by step tutorial is nice for just getting a feel for how shader code is setup while also creating a useful effect for certain art styles or attention drawing practices. It simply creates an outline around 3D objects of various color with variable width.

Tower Defense Tutorial Fixing Scene Manager

Tower Defense Tutorial Fixing Scene Manager

June 19, 2019

Tower Defense Tutorial Project

Fixing Problems with the Scene Manager

To help get back into the groove of working on my tower defense project, I went over some scripts that I thought might help fix problems and listed out how they reference each other. (Lower placed scripts reference the higher ones)

Script Reference List

  • PlayerStats
    • LevelPlayerStats
  • WaveSpawner
    • WaveInformation
    • LevelManager

Then I got working on the problems with the scene manager and the method call timings between the different scenes that were giving me errors. There are a lot of issues when references trying to be called before variables are properly set in different scenes, and this offset is leading to a lot of errors where the checks are checking against default values like 0 and null as opposed to their properly set values. So once again, I made a list of problems as I encountered then and possible fixes I tried, including the ones that finally worked and stuck for now.

SCENE PROBLEMS

Problem

Menu buttons do not work

  • Going back to the level select menu screen is not working on either button, so Menu() method must be incorrect
  • The for loop to deactivate level buttons the player should not have reached yet was given the wrong value to start with when reactivating the scene
    • it was setting a value to the active scene’s index and adding that to the for loop check for the level select button array
    • this value was initializing at 0 the first time through for some reason (another scene timing error), but was then being set to 4 when returning (which I believe is the level scene’s index, so this is another scene timing issue, but being properly set to 3 [the index of the level selection scene] would have been bad as well)
Solutions
  • Solution: Just removed the addition of the current active scene build index all together; I think this was added at some point to process the correct level build indices, but that is no longer needed.



Problem

Retry for a level does not work

  • Clicking retry does unload and reload the current level scenes, but it is done so improperly and the timer does not count do to start the first wave ever
  • Just ever unloading a level scene and trying to load it again has the same problems
    • This indicates something is not being properly reset the second (or more) time the scene is loaded
    • Look to individual Level scene and Base scene (created for all levels), especially in Start type methods
    • EnemiesAlive and WaveIndex are not resetting to 0 when scene is unloaded
      • EnemiesAlive specifically is one of the checks to see if a wave should be spawned (spawns a wave when the value is at 0 to make sure the previous wave was defeated)
Solutions
  • Potential Solution: reset these values to 0 when level scenes are loaded
    • tried this by creating a ResetWaveSpawner method in the WaveSpawner itself, then having something reference this on Start with something that is created on Level load
    • started method in Start method of LevelManager script
      • this actually worked for going back to the menu and then trying the level again, but retry still did not work properly
      • I figured this meant the scenes might be loaded/unloaded differently, so I checked my sceneManagerLite and sure enough, the level selection from the menu needed to load both the Base and Level scene, but retry was JUST unloading/reloading the Leve scene, not the Base scene, which is where the LevelManager is located that is resetting the wave spawner on Start
  • Potential Solution: just have the reset called in the Start method of something in the Level scene itself
    • This did allow the level to start properly when returning to the menu and coming back, or with the simple retry. However, there were still some other problems. Now if you beat a level, every time you returned the game won screen would come up and the game would still play in the background. Leaving the level during play and coming back (by menu or retry) would also change the “Rounds Survived” counter at the end, indicating something with the wave counters was not resetting properly.



Problem

Beating Level Once Beats it Forever

  • After beating level, game won screen comes up immediately when going back to the level
  • Back to our game winning bool checks, appears that the WavesFinished bool is not properly reset when returning to a level. This should be false every time the player starts the level, and get set to true when they win. This is happening correctly, but it is never reset to false.
Solutions
  • Possible Solution: reset the WavesFinished bool in WaveSpawner with proper scene timing
    • Actually just added this to the newly created ResetWaveSpawner method I created to deal with the previous resetting issues and this fixed it



Problem

Wave Spawning Coroutine is Off

  • Resetting a level during the spawning of a wave has the rest of the wave spawn immediately (at the beginning of the newly reset level) as well as spawning the second wave (skips the spawn of the first wave all together)
  • This indicates the coroutine spawning the wave might need manually jumped out of on reset and that the wave index is being messed up by their being enemies remaining

Morph Between 3D Objects with Houdini VDB Morph

June 10, 2019

Houdini VDB Morph

Morph Between 3D Objects

Youtube – Houdini Tutorial – 3D Object Morphing using Open VDB Morph and SOP Solver

By: Jeshuran Paul

One of the finishing touches for my frog generator Houdini project that was suggested was morphing between several of the frog objects it is able to create in a single animation. I was already looking into converting some/all of it into VDB objects at some point to help clean up the joint connections in an interesting and organic way, so this VDB morphing seems like it should fit nicely with that.

Frog Body Generator – Houdini Basics of Polywire and Sweep with Ramp

June 10, 2019

Houdini – Polywire and Sweep Nodes

Using with Ramps

Youtube – Houdini Essential:How to control polywire, and sweep node along a curve by ramp parameter. part2

By: Saman khorram

I think this tutorial may finally give me my solution to replace my personally made ramped scaling in Houdini for my frog generator with a more consistent and simple SOP setup. I’ve just needed a way to sweep and then scale separately in the horizontal and vertical direction using a ramp along the line of the sweep.

This ended up just being more about altering the pscale along the line. This just alters the uniform scale of the circles.

Current Fix

I was able to change the vex a bit to give me a more consistent result as of now. I am still using a Sweep of circles over a line and scaling them my own way with a bit of vex, but I’ve just changed how it works.

Initially, I was using this on the circle that I was sweeping:

vector a = set(0, 0, 0);
@N = normalize(a+@P);

v@xScalingVector = set(@N.x, 0, 0);
v@yScalingVector = set(0, @N.y, 0);

I was doing this so that the circles would be able to keep the scaling vector information with them after they were swept to use for the individual axis scaling. This gave me some inconsistent errors though. The body would not be symmetrical, with a bit of a skew.

The scaling was done by using ramps to assign xScale and yScale attribute values to the points of the circle sweep along the path. The scaling was then done with an attribute wrangle and the following VEX:

@P.z += @xScale * v@xScalingVector.x;
@P.y += @yScale * v@yScalingVector.y;

The P.z taking “x” values was because the z values actually dealt with the width of my frog body. This was taking the ramp values and multiplying that with the originally signed scaling vectors and then readding that to the point position. The scaling vector was supposed to help with direction, so the negative values would go more negative and the positive the opposite. However, some points were keeping scaling vector values of the opposite sign, so they would “scale” in the wrong direction and give the weird skew.

While experimenting with some fixes by just using an arc and mirroring it 1 or 2 times, I actually just tried using the normal vectors directly in my wrangle as opposed to the saved values since I thought the saved values may not be working nicely with the curving of my sweep outline. So for the circles pre-sweep, I just kept the initial part of the VEX wrangle:

vector a = set(0, 0, 0);
@N = normalize(a+@P);

And for the scaling wrangle, I just used the @N vector:

@P.z += @xScale * @N.z;
@P.y += @yScale * @N.y;

So far, this at least fixed the issue for now, and has worked with a few variations so I am hopeful this is a decent fix for my issue for now. Random final note, I did have to reverse the normals after skinning when doing it this way for other nodes to work properly (such as the one protruding the ridges on the frog’s back).

AStar for 2D Pathfinding in Unity

June 8, 2019

Unity 2D Pathfinding

Using AStar

Youtube – 2D PATHFINDING – Enemy AI in Unity

By: Brackeys

This tutorial shows how to setup the general AStar package in a 2D Unity project. It goes over the basics of setting up an initial grid and getting a basic enemy AI that will make the enemy follow a target. It also has an example to setup your own simple AStar enemy AI script using AStar’s Pathfinding package.

This tutorial also cover the basics of setting up an enemy object with a graphics child object, flipping that graphic when the enemy should be going another direction, and just moving an enemy with physics and forces in general, instead of just updating position.

Dev Tutorials Breakdown of Creating Entire 2D Game in Unity

June 6, 2019

Unity

Full 2D Game Process

Youtube – [Unity 2019 Tutorial] 01 Building the Base for Game – Complex Adventure Game With Unity

By: Dev Tutorials

This set of tutorials as an in depth guide on the full process of setting up everything for a 2D adventure game in Unity. This gives a nice overview that can help me see what goes in to really bringing everything you create together to make the single, coherent game in Unity.

Houdini Frog Generator – Controllers and Foot Webbings

June 4, 2019

Houdini Frog Generator

Controllers and Foot Webbing

Foot Webbing

The general concept was to take a line of points and move every other one along its normal to create a general zig-zag pattern. Then, you resample it to make it smoother and wavier. I have another set of points that are along the foot that will create the inner boundary of the webbing. You then use the Add SOP to create a closed polygon between these line boundaries.

To make this more consistent, I wanted to create the line using points from the toes. This way, the webbing will follow the toes around properly as I shift them around. This was easy to accomplish by just adding another point at the tip of the toe geo and setting it to have an id attribute of 0. I could then connect all of the same attribute valued points in a line with the Add SOP.

The line between all of the toes would then be made up of a number of points equal to the toes. I needed to add a single point between each pair of toes to move to create the wave in the webbing. This could be done with a resample that adds a point in the middle of each polygon.

Controllers

I wanted to practice setting up overall controllers to start making it easier to work with my frog generator from a few ruling nodes.

I first practiced this by setting up a controller for the foot to control the webbing parameters. This controller was tied to: webbing length, webbing curvature, and webbing origin.

The length is how much overall area the webbing covers between the toes. The curvature is how wavy, or how far the inner webbing points are away from the general curve. Finally, the origin just helps move the inner boundary of the webbing around in case it is too far from the foot or too far in.

I then moved on to creating a body controller, which had a lot more parameters. This also required connecting some ramp parameters, which are a bit weird in Houdini.

These parameters include:

  • Body Length
  • Spine Shaping
  • xScaling Body
  • yScaling Body
  • Dorsal Start
  • Dorsal End
  • Dorsal Projection Angle
  • Dorsal Projection Ramp
  • Back Leg Position
  • Back Leg Angle
  • Arms Position
  • Arms Angle
  • Eyes Position
  • Eyes Angle
  • Tympanum Position
  • Tympanum Angle

The body length is just the general overall length of the body shape. The spine shaping is a ramp that lets you add curvature to the body. The xScaling and yScaling are ramps that independantly alter the general width or height of the body throughout.

The dorsal variables control the larger dorsolateral dermal plica on the back of the frog. These are raised ridges a lot of frogs have. These control how far along the frog’s body these ridges go, the radial angle around the body they are projected, and a ramp to control how much it deforms the general body in the normal direction along the ridges.

Finally, all of the positions and angles control the connection point locations for various body parts of the frog to the general body. These select a specific point along the main spine to project out onto the body surface, and the angle determines the radial projection around the body these points are located. These two features together let you place the body parts anywhere on the body very easily.