Intro to Python Programming with Mosh – Pt. 04

April 22, 2019

Intro to Python Programming

Tutorial – 04

Youtube – Learn Python 3 for Machine Learning & Web Development [2019]

By: Programming with Mosh
Progress

End Time: 1:41:55

Next Part of Tutorial: For Loops

NOTES

Weight Converter

This was a simple exercise to try and create a simple weight converter. It would take a user input weight and ask if it was in Kilograms or Pounds (lbs), then convert it to the other unit.

Their solution to this exercise provided a nice way to make strings less case sensitive. Since the unit input was just the first letter of the unit abbreviation (L for pounds and K for kilograms), this could make it completely non-case sensitive. You simply use the upper() method on the string you are comparing a value for before checking what it is. Then you only have to compare it to the capital case instance and either they will have already typed in the capital instance, or you will have converted the lower case to an upper case before comparing.

While Loops

These are used to execute blocks of code multiple times. The syntax for while loops is similar to C#. You just use the while key word with a condition, ending with a colon. Then the following indented code will be executed as long as the condition is met.

Guessing Game

This uses a while loop to build a simple guessing game.

This example went over “refactoring”, which is renaming a variable and all the instances of it in your code. This can be done with the keyboard shortcut: Shift + F6.

The Break command is used to immediately exit the program out of a while loop. This is useful when a varied condition is met that doesn’t need the loop to run again. This also prevents any Else counterparts of the while loop from executing.

While loops can also have Else counterparts. These will execute if the entire while loop is completed without the use of a Break.

Car Game

This was another exercise to do on your own. This time it was creating a “Car Game” that just said you started the car if you typed ‘start’ and stopped the car if you typed ‘stop’. I used a simple while loop to contain the game as a whole, with a game_started bool. The entire game ran in this while loop while game_started is true, and terminates when that is set to false. This gave me a way to quit the game when the user typed in quit.

Within the main game while loop, there were just a lot of if statements (with elif) to determine what to print based on what the player typed in. There was also an extra bool added which was car_started, which could be used to determine if the car was already started or stopped. This could be used to make sure the player couldn’t stop an already stopped car or start an already started one.

Human Fall Flat Workshop – Getting Started

April 18, 2019

Human Fall Flat Steam Workshop

Original Human Fall Flat Workhop Steam Group Page

Steam – Human Fall Flat Workshop

Setting Up Human Fall Flat Workshop in Unity

Steam – Human Workshop: Getting Started – Configuring Unity, Making your First Level, Publishing and Subscribing to Levels

This documentation gets you through the process of initially setting up Human Fall Flat Workshop to work in Unity. It starts with the proper version of Unity, which is 2017.4.13f1. You create a new 3D project and import the workshop Unity package that is part of the Human Fall Flat game files you get from Steam. Then, close out of Unity and copy over the “Project Settings” folder from the HFF game files into your Unity project, overwriting the existing “Projece Settings”.

That’s the gist of getting it all setup in Unity. The rest of the documentation gets into setting up your first level and getting a basic understanding of the core objects such as the Spawn Points and Pass Triggers.


Editor Improvements and Node Graph System

Steam – Human Workshop: Editor Improvements and Node Graph System

This write up talks about overall Editor improvements for the workshop, such as being able to teleport the player anywhere in the scene to help with testing and a lot about the signal event references and node graphs.

This documentation has a Node List with simple descriptions of what all the different nodes do in the node graphs, as well as a lot of helpful hints and functions for organizing and utilizing the node graphs. This covers topics such as color coding nodes, using nodes and their inspectors in general, and how to properly use the cheat nodes to efficiently debug/test. This is a very useful resource for getting started with the node graphs for HFFWS specifically.


HFFWS Discord

There is also a discord community for the HFFWS that can be a useful resource for getting help figuring out different aspects of this tool as well as getting player feedback for creations.

Exporting FBX from Houdini with Color

April 17, 2019

Exporting From Houdini

FBX and Color Information

Exporting the Model

Using my balloon Houdini example from class, I was able to export the geometry using the Educational version (the Apprentice version does not allow exporting FBX, but you could export an OBJ for my purposes possibly). This was very straight forward, as you can just use File -> Export -> FBX in Houdini.

Since I was doing this for a class to use in a Snapchat filter (using LensStudio), I wanted to reduce the poly count a lot. I opened the FBX in Maya and used a basic Reduce to reduce the poly count a lot before exporting that for use in LensStudio.

While this was good enough to export the geometry, I could not get any of the color information to come with it. I originally exported out an OBJ and had the same issue, so I exported FBX in hopes it would keep the color information somehow, but this was not the case.

Exporting the Color Information

