User:Bitlab/sandbox

Wirly is a generalization of Sokoban game. Unlike Sokoban, which has only a "hero" who pushes boxes, Wirly can have many heroes which can also pull or leap or do many other interactions with "boxes". In turn, moving boxes can cause "flock" effects by involving neighbor boxes into the movement.

Game Definition
This is an abstract or "mathematical" definition. For actual or visual interpretation, look at "Dress" section.

Units
* Like in Sokoban, map is a set of units which are squares or cubes. * Like in Sokoban, interaction is initiated by the move of a hero.

There can be many heros - in Sokoban, there is only one. Interaction results in moving of units; no attributes of unit change. There are any sorts of interactions possible between pair of units. Sokoban has only push, block, and pass interactions. Currently implemented Wirly has also: pull and swap.

Each unit race can have different colors: black hero, blue gero, green wall, red box, ... Interaction depends only on colors of pairing units.


 * Units
 * Moves
 * Colors

Objective
* Deliver units which have "baton" attribute to location of units which have "matching goal" attribute. For example, in Sokoban, boxes imply baton attribute and targets are goals. * Meaning of "matching goal" depends

Game Dress

 * Skin
 * Dress Rules

Objective
Like in Sokoban, ojective is to deliver available boxes to available targets like in Sokoban.

Interaction has deepness. For deepness 2, moved box may move second box on its way, but second box has no power to move anythig else.

Interaction can have flock behavior: neigbour boxes mock the move of primary box. In visualization of the game, units do not have to look like boxes or walls: they can have any image. "Box", "hero", "color" are parts of mathematical definition, actual skin can be different. "Rules" are part of mathematical definition, but playable game is dressed in rules worded differently.

Rules is a matrix of available interactions between units:

block - move of acting unit is blocked by neighbour, pass - unit can move over second unit (box over target in Sokoban) push - acting unit can push neighbour unit, actee, like in Sokoban, pull - acting unit pulls neighbour, swap - acting unit swaps with neighbour, (leap - neigbour leaps over acting unit. not enabled yet) ...

Interaction matrix in Wirly is not arbitrary, but constrained by introducing colors.

Colonies have additinal attribute - color. In other words colony is a couple (race, color). Races are heros, walls, boxes, targets, grounds.

There are colors available: 0, 1, 2, 3, ... 0 - color called "black" or "colorless", other colors called "colored". 1 usually called blue, 2 - green, ...

No matter, what interactions are, they obey a "color rule". This means that only colors define how colonies interact: any couple of units with colors a,b interacts the same way as another couple of units of the same colors a, b. For example, black walls block every unit, and black grounds pass every unit. However, green wall will pass blue box and green ground will block blue box. Sokoban is a game where all units have the same color, so walls aways block and grounds always pass.

In many cases, color rules even more constrained by obeying color-match-rule: ("parallel colors", "toneless colors") "matching colors" interact by one rule and different colors by other single rule.

By definition, black color matches andy other color. For example, in game "Colorban", coroless units can push any other color, and colored units can push only units of the same color.

For example: Sokoban is a "Wirly" at following extreme cases: 1. only one hero is presented, and all units have the same color, and there is a target for each box of the same color as target. 2. hero is black and each target has a matching box, 3. hero has a color and number of boxes of hero's color is equal of to the number of targets of the same color. Other boxes simply play role of walls.

Interaction has a parameter "deepness". This means that interaction propagates "through" neighbours. For examle, pushed box, can push second box if second box is on its way. If second box cannot push any other box, this means that deepness is 2. If 3 boxes can be pushed at once, deepness is 3. Sokoban is a game with deepness 1.

Interaction has a parameter "flockness" which can be either true or false. Flocked interaction involve neighbours which mock the move of primary unit next to them.

Objective of the game is to "fill" all available goals with color-matching batons.