Add comprehensive level progression system documentation

This commit is contained in:
2025-06-13 10:49:10 +02:00
parent c50c9fc496
commit efcdd50b00

View File

@@ -1,349 +1,327 @@
# Level Progression Design
# Level Progression System - Neural Nexus
## Difficulty Scaling Philosophy
## Overview
### Core Principles
1. **Gradual Learning Curve**: Each level introduces complexity at a manageable pace
2. **Flow State Maintenance**: Difficulty increases to match growing player skill
3. **Recovery Levels**: Occasional easier levels to prevent frustration
4. **Skill Validation**: Regular challenges that test mastered concepts
The level progression system in Neural Nexus is designed to provide a smooth learning curve that gradually introduces complexity while maintaining player engagement. The system balances challenge escalation with skill development to create optimal flow state.
### Mathematical Progression
## Progression Algorithm
### Node Count Scaling
```javascript
const levelProgression = {
// Node count progression
nodeCount: (level) => Math.min(3 + Math.floor(level / 2), 12),
// Connection complexity
connectionCount: (level) => {
const nodes = nodeCount(level);
return Math.min(nodes - 1 + Math.floor(level / 3), nodes * 1.5);
},
// Time pressure
timeLimit: (level) => Math.max(30, 60 - Math.floor(level / 3) * 2),
// Pattern complexity score
complexityScore: (level) => Math.min(level * 0.8 + 2, 10)
};
const nodeCount = Math.min(5 + Math.floor(level * 0.7), 12);
```
## Level Archetypes
**Progression Curve:**
- **Levels 1-3**: 5-6 nodes (learning phase)
- **Levels 4-7**: 6-8 nodes (skill building)
- **Levels 8-12**: 8-10 nodes (competency development)
- **Levels 13-20**: 10-12 nodes (mastery phase)
- **Levels 21+**: 12 nodes (expert challenge)
### Tutorial Levels (1-3)
**Purpose**: Teach basic mechanics
**Node Count**: 3-4
**Pattern Types**: Simple chains, basic shapes
**Time Limit**: 60 seconds (generous)
**Design Rationale:**
- Exponential growth prevents overwhelming new players
- Cap at 12 nodes maintains visual clarity on mobile devices
- Gradual increase allows pattern recognition skill development
- Consistent maximum ensures predictable complexity ceiling
### Connection Complexity
```javascript
// Example Level 1 pattern
const level1 = {
nodes: 3,
pattern: [[0, 1], [1, 2]], // Simple chain A→B→C
type: 'linear_chain',
tutorial: 'Connect the nodes by dragging from one to another'
};
// Example Level 2 pattern
const level2 = {
nodes: 4,
pattern: [[0, 1], [0, 2], [0, 3]], // Hub pattern
type: 'hub',
tutorial: 'One node can connect to multiple others'
};
const connectionCount = Math.min(
nodeCount - 1 + Math.floor(level / 2),
nodeCount * 2
);
```
### Skill Building Levels (4-10)
**Purpose**: Develop pattern recognition
**Node Count**: 4-6
**Pattern Types**: Hubs, simple networks, parallel chains
**Time Limit**: 55-60 seconds
**Connection Density:**
- **Early Levels**: Minimum spanning tree (nodeCount - 1 connections)
- **Mid Levels**: Additional parallel paths (+1-3 connections)
- **Advanced Levels**: Near-complete graphs (approaching nodeCount * 2)
**Complexity Examples:**
- Level 1: 5 nodes, 4 connections (simple chain)
- Level 5: 6 nodes, 6 connections (basic network)
- Level 10: 9 nodes, 13 connections (complex web)
- Level 20: 12 nodes, 19 connections (dense network)
### Time Limit Progression
```javascript
// Level design templates
const skillBuildingTemplates = {
doubleHub: {
description: 'Two hub nodes with overlapping connections',
complexity: 4,
example: [[0, 2], [0, 3], [1, 2], [1, 3]]
},
parallelChains: {
description: 'Multiple independent connection chains',
complexity: 3,
example: [[0, 1], [1, 2], [3, 4], [4, 5]]
},
triangle: {
description: 'Basic geometric shape',
complexity: 3,
example: [[0, 1], [1, 2], [2, 0]]
}
};
const timeLimit = Math.max(45, 60 - Math.floor(level / 3) * 2);
```
### Challenge Levels (11-20)
**Purpose**: Test mastery with complex patterns
**Node Count**: 6-9
**Pattern Types**: Complex networks, geometric shapes, asymmetric designs
**Time Limit**: 45-55 seconds
**Time Allocation:**
- **Levels 1-2**: 60 seconds (generous learning time)
- **Levels 3-5**: 58 seconds (slight pressure introduction)
- **Levels 6-8**: 56 seconds (building urgency)
- **Levels 9-11**: 54 seconds (moderate pressure)
- **Levels 12+**: Continues decreasing by 2 seconds every 3 levels
- **Minimum**: 45 seconds (maintains playability)
```javascript
const challengeTemplates = {
star: {
description: 'Central hub with outer ring connections',
complexity: 6,
nodeCount: 7,
centerNode: true
},
## Level Design Philosophy
mesh: {
description: 'Highly interconnected network',
complexity: 7,
connectionDensity: 0.6 // 60% of possible connections
},
### Phase 1: Introduction (Levels 1-5)
**Objective**: Teach core mechanics without frustration
symmetrical: {
description: 'Mirror-image patterns',
complexity: 5,
symmetryType: 'vertical' // or 'horizontal', 'rotational'
}
};
**Pattern Characteristics:**
- Simple linear chains (A→B→C)
- Clear source and target nodes
- Obvious connection paths
- Minimal branching
- Forgiving time limits
**Example Patterns:**
```
Level 1: O---O---O (3 nodes, 2 connections)
Level 2: O---O---O---O (4 nodes, 3 connections)
Level 3: O (5 nodes, 4 connections)
/|\
O-O-O
```
### Master Levels (21+)
**Purpose**: Ultimate skill test
**Node Count**: 9-12
**Pattern Types**: Complex geometric shapes, dense networks, multi-hub systems
**Time Limit**: 30-45 seconds
**Success Criteria:**
- 95% completion rate for levels 1-3
- Average completion time under 30 seconds
- Players understand connection mechanics
- No confusion about objectives
### Phase 2: Skill Building (Levels 6-15)
**Objective**: Develop pattern recognition and strategic thinking
**Pattern Characteristics:**
- Hub-and-spoke patterns
- Simple symmetrical designs
- Multiple valid solution paths
- Introduction of parallel connections
- Moderate time pressure
**Example Patterns:**
```
Level 8: O-O-O (6 nodes, 7 connections)
|/|\|
O-O-O
Level 12: O (8 nodes, 11 connections)
/ | \
O--O--O
\ | /
\|/
O
```
**Success Criteria:**
- 80% completion rate for levels 6-10
- Players develop efficient connection strategies
- Reduced hesitation in pattern recognition
- Consistent improvement in completion times
### Phase 3: Challenge (Levels 16-30)
**Objective**: Test mastery and provide satisfying difficulty
**Pattern Characteristics:**
- Complex interconnected networks
- Near-optimal path planning required
- High connection density
- Increased time pressure
- Multiple interdependent components
**Example Patterns:**
```
Level 20: O-O-O-O (10 nodes, 16 connections)
|X|X|X| (X represents crossing connections)
O-O-O-O
|X|X|
O-O
```
**Success Criteria:**
- 60% completion rate for levels 16-20
- Players demonstrate advanced pattern recognition
- Strategic planning becomes evident
- High replay value for optimization
### Phase 4: Mastery (Levels 31+)
**Objective**: Provide endless challenge for expert players
**Pattern Characteristics:**
- Maximum complexity within constraints
- Algorithmic pattern generation
- Emphasis on optimization
- Tight time constraints
- Pattern variations to prevent memorization
**Design Principles:**
- Every level should be solvable within time limit
- Patterns avoid pure trial-and-error approaches
- Visual clarity maintained despite complexity
- Reward efficient solutions with better scores
## Pattern Generation Algorithm
### Basic Algorithm
### Basic Generation Process
```javascript
function generateLevelPattern(levelNumber) {
const config = getLevelConfig(levelNumber);
const nodes = generateNodePositions(config.nodeCount);
const pattern = generateConnectionPattern(nodes, config);
function generateLevel(level) {
// 1. Calculate parameters
const nodeCount = calculateNodeCount(level);
const connectionCount = calculateConnectionCount(level, nodeCount);
const timeLimit = calculateTimeLimit(level);
return {
nodes,
targetConnections: pattern,
timeLimit: config.timeLimit,
complexity: calculateComplexity(pattern)
};
// 2. Place nodes in circular arrangement with variation
const nodes = generateNodePositions(nodeCount);
// 3. Generate valid connection pattern
const pattern = generateConnectionPattern(nodes, connectionCount);
// 4. Ensure pattern is solvable
validatePattern(pattern, timeLimit);
return { nodes, pattern, timeLimit };
}
```
### Node Placement Strategy
```javascript
function generateNodePositions(count) {
const positions = [];
const centerX = canvas.width / 2;
const centerY = canvas.height / 2;
const radius = Math.min(canvas.width, canvas.height) * 0.3;
for (let i = 0; i < count; i++) {
const angle = (i / count) * Math.PI * 2;
const x = centerX + Math.cos(angle) * radius + randomVariation();
const y = centerY + Math.sin(angle) * radius + randomVariation();
positions.push({ x, y, id: i, type: determineNodeType(i, count) });
}
function getLevelConfig(level) {
if (level <= 3) return tutorialConfig(level);
if (level <= 10) return skillBuildingConfig(level);
if (level <= 20) return challengeConfig(level);
return masterConfig(level);
return positions;
}
```
### Pattern Validation
```javascript
function validatePattern(nodes, connections) {
const checks = {
isConnected: validateConnectivity(nodes, connections),
hasReasonableComplexity: validateComplexity(connections),
isAesthetic: validateAesthetics(nodes, connections),
isSolvable: validateSolvability(connections)
};
return Object.values(checks).every(check => check === true);
function validatePattern(pattern, timeLimit) {
// Ensure pattern is connected
if (!isConnectedGraph(pattern)) {
throw new Error('Pattern must form connected graph');
}
function validateConnectivity(nodes, connections) {
// Ensure all nodes are part of the pattern (no isolated nodes)
const connectedNodes = new Set();
connections.forEach(([a, b]) => {
connectedNodes.add(a);
connectedNodes.add(b);
});
// Estimate solution time
const estimatedTime = estimateSolutionTime(pattern);
if (estimatedTime > timeLimit * 0.8) {
throw new Error('Pattern too complex for time limit');
}
return connectedNodes.size === nodes.length;
// Check visual clarity
if (hasOverlappingConnections(pattern)) {
throw new Error('Pattern has unclear visual elements');
}
return true;
}
```
## Difficulty Balancing
### Complexity Factors
### Player Skill Metrics
The system tracks implicit player skill indicators:
- **Completion Time**: Average time to complete levels
- **Accuracy**: Ratio of valid to invalid connection attempts
- **Efficiency**: Optimal vs actual connection sequence
- **Consistency**: Variance in performance across similar levels
### Dynamic Adjustment (Future Feature)
```javascript
const complexityFactors = {
nodeCount: {
weight: 2.0,
calculate: (nodes) => nodes
},
function adjustDifficulty(playerMetrics, level) {
const skillLevel = calculateSkillLevel(playerMetrics);
const baseComplexity = getBaseComplexity(level);
connectionDensity: {
weight: 1.5,
calculate: (connections, nodes) => connections.length / (nodes * (nodes - 1) / 2)
},
patternSymmetry: {
weight: -0.5, // Symmetric patterns are easier
calculate: (connections) => calculateSymmetryScore(connections)
},
crossingConnections: {
weight: 1.0,
calculate: (connections, nodePositions) => countCrossings(connections, nodePositions)
// Adjust complexity based on player performance
if (skillLevel > 1.2) {
return baseComplexity * 1.1; // Increase challenge
} else if (skillLevel < 0.8) {
return baseComplexity * 0.9; // Reduce challenge
}
};
function calculateLevelComplexity(level) {
let totalComplexity = 0;
Object.entries(complexityFactors).forEach(([factor, config]) => {
const value = config.calculate(level);
totalComplexity += value * config.weight;
});
return totalComplexity;
return baseComplexity; // Maintain standard progression
}
```
### Dynamic Difficulty Adjustment
```javascript
class DifficultyAdjuster {
constructor() {
this.playerPerformance = [];
this.adjustmentThreshold = 3; // Adjust after 3 consecutive fails/successes
}
### Balancing Principles
1. **Fail-Forward Design**: Failure teaches rather than punishes
2. **Multiple Success Paths**: Avoid single "correct" solutions when possible
3. **Predictable Escalation**: Players can anticipate difficulty increases
4. **Skill Transfer**: Patterns teach techniques useful in later levels
5. **Recovery Opportunities**: Difficult levels followed by easier consolidation
recordPerformance(level, completed, timeRemaining) {
this.playerPerformance.push({
level,
completed,
timeRemaining,
timestamp: Date.now()
});
this.considerAdjustment();
}
considerAdjustment() {
const recent = this.playerPerformance.slice(-this.adjustmentThreshold);
if (recent.length < this.adjustmentThreshold) return;
const allFailed = recent.every(p => !p.completed);
const allSucceeded = recent.every(p => p.completed && p.timeRemaining > 10);
if (allFailed) {
this.suggestEasierLevel();
} else if (allSucceeded) {
this.suggestHarderLevel();
}
}
suggestEasierLevel() {
// Reduce complexity by decreasing connections or increasing time
console.log('Player struggling - suggest reducing complexity');
}
suggestHarderLevel() {
// Increase complexity or reduce time
console.log('Player excelling - suggest increasing complexity');
}
}
```
## Level Testing and Validation
## Testing and Iteration
### Playtesting Metrics
```javascript
const playtestingMetrics = {
completionRate: {
target: '>80% for levels 1-10, >60% for levels 11-20, >40% for levels 21+',
measure: (attempts, completions) => completions / attempts
},
averageTime: {
target: '50-80% of time limit used',
measure: (completionTimes, timeLimit) => completionTimes.reduce((a, b) => a + b) / completionTimes.length / timeLimit
},
retryRate: {
target: '<30% of players retry level',
measure: (retries, attempts) => retries / attempts
},
engagementScore: {
target: 'Players continue to next level >90% of time',
measure: (continuations, completions) => continuations / completions
}
};
```
- **Completion Rates**: Target 70%+ for each difficulty phase
- **Time Distribution**: Histogram of completion times per level
- **Abandonment Points**: Where players stop playing
- **Replay Patterns**: Which levels players retry most
### A/B Testing Framework
```javascript
class LevelTester {
constructor() {
this.variants = {};
this.results = {};
}
addVariant(levelNumber, variantName, pattern) {
if (!this.variants[levelNumber]) {
this.variants[levelNumber] = {};
}
this.variants[levelNumber][variantName] = pattern;
}
getVariantForPlayer(levelNumber, playerId) {
const variants = Object.keys(this.variants[levelNumber] || {});
if (variants.length === 0) return null;
// Deterministic assignment based on player ID
const variantIndex = hashPlayerId(playerId) % variants.length;
return variants[variantIndex];
}
recordResult(levelNumber, variantName, result) {
const key = `${levelNumber}-${variantName}`;
if (!this.results[key]) {
this.results[key] = [];
}
this.results[key].push(result);
}
analyzeResults(levelNumber) {
const variants = this.variants[levelNumber];
const analysis = {};
Object.keys(variants).forEach(variant => {
const results = this.results[`${levelNumber}-${variant}`] || [];
analysis[variant] = {
completionRate: results.filter(r => r.completed).length / results.length,
averageTime: results.reduce((sum, r) => sum + r.timeUsed, 0) / results.length,
playerFeedback: results.map(r => r.satisfaction).filter(Boolean)
const levelVariants = {
control: generateStandardLevel(level),
variant: generateAlternativeLevel(level),
test: generateExperimentalLevel(level)
};
});
return analysis;
}
function trackLevelPerformance(variant, playerResults) {
// Record completion rate, time, satisfaction
analytics.track('level_performance', {
variant,
level,
completed: playerResults.completed,
time: playerResults.completionTime,
attempts: playerResults.attempts
});
}
```
## Special Level Types
### Continuous Improvement
- **Weekly Analysis**: Review player performance data
- **Monthly Balancing**: Adjust difficult outlier levels
- **Quarterly Evolution**: Introduce new pattern types
- **Annual Overhaul**: Comprehensive progression review
### Bonus Levels
**Frequency**: Every 10 levels
**Purpose**: Reward progress with fun, creative challenges
**Characteristics**: Unique mechanics, relaxed time pressure, special visual effects
## Future Enhancements
### Recovery Levels
**Frequency**: After 3 consecutive failures
**Purpose**: Rebuild confidence and momentum
**Characteristics**: Slightly easier than expected, familiar patterns, generous time
### Adaptive Progression
- Machine learning-based difficulty adjustment
- Personalized level generation based on player strengths
- Dynamic time limits based on individual performance
- Skill-based matchmaking for competitive modes
### Skill Check Levels
**Frequency**: Levels 10, 20, 30, etc.
**Purpose**: Validate mastery before advancing to next tier
**Characteristics**: Comprehensive challenge using all learned concepts
### Content Expansion
- Themed level packs with unique mechanics
- Community-generated level sharing
- Seasonal events with special progression tracks
- Achievement-based unlock system for advanced levels
This progression system ensures players remain engaged while being appropriately challenged throughout their journey.
### Accessibility Options
- Colorblind-friendly pattern variations
- Simplified patterns for cognitive accessibility
- Extended time limits for motor accessibility
- Tutorial replay system for learning reinforcement
## Success Metrics
### Player Retention Indicators
- **Session Length**: Average time spent per play session
- **Return Rate**: Percentage of players returning within 24 hours
- **Progression Rate**: Average levels completed per session
- **Satisfaction Score**: Implicit satisfaction based on play patterns
### Difficulty Curve Validation
- **Completion Rate Curve**: Smooth decline from 90% to 60% across levels
- **Time Investment Curve**: Gradual increase in average completion time
- **Replay Frequency**: Higher replay on challenging but fair levels
- **Abandonment Analysis**: Minimal dropoff at any single difficulty spike
The level progression system serves as the backbone of player engagement, ensuring that Neural Nexus provides a consistently challenging and rewarding experience that grows with the player's developing skills.
Last Updated: June 2025
Next Review: July 2025 (Monthly progression analysis)