Category Archives: Learning

The Human Programming Interface: Part 0

You can basically think of yourself as a water balloon robot ** with a little bit of self awareness.

As with any robot, you can run commands and code to get certain behavior and results. But programming the Human Being comes with some of the same challenges that plague any software project over time. Somewhere in the past the documentation for the Human Being got lost. There is a lot of legacy code sitting around in the Human Operating System that has to be accounted for. Many of the inputs to functions produce counterintuitive results. This is my attempt to document some of the programming interface that we seem to have figured out partially as a reminder and partially to help the next guy who comes along.

Here are a few of the key interfaces that are used to program your squishy robot:
Words and Language
Food and Drink
Bacteria
Motion
Chemicals (Drugs)
Location
Other Humans/Social Interactions
Breathing
Sleep
Meditation
Imagination
Entertainment
Recreation
Education
Work

I will primarily be documenting inputs that appear to give the maximum amount of the following outputs:
Happiness
Energy

Note: sometimes these outputs are secondary, for example Motion or Recreation that Outputs Growth will lead to increased Happiness.

** I was inspired by Scott Adams in his book How to Fail at Almost Everything And Still Win Big. He uses the term “moist robot” but since we are approximately 70% water I decided moist did not capture how much water was involved.

Its Turtles All the Way Down

Was reading some articles on game design a few weeks ago and I believe I found this idea on Raph Koster’s blog. The name of the idea is something like the atomic game theory, which is that all games are made up of smaller sub games all the way down until you get to component actions such as clicking the mouse or typing a key.

The concept is used to make sure that all of the subtasks that make up your game are fun. Think of them as games by themselves.

Take even a fairly simple game by today’s standard like classic Mario Bros.  Moving your character is fun. Jumping is fun. Stomping enemies is fun. Collecting coins and powerups is fun. Each of these parts of the game can be thought of as smaller games themselves.

When you combine a bunch of small fun things, you usually end up with a final product that is also fun.

I am using this concept to design and test small parts of a larger game one piece at a time to see if each piece is fun, and I would encourage you to give it a try in your own design process.

Keep getting wiser, stronger, and better.

Placing and Moving Objects in Unreal

A game world with nothing in it would be pretty boring. Just a flat empty expanse. Today we are going to go over various ways to put objects into the game world and how to move them around.

Placement

By default you are in Place mode in the editor when you start it, but if you aren’t you can easily switch to it by selecting it from the tabs in the Modes window on the left side of the editor, it is the first tab with the cube and light bulb in it. You can also switch to this mode by pressing Shift + 1.

In the Modes window you should see various categories of things you can place in your game world including Basics like simple geometric shapes and actor representations, Lights, as well as any classes you have created (under All Classes).

Clicking and dragging one of these objects into your main view will add it to the world.

You can also just right click in the main view and choose from the various place options in the context menu.

Additionally you can use the Content Browser that is by default open at the bottom of the window to drag Static Meshes and Actors into the world.

Movement

Basic Movement

When you click on an object in the main view, if you are using the default tool (Select and Translate Objects) you will see a small white sphere appear with 3 arrows or vectors coming out from it. Clicking one of these arrows allows you to move the object along that Axis (X, Y, or Z). Pretty simple and intuitive. If for some reason you see something different, make sure you are using the correct tool by hitting the W key.

If you click the right angle line between any 2 of the arrows you can move the object along those 2 Axis at the same time. And if you click the small white sphere you can move the object along all 3 at the same time.

Rotated Movement

