Community-based video game design and development.

Posts tagged ‘games’

Marketing: ID-adjusted Prices

As a very quick draft, I’d like to hold down a quick thought that many of you might be able to relate to or understand, and which will require further elaboration and work to fully phrase out and produce the concepts behind into a fleshed-out manifesto or essay. I’m talking about prices adjusted to the customer.

If an online store – that may be based in the USA and hence requires a set amount of USD to make a living in the USA, based on US prices – wants to sell products, and they choose the USD for their local customers, but then require e.g. European customers to pay in Euros and British Pounds, there is a lot of money to be gained for the store, but also a lot of trickery done that is not far away from literal cheating a customer in their faces.

Now, there is an argument that some people may come up with which says: “But the Euro is a stronger currency and people in Germany earn more money than US citizen. They should also pay more.” and honestly, I have mixed feelings about that idea. Because if we start requiring intel about our customers, asking about their place of origin, that itself is already a sketchy concept. Now, if we lever prices to equality like that, we basically have the basics for (economists will correct me on this one) not only a non-free market but also a communist-oriented system. And that’s only the tip of the iceberg: If we truly believe in that ideology and want fair prices, we need to gather intel about the customer’s income, wealth and standing, so to figure out whether one British customer really should pay £50 or rather £50’000, if, let’s say, he were to be a millionaire. And it goes without saying that this not only invades privacy, it also makes transactions insane and plain unattractive.

The next issue arises when we think about how a customer would feel treated when having to pay – essentially – more than others, because he is in fair standing. It discourages hard work, since wealth is gone just as fast anyways (i.e. the communist basics), discriminates the ones who worked hard and/or efficiently in a way to have a more stable economy and also very clearly points with a finger at rich and poor people/nations. Then you have a problem that has more to do with a general economic issue, namely that you start to look at digital goods and services as you’d look at physical goods and services, which function entirely differently:

Not only is a digital good often very tertiary and an expression of luxury (you don’t starve if you can’t download the latest video game online), but you’re lacking two fundamental values in digital goods which are amongst the very definition of a good’s value/price: time and scarceness. – If you tell me to go to my local grocery store and acquire a loaf of bread, that resource is in limited availability and requires me to invest some amount of time into traveling that distance from point A to point B and back. However, on the other end, I can press one key and an algorithm for face detection is duplicated almost instantaneously while I’ve not moved a millimeter from my seat. And instead of utilising those technological facts to our advantage (hey, what’s better than infinite supply and no waiting time or distance?), we deploy police, laws and trickery to somehow force our old, traditional, unflexible, inadequate model of economics on digital trade. And that is where the 21st century will have a natural selection where the old, dusty 18th century economists will get left behind and those with a progressive mindset survive and build the future.

This is an extremely vast scientific field and I dare not go into it too much right now, but I would like to take that opportunity to make one thing very clear: We are no longer dealing with one model of economics, but with multiple that run parallel. I like to refer to the model applicable to the electronic world as “E-conomics”, which stands for “Electronic Economics”, i.e. the science that occupies itself with economic observations and methods in the electronic/digital sector.

Trying to get the most out of the customer is arguably unethical and consequently leads to a competitive society that will not have any motivation to work together and feel unity. For various reasons, it will – in future elaborations – prove to be a lot more efficient and long-term sane to lead trade in a mutual-interest way where the customer and vendor have a more equal standing and the vendor is as much interested in the customer’s well-being as the customer in the vendor’s. All these subjects are a lot more relevant to E-conomics and I’m looking forward to seeing our new era develop with intelligent people contributing to solutions and methods.

– D. von Ziegler

Day 12-16: Achievements

Day 12

Mathematics

  1. Vectors:
    1. Calculated formula for circular rotation of a 2D vector around an origin

Unity

  1. Falltime:
    1. Calculated
    2. Affects Sit() time
  2. Animations:
    1. Grass default
  3. Collision:
    1. Formula to cast 360° rays around centre
    2. Detects custom layers
    3. Outputs object’s identity
    4. Outputs precise angle in degrees of collision

C#

  1. goto
  2. continue (partially)
  3. Trivia: C# has Garbage Collection, unlike e.g. C++

Graphics

  1. Drew Grass tile sprite

Day 15

Unity

  1. Conversion between SI units to Unity units
  2. Physics Handler:
    1. Created basic constants and formulae

Computer Science

  1. Libraries:
    1. OS differences: .dll, .dylib, .so
  2. Executables:
    1. OS differences: .exe, .osx, .elf
  3. Cocoa API: basic overview
  4. WinForm applications:
    1. Basic architecture in VisualStudio 2013
    2. Basic properties
    3. Created clickable Button, displays a MessageBox
    4. Checkbox used

