Skip to content

kevinb42O/UnityAI_SceneBuilderTool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

71 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Unity AI Scene Builder Tool

Text-to-World Generation for Unity - Powered by AI

Unity Version License Status


πŸš€ Overview

The Unity AI Scene Builder Tool is a revolutionary system that enables real-time text-to-world generation in Unity. Create complete 3D scenes, apply production-quality materials, optimize performance, and design entire levels using natural language commands.

Key Features:

  • πŸ›οΈ Geodesic Dome with Oculus - Mathematically perfect 200-unit radius dome with divine lighting (NEWEST!)
  • πŸŒƒ Sci-Fi Capital Generator - 800+ object cyberpunk metropolis with 20 ultra-tall skyscrapers
  • 🏰 Luxury Villa Generator - 400+ object Mediterranean villa in 3 minutes
  • 🌍 Complete World Generation - Generate entire playable worlds in seconds (10 biome types)
  • 🎨 Materials System - 14 predefined PBR materials + custom color/metallic/smoothness/emission
  • πŸ—οΈ Hierarchy System - Organized scene structure + 60x performance optimization via mesh combining
  • 🧠 Scene Intelligence - Context-aware queries (find objects by name, tag, proximity)
  • ⚑ Real-Time Generation - Create complete worlds with terrain, lighting, and props in 2-10 seconds
  • πŸ“š Complete Documentation - 30,000+ words across comprehensive guides

🎯 Quick Start

Prerequisites

  • Unity 2021.3 or newer
  • Node.js 18+
  • PowerShell (Windows) or compatible shell

Installation

  1. Clone Repository:

    git clone https://github.com/kevinb42O/UnityAI_SceneBuilderTool.git
  2. Unity Setup:

    • Copy Assets/Editor/UnityMCPServer.cs to your Unity project's Assets/Editor/ folder
    • Unity will auto-compile and start the MCP server
  3. Node.js Setup:

    cd UnityMCP
    npm install
  4. Test Connection:

    . .\unity-helpers-v2.ps1
    Test-UnityConnection
  5. Run Demo:

    .\demo-v2-features.ps1

πŸ›οΈ Feature Showcase: Geodesic Dome with Oculus (NEWEST!)

Mathematical Perfection Meets Architectural Grandeur

.\create-geodesic-dome.ps1

What You Get

  • βœ… Mathematically Perfect Structure - Based on icosahedron subdivision (20 faces β†’ 5,120 triangles)
  • βœ… Golden Ratio Proportions - Ο† = 1.618 throughout design for natural beauty
  • βœ… Massive Scale - 200-unit radius covers entire map, 85-unit height
  • βœ… Central Oculus - 30-unit diameter skylight with divine lighting system
  • βœ… 500-800 Struts - Metallic structural framework with emissive accents
  • βœ… 1,000-1,500 Panels - Semi-transparent glass with blue tint
  • βœ… Dramatic Lighting - Central beam (5.0 intensity) + 8 god rays (3.0 intensity)
  • βœ… 16 Support Pillars - Concrete foundation with decorative caps

Technical Achievement

  • 1,600-2,400 Objects optimized to 4-8 meshes (200-600Γ— performance gain)
  • Geodesic Mathematics - Natural vertex distribution, triangular tessellation
  • Professional Materials - PBR metallic struts, glass panels, emissive elements
  • Frequency 4 Subdivision - Production-quality detail level
  • Complete Documentation - 19KB comprehensive guide + visual reference
  • 3-5 Minute Generation - Fully automated procedural creation

See: GEODESIC_DOME_GUIDE.md for complete details and GEODESIC_DOME_VISUAL.md for visual reference


πŸŒƒ Sci-Fi Capital of the Future

The Ultimate Ropeswing Paradise - Spider-Man Would Be Jealous!

.\create-scifi-capital.ps1

What You Get

  • βœ… 20 Ultra-Tall Skyscrapers - Buildings up to 150 units high (8x taller than villa!)
  • βœ… 4 Color-Coded Districts - Cyan Tech, Magenta Business, Yellow Commerce, Orange Residential
  • βœ… 16 High-Altitude Skyways - Perfect for web-slinging gameplay at 60-110 units height
  • βœ… Grid Road Network - Streets with lighting, 16 vehicles (hover cars + ground cars)
  • βœ… Neon-Soaked Atmosphere - 16 billboard ads, 24 floating orbs, 8 searchlights
  • βœ… 4 Building Styles - Modern, Cylindrical, Pyramid, Setback architectures
  • βœ… Perfect Swinging Geometry - 40-unit spacing, multi-level gameplay (0-160 units)

