๐ŸŽช TRAELand

February 13, 2026 ยท View on GitHub

ไธญๆ–‡ๆ–‡ๆกฃ

TRAELand Demo

๐ŸŽฎ About

TRAELand ยท Year of the Horse Temple Fair is a 2D pixel-art top-down game set during Chinese New Year celebrations. Players explore a traditional temple fair, interact with AI-powered NPCs, and experience authentic Chinese New Year festivities including fireworks and sky lanterns.

โœจ Features

๐Ÿค– AI-Powered NPCs

  • 11 unique NPCs with distinct personalities powered by LLM (Large Language Model)
  • Dynamic dialogue generation based on NPC personalities
  • AI-generated hawking calls when no customers are nearby
  • Intelligent bargaining and trading conversations

๐ŸŽ† Fireworks System

  • Three themed firework patterns: Horse, Fish, 2026
  • AI-generated blessings with programmer humor
  • Example blessings: "No Bugs in Horse Year", "Memory Overflow of Fortune"

๐Ÿฎ Sky Lantern Scene

  • Stunning 3D scene powered by Three.js
  • GPU Instancing for 3000+ background lanterns
  • 5000 twinkling stars
  • AI-generated 4-character blessings

๐Ÿ›’ Auto-Shopping System

  • 10 AI-controlled tourists with different personalities
  • Smart decision-making for shop visits
  • Realistic bargaining dialogues
  • Queue management at popular stalls

๐Ÿ› ๏ธ Tech Stack

CategoryTechnologyVersion
Game EnginePhaser 33.90.0
3D EngineThree.js0.160.0
AI ServiceDoubao/OpenAI-

๐Ÿ“ Project Structure

โ”œโ”€โ”€ html/                    # Frontend
โ”‚   โ”œโ”€โ”€ js/
โ”‚   โ”‚   โ”œโ”€โ”€ scenes/         # Game scenes
โ”‚   โ”‚   โ”œโ”€โ”€ entities/       # Game entities (Player, NPC)
โ”‚   โ”‚   โ”œโ”€โ”€ utils/          # Utilities (AI, Pathfinding, Effects)
โ”‚   โ”‚   โ””โ”€โ”€ data/           # Game data & NPC profiles
โ”‚   โ””โ”€โ”€ assets/             # Game assets

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.x (for local server)
  • LLM API Key (Doubao or OpenAI)

Configure API Key

# Copy the environment template
cp .env.example .env

# Edit .env and fill in your API key

Available LLM providers:

ProviderEnvironment Variables
DoubaoLLM_PROVIDER=doubao
DOUBAO_API_KEY=your-key
OpenAILLM_PROVIDER=openai
OPENAI_API_KEY=your-key

Run Locally

# Start the game
cd html
python3 serve.py
# Open http://localhost:8000 in browser

๐ŸŽญ NPC Characters

NPCRolePersonality
Aunt WangFried Tangyuan SellerGossipy, loves comparing
Boss QianJewelry SellerMarriage-obsessed
Clay ZhangClay Figurine MakerHumble, worried about son
Li MillionRing Toss OwnerHumble-bragger
Beast KingPet SellerPromotes civil service jobs
Matchmaker WangVegetable & MatchmakingEnthusiastic matchmaker
Firecracker QinFirework SellerLoves festivities
AfantiBBQ Skewer SellerHumorous, generous

๐ŸŽฏ Game Flow

Game Start
    โ†“
10 tourists spawn with random personalities
    โ†“
Each tourist:
    โ†’ AI decides next shop to visit
    โ†’ Walk to shop (A* pathfinding)
    โ†’ AI dialogue with NPC
    โ†’ Purchase & trigger effects
    โ†’ Repeat until money runs out
    โ†“
All tourists return home
    โ†“
Sky Lantern finale scene

๐ŸŽจ Tourist Types

TypeCharacteristics
FoodiePassionate about food
New Year ShopperBudget-conscious, compares prices
CollectorCan't resist buying
Party YouthLoves the crowd
HomebodyForced out by parents
City KidCurious about rural fairs

๐Ÿ”ง AI Functions

FunctionDescription
generateHawkingText()Generate NPC hawking calls
generateTradeDialogue()Generate trading dialogues
generateTouristResponse()Generate tourist responses
generateTouristDecision()AI decides which shop to visit
generateFireworkBlessing()Generate firework blessings (with programmer jokes)
generateKongmingBlessing()Generate 4-character lantern blessings

๐ŸŽ‡ Firework Blessing Examples

Firework TypeBlessing Examples
Horse"No Bugs in Horse Year", "Code Runs Like Horse"
Fish"Bonus Overflow", "Happy Slacking", "Memory Surplus"
2026"2026.release()", "git push NewYear"

๐Ÿ“ License

Copyright (c) 2026 Bytedance Ltd. and/or its affiliates. All rights reserved. Licensed under the MIT License.


๐Ÿด Year of the Horse ยท Programmer's Cyber Couplet

May your code be
As fast as Red Hare โ€”โ€” O(1) algorithm, zero latency
As stable as Dilu โ€”โ€” 100% test coverage, never crashes
As lasting as Jueying โ€”โ€” Zero tech debt, maintained till retirement

while year_of_horse:
    coffee.brew()
    code.write()
    if product_manager.change_requirements():
        git.stash()
        refactor()
    else:
        print("Hello, slacking~")
    git.push("--force-with-lease")  # No breaking main in Horse Year

Happy Year of the Horse! No Bugs, No Overtime! ๐Ÿด๐ŸŽŠ๐Ÿ’ป