Imagine watching Mario play himself โ€” learning from experience, tracking performance, and celebrating every mushroom and level cleared like it’s a milestone. Welcome to my latest project: an AI-powered real-time dashboard that turns classic Super Mario Bros. into a living lab of machine learning, memory, and game analytics.

๐Ÿ”— View the full project on GitHub


๐ŸŽฎ What Is It?

This project uses Python, RAM state parsing, AI logic, and a fully interactive Flask + Socket.IO dashboard to control and visualize an AI agent playing Mario.

It started as a small AI experiment. Now itโ€™s a full command center:

  • ๐Ÿ“Š Live Reward Graphs
  • ๐Ÿง  AI Thought Feed
  • ๐Ÿ† Achievement Toasts
  • ๐Ÿ“ˆ Level Completion Tracking
  • ๐Ÿ“ฆ Exportable Gameplay Sessions

๐Ÿ”ง What Powers It?

  • Python โ€“ AI loop, control logic, reward engine
  • RetroArch โ€“ NES emulator backend
  • Flask + Socket.IO โ€“ Live dashboard
  • Plotly.js โ€“ In-browser visual stats
  • JSON Logs โ€“ All gameplay and AI memory
  • Local AI โ€“ (DeepSeek via Ollama or Transformers if desired)

๐Ÿ“บ Key Features

โœ… AI State + Reward Dashboard

See Marioโ€™s:

  • Live screen
  • Current decision
  • Score over time
  • Frame-by-frame commentary

๐Ÿ› ๏ธ Full AI Control from Your Browser

Pause the AI. Reset the game. Log an episode. Save or load savestates โ€” all without touching your terminal.

๐Ÿ† Toast-Powered Achievements

Real-time popups for:

  • ๐Ÿ„ Mushroom collected
  • ๐Ÿฅ‡ Fire flower
  • ๐Ÿ Level completion
  • โ˜ ๏ธ Death & ๐Ÿ” Retry
  • ๐Ÿ… New high score
  • ๐Ÿƒ Longest survival streak

๐Ÿ“ˆ Stats & Graphs

Auto-generated graphs show:

  • Level attempts vs completions
  • Reward trends
  • Survival history (coming soon)

๐Ÿ“ค Session Export

Download a full ZIP with:

  • Screenshots
  • Reward logs
  • Chat log
  • AI stats
  • Achievements

๐Ÿ“ GitHub Structure

game_memory/
logs/
frame_###.png # Screenshots
chat_log.txt # Live thought log
achievements.json # Unlocked trophies
ai_stats.json # Score & survival records
level_stats.json # Attempts & completions
utils/
reward_dashboard_live.py # Full Flask dashboard
main.py # Core AI gameplay loop

๐Ÿง  How the AI Thinks

No vector store is required โ€” but you could add one.

Currently, the AI:

  • Reads RAM from RetroArch saves
  • Describes state in natural language
  • Logs rewards and performance
  • Optionally uses prompts or LLMs to generate input

You can enhance this with RAG, fine-tuning, or real-time retrieval.


๐Ÿš€ Try It Out

  1. Clone the repo: bashCopyEditgit clone https://github.com/CptNope/game_ai_rag_reproach_livechat cd game_ai_rag_reproach_livechat
  2. Install dependencies: bashCopyEditpip install flask flask-socketio plotly pillow
  3. Launch the dashboard: bashCopyEditpython utils/reward_dashboard_live.py
  4. Run the AI player: bashCopyEditpython main.py

Visit http://localhost:5000 and watch your AI go!


๐Ÿ“š Whatโ€™s Next?

  • Add real-time training visualization
  • Support multiple savestate slots
  • Serve frame stream as MJPEG video
  • Connect to a vector store (Reproach, ChromaDB, FAISS)
  • Enable fine-tuning via JSONL logs and LoRA

๐Ÿ‘พ Why I Built It

I love merging AI with retro games. Thereโ€™s something special about watching an old classic teach a modern model. This project blends:

  • Game design
  • Machine learning
  • Interface dev
  • Real-time systems

โ€ฆand itโ€™s just the beginning.


๐Ÿ”— Check it out on GitHub
๐Ÿ“ข Feel free to fork, remix, or hit me up with your mods!


Leave a Reply

Your email address will not be published. Required fields are marked *