Skip to content
This repository has been archived by the owner on Apr 2, 2022. It is now read-only.

Mini game design guidelines

ipar569 edited this page Oct 26, 2017 · 2 revisions

Goal of mini-game

To find the suitable items to be placed into the slot and complete the puzzle.

How to create a room for mini-game

Scenes for Level 2 has been developed in such a way to facilitate rapid development of new levels.

To create a new room for mini-game, you can either make a copy from level2room1 and start from there and create a new scene.

To create a new room from scratch, it is recommended to create a game hierarchy structure like this.

  • Root
  • Controller
  • Main Camera
  • Grid
    • Editor
      • Background
      • LambdaDisplay
      • Items
      • Player
  • Canvas
  • EventSystem
  • AudioSource

Controller

The singleton script Level2Controller.cs must be present on this GameObject

Main Camera

A game object with Camera component, must be present.

Grid > Editor

This is the editor game object which should be not manually edited but accessed via Window > GridEditor2D > Editor, the full manual for GridEditor2D can be found here

Children of Editor

It is recommended to divide elements into four layers in the order mentioned above. The Background layer should be the lowest and only contains walls and background tiles. The LambdaDisplay layer should be next and contains intermediate displays for the puzzle. The Items layer should contain Lambda items and portals The Player layer should contain the GameObject of the two players.

Canvas

The canvas is the GUI component and must contain four prefabs of both left and right toolbars and hand indicators.

EventSystem

This GameObject should come with the Canvas GameObject

Audio Source

This is needed for audio playback.

To construct a level

A new script of Room<n>Sequence must be created and attached to the Controller GameObject, this script exposes a public field in the Unity Editor to specify the sequence of display and slots used in this level. This field should be populated with the all the display and slots and it must follow the following conventions,

  • The list must start with a lambda display
  • The list must end with two lambda displays, where the last one in the list will not be affected by player actions, this would be known as the answer lambda display.
  • There should be at least one lambda slot in between the display, increasing the number of lambda slots between displays will increase difficulty, it is not recommended to have more than 2 lambda slots in between the displays.
  • The start and end of the display must be initiated with a LambdaGrid for the room to be a sensible puzzle.
  • (The validity of the puzzle is not checked automatically, one should make sure it's solvable).

Creating Lambda Items

To facilitate the creation of lambda items, a set of generic scripts has been created in /assets/level2/scripts/lambdaBehaviorSpec, including

  • GenericFilter
  • GenericMap
  • GenericStackMap
  • GenericStack
  • GenericFilterContains
  • GenericFilterRejects these should be the basic building blocks of the puzzle. To add an item to the room, select the items layer and paint the Item prefab(found in the prefab directory) on the scene, then drag the desired script onto the newly created GameObject and fill them in public fields exposed in the Unity Editor. The items created should be in the Pickups layer and tagged with Item, it should already be set if it is created from the prefab.

Creating lambda slot and display

Again, prefabs were made and can be easily painted onto the scene with Grid2DEditor, no additional config is needed if all of them are created from prefabs. Upon finishing placing them onto the canvas, do not forget to populate the Room<n>Sequence with them. To specify a lambda grid, it is convenient to use the LambdaGrid.FromString() method which will parse a lambda grid like this:

		var start = LambdaGrid.FromString
               ("NONE NONE NONE NONE NONE NONE NONE NONE\n" +
		"NONE NONE NONE NONE NONE NONE NONE NONE\n" +
		"NONE NONE NONE NONE NONE NONE NONE NONE\n" +
		"NONE NONE NONE NONE NONE NONE NONE NONE\n" +
		"NONE NONE NONE NONE NONE NONE NONE NONE\n" +
		"NONE RED NONE NONE NONE NONE RED NONE\n" +
		"NONE YELLOW RED NONE NONE RED YELLOW NONE\n" +
		"NONE YELLOW YELLOW RED RED YELLOW YELLOW NONE");

which would represent a grid like this like this

To aid the visual representation, arrows could be added for aesthetic purposes.

How to play it

Player one controls: W A S D, Q interact with a lambda slot or to pick up a Lambda, E to cycle the cursor in inventory. Backspace to drop a Lambda item. Player two controls: Arrow Up Arrow Left Arrow Down Arrow Right, Right Shift interact with a lambda slot or to pick up a Lambda, Right Ctrl to cycle the cursor in inventory. Enter/Return to drop a Lambda item.

To Complete a level, players must pick up Lambda items and put them into the corresponding Lambda slots. Each item has unique features.

  • Map <colour> to <colour>, change a colour to another color
  • Stack <colour>, stack a layer of colour on top of the current one
  • Reject <colour>, remove all colour from the current.
  • Filter Contains <colour>, remove all columns with this colour in it and center it.
  • Filter Rejects <colour>, keep all columns with this colour in it and center it.
  • Identity, the default in all the lambda slots, does nothing.

Players have to used the features related to the lambda items to "process" the starting figure into the final one. Upon completing the puzzle, a set of portals will open.

Clone this wiki locally