The Axis by default are in relation to the World. But if you have rotated your object and want to move it in a straight line in relation to it rotation, you can change the context of the movement tool by clicking the small icon at the top of the main view that looks like a globe (or a cube if you are in local object coordinate mode). There is also a handy keyboard shortcut for doing toggling back and forth, Ctrl + ` (backtick, same key as ~, right next to the number 1 on most keyboards).

Moving With Or Without the Grid

There is a grid system for helping line up objects and move them in precise increments. You can change the size of the increments that you want or turn the snapping system off entirely. The selectors for this are in the group of selectors on the top right of the main view, right next to the coordinate mode toggle selector.

Moving the Camera with the Object

Sometimes you need to move the object off screen or just a far distance that might have you move it, move the camera, then move it again. Instead you can hold down the Shift key and the camera will move along with the object as you drag the control that you want.

For lights and camera objects, you can actually lock the viewport camera on to them and use the normal view/camera controls (mouse and WASD) to position them precisely or at least in a way that makes sense visually. To do this, select the light or camera you want to control, right click on it and select “Pilot this object” although it will have the name of the object there. To stop piloting, there will be a control in the top left of the viewport that lools like an up arrow with a line under it. Simply click that to go back to the normal viewport camera.

Details Panel Movement

If you want super precise placement, you can also move objects by putting in the exact coordinate number location that you want in the objects properties in the Details window on the right side of the screen. This is in the Transform section with the appropriate Location label.

Final note, the End key will drop your object to the floor. This is super useful to avoid floating objects.

Rotation

Basic Rotation

Rotation is very similar to movement as far as controls go.

You can switch to the Rotate Object tool from the top of the main view or by pressing E. When you do, you will see 3 half circles. Each of these circles allows you to rotate the object along any 1 Axis.

And same as movement, you can switch the relationship of the rotation from rotating relative to the world to rotating relative to the selected object. Same on screen toggle and same hotkey, Ctrl + `.

Rotation Snapping and Details Panel

Similar to the grid for movement, you can have the rotation snap along various degree increments. And for super precise rotation, you can type the exact angles you want in the Details window on the right side of the screen.

I recommend starting a little throwaway project with Unreal’s Starter Content and practicing the various placement and rotation tools.

Keep getting wiser, stronger, and better.

Changing Your Perspective, in Unreal

Today I learned how to easily access the different orthographic views of the game world from the Unreal Editor. You might remember orthogonal lines from math in college or highschool, meaning lines that go off at 90 degree angles.

Orthographic is similar. It means representing a 3D space in 2D so we are looking at the world from directly along one of the 3 axis (X, Y, or Z) and seeing the equivalent of a builder’s blueprint. These views will be useful for precise placement of objects and laying out the game world the way you want.

Find the Right Angle

There are 3 basic ways to switch between views. In the top right of the main viewport, to the right of the camera speed indicator/changer, is a tiny square for maximizing or minimizing the view. This will take you from the default view of Perspective mode to the unified view where you can see all 4 (Perspective, Top Down, Side, and Front) together. In each of the smaller windows you can choose to maximize them and have them take up the entire screen.

There is also a selector to the top left of the main viewport that will let you switch between them directly without having to go to the unified view. In this selector, you can see the 3rd method of switching which is keyboard shortcuts. The defaults are: Alt + G for the Perspective mode, Alt + J for Top Down, Alt + K for the Side View, and Alt + H for the Front. If you press Shift + any of the Alt combinations, it takes you to the other side of the 2D perspective such as the Back instead of the Front.

You can move around these views by holding down the right mouse button and dragging. The left mouse button is used for selection.

See Things Differently

In addition to changing where you see things from, you can also change how you see things and whether or not you see things. Just to the right of the perspective selector are 2 other drop downs that have a ton of view changing options in them.

First there is the View Mode selector that lets you choose various kinds of lighting views, a wireframe mode that shows all of the edges of your objects, and a variety of other views.

Next to that is the Show Flags selector where you can toggle different elements of the game world and editor on and off from the view. In a busy environment it might be difficult to see just what you are looking for. This gives you the ability to declutter without actually removing anything.

Just in case you toggle some things off and can’t remember how to get back to the default view, there is a nice handy selection at the top to reset all of the defaults.

Looking forward to putting all of these different view navigation features to work making games.

Keep getting wiser, stronger, and better.

An Unreal Journey

I have been messing around a bit with the Unreal Engine editor, and today I decided that I wanted to begin the journey of mastering making games with it.

I have figured out how to do a few things here and there just messing around and with some quick searches but it really felt a little overwhelming. It is a huge engine with tons of features and multiple built in editors. The only way to really approach something this big is one small piece at a time.

