Analysis for design

A lecture about who to analyse (board) games using statistics, probability theory and simulations.

Link to the slides if Slide Share plugin does not work: http://www.slideshare.net/lankoski/analysis-for-design

Scripts used to analyse games and visualise data:  http://www.mediafire.com/download/whucaos4v9chv40/AnalysisForDesignScripts.zip

An Experiment in Teaching Level Design

I wanted to introduce some unconventional design approaching while teaching level design. I have had an idea to do a game with using a surrealist  approach. For that I designed a game stub and coded the base functionality on the top of Unity. The student are tasked to do level design using that design, code, created prefabs.

My slides for the course intro (http://www.slideshare.net/lankoski/level-designintro)

Introduction to Unity

 

The introduction tutorial uses accompanied Unity packages:

Update 2013/01/07. file hosting changes and URLs changes to point to the new location.

Update 2012/10/27: The slides and packages now include GameManager and MainScreenGUI prefabs. GameAgents script handles Player adding player object to the scenes so that testing is easier. Tutorial slides reflect these changes.

Level Design

This is a reading I used in my course Level Design. These were used in one-day workshop where we did go through students design and discussed them based on the themes presented in these pieces.

  1. Stage Lighting Design: http://www.stagelightingprimer.com/slfs-poc.html#poc, http://www.stagelightingprimer.com/slfs-functions.html, http://www.stagelightingprimer.com/slfs-qualities.html
  2. An Architect’s Perspective On Level Design Pre-Production, http://www.gamasutra.com/view/feature/2848/an_architects_perspective_on_.php
  3. GDC 2001: Interactive Theme Park Rides, http://www.gamasutra.com/view/feature/3060/gdc_2001_interactive_theme_park_.php
  4. Environmental Storytelling: Creating Immersive 3D Worlds Using Lessons Learned from the Theme Park Industry, http://www.gamasutra.com/view/feature/131594/environmental_storytelling_.php
  5. Environmental Storytelling, Part II: Bringing Theme Park Environment Design Techniques to the Virtual World, http://www.gamasutra.com/view/feature/3185/environmental_storytelling_part_.php
  6. Environmental Storytelling Part III: Lessons Learned in the Virtual World, http://www.gamasutra.com/view/feature/130551/environmental_storytelling_part_.php
  7. The Architecture of Level Design, http://www.gamasutra.com/resource_guide/20010716/chen_01.htm
  8. http://www.worldofleveldesign.com/categories/level_design_tutorials/how-to-plan-level-designs-game-environments-workflow.php
  9. How to Plan Level Designs and Game Environments, http://www.gamasutra.com/view/feature/134949/learning_from_the_masters_level_.php
  10. Horror/Survival Level Design, http://www.worldofleveldesign.com/categories/level_design_tutorials/horror-fear-level-design/part1-survival-horror-level-design-cliches.php

Perception System Explained

Here is a bit explanation how the perception system code works.

Basic features of the code is as follows

  • If the player object is behind some other object, it is not seen. This is tested with Physics.Linecast from the center of perceiving object to the center of the player object.
  • If player object is really near (distance < closeRange), the player object is noticed 360 arc.
  • If the player object is fron (angle between the forward vector of perceiving game object and the player object is less than front angle) and distance is less than frontDistance, the player object is seen.

 

Simple Perception System (Unity, C#)

Here is a very simple perception C# code that I used my lecture today for Unity.

Function that can be added to the Enemy class to check if the enemy sees the player object or not (the code for other functionality can be found on the post /2011/10/29/intro-to-gameplay-programming-with-unity/). With this code, an enemy can perceive player object farther away if the player object is front and when rear on the side perseption range is more limited.There is also very simple line-of-sight checking functionality.

The features of the perception system can be controlled via class variables

public float frontRange = 10.0f;
public float frontAngle = 30.0f; // if angle between forward and los is less than this, the target is at front
public float closeRange = 2.0f;

Then the function actually handling the if enemy can see the player object or not.

public bool IsPlayerWithinPerceptionRange()  {
   RaycastHit hit;
   bool playerWithinPerceptionRange = false;
   if(Physics.Linecast(transform.position, GameAgents.GetPlayer().transform.position, out hit)) {
        if(hit.transform == GameAgents.GetPlayer().transform) {
            if(hit.distance <= closeRange) {
                 playerWithinPerceptionRange = true;
                 Debug.DrawLine(transform.position, hit.transform.position, Color.black);
            }
            else if(hit.distance <= frontRange) {
                 if(Vector3.Angle(transform.forward,hit.transform.position - transform.position) <= frontAngle) {
                     playerWithinPerceptionRange = true;
                     Debug.DrawLine(transform.position, hit.transform.position, Color.black);
                 }
            }
         }

    }
    return playerWithinPerceptionRange;
}