C#

  1. Draw.Rectangle()
  2. Can’t call non-static method from inside static method
  3. Events:
    1. Subscribing and Sender

Day 16

Unity

  1. Constructors:
    1. Doesn’t like new keyword, prefers AddComponent()
  2. Script to calculate volume of sphere object
  3. Structure:
    1. External Physics Handler
    2. Individual Physical Properties
      1. Main interface with properties declaration
      2. Individual scripts implement properties
    3. Acceleration as public method
    4. Categorisation by physical properties and sub-categories
  4. Altitude of objects calculated
  5. Physical constants added:
    1. Standard Gravitational acceleration force
    2. Nullforce

Physics

  1. SI units:
    1. General
    2. Definition
    3. Relationship to other units
    4. Converted SI system into Unity
  2. Thermodynamics: (brief glimpse)
  3. Collision:
    1. Elastic Collision
    2. Inelastic Collision
    3. Coefficient of Restitution (COR)
    4. Partially translated for implementation in Unity

C#

  1. Interfaces
  2. Dictionary()
  3. Properties:
    1. Short syntax
  4. Conditional ?: operator
  5. Fields:
    1. Definition
  6. Terminology:
    1. “Declaration”
    2. “Implementation”

Day 9-11: Achievements

Day 9

Geometry

  1. Quaternions
  2. Euler Angles
  3. Gimbal
  4. Gimbal Lock

Unity

  1. Quaternions:
    1. Identity
    2. Euler
    3. Slerp
  2. Parenting: head inside character
  3. Separation of rotation around x and y axis if using function.Rotate()
  4. Mathf.
    1. Clamp
    2. SmoothDamp
  5. Functioning POV Camera: Quaternion used
  6. Walking: forward, not axis (works)
  7. RotateAround()
  8. Sprites:
    1. Layered character of sprites

Graphics (3D and 2D)

  1. Drew a sprite

Day 10

Physics

  1. Optics: Parallax

Unity

  1. Horizontal Movement works (no acceleration; over multiple scripts)
  2. Camera: Follows player (2D, orthographic)
  3. Gravitation works (no acceleration, mass etc.)
  4. PolygonBoxCollider2D()
  5. CheckSphere()
  6. Gizmos in Unity: Definition
  7. Collision:
    1. 2D Linecast to layer successful
    2. Left/Right Wall-check without cancelling each other out
  8. Jump mechanics created (no acceleration)
  9. Background follows player

Graphics

  1. Background painting in Photoshop

Day 11

Geometry

  1. Minimum Bounding Box: Definition

Unity

  1. Animation:
    1. Idle state
    2. Walk left/right states (incomplete)
    3. Jump state
    4. Falling state
    5. Landing state
    6. Water default
  2. Animator:
    1. Default set to idle
    2. Animations loop when needed
    3. Transitions and triggers for Walk L/R, Jump, Falling, Landing work
  3. Animation handler that can sit() out the input when player can’t move due to animation running
  4. InstaDeath tile works temporarily
  5. Facing direction
  6. Gizmo functions:
    1. DrawRay()
    2. DrawLine()
  7. Flip sprites: Flips all animations as well
  8. Water:
    1. Collision works
    2. Reduces velocity
    3. Allows for multiple Jumps
  9. Input Monitor: knows whether player is idle or not
  10. Jump: now chargeable

Graphics

  1. Different body parts and poses for the 4 animations
  2. InstaDeath tile drawn
  3. Water tile drawn

C# Script: POV Camera

Engine: Unity
Language: C#

Description:
This script is a very blunt and simple approach to have the camera always 
reset to the player's current position, giving you a POV feeling. 
It precedes that you want to keep the camera separate from the 
player's avatar in the hierarchy and that you attach the script 
to the camera.
Note that you will have to make adjustments depending on how tall 
your player avatar is, as the default position may vary 
from object to object.

//Script start
public class POVCamera : MonoBehaviour {
//Initialise members
Vector3 playerposition;
Transform self;
GameObject player;

//This happens when the scene loads
void Start() {
//Returns the Transform component of the camera
self = GetComponent<Transform>(); 
//Returns the GameObject that you called "player" 
//for your player's avatar
player = GameObject.Find("player");
}

//This happens once per frame
void Update() {
//Gets the player's position in (x, y, z)
playerposition = player.transform.position;
//Sets the camera's position to the position of the player
self.transform.position = playerposition;
}
}

Day 5-8: Achievements

Day 5

Physics

  1. Velocity
  2. Acceleration
  3. Kinetic Force