Speaking of breaking down overwhelming looking tasks, I can wholeheartedly recommend How to Fight a Hydra by Josh Kauffman. It is an awesome little book that is literally a story of a man fighting a hydra. At the same time it is a set of principles for approaching large, difficult projects. Not expensive, but filled with value.

Where Do You Start?

If you don’t have a lot of knowledge about a subject, you can’t even ask the right questions. Whenever you are attempting to learn anything, it is best to figure out as many of your unknown unknowns as you can and turn them into known unknowns.

In order to figure out what you don’t know, you will need a large amount of skimmed info on the subject to find out the broad areas you will need to cover. Reading the chapter breakdown at the beginning of a book or even skimming over a few tutorials will help out here.

So far I have come across this excellent list:

  • Create and Manage Projects
  • Viewport Navigation
  • How to use the Content Browser
  • Placing and working with objects and static meshes
  • How to use BSP to block-in a level layout
  • How to use static meshes to construct environments
  • How to insert and use lights (directional, spotlight, etc)
  • How to manage a scene
  • How to insert required level objects (lightness importance volume, player start, etc)
  • How to build objects to scale and proportion
  • How to render the game or build all
  • How to playtest from the editor
  • Little shortcuts to do all of the other steps faster

And this is just stuff a beginner needs to learn. Not to mention Blueprints and / or the C++ code to make the game run.

Step One

As you will find in fighting hydras, you take everything one task at a time. So today I went back over how to navigate the viewport, following Unreal’s tutorials on their YouTube channel.

There are actually a couple of different ways to move the camera around based on your particular taste. My personal choice is using WASD to move like a video game character. This only moves the camera while holding down the right mouse button. E and Q raise and lower the camera and moving the mouse around lets you turn.

You can also hold down the left mouse button and drive the camera around with the mouse.

Alternatively, they have a Maya mode for people used to working in the Maya 3D editor where you hold down Alt and left mouse which allows the mouse to “tumble” the camera around the selected point. Selecting an object and hitting F (while holding Alt) will frame or center the view of the camera on the selected object.

I recommend watching the tutorial video for a full breakdown of viewport movement. You can join me on my journey of learning to make games with the Unreal Engine.

Keep getting wiser, stronger, and better.

p.s. There is a pretty good course on how to learn things quickly put out by Simple Programmer that is worth taking a look at.

Managing Expectations

I learned an important lesson recently about how big a role expectations play in our emotional state and our happiness.

New Zealand is a beautiful country with amazing scenery, friendly people, and unpredictable weather.

The unpredictable weather however does not usually get very hot, and as a result, most homes and dwellings do not have air conditioning or even fans.

Opening the windows is usually enough for a hot day.

However when my wife and I visited recently, New Zealand had 3 of the hottest days it has had in quite some time.

The first day I was a little angry. I had been traveling for about 36 hours the day before, only slept a few hours the night before, and was jet lagged.

In a word, exhausted.

Get to the place we were staying and it is hot and stuffy.

There is no air conditioning.

There are no fans to circulate the air.

The breeze is not coming through the windows and it is summer so the sun is still up keeping things warm at 9 PM.

It wasn’t until after 10 that the room cooled down enough to easily fall asleep.

That first night being tired, hot and unable to get comfortable when we were expecting to have similar comforts to what we are used to in the US, we were a little upset.

But the next night, in the same location, same temperatures (maybe even a little hotter) we were not mad at all.

Because we knew what was coming. We expected it to be hot and to not have any means of circulating the air.

We knew the room would cool down after 10.

We were prepared mentally.

And being prepared mentally for a situation will help you maintain composure and make better decisions.

Keep getting wiser, stronger, and better.

Using Rewards and Missions

Several of the games that I enjoy have various challenges and missions that come up every so often. They usually involve standard game play and provide some sort of reward.

Occasionally however the challenges encourage you to try techniques or strategies that you may not normally use.

My example here is going to be World of Warships. In World of Warships you basically have 6 ways to deal damage to enemy ships. You can hit them with your main guns, torpedo them, ram them, have your secondary guns deal damage, cause flooding or fire damage through one of the previous methods, or if you are using an aircraft carrier you can have various aircraft attack the enemy ships.

