Defining Game Mechanic

January 9, 2019

Resources for Defining Game Mechanics

Thesis Related

Citations
  • R. Hunicke, M. LeBlanc, and R. Zubek, “MDA: A Formal Approach to Game Design and Game Research,” p. 5.
  • E. Adams and J. Dormans, Game mechanics: advanced game design. Berkeley, CA: New Riders, 2012.
  • M. Sicart, “Defining Game Mechanics”, The International Journal of Computer Game Research, vol. 8, no. 2, pp. 15, December 2008.
  • Z. Hiwiller, Players making decisions: game design essentials and the art of understanding your players. New York? New Riders/NRG, 2016.

These are a few various resources that provide in depth descriptions of what makes a game mechanic. Defining this properly will be important for developing my game design methodology for my thesis.

AI Project Research – Looking for Inspiration

January 9, 2019

AI Project Research

GDC 2018 – AI Wish List: What Do Designers Want out of AI?

By: Raph Koster, Dave Mark, Richard Lemarchand, Laralyn McWilliams, Noah Falstein, and Robin Hunicke

GDC 2018 – AI Wish List: What Do Designers Want out of AI?

I’m bringing back a video for reference to try to come up with an AI intensive project. There are lots of quotes and the notation is very note-y, just using it to keep track of points of inspiration.

Laralyn mentions that she wants AI to be able to acknowledge that what the player is doing is unique. The way they are playing is differentiating from what is expected, and it should be noted by surrounding characters. Could we apply a type of “physical constraint” concept to this to help accomplish this goal? Physical constraints mathematically map out what an equilibrium should be, and then apply forces/actions to bring things out of line back to equilibrium. Could we use this concept to perform AI actions when it acknowledges a player diverges from what is expected, the “equilibrium” of the player experience?

From Raph Koster, “…building characters as props that are primarily reactive, and if we want to exploit AI, they need to have their own inner lives, out of which this stuff rises organically.”

”Heartificial Intelligence” – giving NPC’s empathy; Have deeper version of Sim system. Users more interested in “broken” characters with flaws. A dog that is scared of people now and is harder to train. Problem with Sim system was that every object had to echo out how it should affect an NPC, and they all needed to interact with each other so adding things to the system was very difficult(?).

Time Stamps: (0:49:40 – 0:51:18) : AI can be recursive and add detail. “…Can you do that but in a way that is data rich, instead of just going for ‘no let’s plot thousands of trees’, how about when I go look at that tree it’s way more detailed. Now there’s an ecosystem in that tree. Now there’s a burrow in this one and the gophers live under that, and there’s a woodpecker in that one. That’s the kind of detail we will never ever be manually able to do. We just can’t afford it, it’s ridiculous. And it’s exactly the kind of intelligently constructed, realistic, responsive environment. You want the woodpecker to know there’s a gopher. I’m not talking just shallowly, again, it’s not just splatting the textures. Can we actually create a data rich environment? … it’s a fractal or segmented thing. We don’t need each tree to know about each tree. But we could do something really interesting within the tree… each one could have variations.”

Solaris example – it builds things from your memory; makes you miss being on earth

”…go to a foreign planet and you find an object, and when you look inside that object there’s more objects, and you look inside those objects; and then come up with a design of mechanics that are interesting from the exploratory perspective that’s very similar to when you’re a child. When you wander into your backyard, and then the woods there and you find a stream then you look in the stream and you see the tadpoles and then you poke the tadpoles. Think of it from a mechanical perspective, not an aesthetics perspective, and then you get the dynamics that are so interesting.

Decentralize player, other things go on without the player. Make the player feel proud of something else. Have an AI do something the player didn’t expect it to do. Going off of this: Have an AI that the player needs to “teach” it how to do something with their actions. Similar to “Clumsy Ninja”.

Various Video Tutorials – Tactics Programming and Game Design, Tilemaps with Hexagons, C# Enum, Sharing Between Classes

January 8, 2019

Video Tutorials – Programming and Game Design

Youtube – Unity 5 Tutorial Tactical Turn Based Game Part 1 Basic Grid Movement

More turn based tactics game programming to learn another way to approach them, as well as get further into actions and combat.

Youtube – MAKING ISOMETRIC TILEMAPS in Unity 2018 | Beginner’s Guide (Tutorial)

This is just a simple tutorial showing how to use some new Unity features for dealing with hexagonal tile setups and isometric tile maps.

Youtube – Final Fantasy Tactics & Combat Initiative Systems | Game Design Guide

This video goes over some terminology and game design pros/cons for different ways to approach tactics combat systems.

Youtube – The Key to Making Turn Based Games! – C# Enum Tutorial

This video explains the basic concept of using a simple enum for setting up states for a turn based game. There are more links to all of the code included as well.

Youtube – Easiest Way to Share Behavior Between Classes in Unity – C# Interfaces Tutorial