C#

  1. Acceleration programmed

Day 6

Mathematics

  1. Dimensionless Numbers

Geometry

  1. Vector addition
  2. Point addition resulting in vector

Physics

  1. Drag/Fluid-/Air Friction:
    1. Meaning
    2. Drag coefficient
  2. Air Density:
    1. Temperature & Pressure dependency
  3. Reynold’s Number
  4. Viscosity of fluids
  5. Dry Friction:
    1. Stiction
    2. Kinetic Friction:
      1. Coefficient
      2. Coulomb’s formula
      3. Geometric dependency
  6. Angular velocity
  7. Centrifugal force
  8. Graviation:
    1. Earth’s Standard Gravity (gravitational acceleration)
    2. Newton’s law of Universal Gravitation
    3. Gravitational constant G
  9. Normal force:
    1. Formula
    2. Angular aspects
  10. Collision:
    1. Deflection (1D, 2D)
    2. Elasticity (elastic, inelastic)
    3. Impact (deformation)
  11. Tension:
    1. Definition
    2. Relation towards Compression
    3. Relation towards Stress
  12. Stress
  13. Ductility & Malleability
    1. Definition
    2. Relation to Tension and Compression
  14. Pressure

C#

  1. Acceleration formula:
    1. Maximum speed
    2. Adjusting units to Unity’s engine,
    3. Drag considered
  2. Velocity formula:
    1. Considers input-based acceleration (keyboard)
    2. Considers stored acceleration without input (“sliding”)
  3. Getter/Setter

Unity

  1. Accessing Object > Component > Value
  2. Velocity calculation:
    1. Cube in air for T=15°C, p=1atm, g=9.80665m/s2
  3. Prefab created: ‘Gravitational Cube

Day 7

C#

  1. Regex:
    1. Repetition
    2. Word Mining algorithm
  2. Booleans: inversion
  3. Setter: successful application
  4. Named arguments
  5. Optional arguments
  6. Inheritance
  7. Polymorphism
  8. Encapsulation:
    1. Properties (get, set)
  9. Naming conventions
  10. Null vs Nil
  11. Pointers: overview
  12. ‘this’ keyword: repetition

Unity

  1. Vector.Angle:
    1. Definition
    2. Player’s direction calculated
  2. GUI:
    1. OnGUI basics
    2. Rect
    3. GUI.Button with working method
  3. Asset vs Object
  4. Instantiating:
    1. Cloning of an object successful
    2. Object vs GameObject
  5. Mouse:
    1. Position
    2. GetMouseButtonDown

Day 8

Mathematics

  1. Absolute value: repetition
  2. Mapping/Translation:
    1. Algebraic Functions
    2. Linear Map
    3. Matrix method

Geometry

  1. Cross product
  2. Norm
  3. Unit vector
  4. Dot product
  5. Mapping/Translation:
    1. Vector mapping
  6. Exterior algebra
    1. Brief insight
    2. Bivectors: brief insight
  7. Tensors
  8. Osculating circle: definition

Physics

  1. Stress:
    1. Simple uniaxial stress
    2. Shear stress
    3. Isotropic stress (tension) & Hydrostatic pressure (compression)
  2. Net force
  3. Moment of Inertia
  4. Angular/Rotational Motion:
    1. Angular Velocity
    2. Angular Acceleration
    3. Angular Momentum
  5. Torque
  6. Force, Energy, Work, Power: differences and definition
  7. Kinetic energy:
    1. Formulae
    2. Rotational energy
  8. Kinematics:
    1. Uniform Acceleration: partially (motion)
  9. Centripetal force: introduction

C#

  1. Externalisation: passing only attributes to a public method instead of repeating it inside the script (linked to Unity, 3.)
  2. Structure:
    1. Optimising by combining instructions into as few methods as possible.
    2. Optimising by properly separating and prioritising methods within parent handlers.