Technical Achievement

  • 800+ Objects creating massive cyberpunk metropolis
  • 4 Building Generation Functions with sophisticated lighting systems
  • 200+ Swing Attachment Points on edges, skyways, antennas
  • Vertical Gameplay Focus - 4 distinct height levels for progressive challenges
  • Cyberpunk Aesthetic - Blade Runner / Cyberpunk 2077 inspired
  • Complete Documentation - 11KB guide + comparison document

See: SCIFI_CAPITAL_GUIDE.md for complete details and SCIFI_CAPITAL_VS_OTHER_SCENES.md for comparisons


🏰 Luxury Villa Generator

One command. Three minutes. Four hundred objects.

.\build-luxury-villa.ps1

What You Get

  • βœ… 3-Story Structure - Ground floor, first floor, roof terrace
  • βœ… 8+ Furnished Rooms - Living, dining, kitchen, 3 bedrooms, penthouse
  • βœ… Architectural Details - 20+ cornices, 8 pilasters, 12 shutters
  • βœ… 30+ Light Sources - Chandeliers, lamps, emissive elements
  • βœ… Complete Gardens - Trees, fountain, pathways, hedges
  • βœ… Balconies & Stairs - 2 balconies with railings, 2 staircases

See: VILLA_IMPLEMENTATION_COMPLETE.md for complete details


πŸ’‘ Usage Examples

Geodesic Dome with Oculus (NEWEST! πŸ›οΈ)

# Create mathematically perfect dome covering entire map
cd UnityMCP
.\create-geodesic-dome.ps1

# Result: Massive architectural masterpiece with:
# - 200-unit radius dome (covers entire map)
# - 500-800 metallic struts in geodesic pattern
# - 1,000-1,500 semi-transparent glass panels
# - Central 30-unit diameter oculus with divine lighting
# - Golden ring reinforcement with emissive accents
# - 16 concrete support pillars at base
# Time: 3-5 minutes

See GEODESIC_DOME_GUIDE.md for complete documentation.

Building 21 - Call of Duty DMZ Replica

# Create complete B21 military facility (500+ objects)
cd UnityMCP
.\Building21.ps1

# Result: Multi-story complex with:
# - 3 underground levels (storage, server rooms, labs)
# - Ground floor with security lobby
# - 4 upper floors (research labs, offices)
# - Rooftop helipad with lighting
# Time: 15-30 seconds

See BUILDING21_GUIDE.md for complete documentation.

Generate Complete Worlds

# Generate a fantasy world with magical trees and crystals
New-World -biome "Fantasy"

# Generate a medieval village with castle
New-World -biome "Medieval" -worldSize 150 -density 70

# Generate a sci-fi city with glowing structures
New-World -biome "SciFi" -worldSize 200 -density 80

# Available biomes: Forest, Desert, City, Medieval, SciFi, 
# Fantasy, Underwater, Arctic, Jungle, Wasteland

Build Luxury Villa (NEW! 🏰)

# Generate a 3-story Mediterranean villa with 400+ objects
.\build-luxury-villa.ps1

# Features: 8 rooms, balconies, gardens, fountain, lighting
# Time: 2-3 minutes | Objects: 400+
# See: LUXURY_VILLA_GUIDE.md for details

Create Individual Objects

Build-ColoredObject -name "RedCube" -type "Cube" `
    -x 10 -y 5 -z 0 -colorName "Red" `
    -metallic 0.5 -smoothness 0.8

Apply Library Material

Apply-Material -name "MyWall" -materialName "Brick_Red"

Create Organized Structure

New-Group -name "Building"
Build-ColoredObject -name "Foundation" -parent "Building" ...
Build-ColoredObject -name "Walls" -parent "Building" ...
Optimize-Group -parentName "Building"  # 60x performance boost!

Query Scene

# Find all walls
$walls = Find-Objects -query "Wall"

# Find objects near position
$nearby = Find-Objects -radius 50 -position @{ x=0; y=0; z=0 }

πŸ“Š Performance

Proven Results:

  • Complete world generation in 2-10 seconds (includes terrain, environment, props, lighting)
  • 10 unique biomes available (Forest, Desert, City, Medieval, SciFi, Fantasy, Underwater, Arctic, Jungle, Wasteland)
  • 60x draw call reduction via mesh combining
  • 180x faster material setup (30 min β†’ 10 seconds)
  • 60x faster level prototyping (2 hours β†’ 2 minutes)
  • Stress tested with 778-object bridge + complete world generation (100% success rate)

πŸ“– Documentation

Getting Started

Featured Projects

System Documentation

Complete Guides

Technical References


πŸ€– GitHub Copilot Workspace Integration

This project is optimized for GitHub Copilot Workspace with infinite credits.

Multi-Agent Development Instructions