Main guns are the standard way to deal damage and usually the safest. They have the longest range and require a bit of skill at long range so it rewards higher skill play. Torpedoes are super powerful, doing tons of damage in a single hit. But they are short range, can usually only be fired to the sides, and can be dodged pretty easily if you aren’t close. Getting close usually means you are taking a ton of damage from your opponent as you steam towards them. This is just standard game balance. High risk, high reward.

When something high risk like that takes some practice to get right, sometimes you need to add an extra reward to get players to practice it such as a mission or a challenge. For example you get extra in game currency if you sink 5 ships with torpedoes.

This is also true when buffing or nerfing items, guns, or other abilities in games.

If you have a weak item that nobody is using and you give it some more power to make it playable, it is still hard to get players to use an item they have been trained to see as weak. So offering a reward to complete a challenge with it will allow your players to feel good about using it and trying it out again.

If you have an overpowered item and you take its power level down, when players find out they may stop using it even though it is still a viable item. Again you can use the challenge and reward pattern to get more people to use it to at least test its playability.

Keep getting wiser, stronger, and better.

Money Mindset

A lot of people get hung up on the cost of things.

If you want to be wealthy, you need to develop an abundance mindset.

An abundance mindset does not consider the cost in a vacuum. It is always comparing the cost to the value that is provided. If the value is greater than the cost, and the cost is not just in money but more importantly time, then it is an easy decision.

An abundance mindset knows that there is basically an infinite amount of wealth. It is not a fight over a piece of the pie. It is baking your own pie by creating value for others that did not exist before.

An abundance mindset does not say “We can’t afford it.” It either says, “How can I come up with the money?” or “It is not worth it.”

Develop an abundance mindset.

Keep getting wiser, stronger, and better.

Combine Growth into Existing Habits

When you are learning something new, it often helps if you can pair it with something that you already do or like, you are more likely to be successful.

For example, I am trying to learn Thai.

I try to journal every morning and now when I am done, I write letters in the Thai alphabet several times to learn them. I added it as a couple minute habit of writing on the tail of an existing habit of writing.

Thai is a tonal language so being able to hear the up and down pitch on sounds is important. Throughout the day I tend to have various game streams running on twitch while i work as background noise and entertainment. Today as I was looking at various streamers I noticed some familiar looking non Roman alphabet letters as the title of one of the streams.

It was Thai, so I started watching. I was only able to understand a couple of basic words like “No” and some numbers, but this is something I am more likely to continue watching and using as a learning tool because it is attached to something else that I already like and do.

Keep getting wiser, stronger, and better.

Random Map Generation

You want people to enjoy playing your game multiple times.

You don’t want your game to become stale and boring where what happens next is super predictable or the steps to beat your opponent are scripted. Sure you want strategy, but you want the strategy to have to be adaptable.

In multiplayer games, often the opponents unpredictability will keep your game feeling like a fresh experience every play through. But sometimes you want to spice it up just a little bit more, so you add in some randomness.

Map Randomness

Today I was continuing my journey in Unreal Engine development and the particular tutorial I was watching was creating a random map for the turn based strategy game.

There are several ways of generating a random dungeon or map for your game with rooms and corridors but today I want to talk about a simple couple of methods called Quad Trees and Binary Space Provisioning (BSP).

Quad Trees and BSP are basically the same idea.

In Quad Trees you take a rectangular area and divide it into 4 randomly sized smaller rectangles. You then take each of the 4 smaller rectangles and divide them into 4 randomly sized smaller rectangles. Keep going until you have rectangles about the size that you want.

For Binary Space Provisioning you do the exact same thing except you only divide each space into 2 smaller rectangles at a time. You then divide each of those 2 smaller rectangles into 2 more rectangles. Again, keep going until you have rectangles about the size that you want.

You can then use whatever rules you want to choose which of the rectangles you created become rooms by limiting size, combining rectangles, keeping rooms a certain distance apart, etc.

After that come up with some ways to connect the rooms either directly or indirectly. And voila, you have a random map.

Keep getting wiser, stronger, and better.