Dev Blog

Experimenting with Unity: Player Movement – Rotation

Player controlled by rotation about a point

Vimeo – Video of Rotational Movement

I was experimenting with controlling a player agent solely through rotational forces. The first style I looked at was not a force in the physical sense as it just operates on moving the player at a constant rotation speed. This is dictated by the placement of a rotation pivot which the player can place to indirectly move the player agent.

To add an extra amount of control, the player can also press a key in order to reverse the direction of the rotation (switch between clockwise and counterclockwise). This combination of features led to some interesting movement patterns. One of the first things that jumps out is the fact that the movement being dictated by a constant rotation speed still leads to varying velocities by the player agent as this will vary drastically with the radius between the pivot point and the player object. Large pivot distances can lead to dramatic speeds, but will lead to the player covering a larger area.

Notes to remember:

I was having an issue where the rotation was not perfectly making a circle in the game view. It turns out the scripts were correct, but the camera needed to be set to orthographic so the camera was just viewing it at an angle. Remember to check both the editor view and game view closely to help determine camera-based issues.

Using cursor inputs in Unity is a bit awkward. It has been done plenty of times so the basic scripting is available on Unity’s main site, but the process of creating a plane, raycasting, and converting between screen and world space is a lot to keep track of. This might also be something to look into if mouse inputs are acting strange.

Procedural Generation – Far Cry 5 GDC Content Generation

Procedural Generation – GDC 2018 Talk – Procedural World Generation of ‘Far Cry 5’

By: Etienne Carrier

GDC 2018 – Procedural World Generation of ‘Far Cry 5’ – GDC Vault Link

GDC talk where Etienne details a large scale tool they created using procedural generation techniques to help build the world of Far Cry 5. It covers both the user end (world editors/designers) and the behind the scenes processes that make everything possible. They use Dunia and Houdini together to create these tools.

Predictive Physics Simulation in Game Mechanics by Hamalainen et al.

Resource – Research Paper
Title: Predictive Physics Simulation in Game Mechanics
Authors: Perttu Hämäläinen, Xiaoxiao Ma, Jari Takatalo, Julian Togelius

This paper explores using innovations with software and increasing technology and how to apply them to games as a game mechanic. This specifically targeted the increased ability of computers to process physics simulations as a predictive measure for the player to interact with. In the simplest explanation it can break down fast paced physics-based actions into a turn by turn type game or simulation.

Game Feel by Steve Swink

Thesis Resource – Book
Title: Game Feel: A Game Designer’s Guide to Virtual Sensation
Author: Steve Swink

This was a resource suggestion from Tony Rowe that breaks down games and how they are played into their most basic elements. The chapters specifically targeted at individual games show promising parameterization of player controllers that could be effectively applied to my future research.

GDC 2018 Talk – Math for Programmers by Squirrel Eiserloh

There are 6 talks about techniques and implementations of procedural content generation in games. The order is as follows:

  1. The Power of Procedural Recipes – Procedural Recipes
  2. Semi-Procedural Content Pipelines – Semi-Procedural Methods
  3. Staged Parametric Map Generation – Staged Parametric Generation
  4. Digging with Perlin Worms – Perlin Worms (for rivers/roads/caves)
  5. Discrete Constructs in Endless Worlds – Infinite Worlds
  6. Juicing World Generation with Metadata Feedback – Juicing PCG with Metadata

Creating a Basic High Score System in Unity

October 13th, 2018

How to Make a High Score in Unity

How to make a HIGH SCORE in Unity – Brackeys

How to make a HIGH SCORE in Unity – Youtube Link

This youtube tutorial from Brackeys shows the bare bones way of getting a high score system started for a game in Unity. It uses the built in PlayerPrefs function to save data to the user’s system.

PlayerPrefs.SetInt and PlayerPrefs.GetInt were used. Playerprefs.SetInt lets you set a key value (which is basically a name for this value when you want to find it) and the actual value to set to this key at the time. Playerprefs.GetInt will return the value stored at the key value given to it, or if nothing is stored within that key location, it will return the default value, which is the second variable value you set when using PlayerPrefs.GetInt.

Saving Data in Unity: PlayerPrefs

Saving Data in Unity: PlayerPrefs – Youtube Link

Youtube tutorial by Board to Bits Games going over the basics of PlayerPrefs in Unity. This shows limitations of PlayerPrefs as something that is mostly useful for storing smaller amounts of data for the player on their system. This also showed a good practice to follow when using key value pairs: set your key as a string variable so that you can call that key variable name every time you need it instead of hoping you type it in exactly correctly every time.

Lessons Learned:

I wanted my score and high score text objects to contain text other than solely the score value (in this case it was a simple “Score: ” and “High Score: “). This did lead to a couple issues throughout the debugging process where I realized I didn’t add the extra text when changing/resetting score values, so the extra text would be missing and just the number would be shown. For larger projects, it may be safer and more consistent to make a separate small method for setting a score and/or high score that will add that extra text every time when called (removes a copy/paste step of doing similar actions throughout the scoring script.) And again following a main point from the Board to Bits video, set your key names as string variables within the code so they are easier to consistently call throughout your program.