This is a general programming tutorial for a way of sharing behaviors between classes in Unity.

Pawel Margacz – Generalist to VFX Artist – Learning VFX

January 7, 2019

Good Sources to Learn About VFX

80.lv – Link to Description

A quick write up by Pawel Margacz on how they got into VFX and how to learn the art. This included a few good youtube channels to follow to get helpful tutorials.

Youtube Channel – Mirza VFX
Youtube Channel – Sirhaian’Arts
Youtube Channel – ErbGameArt

These three channels offer great tutorials and showings for VFX. Mirza in particular has Unity specific examples with all of the work needed in multiple softwares (such as creating images in Photoshop to use as base for VFX in Unity).

Procedural Generation in Game Design by Tanya X. Short and Tarn Adams

January 7, 2019

Procedural Generation in Game Design

By: Tanya X. Short and Tarn Adams

80.lv – Link to Book Cover

From the link: “Basically, it is a wonderful exploration of the thinking and practice behind procedural generation in games and the way it relates to game design.” This could be a good source to look into for exactly what the title says, procedural generation in games.

Recap – Week of December 30 to January 6

January 6, 2019

Recap – Week of December 30 to January 6

Terminology from Tactics Tutorials

Physics Constraints

Write Up on Physics Constraints by Hubert Eichner

A nice description of equality constraints, impulse and force based constraints, and other physics constraints used in games.

Priority Queue

Youtube – Priority Queue Introduction

Quick video by WilliamFiset on concept of Priority Queues and Heaps.

Heaps

Youtube – Heap Explanation

Quick video on concept of data structure of heaps, which was a follow up to the priority queue information above.

Subscriber Pattern (Observer Pattern?)

Wikipedia – Observer Pattern

Searching for subscriber pattern resulted in a lot of information on observer patterns, which may be another term for the same thing described in the tutorials. This will require further investigation.

Dictionary

C# Corner – Using Dictionary in C#

Nice, simple write up on basic functionalities of the dictionary type in C#. “A dictionary type represents a collection of keys and values pair of data.”

Youtube – Create a Dictionary Using Collections in C#

This is a basic video tutorial for setting up dictionaries and using them in C#.

Stacks

Tutorials Teacher – Stacks

Tutorial on setting up stacks in C# and some of their functionalities.

Microsoft Documentation – Stacks

This is the Microsoft documentation on everything about the stack class in C# with examples.

Queues

Microsoft Documentation – Queues

This is the Microsoft documentation on everything about the Queue class in C# with examples.

Youtube – How to Work with C# Queues

Simple tutorial initially from Lynda.com about using queues.

Video Game Physics – Constrained Rigid Body Simulation by Nilson Souto

January 5, 2019

Video Game Physics – Constrained Rigid Body Simulation by Nilson Souto

Toptal – Video Game Physics Tutorial – Part III: Constrained Rigid Body Simulation

By: Nilson Souto

Link to Erin Catto’s box2d.org

This appears to be a good follow up to the game physics GDC talk by Erin Catto I watched earlier. This serves as another listing of physics constraints and how they can apply in games, specifically when dealing with rigid body elements. I also learned the constraint type is “revolute”, not “resolute”. This article actually references Erin Catto and his Box2D site since it goes into his creation of the sequential impulse method.

Physics for Game Programmers: Understanding Constraints

January 5, 2019

Physics for Game Programmers: Understanding Constraints

Constraints in Game Physics

Youtube – GDC – Physics for Game Programmers: Understanding Constraints

By: Erin Catto

EDIT: Updated to correct “resolute” constraint to “revolute” (Jan 5, 2019)

Erin goes over the importance of physics constraints in physics game programming and how to implement them to add diversity and creativity when designing physics for games.

Erin explains that physics constraints are to physics programmers as shaders are to graphics programming. You can use the already existing recipes that will get the job done, but designing your own will allow you more flexibility and creativity.

Shaders – lighting, shadows; Physics constraints – revolute, prismatic

Position constraint: in example, it is a particle that is restricted to a surface. Appears the equation should be 0 if particle is on surface, than < 0 or > 0 depending on what side of the surface it is on if it moves away from surface.

Contact constraint: the contact points on the contacting bodies do not move relative to each other along the contact normal

Global solvers vs Local solvers: Global solvers would solve everything somewhat simultaneously by having everything in a single large matrix equation setup. Local solvers are used to do computations linearly and solve one thing at a time.

Physics solver will need to iterate multiple times to solve impulses, but cannot run enough times to get everything completely accurate which leads to some overlap.

Iterations allow for convergence of the system’s solution and the actual determined solution. The iterations and time for this convergence to occur vary based on the complexity of the physical system. In the examples, circle stacks with assigned mass values were used. It turns out heavier masses on top of smaller masses leads to much slower convergence, and it gets slower as the mass ratio increases. This occurs because the solver needs to bring the top circle to rest, but each iteration it does on the contact occurring between the two circles only removes a small amount of the large circle’s velocity because it does it relative to the size of the lower circle.

