Unity Learn Class – Unity Gameplay Programming Fundamentals

September 14, 2020

Unity Learn

Gameplay Programming Fundamentals

Unity Gameplay Programming Fundamentals

Unity Learn – Link

By: Joshua Kinney


Overview

This is just a more advanced Unity programming fundamentals class, which sounds like exactly what I am looking to shore up currently, especially going into another personal project. This even has a focus on player movement scripts and interactive objects, which will fit very nicely with the next project I am looking to work on.

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).

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.

Houdini Assignment – Fuse and Group

April 8, 2019

Houdini Assignment

Fuse and Group

I worked on a Houdini class assignment to make a basic model and decided to try and create the bulb on the back of a Bulbasaur, a Pokemon that is half plant and half dinosaur. I figured I could use a lot of the basics we learned in class to get me pretty far, while also needing to cover a few new things to get it exactly how I wanted it.

In class, we created a basic hot air balloon. This consisted of tracing a curve over a background reference image of a hot air balloon, creating a section of the balloon from this original curve, then replicating that section as many times as needed to fully encompass the full balloon. These were a lot of principles I used for creating my bulb.

The biggest hurdle I needed to overcome was that that top of each of my sections would all need to connect at a single point, so I would need some additional nodes after simply creating a “left” and “right” variation of my additional curve making up a single segment. I decided to approach this by using a grouprange node and an additional fuse node.

The grouprange node allowed me to create a group consisting of the three points at the top of each curve. I changed the “Group Type” to points, since I was interested in point objects, and I adjusted the “Range Filter” according to how many points I had on my curve. By setting the “Range Filter” to “Select 1 of 8”, where 8 was the number of points in each curve (since they were all similar copies of each other), I could create a group that was all of the first points on the curve, which happen to be the top ones.

I then followed this with a fuse node to snap these three points together into one. The way I was able to get the best result was by setting the “Group” to the group I created in the previous node, and using the “Snap” version of the fuse node. When I increased the “Snap Distance” a significant amount, all the points combined into one to create the tip of the leaf-like structures of the bulb.