- Game Overview
- Game Concept
- Character Roles
- Movement & Actions
- Game Mechanics
- Detection System
- Win Conditions
- Game Flow
- UI & Information Display
- Strategy & Tactics
RajakarDhor is a turn-based stealth/tactical game set on a 10x10 grid-based maze. It's a two-player asymmetric game where:
- One player takes the role of Rajakar (the thief/intruder trying to escape)
- The other takes Birsreshtha (the guard/defender trying to prevent escape)
Key Statistics:
- Grid Size: 10×10 cells
- Maximum Turns: 60 (30 rounds when alternating turns)
- Tile Size: 64 pixels (48-64 recommended)
- Game Speed: 60 FPS with adjustable simulation speed
- Playable Mode: Fully automated AI gameplay (both players controlled by AI)
The game name "RajakarDhor" has roots in Indian administrative history:
- Rajakar: A historical term referring to tax collectors or administrators
- Dhor: Pursuit/capture
- Asymmetric: Each player has fundamentally different abilities and objectives
- Information Warfare: Players have incomplete information about each other
- Strategic Depth: Combines stealth (Rajakar) with hunting (Birsreshtha)
- Probabilistic: Uses belief maps and statistical inference for AI decision-making
- Strategy game enthusiasts
- AI/Game Theory enthusiasts
- Tactical puzzle players
Escape the maze by reaching an EXIT tile and executing an ESCAPE action
Rajakar is an infiltrator trying to escape through exit points in the maze. The character must:
- Move silently through the maze
- Avoid detection by Birsreshtha
- Use walls as cover to block sightlines
- Navigate to designated EXIT tiles
- Execute the ESCAPE action to win
- Vision: Can see in 4 cardinal directions (up/down/left/right) up to 3 cells away
- Can see through walls: Does NOT have line-of-sight restrictions
- Silent movement: Waiting generates NO noise
- Escape ability: Can only use on EXIT tiles
- Typically controlled by AI (optional: human player mode)
- Strategy: Stealth, evasion, path-finding
- Difficulty: Medium (must balance speed with stealth)
Capture Rajakar by getting adjacent to them AFTER Birsreshtha's action
Birsreshtha is the defender protecting the maze, tracking and intercepting the escaped. The character must:
- Locate Rajakar using various detection methods
- Track Rajakar's likely positions using probability inference
- Move toward and intercept Rajakar
- Use the power scan strategically
- Maintain awareness of exit points
- Directional Sight: Sees in the direction facing (4 cardinal directions), up to 3 cells away, blocked by walls
- Orthogonal Range: Always-on detection in cardinal directions ignoring walls
- Power Scan: Special ability available every 4 turns
- 8-directional coverage (orthogonal + diagonal)
- Radius: 2 cells
- Ignores walls - can penetrate obstacles
- Instantly reveals Rajakar if within range
- AI Assistance: Sophisticated AI that uses both Minimax (when Rajakar seen) and Probability Maps (when hidden)
- Controlled by AI with advanced decision-making
- Strategy: Hunting, predicting, narrowing down possibilities
- Difficulty: Hard (complex AI with multiple algorithms)
| Action | Description | Noise | When Available | Duration | Effect |
|---|---|---|---|---|---|
| MOVE | Move to adjacent cell (4 directions) | 2 cells radius | Always (valid floor) | 1 turn | Generates noise, reveals position to those within range |
| WAIT | Stay in place, no action | Silent (0) | Always | 1 turn | No noise generated - perfect for stealth |
| ESCAPE | Execute escape sequence | 3 cells radius | On EXIT tiles only | 1 turn | Wins the game if Birsreshtha doesn't capture first |
- Can move: To adjacent walkable floor tiles (4 directions only: up/down/left/right)
- Cannot move: Through walls (#), out of bounds, or diagonally
- Line of Sight: Not required for movement (can move behind walls)
When Rajakar performs an action, noise is generated:
- MOVE: Noise reaches up to 2 cells away (Manhattan distance)
- WAIT: No noise (silent action)
- ESCAPE: Noise reaches up to 3 cells away (loudest action)
Strategic Implication: If Birsreshtha is within the noise radius, they HEAR the action and update their belief map accordingly.
| Action | Description | Trigger | When Available | Effect |
|---|---|---|---|---|
| MOVE | Move to adjacent cell (AI-guided) | AI decision | Always (valid floor) | Moves toward Rajakar or likely location |
| WAIT | Stay in place | AI decision | Always | Hold position, useful for ambush or when uncertain |
| POWER SCAN | Special detection ability | Automatic (every 4 turns) | Every 4th Birsreshtha turn | Reveals all cells within 2-cell radius in all 8 directions |
-
Directional Sight (Always Active)
- Coverage: Direction facing (one of 4 cardinal directions)
- Range: 3 cells maximum
- Obstacles: Blocked by walls (line-of-sight required)
- Visibility: Shows up as light blue tint on grid
-
Orthogonal Range (Always Active)
- Coverage: All 4 cardinal directions
- Range: 3 cells maximum
- Obstacles: Ignores walls (penetrates obstacles)
- Purpose: Always-on backup detection
-
Noise Detection (Passive)
- Triggered By: Rajakar's MOVE or ESCAPE actions
- Range: Action-dependent (2 for MOVE, 3 for ESCAPE)
- Information: Tells Birsreshtha that Rajakar made an action, but not exact position (only distance)
-
Power Scan (Active Ability)
- Frequency: Every 4 Birsreshtha turns (automatic at turns 4, 8, 12, 16, etc.)
- Coverage: 8 directions (cardinal + diagonal)
- Range: 2 cells radius
- Wall Penetration: Ignores walls completely
- Accuracy: If Rajakar is within range, instantly reveals position
- Visual Feedback: Blue highlighted cells appear on grid showing scan area
- AI Uses: Updates belief map with this evidence
Birsreshtha's moves are determined by sophisticated AI:
When Rajakar is SEEN (detected directly):
- Uses MINIMAX with Alpha-Beta Pruning algorithm
- Looks 3 moves ahead
- Makes optimal interception move
- Direct pursuit mode
When Rajakar is HIDDEN (not currently visible):
- Uses Probability-Based Belief Map Tracking
- Maintains probability distribution of possible locations
- Moves toward highest-probability regions
- Incorporates noise, scan results, and motion prediction
- Adaptive hunting mode
Structure:
- 10×10 grid (100 cells total)
- Three tile types:
- FLOOR (.): Walkable space (default)
- WALL (#): Impassable obstacle, blocks line-of-sight
- EXIT (E): Escape point for Rajakar (appears as green tile)
Coordinates:
- (0,0) is top-left corner
- Rows increase downward (0-9)
- Columns increase rightward (0-9)
- Movement uses compass directions: Up (-1,0), Down (+1,0), Left (0,-1), Right (0,+1)
Rajakar and Birsreshtha are spawned with strict distance constraints:
Spawn Constraints:
- Rajakar to Birsreshtha: Minimum 4 cells (Manhattan distance)
- Rajakar to each EXIT: Minimum 4 cells
- Birsreshtha to each EXIT: Minimum 8 cells
- EXIT to EXIT: Minimum 8 cells
- Attempts: Up to 8000 tries to find valid spawn configuration
- Exits: 2 per game
Rationale: Ensures fair starting positions - Rajakar has space to move, Birsreshtha isn't positioned to capture immediately.
Turn Structure:
- Current Player: One player takes an action
- Turn Count: Increments after action resolves
- Alternation: Switches to other player
- Order: Rajakar starts first
- Total Limit: 60 turns maximum
Timing:
- Each turn represents one action (MOVE, WAIT, or special)
- Actions resolve immediately
- No simultaneous turns (fully sequential)
- Players alternate: R → B → R → B → ...
Turn Counting:
- Turns = individual actions (60 total)
- Rounds = pairs of actions (30 rounds = 1 Rajakar + 1 Birsreshtha)
- UI displays: "Turn Count: X / 60"
What each player knows:
At the START of Rajakar's turn:
- If Birsreshtha is visible in Rajakar's 4-direction sight (range 3, blocked by walls)
- If noise was heard from Birsreshtha (not implemented for Birsreshtha yet)
At the START of Birsreshtha's turn:
- If Rajakar is visible through directional sight (range 3, blocked by walls)
- If Rajakar is within orthogonal range (range 3, ignores walls)
- If noise was heard from Rajakar's last action (range 2 for MOVE, range 3 for ESCAPE)
- Power scan evidence (if active and within range)
Fog of War:
- Birsreshtha doesn't know EXIT positions until seeing them directly
- Rajakar doesn't know Birsreshtha's exact position after losing sight
- Both use probability/inference to track hidden opponent
- Active: Always (in facing direction)
- Range: 3 cells in one cardinal direction
- Line of Sight: Yes - blocked by walls
- Directions: Up, Down, Left, Right (Birsreshtha turns to face)
- Accuracy: Perfect - if visible, exact position is known
- Visuals: Light blue tint on grid shows sight cone
Example: If Birsreshtha faces UP and Rajakar is 2 cells above in direct line with no walls → DETECTED
- Active: Always
- Range: 3 cells in cardinal directions
- Line of Sight: No - ignores walls
- Accuracy: Perfect if within range
- Purpose: Backup detection that works through walls
Example: If Rajakar is 2 cells to the RIGHT even behind a wall → DETECTED
- Active: When Rajakar moves or escapes
- Trigger:
- MOVE action → 2 cell radius noise
- ESCAPE action → 3 cell radius noise
- WAIT action → 0 (no noise)
- Information: Birsreshtha hears that something happened within range, but exact position unclear
- Effect: Updates probability belief map with noise constraint
- Advantages: Works through walls, detects WAIT is NOT performed
- Active: Every 4 Birsreshtha turns (turns 4, 8, 12, etc.)
- Range: 2 cells in all 8 directions (orthogonal + diagonal)
- Line of Sight: No - penetrates all walls
- Coverage: 24 cells maximum (8 directions × 2 cells + center)
- Accuracy: Perfect - instant reveal if Rajakar is within range
- Visuals: Bright blue highlighted cells appear briefly
- Strategic: Most dangerous detection method (no hiding from scan)
Power Scan Pattern (from Birsreshtha at center):
□ □ □
□ □ □
□ □ B □ □
□ □ □
□ □ □
All 24 surrounding cells + center in 8 directions, radius 2
- Method: 4-directional sight only
- Range: 3 cells in cardinal directions
- Line of Sight: Yes - blocked by walls
- Detection Target: Can only see Birsreshtha
- Purpose: Know if guard is visible, doesn't affect gameplay (AI-controlled)
Condition: Standing on EXIT tile + ESCAPE action executed
Mechanics:
- Move adjacent to or onto an EXIT tile
- Use ESCAPE action while on EXIT tile
- If Birsreshtha has NOT moved adjacent to Rajakar yet this turn → RAJAKAR WINS
- Screen displays: "RAJAKAR WINS!"
- Score: Victory for Rajakar
Requirements:
- EXIT tile must be reached (visible on grid as green)
- ESCAPE action must be executed on that exact tile
- Birsreshtha must not be adjacent when Rajakar escapes
- ESCAPE takes exactly 1 full turn
Condition: Adjacent to Rajakar (Manhattan distance = 1) AFTER Birsreshtha's action
Mechanics:
- Birsreshtha performs MOVE action to move adjacent to Rajakar
- After Birsreshtha's action resolves, check: Is Birsreshtha adjacent to Rajakar?
- If YES → BIRSRESHTHA WINS
- Screen displays: "BIRSRESHTHA WINS!"
- Score: Victory for Birsreshtha
Requirements:
- Must be adjacent AFTER Birsreshtha moves (not before)
- Adjacency = Manhattan distance of 1 (4 adjacent cells: up/down/left/right)
- Capture doesn't require facing or direct sight
- Diagonal adjacency does NOT count
Note: Rajakar cannot be captured WHILE moving. Capture check happens AFTER Birsreshtha's action completes.
Condition: Reach turn limit without either player winning
Mechanics:
- Game progresses through turns
- At end of turn 60: Check if winner is still
None - If YES → Game is DRAW
- Screen displays: "DRAW!"
- Score: Draw (no winner)
Why Draw Happens:
- Rajakar managed to evade for maximum turns without escaping
- Birsreshtha couldn't intercept in time
- Both players' strategies were defensive
Duration: 30 complete rounds (60 individual turns)
- Load Game: Parse maze from ASCII map
- Spawn Players: Generate valid spawn positions for Rajakar and Birsreshtha
- Place Exits: Position 2 EXIT tiles using spawn constraints
- Initialize AI:
- Create probability map for Birsreshtha
- Reset detection clues
- Set facing direction for Birsreshtha
- UI Setup: Display initial game state
While running AND winner is None:
1. Handle Events (quit, pause, restart)
2. Check if current player is AI
3. If AI turn:
- Delay for visibility (300-350ms)
- If Rajakar: AI chooses move (fuzzy)
- If Birsreshtha: AI chooses move (Minimax or Probability)
4. Process Action:
- Execute movement/action
- Update positions
- Generate noise if applicable
- Check win conditions:
* Rajakar on EXIT + ESCAPE → Rajakar Wins
* Birsreshtha adjacent after move → Birsreshtha Wins
* Turn 60 reached → Draw
5. Update Detection:
- Calculate what each player can see
- Update belief maps
- Record noise/sight clues
6. Switch Turns:
- Current = other player
- Increment turn counter
7. Render:
- Draw grid and tiles
- Show players (R=Rajakar, B=Birsreshtha)
- Show vision cones (gold for R, blue for B)
- Show power scan highlights (if active)
- Display UI panel with stats
8. Update Frame:
- Display to screen
- Cap FPS to 60
- Game Over: Display win message or draw
- Options:
- Press R to restart simulation
- Click restart button → Reset game
- Click menu button → Return to main menu
- Statistics: Show turn count and winner
┌─────────────────────────────────────────────┐
│ TOP BAR (Game Status) │
├─────────────────────┬───────────────────────┤
│ │ │
│ 10×10 GRID │ RIGHT PANEL (UI) │
│ • Walls (#) │ • Round Info │
│ • Floor (.) │ • Detection Signals │
│ • Exits (E) │ • Objective Info │
│ • Rajakar (R) │ • Confidence % │
│ • Birsreshtha (B) │ • Exit Tracking │
│ │ │
└─────────────────────┴───────────────────────┘
Right Panel Cards:
-
Round Info
- Current player: Rajakar or Birsreshtha
- Turn count: Current / Max (e.g., 12 / 60)
- Confidence: % probability (for Birsreshtha's belief map)
- Exits discovered: X/Y (how many Birsreshtha has found)
-
Detection Signals
- For Rajakar's turn: "Contact this turn: [Seen/Not Seen] [Heard/Not Heard]"
- For Birsreshtha's turn: "Signals this turn: [Seen/Not Seen] [Heard/Not Heard]"
-
Objective
- Rajakar turn: "Reach EXIT and Escape. (Escape takes 1 full turn on EXIT)"
- Birsreshtha turn: "Get adjacent to capture. (Capture check happens after Birsreshtha move)"
-
Visual Indicators
- Green circle: Positive (detection success)
- Red circle: Alert (danger zone)
- Gold tint: Rajakar's vision area
- Blue tint: Birsreshtha's vision area
- Bright blue: Power scan area (when active)
- Options:
- Resume Game
- Restart Match
- Main Menu
- Message: "RAJAKAR WINS!" or "BIRSRESHTHA WINS!" or "DRAW!"
- Buttons:
- Restart
- Main Menu
- Speed Route: Move quickly toward nearest EXIT while avoiding Birsreshtha
- Noise Masking: Wait (silent) when Birsreshtha is far, MOVE only when sure it's safe
- Wall Hugging: Use walls to block Birsreshtha's directional sight
- False Trails: Move in one direction to generate noise, then WAIT
- Exit Rushing: Once path to EXIT is clear, sprint there before power scan
- Silent Movement: Alternate MOVE with WAIT to confuse Birsreshtha's tracking
- Maze Mastery: Know wall patterns to maximize blocked sightlines
- Temporal Avoidance: Move when power scan won't activate (turns 1-3, 5-7, etc.)
- Corner Camping: Hide in maze corners where detection is hardest
- Misdirection: Generate noise far from actual EXIT location
- Mid-Game: Conservative movement, gather information
- Late-Game: Aggressive push toward EXIT when turn count is high
- Crisis: If detected, either escape or evade depending on distance
- Direct Pursuit: Move directly toward last known position of Rajakar
- Choke Points: Position near EXITs (discovered through vision) to block escape
- Scan Timing: Use power scan strategically at turns 4, 8, 12, etc.
- Narrowing: Eliminate possibilities based on noise range
- Ambush: Wait at likely escape routes
- Perimeter Control: Patrol around all known EXITs
- Exit Discovery: Actively search maze to find all EXIT locations first
- Containment: Use walls to restrict Rajakar's movement options
- Information Gathering: Use every detection method to build accurate belief map
- Entropy Reduction: Each turn, eliminate impossible positions
- Early Game: Explore maze, discover exits, build belief map
- Mid Game: Active hunting when Rajakar generates noise
- Late Game: Aggressive if Rajakar not found; passive if confident of position
For Rajakar:
- WAIT is your friend (no noise)
- Move when Birsreshtha just moved (can't capture yet)
- Plan EXIT route during early game
- Use walls to break line-of-sight
- Don't move on turns 4, 8, 12 (power scan danger)
For Birsreshtha:
- Power scan is your superpower (use every 4 turns)
- Track noise sources with belief map
- EXITs are natural chokepoints
- Don't waste moves; use probability to predict
- Orthogonal range (ignores walls) is free detection
General:
- Maze layout determines strategy (open = hard for Rajakar, tight = good for hiding)
- Turn count increases pressure on Rajakar (must escape)
- Detection is asymmetric (Birsreshtha has more tools)
| Setting | Value | Purpose |
|---|---|---|
| GRID_SIZE | 10 | 10×10 maze |
| TILE_SIZE | 64 px | Visual size |
| MAX_TURNS | 60 | Game length |
| SIGHT_RANGE | 3 cells | Detection range |
| NOISE_MOVE | 2 cells | Movement noise radius |
| NOISE_WAIT | 0 cells | Silent action |
| NOISE_ESCAPE | 3 cells | Escape noise radius |
| BIRSRESHTHA_POWER_COOLDOWN_TURNS | 4 | Scan frequency |
| BIRSRESHTHA_POWER_SCAN_RADIUS | 2 cells | Scan range |
| BIRSRESHTHA_MINIMAX_DEPTH | 3 plies | Look-ahead depth |
- Frame Rate: 60 FPS
- AI Delay: 300-350ms per move (for visibility)
- Grid Updates: Real-time each frame
- Rendering: Pygame 2D rendering
RajakarDhor is a sophisticated tactical game combining:
- ✓ Turn-based grid movement
- ✓ Asymmetric gameplay (two different playstyles)
- ✓ Information uncertainty (fog of war)
- ✓ Advanced AI (Minimax + Probability Maps)
- ✓ Strategic depth (multiple win paths)
- ✓ Rich detection mechanics (sight, sound, scan)
The game creates an emergent gameplay experience where Rajakar must use stealth and evasion while Birsreshtha employs hunting and probability inference. The ~30-turn length ensures paced, strategic gameplay where every action matters.