Home

ripple

Game Rules

# Ripple – Game Specification

## Overview
Ripple is a strategic board game where players place colored stones that create cascading movement effects across the board. The goal is to form groups of connected stones while disrupting your opponent’s formations. **The game features dynamic scoring where points are only held while groups exist – if your groups get scattered, you lose those points!**

## Game Setup

### Board
– 7×7 grid (49 squares total)
– Empty at start
– Grid positions referenced as (row, col) from 0-6

### Stones
– 4 colors available: Red, Blue, Green, Yellow
– Each player has access to all colors
– Unlimited supply of each color

### Players
– 2 players alternate turns
– Player 1 goes first

## Core Gameplay

### Turn Structure
1. Player places one stone of any color on any empty square
2. Ripple effect triggers automatically
3. **All scores are recalculated dynamically based on current board state**
4. Turn passes to opponent

### Ripple Effect Mechanics
When a stone is placed, ALL existing stones of the same color on the board move away from the newly placed stone:

**Movement Rules:**
– Stones move in straight lines (horizontal, vertical, or diagonal)
– Each stone moves exactly 1 space in the direction directly away from the new stone
– Movement direction is determined by the shortest path from new stone to existing stone
– If multiple directions are equally short, prioritize: North, Northeast, East, Southeast, South, Southwest, West, Northwest

**Collision Rules:**
– If a moving stone would land on an occupied square, it stops in its current position
– If a moving stone would move off the board edge, it stops at the edge
– Stones cannot occupy the same square

**Movement Examples:**
– New stone placed at (3,3), existing same-color stone at (3,5) → moves to (3,6)
– New stone at (2,2), existing stone at (4,4) → moves to (5,5) (diagonal)
– New stone at (1,1), existing stone at (1,2) → moves to (1,3) if empty, stays at (1,2) if blocked

## Dynamic Scoring System

### **Key Change: Points Are Only Held While Groups Exist**
– After every move and ripple effect, ALL scores are recalculated from scratch
– Players only earn points for groups that currently exist on the board
– **If your groups get scattered by ripples, you lose those points immediately**
– This creates dramatic score swings and makes defensive play crucial

### Group Formation
– A group consists of 3 or more stones of the same color that are adjacent (horizontally, vertically, or diagonally connected)
– Groups are evaluated after every ripple effect completes

### Group Ownership
– Groups are “owned” by the player who contributed the most stones to that group
– If players contribute equally to a group, neither player gets the points
– Ownership is tracked based on who originally placed each stone

### Point Values
– 3 connected stones: 3 points
– 4 connected stones: 6 points
– 5 connected stones: 10 points
– 6+ connected stones: 15 points + 3 points for each additional stone

### Scoring Examples
– Player 1 places 2 red stones, Player 2 places 1 red stone, they form a group of 3 → Player 1 gets 3 points
– Later, a ripple scatters this group → Player 1 immediately loses the 3 points
– If the ripple creates a new group of 4 stones (3 from Player 1, 1 from Player 2) → Player 1 gets 6 points

## Win Conditions

The game ends when either:
1. **Point Victory**: A player reaches 15 points (much more challenging now due to dynamic scoring)
2. **Mega Group Victory**: A player creates a group of 5 or more connected stones of the same color (this becomes even more valuable as it ends the game before opponents can disrupt it)
3. **Board Full**: If the board fills completely, highest score wins

## Strategic Implications of Dynamic Scoring

### **Dramatically Increased Strategy**
– **Defensive Play is Crucial**: Breaking up opponent groups is now as important as building your own
– **Tension and Volatility**: Scores constantly swing as groups form and break apart
– **Color Choice Strategy**: Do you strengthen your existing groups or break opponent groups?
– **Timing Matters**: When to go for big groups vs when to play defensively
– **Never Safe**: Leading players must constantly defend their groups

### **Risk vs Reward**
– Large groups give more points but are bigger targets for disruption
– Small, scattered groups are safer but give fewer points
– Mega groups (5+ stones) become extremely valuable as instant wins

## Game States

### Valid Moves
– Any empty square on the board
– Any of the 4 available colors
– Move is only valid if the square is unoccupied

### Game Flow
1. Initialize empty 7×7 board
2. Set current player to Player 1
3. Set both player scores to 0
4. While game not ended:
– Display current board state and scores
– Prompt current player for move (position + color)
– Validate move
– Place stone
– Execute ripple effect
– **Recalculate all scores dynamically**
– Check win conditions
– Switch players
5. Display winner and final scores

## Technical Implementation Notes

### Data Structures
“`
Board: 7×7 array of objects
– Each cell: { color: null|’red’|’blue’|’green’|’yellow’, isEmpty: boolean }

GameState: {
board: Board,
currentPlayer: 1|2,
scores: { player1: number, player2: number },
gameEnded: boolean,
winner: null|1|2,
moveHistory: Array of moves
}

Move: {
player: 1|2,
position: {row: number, col: number},
color: string,
totalScore: number // Player’s total score after this move
}
“`

### Key Functions Needed
– `placeStone(row, col, color)` – Place stone and trigger ripple
– `executeRipple(newStonePos, color)` – Move all matching stones
– `calculateDirection(from, to)` – Determine movement direction
– `findGroups(color)` – Identify connected groups after ripple
– **`recalculateScoresWithOwnership()`** – Recalculate all player scores based on current groups and stone ownership
– `checkWinConditions()` – Check if game should end
– `isValidMove(row, col)` – Validate move legality

### Animation Considerations
– Stone placement should be immediate
– Ripple movement should be animated smoothly (suggest 300-500ms duration)
– **Score updates should be dramatic and visible** to emphasize the dynamic nature
– Group highlighting should occur after ripple completes
– **Score change animations** to show gains/losses clearly

### UI Requirements
– Clear visual distinction between the 4 stone colors
– Grid lines clearly visible
– Current player indicator
– **Prominent score display with change indicators** (gains/losses highlighted)
– Color selection interface for current player
– Move history showing total scores after each move
– Restart game button
– **Visual feedback for score changes** (animations, color coding)

## Strategic Depth

### Key Strategic Elements Enhanced by Dynamic Scoring
– **Color Selection**: Even more critical – affects both scoring potential and opponent disruption
– **Placement Positioning**: Where you place determines ripple effects that can create or destroy multiple groups
– **Defensive Play**: Now equally important as offensive play – breaking opponent groups removes their points
– **Setup Moves**: Creating resilient group structures that survive ripples
– **Timing**: Balancing group building vs group disruption
– **Risk Management**: Large groups are high-reward but high-risk targets

### Common Tactics
– **Resilient Clustering**: Building groups that can survive being scattered
– **Strategic Scattering**: Placing stones to maximally disrupt opponent groups
– **Edge Control**: Using board edges to create “safe” zones for groups
– **Color Denial**: Preventing opponents from building in specific colors
– **Tempo Control**: Forcing opponents to rebuild while you maintain groups

## Variants (Optional)

### Power Stones (Advanced)
– Special stones that create larger ripples (2 spaces instead of 1)
– Each player gets 2 power stones per game

### Asymmetric Colors (Advanced)
– Each player can only use 2 of the 4 colors
– Players choose colors at game start

### Timed Mode
– Each player has 60 seconds total thinking time
– Adds pressure and prevents analysis paralysis