Warm Starting – since a lot of things in games aren’t moving all the time, you can “save” impulses to try initially later so that it will have a saved solution if it hasn’t moved and if it starts moving, it may be closer to the next solution already This does not do well with quick load changes.

Inequality constraints – only want impulses to be able to push, not pull (lamba > 0); For accumulated impulses, you actually don’t want each incremental impulse to be restricted by > 0, you just want to apply that to entire accumulated impulse. Sometimes you need negative incremental impulses to solve cases of overshooting. This is when impulse applied at a step is actually too great and you need to bring it back down.

Global solvers are great but too expensive.

Don’t use acceleration constraints because it leads to cases where you need an infinite force to truly stop an object instantaneously, which is theoretically what should occur in rigid body collision.

Link to Erin Catto’s box2d.org

References from the talk:
  • David Baraff: Coping with Friction for Non-penetrating Rigid Body Simulation
  • Metthias Muller: Position Based Dynamics

Tactics Movement Tutorial (Cont.) – AI and A*

January 4, 2019

Tactics Movement – AI

AI with A* (A Star)

Youtube – Unity Tutorial – Tactics Movement – Part 6

By: Game Programming Academy

This part of the tutorial implements A* for use as the AI for NPCs. Most tactics games would generally involve some type of action phase, but this tutorial finishes with just getting the movement setup.

NOTES

The tutorial’s breakdown of A*:

  • processing the open list by finding the lowest f cost
  • put it in the closed list
  • checking for the target
  • then process adjacency and see if tile is in open list, closed list, or neither (in which case it is added)

Like in many tactics games, the NPCs will still show all of their selectable locations to move before actually selecting one.

For checking distance, tutorial just uses “Vector3.Distance”, but they suggest using the squared magnitude value since it is easier computing because Distance uses square root. Used for setting up simple AI searching algorithm to find the closest thing. It is a simple foreach loop that goes through an array of gameobjects checking the distance between the gameobject itself and each of those individual objects. The distance as well as the object is stored, so whenever a new lower distance is found, the object will be replaced, otherwise, the same object remains there (as that indicates the currently checked object is farther away).

The tutorial tries to keep the TacticsMove script as a generalized class that holds all the helper methods for use in the other classes.

A* uses two lists: an open list and a closed list. A* can also use a priority queue, but C# doesn’t have a built in priority queue. The open list is any tile that has not been processed, and the closed list is those that have been processed. It will finish when the target tile is added to the closed list.

Since we’re using tiles, we could use the “Manhattan Distance” instead. Manhattan distance may work better particularly with arrays though so tutorial sticks with Euclidean distance.

Since we’re using pathing to walk up to a unit, not on top of, the tutorial just decides to follow the A* path and then stop one node before the end (which would be where the target unit is located).

TERMINOLOGY

Manhattan Distance:The sum of the absolute differences of the Cartesian coordinates of two points. This represents the straight line nature of moving around on tiles in this case which is a grid-like layout.

Priority Queue: Like a normal queue but each element within has a priority value associated with it.

TODO

Suggested by the tutorial, program NPC for case where there is no target in range.

Tactics Movement Tutorial (Cont.) – Turn Manager

January 3rd, 2019

Turn Manager – Tactics

Turn Management

Youtube – Unity Tutorial – Tactics Movement – Part 5

By: Game Programming Academy

This part of the tactics game tutorials focused on creating the turn manager. An NPC character was created to represent another team. Even though there are only two units, the tutorial design deals with entire teams. The turnManager used static variables and methods because it should be very accessible and will act as a sort of global since there should only ever be one.

TERMINOLOGY

Subscriber Pattern: the tutorial mentions using this method to add units to the turn manager queue. This was tied to the idea that when a unit comes “online”, it should be able to add itself to the proper list in dictionary.

Dictionary: more uses of this in turnManager system, so I still need to look into this to see how they work.

NOTES

Will need to add method to remove unit from queue when it is defeated, which will then also lead into another method that will be needed for dealing with what happens when an entire team is defeated.

There was a method named “EndTurn” in the TurnManager script and the TacticsMove script. I am not sure if this is a bad practice or something that is generally done without consequence.

PROBLEMS

My units could move through each other or even on to the same space. Going back to tutorial video “Tactics Movement – Part 2” I saw there was an adjacencyList.Clear(); command I was missing in my Tile Reset method. Adding this back in fixed the issue. I wasn’t sure if this was removed later in the tutorial by the tutorial itself for bug testing when player movement was buggy. After checking video “Tactics Movement – Part 4” in the debugging segment, this does not appear to be the case, so it does seem that I just missed that line of code the first time.