When working on this codebase with multiple AI agents:

  1. Read Documentation First:

    • V2_IMPLEMENTATION_SUMMARY.md - System architecture
    • .github/copilot-instructions.md - Project-specific AI guidelines
    • V2_QUICK_REFERENCE.md - API reference
  2. Code Standards:

    • Zero compiler warnings (Unity)
    • Full error handling on all API endpoints
    • Comprehensive XML documentation
    • Follow existing naming conventions
  3. Testing Requirements:

    • Test all endpoints with demo script
    • Verify 60x performance optimization
    • Check Unity Profiler for zero allocations
    • Validate with 500+ object scenes
  4. Performance Guidelines:

    • All hot paths must be zero-allocation
    • Mesh combining must group by material
    • Query results limited to 500 objects
    • Use cached objects in Unity loops
  5. Documentation Requirements:

    • Update docs when adding features
    • Include code examples in docs
    • Add to V2_QUICK_REFERENCE.md
    • Update V2_IMPLEMENTATION_SUMMARY.md stats
  6. Parallel Development:

    • Unity C# β†’ Assets/Editor/UnityMCPServer.cs
    • Node.js MCP β†’ UnityMCP/index.js
    • PowerShell β†’ UnityMCP/unity-helpers-v2.ps1
    • Docs β†’ UnityMCP/V2_*.md

GitHub Copilot Workspace Benefits:

  • Infinite agent credits (GitHub Pro+)
  • Parallel feature development
  • Automatic code review
  • Documentation generation
  • Test case creation

πŸ› οΈ Architecture

Components

  1. Unity MCP Server (Assets/Editor/UnityMCPServer.cs)

    • HTTP REST API on port 8765
    • 15+ endpoints for scene manipulation
    • Zero-allocation design
    • Full Undo/Redo support
  2. Node.js MCP Bridge (UnityMCP/index.js)

    • Model Context Protocol server
    • Tool definitions for AI agents
    • Connection health monitoring
  3. PowerShell Helper Library (UnityMCP/unity-helpers-v2.ps1)

    • 15 high-level functions
    • Material presets
    • Error handling
    • Progress reporting

Data Flow

AI Agent β†’ MCP Server β†’ Unity HTTP API β†’ Unity Editor β†’ Scene

🎨 Material Library

Material Description Use Case
Wood_Oak Brown rough wood Structures, furniture
Metal_Steel Gray shiny metal Industrial, machinery
Metal_Gold Gold mirror finish Decorative elements
Brick_Red Red rough brick Buildings, walls
Concrete Gray matte concrete Foundations, floors
Glass_Clear Transparent glass Windows, containers
Emissive_Blue Glowing blue Sci-fi, energy effects

14 total presets available - See V2_DOCUMENTATION.md


🚦 Roadmap

v2.0 (Current - Production Ready) βœ…

  • Materials system (custom + 14 presets)
  • Hierarchy organization
  • Mesh optimization (60x performance)
  • Scene queries
  • Complete documentation

v2.1 (Next - 1 week)

  • Texture loading from files
  • More material presets
  • Batch material operations
  • Material preview system

v3.0 (Future - 7-10 weeks)

  • Physics integration (colliders, rigidbodies, layers)
  • Template library (Castle, House, Bridge, Arena)
  • Terrain generation
  • Lighting control
  • Asset Store package integration

🀝 Contributing

Contributions welcome! This project is designed for multi-agent development.

Development Workflow

  1. Read .github/copilot-instructions.md
  2. Create feature branch
  3. Follow code standards (zero warnings)
  4. Update documentation
  5. Test with demo script
  6. Submit PR

Priority Areas

  • New material presets
  • Performance optimizations
  • Documentation improvements
  • Example scenes
  • Template library

πŸ“ License

MIT License - See LICENSE file


πŸ™ Credits

Created by: Kevin B.
Integration: AAA Movement Controller + Unity MCP System
Platform: Unity 2021.3+
Repository: github.com/kevinb42O/UnityAI_SceneBuilderTool


πŸ“ž Support

Issues: GitHub Issues tab
Discussions: GitHub Discussions
Documentation: See UnityMCP/ folder


🌟 Showcase

Real-world results:

  • βœ… Complete worlds generated in 2-10 seconds (terrain + environment + lighting)
  • βœ… 10 unique biome types available (Forest, Desert, City, Medieval, SciFi, Fantasy, Underwater, Arctic, Jungle, Wasteland)
  • βœ… 778-object suspension bridge created in 2 minutes
  • βœ… 60-brick wall optimized from 60 draw calls to 1
  • βœ… Complete building with materials in 30 seconds
  • βœ… Zero compiler warnings, production-ready code

Build worlds with your words. πŸš€

About

build scenes in a flash

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •