Skip to content

Public documentation for Flutter Stock Exchange Game AI/ML Simulation Platform

License

Notifications You must be signed in to change notification settings

Capitalmind/Flutter-AI-Game-Public

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Flutter Stock Exchange Game - AI/ML Simulation Platform

Flutter Game Year AI Status

An authentic digital recreation of the 1966 J.W. Spear & Sons "Flutter" board game, designed as a comprehensive AI/ML training platform for financial decision-making algorithms.


๐ŸŽฏ Project Overview

This project is a faithful digital recreation of the classic 1966 "Flutter - Stock Exchange Game" by J.W. Spear & Sons, transformed into a sophisticated machine learning simulation platform. The game serves as a controlled environment for training and testing AI agents in financial decision-making, risk assessment, and strategic trading scenarios.

๐Ÿ›๏ธ Historical Context

Flutter was originally designed in 1966 as an educational board game to teach stock market mechanics, investment strategies, and financial risk management. The game features:

  • Authentic 1966 Rules: Faithfully implemented dividend systems, market fluctuations, and bankruptcy mechanics
  • Strategic Depth: Balance between skill and chance that mirrors real financial markets
  • Educational Value: Teaches concepts of volatility, diversification, and market timing

๐Ÿค– Why Flutter for Machine Learning?

1. Perfect Training Environment

  • Deterministic Rules: Clear, well-defined game mechanics eliminate ambiguity
  • Bounded Complexity: Manageable state space while maintaining strategic depth
  • Multi-Agent Dynamics: 6 AI personalities compete simultaneously, creating realistic market conditions

2. Financial Decision-Making Parallels

  • Risk Assessment: Players must evaluate when to buy, sell, or hold positions
  • Market Timing: Random events (Market News cards) simulate real market volatility
  • Portfolio Management: Limited capital forces strategic resource allocation
  • Loss Tolerance: Bankruptcy mechanics teach risk management

3. Measurable Outcomes

  • Clear Success Metrics: Win conditions based on total wealth accumulation
  • Quantifiable Performance: Every decision has immediate financial consequences
  • Reproducible Results: Deterministic rules allow for consistent training scenarios

๐Ÿง  Advanced AI Competitive Intelligence System

The simulation features 16 distinct AI personalities with sophisticated competitive intelligence and a dynamic tournament evolution system. Each AI employs advanced game theory concepts including opponent analysis, strategic memory, multi-move planning, market manipulation, and defensive tactics.

๐ŸŽฏ Competitive Intelligence Features:

  • Real-time Opponent Analysis: Portfolio tracking, behavioral prediction, threat assessment
  • Strategic Memory Systems: Tournament history, performance patterns, elimination tracking
  • Multi-Move Lookahead: Advanced strategic planning with value optimization
  • Market Manipulation: Pump/dump strategies, influence campaigns, price discovery
  • Defensive Tactics: Leader blocking, position disruption, competitive interference
  • Game Theory Integration: Nash equilibrium analysis, information asymmetry exploitation
Personality Strategy Risk Level Trading Frequency
๐Ÿ›ก๏ธ Conservative Investor Long-term stability Very Low (30%) Low (40%)
โšก Day Trader Frequent small profits High (80%) Very High (95%)
๐Ÿš€ Aggressive Speculator High-risk momentum Very High (90%) High (90%)
๐Ÿ”„ Contrarian Investor Counter-trend trading Medium (70%) Medium (50%)
๐Ÿ’Ž Value Hunter Deep value investing Low (40%) Low (35%)
๐Ÿ“ˆ Growth Chaser Momentum following High (85%) High (80%)
โš–๏ธ Balanced Trader Diversified approach Medium (60%) Medium (60%)
๐ŸŽฏ Dividend Focuser Income generation Low (45%) Low (30%)
๐ŸŒŠ Trend Follower Market momentum Medium (65%) Medium (55%)
๐ŸŽฒ Random Trader Chaos theory Variable Variable

๐Ÿ† Tournament Evolution System

  • First Game: Completely random personality selection from all 16 available
  • Subsequent Games: Worst performer eliminated and replaced with new challenger
  • Evolution Process: Continues until only 2 strongest personalities remain
  • Session Persistence: Tournament state maintained across browser session
  • Performance Tracking: Complete elimination history and statistics
  • Live Updates: Real-time console logging of eliminations and new challengers

๐Ÿ“Š Machine Learning Applications

Current Implementation

  • Rule-Based AI: 10 personality-driven trading algorithms
  • Decision Trees: Complex conditional logic for buy/sell decisions
  • Risk Management: Dynamic cash reserve and position sizing
  • ๐ŸŽฏ Comprehensive ML Recording System: Complete data capture for training datasets

๐ŸŽฌ ML Data Recording Capabilities

  • Complete Game Observability: Every action, event, and decision captured
  • Real-Time Data Export: JSON datasets with full game state snapshots
  • Comprehensive Event Logging: Dice rolls, trades, market events, dividends, bankruptcies
  • AI Decision Tracking: Personality-based reasoning for every trade decision
  • Performance Metrics: Round counting, timing, success rates, risk events
  • Research-Ready Datasets: Standardized notation perfect for ML training