Unity

  1. Materials:
    1. Created simple texture.
    2. Created simple bumpmap from texture.
  2. Heightmap: basic knowledge
  3. Script Management: empty GameObjects serving as libraries (linked to C#, 1.)
  4. POV Camera: attached to player avatar’s ‘head’
  5. Mouse: axis translates Camera’s angle to rotate (“POV mouse camera”)

Day 4: Achievements

Graphics & Engine

  1. What is Raycasting and how do you apply it?
  2. What are Collision Masks and how do you apply them?
  3. How do you access objects’ components and their values?

Physics

  1. Velocity (v = Δx/Δt)
  2. Acceleration (a = v/t)
  3. Momentum (p = m * v)
  4. Kinetic Energy (E = m * v2)
  5. Weight (W = m * g)
  6. Mass (m = F / a)
  7. Density (ρ = m / V)
  8. Volume (V = x * y * z) (for a cube)
  9. Grativation (g = 9.80665 m/s2) & (F = G * m1 * m2 / r2) & (G = 6.67384(80) * 10−11 * N (m/kg)2)

Material Science

  1. Iron: physical properties

Programming

  1. 2D collision detection.
  2. Primitive acceleration.

Day 3: Study Achievements

It has been a truly productive day in which I could cover a broad range of topics that bring me closer to design and develop video games in my future. I greatly loved learning about those things and sometimes wanted to wander off into details or related topics, but had to stay superficial to stay in my schedule. It is beyond me how people cannot adore mathematics, physics and computer sciences; especially when your vision and dream of what you create with those is a video game, something that’s fun and can deliver entire worlds into our hands. – This is also why I’ve decided to simply list the noteworthy concepts I’ve learnt about every once in a while in such a post to show what kind of ‘course’ may be required to get into game design.

 

  1. What is a library? (repetition)
  2. What is a framework?
  3. What is an SDK? (repetition)
  4. What is a Desktop Environment (DE)?
  5. What is an API?
  6. What is a Window Manager?
  7. What is a sprite?
  8. What is a bitmap? (repetition)
  9. What are vector graphics? (repetition)
  10. What is a polygon mesh?
  11. What is a GUI? (repetition)
  12. What is a subroutine? (repetition)
  13. What is a communications protocol? (repetition)
  14. What is a Turing machine? (repetition)
  15. What is a rigid body?
  16. What is DMM?
  17. What is the Finite Element Method (FEM)?
  18. What is OpenGL?
  19. What is Direct3D?
  20. What is texture mapping?
  21. What is an engine?
  22. What is tessellation?
  23. What is parallax mapping?
  24. What is bump mapping?
  25. What is a decal?
  26. What is a halo?
  27. What is a flare?
  28. What is a particle system?
  29. What components does Unity 4 offer?
  30. What is collision detection?
  31. What is pathfinding?

 

Note:

Most items on this list don’t just contain the question “what is…” but also “How does it work?” (e.g. OpenGL APIs) and other studies. Also note that the majority are elements I’ve worked with before but didn’t know the precise, official details and could only apply them without really understanding their full potential. They were all studied in low-level depth that allows me to connect these things into my understanding of computer engineering and – technically – any programming language, once I master those. – In pathfinding I analysed the A* algorithm in particular and partially tested it for weaknesses, while collision detection led me to the tree structures of Axis-Aligned Bounding Boxes (AABBs).

Day 1: Player Control Input in C#

The first script I’ve written and helped me find the entrance into C# and Unity did one simple, yet powerful thing: It allows the player to move a square freely in two dimensions by using the default keyboard input.

using UnityEngine;

using System.Collections;

[RequireComponent(typeof(PlayerPhysics))]

public class PlayerControl : MonoBehaviour {

//Handler Variables

public float h;

public float v;

private Vector2 amount;

private PlayerPhysics playerPhysics;

// Use this for initialization

void Start () {

playerPhysics = GetComponent<PlayerPhysics>();

}

// Update is called once per frame

void Update () {

h = Input.GetAxis (“Horizontal”);

v = Input.GetAxis (“Vertical”);

amount = new Vector2(h, v);

playerPhysics.Move(amount);

}

}

//=== SECOND SCRIPT STARTS HERE ===

using UnityEngine;

using System.Collections;

[RequireComponent(typeof(BoxCollider))]

public class PlayerPhysics : MonoBehaviour {

public void Move(Vector2 amount) {

transform.Translate(amount);

}

}

The code consists of two scripts that I had to merge here for facility: PlayerControl.cs and PlayerPhysics.cs. Where the first translates the horizontal (h) and vertical (v) arrow-key inputs into a vector (amount), the second shifts the position of the player (i.e. the cube) by just that amount into those directions (Move()).

Through that, simple two-dimensional games can be created that don’t require a lot of special attention. It matters not whether the “player” is a cube, a 2D sprite or a 3D animated model – it will always move with that script and alterations will smoothen it out, give it a more realistic and fluid, stable feeling.

It was very refreshing for me to see many familiar terms and syntax elements again after a “long” time, but I had to rely on some sources to update my memory and teach me this or that, especially when it came to working with physical objects on a plane/in a space and the Unity engine’s terms, usage and architecture. I greatly enjoyed it, though, and feel like I’ve opened the gate to a long, arduous journey of learning, training and perfecting C# programming and video game development.