My first thought to get the color information out of Houdini (since the colors of my balloons were being created with color nodes assigned directly to the primitives) was to create a material or texture of some kind with the information. My first attempt was simply adding a PrincipleShader to the balloon and hoping that would hold on to the color data. While the material did come out with the FBX export, it still did not have the color information.

Next, I looked to the output channel of Houdini to see if there was something I could use there. This is where I came across the BakeTexture node. This node has a huge amount of options that I could not really get a hold of everything, but this ending up being a good starting point to my process. I could use a lot of the default settings, including the “Texture Format” UDIM. This format however, requires that there be UVs on the geometry, which mine did not.

Using this to determine my next step, I looked into how to create UVs for my model. This led me to the UVProject node. This node can actually create a UV map from your model. It has several settings to change the plane it projects onto and the projection method, but the defaults were all good enough for me. It created a simple rolled out horizontal texture of my balloon model with its current color information.

Now, with UVs I could go back to the BackTexture node. This allowed me to use the UDIM “Texture Format” now. The selections I used under Images – Main, were “Extract Image Planes” (with Extract Format of PNG) and “Surface Unlit Base Color (basecolor)”. Basecolor ended up being the file I actually used in the end. Finally, I selected my balloon object as the “UV Object 1” and selected a path to output the file in “Output Picture 1”, as well as setting the “Resolution” to 256 x 256. This gave me my PNG texture file.

Using the Model and Texture

When I placed the FBX model in LensStudio, it came with the PrincipledShader as a material naturally now. I placed my exported basecolor PNG texture file in as the base texture file for the PrincipledShader material and this got my colors onto the balloons. Since the models did not seem to be exporting perfectly true to form of the Houdini geometry, I am not completely sure how accurate the color information is to the Houdini version, but it looked similar enough for my purposes.

Setting Up Java

April 15, 2019

Setting Up Java

Dev Kit, Eclipse, and Working in Command Prompt

Oracle – Java SE Development Kit 8 Downloads
Eclipse Site

Basic Setup

As I’m preparing for a foundational programming course, I needed to get Java setup on my computer. This started with downloading the Java Development Kit (JDK) and Eclipse (an IDE package for working with Java). I had to make sure to run and install the JDK first, as Eclipse needed some of its components to setup initially.

I needed to do some work using the command prompt on Windows, and found I was having trouble using the javac and java commands. This turned out to be an environment variable issue (something I ran into similarly when starting Python). I was able to easily resolve this by checking the “Edit the System Environment Variables” section of my control panel and adding the path to the Java jdk bin file to my “Path” system variable.

Houdini Flower Tutorials

April 13, 2019

Houdini Flowers

Tutorials

Youtbe – CGI Rose using Houdini and Redshift by Stephen Bester | VFX

By: CG Record

Youtube – Houdini Tutorial: Creating Water flowers blossoming | Project File for download

By: CG Record

Vimeo – Water flowers blossoming in Houdini. Tutorial + project (HIP,comp,ae)

By: Mike Stoliarov
UPDATE 4/29: This is the same video as the one above, but has higher resolution options so you can see the steps much clearer.

These are a couple tutorials showing how to create flower-like objects in Houdini. I’d like to get into making plants with Houdini at some point, especially flowering plants, so I just wanted to start gathering some resources for that.

While one of these tutorials is for creating water flowers, a lot can be taken from that for the core of the flower making process. The other tutorial is for making a rose, which is perfect for a lot of flower uses. It also says it uses Redshift, which I’m not sure what that is or how much of a difference that makes in Houdini’s workflow for any reason.

GDC 2019 Talks – Into the Breach and Dead Cells

April 11, 2019

2019 GDC Vault

Talks

GDC 2019 – Into the Breach’ Design Postmortem

By: Matthew Davis
From: Subset Games

GDC 2019 – ‘Dead Cells’: What the F*n!?

By: Sebastien Benard
From: Motion Twin

Into the Breach Design Postmortem

Constraint Focused Design: This basically has them set constraints as early in the game design process as possible that help direct and restrict future design choices. This can be something like a genre, or a game mechanic like health.

Gameplay focused design: They approach making games by starting the the main gameplay they want to create, and then building everything else to fit around that. Everything such as narrative or theme ends up following the gameplay.

They used a very board game inspired design for “Into the Breach”. They like to keep numbers small, easy to understand, and meaningful. The difference from 1 to 2 should be impactful. This also leads into how they designed enemies. There is a “chess-like” feel to enemies, and the overall gameplay in general, in that the player should have a good understanding of how a piece operates and its zone of danger it creates and be able to play around that.