Future ML Extensions

  • Reinforcement Learning: Train agents using Q-learning or policy gradients
  • Neural Networks: Deep learning for pattern recognition in market states
  • Genetic Algorithms: Evolve optimal trading strategies through tournament selection
  • Multi-Agent Learning: Study emergent behaviors in competitive environments

๐ŸŽฎ Game Features

Core Mechanics

  • โœ… Authentic 1966 Rules: Complete implementation of original game logic
  • โœ… 32-Row Board Layout: Exact replica of original board with special cells
  • โœ… Rule 11 Compliance: Proper dividend processing and round management
  • โœ… Market News System: 24-card deck with realistic market events
  • โœ… Bankruptcy Mechanics: Company elimination and share value destruction

Technical Features

  • โœ… Real-Time Visualization: Live board updates with peg positioning
  • โœ… ๐Ÿ† Tournament Evolution System: Dynamic elimination-based personality competition
  • โœ… Comprehensive Logging: Detailed action history for analysis
  • โœ… Configurable Speed: From 0.125s to 5s per turn for different testing needs
  • โœ… Multi-Company Support: 3-6 players with tournament-aware personality assignment
  • โœ… ๐ŸŽฏ ML Recording System: Complete data capture with export capabilities
  • โœ… Research Analytics: Live statistics, comprehensive reports, performance tracking
  • โœ… Session Persistence: Tournament state maintained across browser refreshes

๐Ÿ“ˆ Research Applications

Behavioral Finance

  • Study how different risk profiles perform under identical market conditions
  • Analyze the impact of market volatility on decision-making quality
  • Compare short-term vs. long-term investment strategies

Algorithm Development

  • Benchmark new trading algorithms against established strategies
  • Test robustness under varying market conditions
  • Evaluate performance across different game configurations

Educational Simulation

  • Demonstrate financial concepts in a controlled environment
  • Visualize the impact of different investment approaches
  • Provide safe environment for experimenting with risk management

๐Ÿ”ง Technical Architecture

Frontend

  • Pure HTML5/CSS3/JavaScript: No external dependencies for maximum compatibility
  • Grid-Based Layout: Authentic board representation with responsive design
  • Real-Time Updates: Dynamic peg positioning and status displays

AI Engine

  • Modular Personality System: Easy addition of new trading strategies
  • Decision Framework: Extensible logic for complex trading decisions
  • Performance Tracking: Built-in metrics for strategy evaluation

Data Management & ML Recording

  • Game State Persistence: Complete game state tracking
  • Action Logging: Detailed history for post-game analysis
  • Export Capabilities: Data extraction for external analysis tools
  • ๐ŸŽฏ ML Dataset Generation: Automatic capture of all game events and decisions
  • Real-Time Analytics: Live statistics and comprehensive reporting
  • Research-Ready Output: JSON datasets with standardized notation for ML training

๐ŸŽฏ Getting Started

  1. Open the Game: Load flutter_game_with_personalities_4.html in any modern browser
  2. Start New Game: Click "New Game" and select number of companies (3-6)
  3. Set Win Target: Choose from ยฃ600 (quick) to ยฃ5000+ (marathon)
  4. Watch AI Trade: Enable auto-play to observe AI personalities in action
  5. Analyze Results: Study the console logs for detailed decision tracking

๐Ÿ“š Documentation

๐Ÿ”ฌ Research Potential

This simulation platform enables research in:

  • Algorithmic Trading: Test and benchmark trading strategies
  • Risk Management: Study portfolio optimization under uncertainty
  • Behavioral Modeling: Analyze decision-making patterns across personalities
  • Market Dynamics: Investigate multi-agent interactions in competitive environments
  • Educational Technology: Develop interactive financial literacy tools

๐ŸŽ“ Academic Value

The Flutter simulation bridges the gap between theoretical finance and practical algorithm development, providing:

  • Reproducible Experiments: Controlled environment for consistent testing
  • Measurable Outcomes: Clear success metrics for strategy evaluation
  • Historical Context: Grounding in established game theory and financial principles
  • Scalable Complexity: From simple rule-based agents to sophisticated ML models

"Flutter" - Where 1966 meets 2025, and traditional game theory meets modern machine learning.

This project demonstrates how classic board games can serve as sophisticated platforms for AI research and financial algorithm development.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Historical Note: Based on the 1966 "Flutter - Stock Exchange Game" by J.W. Spear & Sons. This digital implementation is created for educational and research purposes.

๐Ÿค Contributing

This is a research project focused on AI/ML applications in financial simulation. Contributions welcome for:

  • New AI personality implementations
  • Machine learning algorithm integrations
  • Performance optimization
  • Educational enhancements

Built with โค๏ธ for the intersection of classic game design and modern artificial intelligence.

About

Public documentation for Flutter Stock Exchange Game AI/ML Simulation Platform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published