Randomness was something to be kept to a minimum. This went very well with the idea of having the enemies forecast their attacks. Again, this also ties in with making as much information available to the player as possible. Even though they wanted to reduce randomness to a minimum, they still implemented it when they deemed it a much better option.

As most game designers do, they wanted a strong focus on interesting decisions. This led to keeping out a lot of complex systems that were too difficult to use for what they really brought to the game. This was also done a bit differently on their team since they only have two people, so they could iterate quickly and often and scrap ideas and designs much more easily.

‘Dead Cells’: What the F*n!?

They really wanted to focus on “permadeath” as a game mechanic. Focusing on this led them to some core mecahnics to “make death fun”. The core of this was death being a way to progress in the game. It gave you a way to improve your character’s abilities, as well as access previous areas again (since the game does not allow back tracking).

They wanted to focus the design on combat, NOT platforming. Even though it is still a 2D platformer, they really wanted the player to use their skills for fighting and limit or even remove punishments for platforming. To achieve this, they used many small mechanics such as allowing players to jump a few frames after leaving a platform, teleporting the player onto a platform if they missed a jump by a few pixels, and implementing an edge grabbing mechanic.

This player helping system in platforming got carried over into over mechanics as well, such as helping aim attacks. If the player is facing the wrong direction when going for an attack, the game can actually assist them and switch them around the other direction. I initially was very against this concept, but I appreciated their take on it and was much more accepting after their explanations. This helped reduce the mechanical demands for the game, rewarding the player much more for strategic combat gameplay. Then in this way, this actually allowed them to make the game more difficult in some respects since the player wouldn’t be punished for these less important game aspects.

Just a small note, since they use a lot of community feedback to update their game, they will leave comments in the patch notes stating who inspired the change. This is just a good way to let the community know how impactful they are and make them more willing to help in the future.

2019 GDC Vault Opening

April 9, 2019

2019 GDC Vault

Talks

GDC 2019 – Into the Breach’ Design Postmortem

By: Matthew Davis
From: Subset Games

GDC 2019 – Cursed Problems in Game Design

By: Alex Jaffe
From: Riot Games

GDC 2019 – How to Teach 5 Semesters of Game Design in 1 Class

By: Jason Wiser
From: Yaya Play Games, Tufts and Harvard University

GDC 2019 – Creating Customized Game Events with Machine Learning (Presented by Amazon)

By: Africa Perianez
From: Yokozuna Data

The 2019 GDC vault has finally opened! I just wanted to take a quick peak and see if I could find any interesting talks to watch in the near future. I really loved playing Into the Breach, so I’m excited to check out their Postmortem. Riot Games always has interesting talks with League of Legends size and popularity. The other two just seemed like interesting sounding titles that I’d like to hear more about.

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.

Intro to Python Programming with Mosh – Pt. 03

April 7, 2019

Intro to Python Programming

Tutorial – 03

Youtube – Learn Python 3 for Machine Learning & Web Development [2019]

By: Programming with Mosh
Progress

End Time: 1:16:25

Next Part of Tutorial: Project: Weight Converter

NOTES

Arithmetic Operations

In Python we have the same operations used in math, as well as a few extra ones. There is addition, subtraction, multiplication, and division.

Here are a few of the extra operators. By using //, it returns the integer of the division with no remainder. Using the modulus, %, it returns the remainder after performing the division. Finally, ** is exponent, so this will raise a number to the other values power.

Then there is the augmented assignment operator. This is done by placing the operator directly before the equal sign. For example:

x += 3
is the same as: x = x + 3

Operator Precedence

This is the math concept where certain operations are performed before other operations. Many of these in Python are the same as those in basic math.

Math Functions

This just covers so more basic math functions: round, abs

Round rounds your value to the nearest integer. Abs returns the absolute value of a number.

If you want to do very intense mathematical calculations, you will want to grab a math module to add to Python. This module would give you more built in functions to perform mathematical functions. This is done by typing:

import math

at the top of your Python code. You can then call functions from it in your code with math.FUNCTIONNAME.

if Statements

The syntax of if statements is a bit different from C#. The syntax is as follows:

if STATEMENT:
functionsToPerform()

A colon is used to end the if conditional, and the functions following it are determined just by the indentation. To end the statement, you just remove the indent.

To perform else if, you simply type elif in Python. Else remains the same as you type the full word.

Logical Operators

These are the AND, OR, and NOT operators. In Python, logical AND, OR, and NOT are done by simply typing the word “and”, “or”, or “not” in the place they are needed. They do not use symbols.

Comparison Operators

These are used to compare variables with values. These are operators such as greater than and less than. These are all the same as C#, including the equivalency operator that is ==. Not equal is also the same, which is !=.