chore: commit untracked UE/scaffold files (repo cleanup triage 20260707)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Dubai Metaverse Team
2026-07-07 03:43:19 -07:00
parent b9c4978802
commit 9629838469
147 changed files with 26523 additions and 0 deletions

478
scripts/API_REFERENCE.md Normal file
View File

@@ -0,0 +1,478 @@
# Scripts API Reference - Dubai Metaverse
## Overview
This document provides API reference for all automation scripts in the Dubai Metaverse project.
## Setup Scripts
### setup_project.sh
**Purpose**: Initialize project structure and configuration
**Usage**:
```bash
./scripts/setup/setup_project.sh
```
**Functions**:
- Initializes Git repository
- Sets up Git LFS
- Creates directory structure
- Validates prerequisites
**Exit Codes**:
- `0`: Success
- `1`: Error
### setup_ue5_project.sh
**Purpose**: Validate and configure Unreal Engine project
**Usage**:
```bash
./scripts/setup/setup_ue5_project.sh
```
**Functions**:
- Validates project structure
- Checks UE5 installation
- Verifies project settings
### create_ue5_project.sh
**Purpose**: Create Dubai Metaverse Unreal Engine project
**Usage**:
```bash
./scripts/setup/create_ue5_project.sh [PROJECT_NAME]
```
**Arguments**:
- `PROJECT_NAME` (optional): Project name (default: DubaiMetaverse)
**Functions**:
- Creates .uproject file
- Sets up Source directory structure
- Copies configuration files
- Generates project files
- Verifies Content directory
**Exit Codes**:
- `0`: Success
- `1`: Error
- `2`: Invalid arguments
- `3`: Missing dependencies
### verify_ue5_installation.sh
**Purpose**: Verify Unreal Engine 5.4 installation
**Usage**:
```bash
./scripts/setup/verify_ue5_installation.sh
```
**Functions**:
- Checks UnrealEditor binary exists
- Verifies version (5.4.x)
- Checks required plugins
- Reports installation size
**Exit Codes**:
- `0`: Installation verified
- `1`: Installation issues found
### setup_blockout.sh
**Purpose**: Display blockout level setup guide
**Usage**:
```bash
./scripts/setup/setup_blockout.sh
```
**Functions**:
- Displays blockout setup instructions
- Provides checklist
- Links to detailed documentation
## Installation Scripts
### install_ue5_5.4.1_auto.sh
**Purpose**: Automated installation of Unreal Engine 5.4.1
**Usage**:
```bash
./scripts/install_ue5_5.4.1_auto.sh
```
**Options**: None (fully automated)
**Functions**:
- Installs system dependencies
- Clones UE5.4.1 repository
- Builds Unreal Engine
- Creates launch script
**Exit Codes**:
- `0`: Success
- `1`: Error
**Output**:
- Unreal Engine installed to `~/UnrealEngine/`
- Launch script: `~/launch_ue5.sh`
### install_ue5_wsl.sh
**Purpose**: Install Unreal Engine 5.4 on WSL/Ubuntu
**Usage**:
```bash
./scripts/install_ue5_wsl.sh
```
**Similar to**: `install_ue5_5.4.1_auto.sh` but for 5.4 branch
## Validation Scripts
### validate_project.sh
**Purpose**: Validate project structure and configuration
**Usage**:
```bash
./scripts/validation/validate_project.sh
```
**Functions**:
- Checks directory structure
- Validates configuration files
- Verifies documentation
- Checks script standards
**Exit Codes**:
- `0`: All validations pass
- `1`: Validation failures found
### validate_assets.sh
**Purpose**: Validate asset naming and structure
**Usage**:
```bash
./scripts/validation/validate_assets.sh [directory]
```
**Arguments**:
- `directory` (optional): Directory to validate (default: Content/)
**Functions**:
- Validates naming conventions
- Checks folder structure
- Verifies asset organization
## Data Processing Scripts
### import_osm_data.py
**Purpose**: Import OpenStreetMap data for Dubai Marina
**Usage**:
```bash
python3 scripts/data/import_osm_data.py --output data/processed/dubai_marina_buildings.geojson
```
**Options**:
- `--output`: Output file path (required)
- `--area`: Bounding box coordinates (optional)
- `--verbose`: Enable verbose output
**Returns**: GeoJSON file with building footprints
**Dependencies**: `overpy`, `geojson`
### gis_to_unreal.py
**Purpose**: Convert GIS elevation data to Unreal terrain format
**Usage**:
```bash
python3 scripts/data/gis_to_unreal.py data/elevation/dubai_marina_dem.tif --output data/processed/terrain_heightmap.raw
```
**Options**:
- `--output`: Output file path (required)
- `--resolution`: Heightmap resolution (optional)
- `--scale`: Height scale factor (optional)
**Returns**: Raw heightmap file for Unreal Engine
**Dependencies**: `rasterio`, `numpy`
## Build Scripts
### package_build.sh
**Purpose**: Package project for distribution
**Usage**:
```bash
./scripts/build/package_build.sh [options]
```
**Options**:
- `-c, --config CONFIG`: Build configuration (Development/Shipping) [default: Shipping]
- `-p, --platform PLAT`: Platform (Windows/Linux) [default: Windows]
- `-o, --output DIR`: Output directory [default: Builds/]
- `-d, --dry-run`: Perform dry run
- `-v, --verbose`: Enable verbose output
- `-h, --help`: Show help
**Functions**:
- Cleans build artifacts
- Validates assets
- Packages project
- Creates distribution build
**Exit Codes**:
- `0`: Success
- `1`: Error
- `2`: Invalid arguments
### setup_pixel_streaming.sh
**Purpose**: Set up Pixel Streaming for cloud access
**Usage**:
```bash
./scripts/build/setup_pixel_streaming.sh [options]
```
**Options**:
- `-p, --port PORT`: Streaming port [default: 8888]
- `-s, --signaling PORT`: Signaling server port [default: 8888]
- `-d, --dry-run`: Perform dry run
- `-v, --verbose`: Enable verbose output
- `-h, --help`: Show help
**Functions**:
- Enables Pixel Streaming plugin
- Configures project settings
- Sets up signaling server
- Creates startup script
**Exit Codes**:
- `0`: Success
- `1`: Error
## Monitoring Scripts
### monitor_ue5_install.sh
**Purpose**: Monitor UE5 installation progress
**Usage**:
```bash
./scripts/monitor_ue5_install.sh
```
**Functions**:
- Checks installation status
- Shows build progress
- Displays disk usage
- Lists active processes
## Utility Scripts
### enhance_scripts.sh
**Purpose**: Check and enhance script syntax
**Usage**:
```bash
./scripts/enhance_scripts.sh
```
**Functions**:
- Validates script syntax
- Checks for common issues
- Suggests improvements
### generate_docs.sh
**Purpose**: Generate/validate documentation
**Usage**:
```bash
./scripts/generate_docs.sh
```
**Functions**:
- Validates documentation structure
- Checks for broken links
- Generates documentation index
### master_setup.sh
**Purpose**: Run all setup scripts in sequence
**Usage**:
```bash
./scripts/master_setup.sh
```
**Functions**:
- Runs project setup
- Validates installation
- Configures environment
## Python Scripts
### pcg_validation.py
**Purpose**: Validate PCG graph outputs
**Usage**:
```bash
python3 scripts/pcg_validation.py [options]
```
**Status**: Placeholder for Phase 2
### texture_validation.py
**Purpose**: Validate texture resolution and format
**Usage**:
```bash
python3 scripts/texture_validation.py [options]
```
**Status**: Placeholder for Phase 2
### lighting_validation.py
**Purpose**: Validate lighting setup and performance
**Usage**:
```bash
python3 scripts/lighting_validation.py [options]
```
**Status**: Placeholder for Phase 3
### performance_audit.py
**Purpose**: Audit performance metrics
**Usage**:
```bash
python3 scripts/performance_audit.py [options]
```
**Status**: Placeholder for Phase 4
### render_cinematic.py
**Purpose**: Automate Movie Render Queue rendering
**Usage**:
```bash
python3 scripts/render_cinematic.py [options]
```
**Status**: Placeholder for Phase 4
### automated_tests.py
**Purpose**: Run automated test suite
**Usage**:
```bash
python3 scripts/automated_tests.py [options]
```
**Status**: Placeholder for Phase 5
### npc_dialogue_api.py
**Purpose**: ChatGPT API integration for NPC dialogue
**Usage**:
```bash
python3 scripts/npc_dialogue_api.py [options]
```
**Status**: Optional feature
## Common Patterns
### Logging
All scripts use consistent logging:
```bash
log "INFO" "Message"
log "WARNING" "Warning message"
log "ERROR" "Error message"
log "SUCCESS" "Success message"
```
### Error Handling
Standard error handling:
```bash
error_exit "Error message" # Exits with code 1
warning "Warning message" # Logs warning, continues
```
### Exit Codes
Standard exit codes:
- `0`: Success
- `1`: General error
- `2`: Invalid arguments
- `3`: Missing dependencies
## Environment Variables
### UE_ROOT
Unreal Engine installation directory
- Default: `~/UnrealEngine` or `/opt/UnrealEngine`
- Used by: Build and packaging scripts
### PROJECT_ROOT
Project root directory
- Default: Parent of scripts directory
- Used by: All scripts
### LOG_FILE
Log file path
- Default: `$PROJECT_ROOT/logs/script_name.log`
- Used by: All scripts
## Dependencies
### System Dependencies
- `bash` 4.0+
- `python3` 3.8+
- `git` 2.0+
- `git-lfs` 2.0+
### Python Dependencies
See `requirements.txt`:
- `overpy` - OpenStreetMap data
- `geojson` - GeoJSON handling
- `rasterio` - GIS data processing
- `numpy` - Numerical operations
## See Also
- [Script Standards](STANDARDS.md) - Script development standards
- [Scripts README](README.md) - General scripts documentation
---
**Last Updated**: 2024

View File

@@ -0,0 +1,96 @@
# Detailed Script Analysis
## Date: 2024-11-21
## Script Inventory
### Setup Scripts (`scripts/setup/`)
- Purpose: Project and environment setup
- Count: Check with `find scripts/setup -type f | wc -l`
### Installation Scripts (`scripts/install/`)
- Purpose: Software installation
- Count: Check with `find scripts/install -type f | wc -l`
### Validation Scripts (`scripts/validation/`)
- Purpose: Validation and verification
- Count: Check with `find scripts/validation -type f | wc -l`
### Data Processing Scripts (`scripts/data/`)
- Purpose: Data import and processing
- Count: Check with `find scripts/data -type f | wc -l`
### Build Scripts (`scripts/build/`)
- Purpose: Build and packaging
- Count: Check with `find scripts/build -type f | wc -l`
### Tools Scripts (`scripts/tools/`)
- Purpose: Development tools
- Count: Check with `find scripts/tools -type f | wc -l`
### Monitoring Scripts (`scripts/monitoring/`)
- Purpose: Process monitoring
- Count: Check with `find scripts/monitoring -type f | wc -l`
## Quality Metrics
### Shebang Coverage
- Scripts with shebang: [To be calculated]
- Scripts without shebang: [To be calculated]
### Error Handling
- Scripts with `set -e`: [To be calculated]
- Scripts with error handling: [To be calculated]
### Documentation
- Scripts with header comments: [To be calculated]
- Scripts with function docs: [To be calculated]
### Input Validation
- Scripts with argument validation: [To be calculated]
- Scripts with file checks: [To be calculated]
## Recommendations by Category
### Setup Scripts
- [ ] Add comprehensive error handling
- [ ] Add progress indicators
- [ ] Add rollback capability
- [ ] Improve logging
### Installation Scripts
- [ ] Add dependency checking
- [ ] Add version verification
- [ ] Add installation verification
- [ ] Improve error messages
### Validation Scripts
- [ ] Add detailed reporting
- [ ] Add exit codes
- [ ] Add summary output
- [ ] Improve error messages
### Data Processing Scripts
- [ ] Add data validation
- [ ] Add progress indicators
- [ ] Add error recovery
- [ ] Improve logging
### Build Scripts
- [ ] Add build verification
- [ ] Add artifact checking
- [ ] Add cleanup on failure
- [ ] Improve error handling
### Tools Scripts
- [ ] Add usage help
- [ ] Add parameter validation
- [ ] Add example outputs
- [ ] Improve documentation
### Monitoring Scripts
- [ ] Add status reporting
- [ ] Add alerting
- [ ] Add log rotation
- [ ] Improve output formatting

419
scripts/STANDARDS.md Normal file
View File

@@ -0,0 +1,419 @@
# Script Standards - Dubai Metaverse
## Overview
This document defines standards and best practices for all scripts in the Dubai Metaverse project. All scripts should follow these guidelines for consistency, maintainability, and reliability.
## Script Template
### Bash Script Template
```bash
#!/bin/bash
#
# Script Name: script_name.sh
# Description: Brief description of what the script does
# Usage: ./script_name.sh [options] [arguments]
# Author: [Author Name]
# Date: 2024-11-21
# Version: 1.0
#
# Exit codes:
# 0: Success
# 1: General error
# 2: Invalid arguments
# 3: Missing dependencies
# 4: Permission denied
# 5: File/directory not found
set -euo pipefail # Exit on error, undefined vars, pipe failures
# Configuration
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
LOG_FILE="${LOG_FILE:-$PROJECT_ROOT/logs/script_name.log}"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Logging function
log() {
local level="${1:-INFO}"
shift
local message="$*"
local timestamp=$(date +'%Y-%m-%d %H:%M:%S')
echo "[$timestamp] [$level] $message" | tee -a "$LOG_FILE"
}
# Error handling
error_exit() {
log "ERROR" "$*"
exit 1
}
# Warning function
warning() {
log "WARNING" "$*"
}
# Success function
success() {
log "SUCCESS" "$*"
}
# Validate prerequisites
validate_prerequisites() {
local missing_deps=()
# Check required commands
local required_commands=("git" "python3")
for cmd in "${required_commands[@]}"; do
if ! command -v "$cmd" &> /dev/null; then
missing_deps+=("$cmd")
fi
done
if [ ${#missing_deps[@]} -gt 0 ]; then
error_exit "Missing required commands: ${missing_deps[*]}"
fi
# Check required files
local required_files=("$PROJECT_ROOT/README.md")
for file in "${required_files[@]}"; do
if [ ! -f "$file" ]; then
error_exit "Required file not found: $file"
fi
done
# Check environment
if [ -z "${REQUIRED_ENV_VAR:-}" ]; then
warning "Environment variable REQUIRED_ENV_VAR not set"
fi
}
# Print usage information
usage() {
cat << EOF
Usage: $0 [OPTIONS] [ARGUMENTS]
Description:
Brief description of what the script does
Options:
-h, --help Show this help message
-v, --verbose Enable verbose output
-q, --quiet Suppress non-error output
-d, --dry-run Perform a dry run without making changes
Arguments:
arg1 Description of first argument
arg2 Description of second argument
Examples:
$0 --verbose arg1 arg2
$0 --dry-run
Exit codes:
0 Success
1 General error
2 Invalid arguments
3 Missing dependencies
EOF
}
# Parse command line arguments
parse_args() {
while [[ $# -gt 0 ]]; do
case $1 in
-h|--help)
usage
exit 0
;;
-v|--verbose)
VERBOSE=true
shift
;;
-q|--quiet)
QUIET=true
shift
;;
-d|--dry-run)
DRY_RUN=true
shift
;;
*)
error_exit "Unknown option: $1. Use --help for usage."
;;
esac
done
}
# Main function
main() {
log "INFO" "Starting script_name.sh"
# Parse arguments
parse_args "$@"
# Validate prerequisites
validate_prerequisites
# Create log directory if it doesn't exist
mkdir -p "$(dirname "$LOG_FILE")"
# Script logic here
log "INFO" "Performing main operations..."
# Example: Check if running as root (if needed)
# if [ "$EUID" -eq 0 ]; then
# error_exit "This script should not be run as root"
# fi
# Example: Check if file exists
# if [ ! -f "$file" ]; then
# error_exit "File not found: $file"
# fi
# Example: Execute command with error handling
# if ! command_to_run; then
# error_exit "Command failed: command_to_run"
# fi
success "Script completed successfully"
}
# Run main if script is executed directly
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
main "$@"
fi
```
### Python Script Template
```python
#!/usr/bin/env python3
"""
Script Name: script_name.py
Description: Brief description of what the script does
Usage: python3 script_name.py [options] [arguments]
Author: [Author Name]
Date: 2024-11-21
Version: 1.0
"""
import sys
import os
import argparse
import logging
from pathlib import Path
from typing import List, Optional
# Configuration
SCRIPT_DIR = Path(__file__).parent.resolve()
PROJECT_ROOT = SCRIPT_DIR.parent.resolve()
LOG_FILE = PROJECT_ROOT / "logs" / "script_name.log"
# Setup logging
logging.basicConfig(
level=logging.INFO,
format='[%(asctime)s] [%(levelname)s] %(message)s',
handlers=[
logging.FileHandler(LOG_FILE),
logging.StreamHandler(sys.stdout)
]
)
logger = logging.getLogger(__name__)
def validate_prerequisites() -> None:
"""Validate that all prerequisites are met."""
missing_deps = []
# Check required commands
required_commands = ["git", "python3"]
for cmd in required_commands:
if not shutil.which(cmd):
missing_deps.append(cmd)
if missing_deps:
logger.error(f"Missing required commands: {', '.join(missing_deps)}")
sys.exit(3)
# Check required files
required_files = [PROJECT_ROOT / "README.md"]
for file in required_files:
if not file.exists():
logger.error(f"Required file not found: {file}")
sys.exit(5)
def parse_args() -> argparse.Namespace:
"""Parse command line arguments."""
parser = argparse.ArgumentParser(
description="Brief description of what the script does",
formatter_class=argparse.RawDescriptionHelpFormatter
)
parser.add_argument(
"-v", "--verbose",
action="store_true",
help="Enable verbose output"
)
parser.add_argument(
"-q", "--quiet",
action="store_true",
help="Suppress non-error output"
)
parser.add_argument(
"-d", "--dry-run",
action="store_true",
help="Perform a dry run without making changes"
)
parser.add_argument(
"arg1",
help="Description of first argument"
)
return parser.parse_args()
def main() -> int:
"""Main function."""
logger.info("Starting script_name.py")
try:
# Parse arguments
args = parse_args()
# Validate prerequisites
validate_prerequisites()
# Create log directory if it doesn't exist
LOG_FILE.parent.mkdir(parents=True, exist_ok=True)
# Script logic here
logger.info("Performing main operations...")
# Example: Check if file exists
# file_path = Path("example.txt")
# if not file_path.exists():
# logger.error(f"File not found: {file_path}")
# return 1
logger.info("Script completed successfully")
return 0
except KeyboardInterrupt:
logger.warning("Script interrupted by user")
return 130
except Exception as e:
logger.error(f"Unexpected error: {e}", exc_info=True)
return 1
if __name__ == "__main__":
sys.exit(main())
```
## Standards
### Error Handling
1. **Always use `set -euo pipefail`** in bash scripts
2. **Handle errors explicitly** - don't ignore failures
3. **Provide meaningful error messages**
4. **Use appropriate exit codes**
5. **Log all errors** to log file
### Logging
1. **Log all important operations**
2. **Use consistent log format**: `[timestamp] [level] message`
3. **Log levels**: INFO, WARNING, ERROR, SUCCESS
4. **Log to both file and console** (tee)
5. **Create log directory** if it doesn't exist
### Input Validation
1. **Validate all user input**
2. **Check prerequisites** before execution
3. **Verify file/directory existence**
4. **Check command availability**
5. **Validate environment variables**
### Documentation
1. **Include header with description**
2. **Document all functions**
3. **Provide usage information**
4. **Include examples**
5. **Document exit codes**
### Code Quality
1. **Use meaningful variable names**
2. **Add comments for complex logic**
3. **Keep functions focused and small**
4. **Avoid hardcoded paths** (use variables)
5. **Follow consistent formatting**
## Exit Codes
Standard exit codes for all scripts:
- `0`: Success
- `1`: General error
- `2`: Invalid arguments
- `3`: Missing dependencies
- `4`: Permission denied
- `5`: File/directory not found
- `130`: Interrupted by user (Ctrl+C)
## Testing
### Before Committing
1. **Test with valid inputs**
2. **Test with invalid inputs**
3. **Test error conditions**
4. **Test edge cases**
5. **Verify exit codes**
### Test Checklist
- [ ] Script runs without errors
- [ ] Error handling works correctly
- [ ] Logging functions properly
- [ ] Help/usage information displays
- [ ] Exit codes are correct
- [ ] No hardcoded paths
- [ ] Documentation is complete
## Best Practices
1. **Fail fast** - Check prerequisites early
2. **Be idempotent** - Scripts should be safe to run multiple times
3. **Provide feedback** - Inform user of progress
4. **Clean up** - Remove temporary files
5. **Be portable** - Avoid platform-specific code when possible
## Examples
See existing scripts for examples:
- `scripts/setup/setup_project.sh` - Setup script example
- `scripts/validation/validate_project.sh` - Validation script example
- `scripts/data/import_osm_data.py` - Python script example
---
**Last Updated**: 2024
**Version**: 1.0

251
scripts/build/package_build.sh Executable file
View File

@@ -0,0 +1,251 @@
#!/bin/bash
#
# Script Name: package_build.sh
# Description: Package Dubai Metaverse project for distribution
# Usage: ./package_build.sh [options]
# Author: Dubai Metaverse Team
# Date: 2024
# Version: 1.0
#
# Exit codes:
# 0: Success
# 1: General error
# 2: Invalid arguments
# 3: Missing dependencies
set -euo pipefail
# Configuration
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
LOG_FILE="${LOG_FILE:-$PROJECT_ROOT/logs/package_build.log}"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
# Logging
log() {
local level="${1:-INFO}"
shift
local message="$*"
local timestamp=$(date +'%Y-%m-%d %H:%M:%S')
echo "[$timestamp] [$level] $message" | tee -a "$LOG_FILE"
}
error_exit() {
log "ERROR" "$*"
exit 1
}
warning() {
log "WARNING" "$*"
}
success() {
log "SUCCESS" "$*"
}
# Parse arguments
BUILD_CONFIG="Shipping"
PLATFORM="Windows"
OUTPUT_DIR="${PROJECT_ROOT}/Builds"
DRY_RUN=false
VERBOSE=false
usage() {
cat << EOF
Usage: $0 [OPTIONS]
Package Dubai Metaverse project for distribution.
Options:
-h, --help Show this help message
-c, --config CONFIG Build configuration (Development/Shipping) [default: Shipping]
-p, --platform PLAT Platform (Windows/Linux) [default: Windows]
-o, --output DIR Output directory [default: Builds/]
-d, --dry-run Perform dry run without packaging
-v, --verbose Enable verbose output
Examples:
$0 --config Shipping --platform Windows
$0 --dry-run
$0 --output /path/to/output
EOF
}
parse_args() {
while [[ $# -gt 0 ]]; do
case $1 in
-h|--help)
usage
exit 0
;;
-c|--config)
BUILD_CONFIG="$2"
shift 2
;;
-p|--platform)
PLATFORM="$2"
shift 2
;;
-o|--output)
OUTPUT_DIR="$2"
shift 2
;;
-d|--dry-run)
DRY_RUN=true
shift
;;
-v|--verbose)
VERBOSE=true
shift
;;
*)
error_exit "Unknown option: $1. Use --help for usage."
;;
esac
done
}
# Validate prerequisites
validate_prerequisites() {
log "INFO" "Validating prerequisites..."
# Check for Unreal Engine
if [ -z "${UE_ROOT:-}" ]; then
if [ -d "$HOME/UnrealEngine" ]; then
export UE_ROOT="$HOME/UnrealEngine"
elif [ -d "/opt/UnrealEngine" ]; then
export UE_ROOT="/opt/UnrealEngine"
else
error_exit "Unreal Engine not found. Set UE_ROOT environment variable or install UE5.4"
fi
fi
# Check for project file
local project_file=$(find "$PROJECT_ROOT" -name "*.uproject" | head -1)
if [ -z "$project_file" ]; then
error_exit "Project file (.uproject) not found in $PROJECT_ROOT"
fi
export PROJECT_FILE="$project_file"
log "INFO" "Using project file: $PROJECT_FILE"
log "INFO" "Using Unreal Engine: $UE_ROOT"
}
# Clean build artifacts
clean_build() {
log "INFO" "Cleaning build artifacts..."
if [ "$DRY_RUN" = true ]; then
log "INFO" "[DRY RUN] Would clean: Binaries/, Intermediate/, Saved/"
return
fi
cd "$PROJECT_ROOT"
# Remove build artifacts
[ -d "Binaries" ] && rm -rf Binaries
[ -d "Intermediate" ] && rm -rf Intermediate
[ -d "Saved" ] && rm -rf Saved
success "Build artifacts cleaned"
}
# Validate assets
validate_assets() {
log "INFO" "Validating assets..."
if [ "$DRY_RUN" = true ]; then
log "INFO" "[DRY RUN] Would validate assets"
return
fi
# Run asset validation
if [ -f "$SCRIPT_DIR/validate_assets.sh" ]; then
"$SCRIPT_DIR/validate_assets.sh" || warning "Asset validation found issues"
else
warning "Asset validation script not found, skipping"
fi
}
# Package project
package_project() {
log "INFO" "Packaging project..."
log "INFO" "Configuration: $BUILD_CONFIG"
log "INFO" "Platform: $PLATFORM"
log "INFO" "Output: $OUTPUT_DIR"
if [ "$DRY_RUN" = true ]; then
log "INFO" "[DRY RUN] Would package to: $OUTPUT_DIR"
log "INFO" "[DRY RUN] Command: UnrealEditor -run=Cook -targetplatform=$PLATFORM -project=$PROJECT_FILE"
return
fi
# Create output directory
mkdir -p "$OUTPUT_DIR"
# Determine UnrealEditor path
local editor_path
if [ "$PLATFORM" = "Windows" ]; then
editor_path="$UE_ROOT/Engine/Binaries/Win64/UnrealEditor.exe"
else
editor_path="$UE_ROOT/Engine/Binaries/Linux/UnrealEditor"
fi
if [ ! -f "$editor_path" ]; then
error_exit "UnrealEditor not found at: $editor_path"
fi
log "INFO" "Starting packaging process..."
log "INFO" "This may take 30-60 minutes depending on project size..."
# Package using UnrealEditor command line
# Note: This is a simplified version. Full implementation would use
# UnrealEditor's packaging system with proper parameters
log "WARNING" "Full packaging implementation requires Unreal Editor command line"
log "INFO" "For now, use Unreal Editor GUI: File > Package Project"
log "INFO" "Or use Unreal Automation Tool (UAT) for advanced packaging"
# Placeholder for actual packaging command
# "$editor_path" "$PROJECT_FILE" -run=Cook -targetplatform="$PLATFORM" -project="$PROJECT_FILE" || error_exit "Packaging failed"
success "Packaging complete (placeholder - use Unreal Editor GUI for actual packaging)"
}
# Main function
main() {
log "INFO" "Starting package_build.sh"
# Create log directory
mkdir -p "$(dirname "$LOG_FILE")"
# Parse arguments
parse_args "$@"
# Validate prerequisites
validate_prerequisites
# Clean build
clean_build
# Validate assets
validate_assets
# Package project
package_project
success "Build packaging process complete"
log "INFO" "Output directory: $OUTPUT_DIR"
log "INFO" "Log file: $LOG_FILE"
}
# Run main if executed directly
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
main "$@"
fi

View File

@@ -0,0 +1,295 @@
#!/bin/bash
#
# Script Name: setup_pixel_streaming.sh
# Description: Set up Pixel Streaming for Dubai Metaverse project
# Usage: ./setup_pixel_streaming.sh [options]
# Author: Dubai Metaverse Team
# Date: 2024
# Version: 1.0
#
# Exit codes:
# 0: Success
# 1: General error
# 2: Invalid arguments
# 3: Missing dependencies
set -euo pipefail
# Configuration
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
LOG_FILE="${LOG_FILE:-$PROJECT_ROOT/logs/setup_pixel_streaming.log}"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
# Logging
log() {
local level="${1:-INFO}"
shift
local message="$*"
local timestamp=$(date +'%Y-%m-%d %H:%M:%S')
echo "[$timestamp] [$level] $message" | tee -a "$LOG_FILE"
}
error_exit() {
log "ERROR" "$*"
exit 1
}
warning() {
log "WARNING" "$*"
}
success() {
log "SUCCESS" "$*"
}
# Parse arguments
PORT=8888
SIGNALING_SERVER_PORT=8888
DRY_RUN=false
VERBOSE=false
usage() {
cat << EOF
Usage: $0 [OPTIONS]
Set up Pixel Streaming for Dubai Metaverse project.
Options:
-h, --help Show this help message
-p, --port PORT Streaming port [default: 8888]
-s, --signaling PORT Signaling server port [default: 8888]
-d, --dry-run Perform dry run without making changes
-v, --verbose Enable verbose output
Examples:
$0 --port 8888
$0 --dry-run
$0 --port 8080 --signaling 8081
EOF
}
parse_args() {
while [[ $# -gt 0 ]]; do
case $1 in
-h|--help)
usage
exit 0
;;
-p|--port)
PORT="$2"
shift 2
;;
-s|--signaling)
SIGNALING_SERVER_PORT="$2"
shift 2
;;
-d|--dry-run)
DRY_RUN=true
shift
;;
-v|--verbose)
VERBOSE=true
shift
;;
*)
error_exit "Unknown option: $1. Use --help for usage."
;;
esac
done
}
# Validate prerequisites
validate_prerequisites() {
log "INFO" "Validating prerequisites..."
# Check for Node.js (required for signaling server)
if ! command -v node &> /dev/null; then
warning "Node.js not found. Pixel Streaming signaling server requires Node.js"
warning "Install Node.js: https://nodejs.org/"
else
local node_version=$(node --version)
log "INFO" "Node.js version: $node_version"
fi
# Check for Unreal Engine
if [ -z "${UE_ROOT:-}" ]; then
if [ -d "$HOME/UnrealEngine" ]; then
export UE_ROOT="$HOME/UnrealEngine"
elif [ -d "/opt/UnrealEngine" ]; then
export UE_ROOT="/opt/UnrealEngine"
else
error_exit "Unreal Engine not found. Set UE_ROOT environment variable"
fi
fi
# Check for Pixel Streaming plugin
local ps_plugin="$UE_ROOT/Engine/Plugins/Media/PixelStreaming"
if [ ! -d "$ps_plugin" ]; then
warning "Pixel Streaming plugin not found at: $ps_plugin"
warning "Pixel Streaming is included with UE5.4, verify installation"
else
log "INFO" "Pixel Streaming plugin found"
fi
# Check for project file
local project_file=$(find "$PROJECT_ROOT" -name "*.uproject" | head -1)
if [ -z "$project_file" ]; then
error_exit "Project file (.uproject) not found in $PROJECT_ROOT"
fi
export PROJECT_FILE="$project_file"
log "INFO" "Using project file: $PROJECT_FILE"
}
# Enable Pixel Streaming plugin
enable_plugin() {
log "INFO" "Enabling Pixel Streaming plugin..."
if [ "$DRY_RUN" = true ]; then
log "INFO" "[DRY RUN] Would enable Pixel Streaming plugin in project"
return
fi
# Note: Plugin should be enabled in .uproject file
# This script provides instructions
log "INFO" "Ensure Pixel Streaming plugin is enabled in $PROJECT_FILE"
log "INFO" "Add to Plugins array if not present:"
log "INFO" ' { "Name": "PixelStreaming", "Enabled": true }'
}
# Configure project settings
configure_settings() {
log "INFO" "Configuring Pixel Streaming settings..."
if [ "$DRY_RUN" = true ]; then
log "INFO" "[DRY RUN] Would configure Pixel Streaming settings"
return
fi
log "INFO" "Configure Pixel Streaming in Project Settings:"
log "INFO" " Edit > Project Settings > Plugins > Pixel Streaming"
log "INFO" " - Enable Pixel Streaming"
log "INFO" " - Set Streaming Port: $PORT"
log "INFO" " - Configure encoder settings"
}
# Setup signaling server
setup_signaling_server() {
log "INFO" "Setting up Pixel Streaming signaling server..."
local signaling_dir="$PROJECT_ROOT/PixelStreamingSignalingServer"
if [ "$DRY_RUN" = true ]; then
log "INFO" "[DRY RUN] Would set up signaling server in: $signaling_dir"
return
fi
# Check if Node.js is available
if ! command -v node &> /dev/null; then
warning "Node.js not found. Cannot set up signaling server automatically"
warning "Install Node.js and run setup manually"
return
fi
# Copy signaling server from UE5
local ue_signaling="$UE_ROOT/Engine/Source/Programs/PixelStreamingInfrastructure"
if [ -d "$ue_signaling" ]; then
log "INFO" "Copying signaling server files..."
mkdir -p "$signaling_dir"
cp -r "$ue_signaling"/* "$signaling_dir/" 2>/dev/null || warning "Could not copy signaling server files"
# Install dependencies if package.json exists
if [ -f "$signaling_dir/package.json" ]; then
log "INFO" "Installing signaling server dependencies..."
cd "$signaling_dir"
npm install || warning "Failed to install dependencies"
fi
else
warning "Signaling server source not found at: $ue_signaling"
warning "Use Unreal Engine's built-in signaling server or set up manually"
fi
}
# Create startup script
create_startup_script() {
log "INFO" "Creating startup script..."
local script_path="$PROJECT_ROOT/start_pixel_streaming.sh"
if [ "$DRY_RUN" = true ]; then
log "INFO" "[DRY RUN] Would create startup script: $script_path"
return
fi
cat > "$script_path" << 'EOF'
#!/bin/bash
# Pixel Streaming Startup Script
UE_ROOT="${UE_ROOT:-$HOME/UnrealEngine}"
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_FILE=$(find "$PROJECT_ROOT" -name "*.uproject" | head -1)
PORT="${PORT:-8888}"
echo "Starting Pixel Streaming..."
echo "Project: $PROJECT_FILE"
echo "Port: $PORT"
# Start Unreal Editor with Pixel Streaming
"$UE_ROOT/Engine/Binaries/Linux/UnrealEditor" "$PROJECT_FILE" \
-AudioMixer \
-PixelStreamingIP=0.0.0.0 \
-PixelStreamingPort=$PORT \
-game \
-log
EOF
chmod +x "$script_path"
success "Startup script created: $script_path"
}
# Main function
main() {
log "INFO" "Starting setup_pixel_streaming.sh"
# Create log directory
mkdir -p "$(dirname "$LOG_FILE")"
# Parse arguments
parse_args "$@"
# Validate prerequisites
validate_prerequisites
# Enable plugin
enable_plugin
# Configure settings
configure_settings
# Setup signaling server
setup_signaling_server
# Create startup script
create_startup_script
success "Pixel Streaming setup complete"
log "INFO" "Next steps:"
log "INFO" " 1. Configure Pixel Streaming in Project Settings"
log "INFO" " 2. Start signaling server: cd PixelStreamingSignalingServer && npm start"
log "INFO" " 3. Launch project with Pixel Streaming: ./start_pixel_streaming.sh"
log "INFO" " 4. Access via browser: http://localhost:$PORT"
log "INFO" "See docs/PIXEL_STREAMING.md for detailed instructions"
}
# Run main if executed directly
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
main "$@"
fi

158
scripts/data/gis_to_unreal.py Executable file
View File

@@ -0,0 +1,158 @@
#!/usr/bin/env python3
"""
Dubai Metaverse - GIS to Unreal Terrain Conversion Script
Converts elevation data (DEM/GeoTIFF) to Unreal Engine terrain format
"""
import os
import sys
import argparse
from typing import Tuple, Optional
try:
import rasterio
import numpy as np
except ImportError:
print("Error: Required packages not installed.")
print("Install with: pip install rasterio numpy")
sys.exit(1)
def load_elevation_data(dem_file: str) -> Tuple[np.ndarray, dict]:
"""
Load elevation data from GeoTIFF file.
Returns:
elevation_data: NumPy array of elevation values
metadata: Dictionary with geospatial metadata
"""
try:
with rasterio.open(dem_file) as src:
elevation_data = src.read(1) # Read first band
metadata = {
'width': src.width,
'height': src.height,
'crs': src.crs,
'transform': src.transform,
'bounds': src.bounds
}
return elevation_data, metadata
except Exception as e:
print(f"Error loading elevation data: {e}")
sys.exit(1)
def normalize_elevation(elevation_data: np.ndarray, min_elev: float, max_elev: float) -> np.ndarray:
"""
Normalize elevation data to 0-1 range for Unreal Engine.
Unreal Engine uses 0-1 normalized height values.
"""
# Clip to min/max range
elevation_data = np.clip(elevation_data, min_elev, max_elev)
# Normalize to 0-1
normalized = (elevation_data - min_elev) / (max_elev - min_elev)
return normalized
def export_heightmap(normalized_data: np.ndarray, output_file: str, format: str = 'raw'):
"""
Export normalized elevation data as heightmap.
Formats:
- 'raw': Raw binary format (16-bit)
- 'png': PNG format (16-bit grayscale)
"""
# Convert to 16-bit integer (0-65535)
heightmap = (normalized_data * 65535).astype(np.uint16)
if format == 'raw':
heightmap.tofile(output_file)
print(f"✓ Exported heightmap to {output_file} (RAW format)")
elif format == 'png':
try:
from PIL import Image
# Convert to 16-bit PNG
img = Image.fromarray(heightmap, mode='I;16')
img.save(output_file)
print(f"✓ Exported heightmap to {output_file} (PNG format)")
except ImportError:
print("Warning: PIL not installed, falling back to RAW format")
heightmap.tofile(output_file)
print(f"✓ Exported heightmap to {output_file} (RAW format)")
else:
print(f"Error: Unknown format '{format}'")
sys.exit(1)
def main():
parser = argparse.ArgumentParser(description='Convert GIS elevation data to Unreal terrain')
parser.add_argument('input', help='Input DEM/GeoTIFF file')
parser.add_argument('--output', '-o', default='data/processed/terrain_heightmap.raw',
help='Output heightmap file')
parser.add_argument('--format', choices=['raw', 'png'], default='raw',
help='Output format (raw or png)')
parser.add_argument('--min-elev', type=float, help='Minimum elevation (meters)')
parser.add_argument('--max-elev', type=float, help='Maximum elevation (meters)')
args = parser.parse_args()
if not os.path.exists(args.input):
print(f"Error: Input file not found: {args.input}")
sys.exit(1)
# Create output directory if it doesn't exist
os.makedirs(os.path.dirname(args.output), exist_ok=True)
print("==========================================")
print("Dubai Metaverse - GIS to Unreal Terrain")
print("==========================================")
print("")
print(f"Loading elevation data: {args.input}")
elevation_data, metadata = load_elevation_data(args.input)
print(f"Data dimensions: {metadata['width']} x {metadata['height']}")
print(f"Bounds: {metadata['bounds']}")
print("")
# Determine elevation range
if args.min_elev is None:
min_elev = float(np.nanmin(elevation_data))
else:
min_elev = args.min_elev
if args.max_elev is None:
max_elev = float(np.nanmax(elevation_data))
else:
max_elev = args.max_elev
print(f"Elevation range: {min_elev:.2f}m to {max_elev:.2f}m")
print("")
print("Normalizing elevation data...")
normalized = normalize_elevation(elevation_data, min_elev, max_elev)
print("Exporting heightmap...")
export_heightmap(normalized, args.output, args.format)
print("")
print("==========================================")
print("Conversion Complete")
print("==========================================")
print("")
print("Next steps:")
print("1. Import heightmap to Unreal Engine")
print("2. Create landscape from heightmap")
print("3. Adjust landscape material and settings")
print("")
print(f"Heightmap file: {args.output}")
print(f"Dimensions: {metadata['width']} x {metadata['height']}")
print("")
if __name__ == '__main__':
main()

134
scripts/data/import_osm_data.py Executable file
View File

@@ -0,0 +1,134 @@
#!/usr/bin/env python3
"""
Dubai Metaverse - OpenStreetMap Data Import Script
Imports OpenStreetMap data for Dubai Marina and converts to Unreal-compatible format
"""
import os
import sys
import json
import argparse
from typing import List, Dict, Tuple
try:
import overpy
import geojson
except ImportError:
print("Error: Required packages not installed.")
print("Install with: pip install overpy geojson")
sys.exit(1)
def get_marina_buildings(api: overpy.Overpass) -> List[Dict]:
"""
Query OpenStreetMap for buildings in Dubai Marina area.
Note: Coordinates should be adjusted based on actual Dubai Marina location.
"""
# Dubai Marina approximate bounding box
# These coordinates should be verified and adjusted
query = """
[out:json][timeout:25];
(
way["building"](25.0750,55.1350,25.0850,55.1450);
);
out geom;
"""
try:
result = api.query(query)
buildings = []
for way in result.ways:
building = {
'id': way.id,
'nodes': [(node.lat, node.lon) for node in way.nodes],
'tags': way.tags
}
buildings.append(building)
return buildings
except Exception as e:
print(f"Error querying OpenStreetMap: {e}")
return []
def buildings_to_geojson(buildings: List[Dict], output_file: str):
"""Convert buildings to GeoJSON format."""
features = []
for building in buildings:
# Create polygon from nodes
coordinates = [[node[1], node[0]] for node in building['nodes']] # GeoJSON uses [lon, lat]
coordinates.append(coordinates[0]) # Close polygon
feature = {
'type': 'Feature',
'geometry': {
'type': 'Polygon',
'coordinates': [coordinates]
},
'properties': {
'id': building['id'],
'tags': building['tags']
}
}
features.append(feature)
geojson_data = {
'type': 'FeatureCollection',
'features': features
}
with open(output_file, 'w') as f:
json.dump(geojson_data, f, indent=2)
print(f"✓ Exported {len(features)} buildings to {output_file}")
def main():
parser = argparse.ArgumentParser(description='Import OpenStreetMap data for Dubai Marina')
parser.add_argument('--output', '-o', default='data/processed/dubai_marina_buildings.geojson',
help='Output GeoJSON file path')
parser.add_argument('--area', help='Custom bounding box (lat1,lon1,lat2,lon2)')
args = parser.parse_args()
# Create output directory if it doesn't exist
os.makedirs(os.path.dirname(args.output), exist_ok=True)
print("==========================================")
print("Dubai Metaverse - OSM Data Import")
print("==========================================")
print("")
print("Connecting to OpenStreetMap API...")
api = overpy.Overpass()
print("Querying Dubai Marina buildings...")
buildings = get_marina_buildings(api)
if not buildings:
print("⚠ No buildings found. Check coordinates and query.")
return
print(f"Found {len(buildings)} buildings")
print("")
print("Converting to GeoJSON...")
buildings_to_geojson(buildings, args.output)
print("")
print("==========================================")
print("Import Complete")
print("==========================================")
print("")
print("Next steps:")
print("1. Review GeoJSON file in GIS software (QGIS)")
print("2. Import to Unreal Engine using GIS import tools")
print("3. Generate building meshes from footprints")
print("")
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,256 @@
#!/bin/bash
# Dubai Metaverse - Unreal Engine 5.4.1 Linux/WSL Installation Script
# Automated installation script for UE 5.4.1 on Ubuntu/WSL
set -e
echo "=========================================="
echo "Dubai Metaverse - UE 5.4.1 Installation"
echo "=========================================="
echo ""
echo "This script will install Unreal Engine 5.4.1 from source on Ubuntu/WSL"
echo "Optimized for reduced disk space (~300GB) and limited CPU (4 cores)"
echo "Prerequisites:"
echo " 1. GitHub account linked to Epic Games account"
echo " 2. Sufficient disk space (~300GB+)"
echo " 3. Sufficient RAM (32GB+ recommended)"
echo " 4. This will take 4-6+ hours to build (using 4 CPU cores)"
echo ""
read -p "Continue? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m'
print_step() {
echo -e "${GREEN}[STEP]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Step 1: Update system
print_step "Updating system packages..."
sudo apt update && sudo apt upgrade -y
# Step 2: Install dependencies
print_step "Installing build dependencies..."
# Add .NET backports repository for dotnet-sdk-6.0 (required for Ubuntu 24.04)
print_step "Adding .NET backports repository..."
sudo add-apt-repository -y ppa:dotnet/backports 2>/dev/null || echo "Repository may already exist or adding manually..."
sudo apt update
# Install dependencies
print_step "Installing build dependencies..."
sudo apt install -y \
build-essential \
clang \
cmake \
ninja-build \
mono-devel \
python3 \
python3-pip \
git \
git-lfs \
curl \
wget \
unzip \
libvulkan-dev \
libxcb-xinput-dev \
libgtk-3-dev \
libxrandr-dev \
libxinerama-dev \
libxi-dev \
libsdl2-dev \
libssl-dev \
libicu-dev \
libxml2-dev \
libxcursor-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
libxcb-render-util0-dev \
libxcb-xkb-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
mesa-common-dev \
libgl1-mesa-dev \
libc++-dev \
libc++abi-dev
# Try to install dotnet-sdk-6.0 (may not be available, but try)
print_step "Installing .NET SDK 6.0..."
if sudo apt install -y dotnet-sdk-6.0 2>/dev/null; then
echo "✓ .NET SDK 6.0 installed"
else
print_warning ".NET SDK 6.0 not available, trying alternative..."
# Try installing dotnet8 or skip if not critical
sudo apt install -y dotnet-sdk-8.0 2>/dev/null || echo "Note: .NET SDK optional, continuing without it..."
fi
# Step 3: Setup Git LFS
print_step "Setting up Git LFS..."
git lfs install
# Step 4: Check GitHub/Epic Games account
print_step "Checking GitHub access to Unreal Engine repository..."
if ! git ls-remote https://github.com/EpicGames/UnrealEngine.git &>/dev/null; then
print_error "Cannot access Unreal Engine repository"
echo ""
echo "Please ensure:"
echo " 1. Your GitHub account is linked to Epic Games account"
echo " 2. You have accepted the Unreal Engine license"
echo " 3. Visit: https://www.unrealengine.com/en-US/ue-on-github"
echo ""
exit 1
fi
# Step 5: Check for 5.4.1 tag
print_step "Checking for UE 5.4.1 tag..."
TAG_EXISTS=$(git ls-remote --tags https://github.com/EpicGames/UnrealEngine.git | grep -E "refs/tags/5\.4\.1" || echo "")
if [ -z "$TAG_EXISTS" ]; then
print_warning "Tag 5.4.1 not found, checking available 5.4.x tags..."
git ls-remote --tags https://github.com/EpicGames/UnrealEngine.git | grep "5.4" | tail -5
echo ""
read -p "Tag 5.4.1 not found. Use 5.4 branch instead? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
UE_VERSION="5.4"
USE_TAG=false
else
print_error "Installation cancelled"
exit 1
fi
else
UE_VERSION="5.4.1"
USE_TAG=true
print_step "Found tag 5.4.1"
fi
# Step 6: Clone repository
print_step "Cloning Unreal Engine ${UE_VERSION} repository..."
echo "This may take 30-60 minutes depending on connection speed..."
cd ~
if [ -d "UnrealEngine" ]; then
print_warning "UnrealEngine directory already exists"
read -p "Remove and re-clone? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
rm -rf UnrealEngine
else
echo "Using existing directory"
cd UnrealEngine
if [ "$USE_TAG" = true ]; then
print_step "Checking out tag ${UE_VERSION}..."
git fetch --tags
git checkout ${UE_VERSION}
fi
cd ~
fi
fi
if [ ! -d "UnrealEngine" ]; then
if [ "$USE_TAG" = true ]; then
print_step "Cloning repository (will checkout tag ${UE_VERSION} after clone)..."
# Clone without specifying branch/tag first
git clone --depth=1 https://github.com/EpicGames/UnrealEngine.git UnrealEngine
cd UnrealEngine
print_step "Checking out tag ${UE_VERSION}..."
# Fetch the specific tag
git fetch --depth=1 origin tag ${UE_VERSION}
# Checkout the tag
git checkout ${UE_VERSION}
cd ~
else
print_step "Cloning with branch ${UE_VERSION}..."
git clone --depth=1 --branch ${UE_VERSION} https://github.com/EpicGames/UnrealEngine.git UnrealEngine
fi
fi
# Step 7: Run Setup (with minimal dependencies)
print_step "Running Setup.sh (this may take 30-60 minutes)..."
cd ~/UnrealEngine
# Setup.sh will download required dependencies
./Setup.sh
# Step 8: Generate project files (Development Editor only)
print_step "Generating project files for Development Editor..."
# Generate project files - this creates the build system files
./GenerateProjectFiles.sh -game -engine
# Step 9: Build Unreal Engine (optimized for disk space and 4 cores)
print_step "Building Unreal Engine ${UE_VERSION}..."
echo "Building Development Editor only (reduces disk space)"
echo "Skipping Shipping builds, templates, and samples to save space"
echo "Using 4 CPU cores (will take 4-6+ hours)"
echo "To use more cores, edit this script and change NUM_CORES=4"
NUM_CORES=4
# Build only Development Editor (not Shipping, not all tools)
# This significantly reduces disk space requirements
make -j${NUM_CORES} UnrealEditor
# Step 10: Clean up intermediate files to save disk space
print_step "Cleaning up intermediate build files to save disk space..."
# Remove intermediate build files (keeps binaries and required files)
find Engine/Intermediate -type f -name "*.o" -delete 2>/dev/null || true
find Engine/Intermediate -type f -name "*.obj" -delete 2>/dev/null || true
find Engine/Intermediate -type f -name "*.d" -delete 2>/dev/null || true
find Engine/Intermediate -type f -name "*.pch" -delete 2>/dev/null || true
# Clean up source control files that aren't needed
find . -type f -name ".git*" -not -path "./.git/*" -delete 2>/dev/null || true
print_step "Cleanup complete. Checking disk usage..."
du -sh ~/UnrealEngine 2>/dev/null | awk '{print "Installation size: " $1}'
# Step 11: Verify installation
print_step "Verifying installation..."
if [ -f "Engine/Binaries/Linux/UnrealEditor" ]; then
echo -e "${GREEN}${NC} Unreal Editor built successfully!"
echo ""
echo "Installation location: ~/UnrealEngine/Engine/Binaries/Linux/UnrealEditor"
echo "Version: ${UE_VERSION}"
echo "CPU cores used: ${NUM_CORES}"
echo ""
# Create launch script
cat > ~/launch_ue5.sh << 'EOF'
#!/bin/bash
cd ~/UnrealEngine/Engine/Binaries/Linux
./UnrealEditor "$@"
EOF
chmod +x ~/launch_ue5.sh
echo "Launch script created: ~/launch_ue5.sh"
echo ""
echo "To launch:"
echo " ~/launch_ue5.sh"
echo " # Or directly:"
echo " ~/UnrealEngine/Engine/Binaries/Linux/UnrealEditor"
echo ""
echo "For WSL graphics, ensure X server is running (WSLg on Windows 11, or VcXsrv/Xming on Windows 10)"
else
print_error "Build failed - UnrealEditor binary not found"
exit 1
fi
echo ""
echo "=========================================="
echo "Installation Complete!"
echo "=========================================="
echo ""
echo "Next steps:"
echo "1. Set up X server for graphics (if using WSL)"
echo "2. Create project: Follow UE5_WSL_INSTALL.md"
echo "3. Configure project settings"
echo ""

View File

@@ -0,0 +1,227 @@
#!/bin/bash
# Dubai Metaverse - Unreal Engine 5.4.1 Linux/WSL Installation Script (Non-Interactive)
# Automated installation script for UE 5.4.1 on Ubuntu/WSL
# This version runs without user prompts (for automated execution)
set -e
echo "=========================================="
echo "Dubai Metaverse - UE 5.4.1 Installation"
echo "=========================================="
echo ""
echo "This script will install Unreal Engine 5.4.1 from source on Ubuntu/WSL"
echo "Optimized for reduced disk space (~80-100GB) and limited CPU (4 cores)"
echo "Running in AUTO mode (non-interactive)"
echo ""
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m'
print_step() {
echo -e "${GREEN}[STEP]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Step 1: Update system
print_step "Updating system packages..."
sudo apt update && sudo apt upgrade -y
# Step 2: Install dependencies
print_step "Installing build dependencies..."
# Add .NET backports repository for dotnet-sdk-6.0 (required for Ubuntu 24.04)
print_step "Adding .NET backports repository..."
sudo add-apt-repository -y ppa:dotnet/backports 2>/dev/null || echo "Repository may already exist or adding manually..."
sudo apt update
# Install dependencies
print_step "Installing build dependencies..."
sudo apt install -y \
build-essential \
clang \
cmake \
ninja-build \
mono-devel \
python3 \
python3-pip \
git \
git-lfs \
curl \
wget \
unzip \
libvulkan-dev \
libxcb-xinput-dev \
libgtk-3-dev \
libxrandr-dev \
libxinerama-dev \
libxi-dev \
libsdl2-dev \
libssl-dev \
libicu-dev \
libxml2-dev \
libxcursor-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
libxcb-render-util0-dev \
libxcb-xkb-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
mesa-common-dev \
libgl1-mesa-dev \
libc++-dev \
libc++abi-dev
# Try to install dotnet-sdk-6.0 (may not be available, but try)
print_step "Installing .NET SDK 6.0..."
if sudo apt install -y dotnet-sdk-6.0 2>/dev/null; then
echo "✓ .NET SDK 6.0 installed"
else
print_warning ".NET SDK 6.0 not available, trying alternative..."
# Try installing dotnet8 or skip if not critical
sudo apt install -y dotnet-sdk-8.0 2>/dev/null || echo "Note: .NET SDK optional, continuing without it..."
fi
# Step 3: Setup Git LFS
print_step "Setting up Git LFS..."
git lfs install
# Step 4: Check GitHub/Epic Games account
print_step "Checking GitHub access to Unreal Engine repository..."
if ! git ls-remote https://github.com/EpicGames/UnrealEngine.git &>/dev/null; then
print_error "Cannot access Unreal Engine repository"
echo ""
echo "Please ensure:"
echo " 1. Your GitHub account is linked to Epic Games account"
echo " 2. You have accepted the Unreal Engine license"
echo " 3. Visit: https://www.unrealengine.com/en-US/ue-on-github"
echo ""
exit 1
fi
# Step 5: Check for 5.4.1 tag
print_step "Checking for UE 5.4.1 tag..."
TAG_EXISTS=$(git ls-remote --tags https://github.com/EpicGames/UnrealEngine.git | grep -E "refs/tags/5\.4\.1" || echo "")
if [ -z "$TAG_EXISTS" ]; then
print_warning "Tag 5.4.1 not found, using 5.4 branch instead..."
UE_VERSION="5.4"
USE_TAG=false
else
UE_VERSION="5.4.1"
USE_TAG=true
print_step "Found tag 5.4.1"
fi
# Step 6: Clone repository
print_step "Cloning Unreal Engine ${UE_VERSION} repository..."
echo "This may take 30-60 minutes depending on connection speed..."
cd ~
if [ -d "UnrealEngine" ]; then
print_warning "UnrealEngine directory already exists"
print_warning "Removing existing directory for fresh install..."
rm -rf UnrealEngine
fi
if [ ! -d "UnrealEngine" ]; then
if [ "$USE_TAG" = true ]; then
print_step "Cloning repository (will checkout tag ${UE_VERSION} after clone)..."
# Clone without specifying branch/tag first
git clone --depth=1 https://github.com/EpicGames/UnrealEngine.git UnrealEngine
cd UnrealEngine
print_step "Checking out tag ${UE_VERSION}..."
# Fetch the specific tag
git fetch --depth=1 origin tag ${UE_VERSION}
# Checkout the tag
git checkout ${UE_VERSION}
cd ~
else
print_step "Cloning with branch ${UE_VERSION}..."
git clone --depth=1 --branch ${UE_VERSION} https://github.com/EpicGames/UnrealEngine.git UnrealEngine
fi
fi
# Step 7: Run Setup (with minimal dependencies)
print_step "Running Setup.sh (this may take 30-60 minutes)..."
cd ~/UnrealEngine
./Setup.sh
# Step 8: Generate project files (Development Editor only)
print_step "Generating project files for Development Editor..."
# Generate project files - this creates the build system files
./GenerateProjectFiles.sh -game -engine
# Step 9: Build Unreal Engine (optimized for disk space and 4 cores)
print_step "Building Unreal Engine ${UE_VERSION}..."
echo "Building Development Editor only (reduces disk space)"
echo "Skipping Shipping builds, templates, and samples to save space"
echo "Using 4 CPU cores (will take 4-6+ hours)"
echo "To use more cores, edit this script and change NUM_CORES=4"
NUM_CORES=4
# Build only Development Editor (not Shipping, not all tools)
# This significantly reduces disk space requirements
make -j${NUM_CORES} UnrealEditor
# Step 10: Clean up intermediate files to save disk space
print_step "Cleaning up intermediate build files to save disk space..."
# Remove intermediate build files (keeps binaries and required files)
find Engine/Intermediate -type f -name "*.o" -delete 2>/dev/null || true
find Engine/Intermediate -type f -name "*.obj" -delete 2>/dev/null || true
find Engine/Intermediate -type f -name "*.d" -delete 2>/dev/null || true
find Engine/Intermediate -type f -name "*.pch" -delete 2>/dev/null || true
# Clean up source control files that aren't needed
find . -type f -name ".git*" -not -path "./.git/*" -delete 2>/dev/null || true
print_step "Cleanup complete. Checking disk usage..."
du -sh ~/UnrealEngine 2>/dev/null | awk '{print "Installation size: " $1}'
# Step 11: Verify installation
print_step "Verifying installation..."
if [ -f "Engine/Binaries/Linux/UnrealEditor" ]; then
echo -e "${GREEN}${NC} Unreal Editor built successfully!"
echo ""
echo "Installation location: ~/UnrealEngine/Engine/Binaries/Linux/UnrealEditor"
echo "Version: ${UE_VERSION}"
echo "CPU cores used: ${NUM_CORES}"
echo ""
# Create launch script
cat > ~/launch_ue5.sh << 'EOF'
#!/bin/bash
cd ~/UnrealEngine/Engine/Binaries/Linux
./UnrealEditor "$@"
EOF
chmod +x ~/launch_ue5.sh
echo "Launch script created: ~/launch_ue5.sh"
echo ""
echo "To launch:"
echo " ~/launch_ue5.sh"
echo " # Or directly:"
echo " ~/UnrealEngine/Engine/Binaries/Linux/UnrealEditor"
echo ""
echo "For WSL graphics, ensure X server is running (WSLg on Windows 11, or VcXsrv/Xming on Windows 10)"
else
print_error "Build failed - UnrealEditor binary not found"
exit 1
fi
echo ""
echo "=========================================="
echo "Installation Complete!"
echo "=========================================="
echo ""
echo "Next steps:"
echo "1. Set up X server for graphics (if using WSL)"
echo "2. Create project: Follow UE5_WSL_INSTALL.md"
echo "3. Configure project settings"
echo ""

View File

@@ -0,0 +1,159 @@
#!/bin/bash
# Dubai Metaverse - Unreal Engine 5.4 WSL/Ubuntu Installation Script
# Automated installation script for UE5.4 on Ubuntu/WSL
set -e
echo "=========================================="
echo "Dubai Metaverse - UE5.4 WSL Installation"
echo "=========================================="
echo ""
echo "This script will install Unreal Engine 5.4 from source on Ubuntu/WSL"
echo "Prerequisites:"
echo " 1. GitHub account linked to Epic Games account"
echo " 2. Sufficient disk space (100GB+)"
echo " 3. Sufficient RAM (32GB+ recommended)"
echo ""
read -p "Continue? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m'
print_step() {
echo -e "${GREEN}[STEP]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Step 1: Update system
print_step "Updating system packages..."
sudo apt update && sudo apt upgrade -y
# Step 2: Install dependencies
print_step "Installing build dependencies..."
sudo apt install -y \
build-essential \
clang \
cmake \
ninja-build \
mono-devel \
python3 \
python3-pip \
git \
git-lfs \
curl \
wget \
unzip \
libvulkan-dev \
libxcb-xinput-dev \
libgtk-3-dev \
libxrandr-dev \
libxinerama-dev \
libxi-dev \
libsdl2-dev \
libssl-dev \
libicu-dev \
libxml2-dev \
libxcursor-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
libxcb-render-util0-dev \
libxcb-xkb-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
mesa-common-dev \
libgl1-mesa-dev
# Step 3: Setup Git LFS
print_step "Setting up Git LFS..."
git lfs install
# Step 4: Check GitHub/Epic Games account
print_step "Checking GitHub access..."
if ! git ls-remote https://github.com/EpicGames/UnrealEngine.git &>/dev/null; then
print_error "Cannot access Unreal Engine repository"
echo ""
echo "Please ensure:"
echo " 1. Your GitHub account is linked to Epic Games account"
echo " 2. You have accepted the Unreal Engine license"
echo " 3. Visit: https://www.unrealengine.com/en-US/ue-on-github"
echo ""
exit 1
fi
# Step 5: Clone repository
print_step "Cloning Unreal Engine 5.4 repository..."
echo "This may take 30-60 minutes depending on connection speed..."
cd ~
if [ -d "UnrealEngine" ]; then
print_warning "UnrealEngine directory already exists"
read -p "Remove and re-clone? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
rm -rf UnrealEngine
else
echo "Using existing directory"
fi
fi
if [ ! -d "UnrealEngine" ]; then
git clone --depth=1 https://github.com/EpicGames/UnrealEngine.git -b 5.4 UnrealEngine
fi
# Step 6: Run Setup
print_step "Running Setup.sh (this may take 30-60 minutes)..."
cd ~/UnrealEngine
./Setup.sh
# Step 7: Generate project files
print_step "Generating project files..."
./GenerateProjectFiles.sh
# Step 8: Build Unreal Engine
print_step "Building Unreal Engine..."
echo "This will take 2-4+ hours depending on CPU..."
echo "Using $(nproc) parallel jobs"
make -j$(nproc) UnrealEditor
# Step 9: Verify installation
print_step "Verifying installation..."
if [ -f "Engine/Binaries/Linux/UnrealEditor" ]; then
echo -e "${GREEN}${NC} Unreal Editor built successfully!"
echo ""
echo "Installation location: ~/UnrealEngine/Engine/Binaries/Linux/UnrealEditor"
echo ""
echo "To launch:"
echo " ~/UnrealEngine/Engine/Binaries/Linux/UnrealEditor"
echo ""
echo "For WSL graphics, ensure X server is running (WSLg on Windows 11, or VcXsrv/Xming on Windows 10)"
else
print_error "Build failed - UnrealEditor binary not found"
exit 1
fi
echo ""
echo "=========================================="
echo "Installation Complete!"
echo "=========================================="
echo ""
echo "Next steps:"
echo "1. Set up X server for graphics (if using WSL)"
echo "2. Create project: Follow UE5_WSL_INSTALL.md"
echo "3. Configure project settings"
echo ""

View File

@@ -0,0 +1,55 @@
#!/bin/bash
# Monitor UE 5.4.1 Installation Progress
echo "=== UE 5.4.1 Installation Monitor ==="
echo ""
# Check if installation is running
if pgrep -f "install_ue5_5.4.1" > /dev/null; then
echo "✓ Installation script is running"
else
echo "✗ Installation script not found (may have completed or not started)"
fi
# Check installation directory
if [ -d ~/UnrealEngine ]; then
echo "✓ UnrealEngine directory exists"
echo ""
echo "Directory size:"
du -sh ~/UnrealEngine 2>/dev/null | awk '{print " " $1}'
echo ""
# Check build progress
if [ -f ~/UnrealEngine/Engine/Binaries/Linux/UnrealEditor ]; then
echo "✓ UnrealEditor binary found - BUILD COMPLETE!"
ls -lh ~/UnrealEngine/Engine/Binaries/Linux/UnrealEditor
else
echo "⏳ Build in progress (UnrealEditor not found yet)"
# Check for build artifacts
if [ -d ~/UnrealEngine/Engine/Intermediate ]; then
echo " Build artifacts found in Engine/Intermediate"
fi
# Check if Setup.sh has run
if [ -d ~/UnrealEngine/Engine/Plugins ]; then
echo " ✓ Setup.sh appears to have completed (plugins directory exists)"
fi
fi
else
echo "✗ UnrealEngine directory not found yet"
echo " Installation may still be in early stages (cloning repository)"
fi
echo ""
echo "Active processes:"
ps aux | grep -E "(Setup|make|clang|cmake)" | grep -v grep | head -5 | awk '{print " " $11 " " $12 " " $13}'
echo ""
echo "Disk usage:"
df -h ~ | tail -1 | awk '{print " Available: " $4 " / " $2 " (" $5 " used)"}'
echo ""
echo "To view full installation log, check the terminal where installation started"

View File

@@ -0,0 +1,85 @@
#!/bin/bash
#
# UE5 Build Monitor Script
# Monitors the progress of Unreal Engine build
#
BUILD_DIR="$HOME/UnrealEngine"
BUILD_LOG="$BUILD_DIR/build.log"
BINARY_PATH="$BUILD_DIR/Engine/Binaries/Linux/UnrealEditor"
echo "=== UE5.4.1 Build Monitor ==="
echo ""
# Check if build is running
if pgrep -f "make -j4 UnrealEditor" > /dev/null; then
echo "✓ Build is RUNNING"
echo " PID: $(pgrep -f 'make -j4 UnrealEditor' | head -1)"
else
echo "⚠ Build is NOT running"
echo " (May have completed or not started)"
fi
echo ""
# Check build log
if [ -f "$BUILD_LOG" ]; then
LOG_SIZE=$(du -h "$BUILD_LOG" | cut -f1)
echo "Build Log: $BUILD_LOG"
echo "Log Size: $LOG_SIZE"
echo ""
echo "Last 10 lines of build log:"
echo "----------------------------------------"
tail -10 "$BUILD_LOG"
echo "----------------------------------------"
else
echo "Build log not found: $BUILD_LOG"
fi
echo ""
# Check if binary exists
if [ -f "$BINARY_PATH" ]; then
BINARY_SIZE=$(du -h "$BINARY_PATH" | cut -f1)
BINARY_DATE=$(stat -c %y "$BINARY_PATH" | cut -d'.' -f1)
echo "✓ UnrealEditor binary EXISTS"
echo " Size: $BINARY_SIZE"
echo " Last modified: $BINARY_DATE"
echo ""
echo "Build appears to be COMPLETE!"
echo "Verify with: $BINARY_PATH -version"
else
echo "⏳ UnrealEditor binary not found yet"
echo " Expected location: $BINARY_PATH"
echo " Build still in progress..."
fi
echo ""
# Check disk usage
if [ -d "$BUILD_DIR" ]; then
DISK_USAGE=$(du -sh "$BUILD_DIR" 2>/dev/null | cut -f1)
echo "Installation size: $DISK_USAGE"
fi
echo ""
# Check CPU/Memory usage
if pgrep -f "make -j4 UnrealEditor" > /dev/null; then
echo "Build process resource usage:"
ps aux | grep "make -j4" | grep -v grep | awk '{printf " CPU: %s%%, Memory: %s%%\n", $3, $4}'
fi
echo ""
echo "=== Monitoring Commands ==="
echo ""
echo "Watch build log:"
echo " tail -f $BUILD_LOG"
echo ""
echo "Check if running:"
echo " ps aux | grep 'make -j4'"
echo ""
echo "Check binary:"
echo " ls -lh $BINARY_PATH"
echo ""

View File

@@ -0,0 +1,308 @@
#!/bin/bash
#
# Script Name: configure_project_settings.sh
# Description: Configure all Unreal Engine project settings (Nanite, Lumen, World Partition, Plugins)
# Usage: ./configure_project_settings.sh
# Author: Dubai Metaverse Team
# Date: 2025-11-21
# Version: 1.0
set -euo pipefail
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
# Configuration
PROJECT_DIR="${PROJECT_DIR:-$(pwd)}"
PROJECT_FILE="$PROJECT_DIR/DubaiMetaverse.uproject"
ENGINE_INI="$PROJECT_DIR/Config/DefaultEngine.ini"
GAME_INI="$PROJECT_DIR/Config/DefaultGame.ini"
LOG_FILE="$PROJECT_DIR/logs/configure_project_settings.log"
# Create log directory
mkdir -p "$(dirname "$LOG_FILE")"
log() {
local level="${1:-INFO}"
shift
local message="$*"
local timestamp=$(date +'%Y-%m-%d %H:%M:%S')
echo "[$timestamp] [$level] $message" | tee -a "$LOG_FILE"
echo -e "${message}"
}
echo "=========================================="
echo "Dubai Metaverse Project Settings Configuration"
echo "=========================================="
echo ""
cd "$PROJECT_DIR"
# Check project file exists
if [ ! -f "$PROJECT_FILE" ]; then
echo -e "${RED}${NC} Project file not found: $PROJECT_FILE"
echo " Run: ./scripts/setup/create_ue5_project.sh first"
exit 1
fi
echo -e "${GREEN}${NC} Project file found: $PROJECT_FILE"
# Backup existing config files
if [ -f "$ENGINE_INI" ]; then
cp "$ENGINE_INI" "$ENGINE_INI.backup.$(date +%Y%m%d_%H%M%S)"
echo -e "${BLUE}${NC} Backed up DefaultEngine.ini"
fi
if [ -f "$GAME_INI" ]; then
cp "$GAME_INI" "$GAME_INI.backup.$(date +%Y%m%d_%H%M%S)"
echo -e "${BLUE}${NC} Backed up DefaultGame.ini"
fi
# Create Config directory if it doesn't exist
mkdir -p "$PROJECT_DIR/Config"
echo ""
echo "=========================================="
echo "Configuring DefaultEngine.ini"
echo "=========================================="
echo ""
# Create comprehensive DefaultEngine.ini
cat > "$ENGINE_INI" << 'EOF'
; Dubai Metaverse - DefaultEngine.ini
; Configured automatically by configure_project_settings.sh
; Last Updated: 2025-11-21
[/Script/Engine.RendererSettings]
; ============================================
; NANITE SETTINGS
; ============================================
r.Nanite.ProjectEnabled=True
; ============================================
; LUMEN SETTINGS
; ============================================
r.DefaultFeature.LumenSupport=1
r.Lumen.ProjectEnabled=True
r.Lumen.DiffuseIndirect.Allow=1
r.Lumen.Reflections.Allow=1
r.Lumen.ScreenProbeGather.ScreenSpaceBentNormal=1
r.Lumen.ScreenProbeGather.TraceMeshSDFs=1
r.Lumen.ScreenProbeGather.ScreenTraces=1
; ============================================
; VIRTUAL SHADOW MAPS
; ============================================
r.Shadow.Virtual.Enable=1
r.Shadow.Virtual.OnePassProjection=1
; ============================================
; ANTI-ALIASING
; ============================================
r.DefaultFeature.AntiAliasing=2
r.TemporalAA.Quality=4
r.TemporalAA.Upsampling=1
; ============================================
; POST-PROCESS EFFECTS
; ============================================
r.DefaultFeature.AutoExposure=False
r.DefaultFeature.Bloom=True
r.DefaultFeature.MotionBlur=True
r.MotionBlurQuality=4
r.BloomQuality=4
; ============================================
; RENDERING PERFORMANCE
; ============================================
r.VirtualTextures=True
r.VirtualTextures.EnableAutoImport=True
r.VirtualTextures.Enable=1
[/Script/Engine.WorldSettings]
; ============================================
; WORLD PARTITION
; ============================================
bEnableWorldPartition=True
[/Script/Engine.Engine]
; ============================================
; PROJECT SETTINGS
; ============================================
+ActiveGameNameRedirects=(OldGameName="TP_Blank",NewGameName="/Script/DubaiMetaverse")
+ActiveGameNameRedirects=(OldGameName="/Script/TP_Blank",NewGameName="/Script/DubaiMetaverse")
+ActiveClassRedirects=(OldClassName="TP_BlankGameModeBase",NewClassName="DubaiMetaverseGameModeBase")
[/Script/EngineSettings.GameMapsSettings]
; ============================================
; DEFAULT MAPS
; ============================================
GameDefaultMap=/Game/Maps/MainLevel
EditorStartupMap=/Game/Maps/MainLevel
[/Script/WindowsTargetPlatform.WindowsTargetSettings]
; ============================================
; WINDOWS PLATFORM SETTINGS
; ============================================
DefaultGraphicsRHI=Default
+TargetedRHIs=PCD3D_SM6
+TargetedRHIs=PCD3D_SM5
[/Script/LinuxTargetPlatform.LinuxTargetSettings]
; ============================================
; LINUX PLATFORM SETTINGS
; ============================================
DefaultGraphicsRHI=Default
EOF
echo -e "${GREEN}${NC} DefaultEngine.ini configured with:"
echo " - Nanite enabled"
echo " - Lumen enabled (GI + Reflections)"
echo " - Virtual Shadow Maps enabled"
echo " - World Partition enabled"
echo " - Post-process effects configured"
echo ""
echo "=========================================="
echo "Configuring DefaultGame.ini"
echo "=========================================="
echo ""
# Create DefaultGame.ini
cat > "$GAME_INI" << 'EOF'
; Dubai Metaverse - DefaultGame.ini
; Configured automatically by configure_project_settings.sh
; Last Updated: 2025-11-21
[/Script/EngineSettings.GameMapsSettings]
; ============================================
; DEFAULT MAPS
; ============================================
GameDefaultMap=/Game/Maps/Main/MainLevel
EditorStartupMap=/Game/Maps/Main/MainLevel
GlobalDefaultGameMode=/Script/Engine.GameModeBase
[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
[/Script/OnlineSubsystem.IpNetDriver]
NetDriverClassName="OnlineSubsystemUtils.IpNetDriver"
EOF
echo -e "${GREEN}${NC} DefaultGame.ini configured"
echo ""
echo "=========================================="
echo "Verifying Plugins in Project File"
echo "=========================================="
echo ""
# Check and configure plugins in project file
REQUIRED_PLUGINS=(
"ProceduralContentGeneration"
"VirtualProduction"
"MovieRenderQueue"
"ModelingTools"
"GeometryScript"
)
PLUGINS_MISSING=0
for plugin in "${REQUIRED_PLUGINS[@]}"; do
if grep -q "\"Name\": \"$plugin\"" "$PROJECT_FILE"; then
if grep -A1 "\"Name\": \"$plugin\"" "$PROJECT_FILE" | grep -q "\"Enabled\": true"; then
echo -e "${GREEN}${NC} Plugin enabled: $plugin"
else
echo -e "${YELLOW}${NC} Plugin found but not enabled: $plugin"
PLUGINS_MISSING=1
fi
else
echo -e "${RED}${NC} Plugin missing: $plugin"
PLUGINS_MISSING=1
fi
done
if [ $PLUGINS_MISSING -eq 1 ]; then
echo ""
echo -e "${YELLOW}${NC} Some plugins need to be enabled manually:"
echo " 1. Launch Unreal Editor"
echo " 2. Go to Edit > Plugins"
echo " 3. Enable the missing plugins listed above"
echo " 4. Restart editor"
else
echo ""
echo -e "${GREEN}${NC} All required plugins are enabled"
fi
echo ""
echo "=========================================="
echo "Configuration Summary"
echo "=========================================="
echo ""
# Verify settings
echo "Verifying configuration..."
NANITE_OK=0
LUMEN_OK=0
WORLDPARTITION_OK=0
if grep -q "r.Nanite.ProjectEnabled=True" "$ENGINE_INI"; then
echo -e "${GREEN}${NC} Nanite: Enabled"
NANITE_OK=1
else
echo -e "${RED}${NC} Nanite: Not configured"
fi
if grep -q "r.Lumen.ProjectEnabled=True" "$ENGINE_INI"; then
echo -e "${GREEN}${NC} Lumen: Enabled"
LUMEN_OK=1
else
echo -e "${RED}${NC} Lumen: Not configured"
fi
if grep -q "bEnableWorldPartition=True" "$ENGINE_INI"; then
echo -e "${GREEN}${NC} World Partition: Enabled"
WORLDPARTITION_OK=1
else
echo -e "${RED}${NC} World Partition: Not configured"
fi
echo ""
echo "=========================================="
echo "Next Steps"
echo "=========================================="
echo ""
if [ $NANITE_OK -eq 1 ] && [ $LUMEN_OK -eq 1 ] && [ $WORLDPARTITION_OK -eq 1 ]; then
echo -e "${GREEN}✅ All project settings configured successfully!${NC}"
echo ""
echo "Next steps:"
echo "1. Launch Unreal Editor:"
echo " ~/UnrealEngine/Engine/Binaries/Linux/UnrealEditor \\"
echo " ~/projects/metaverseDubai/DubaiMetaverse.uproject"
echo ""
echo "2. Verify settings in editor:"
echo " - Edit > Project Settings > Engine > Rendering"
echo " - Verify Nanite is enabled"
echo " - Verify Lumen (Global Illumination and Reflections) is enabled"
echo " - World Settings > Enable World Partition"
echo ""
echo "3. Verify plugins:"
echo " - Edit > Plugins"
echo " - Verify all required plugins are enabled"
echo ""
log "INFO" "Configuration complete - All settings verified"
exit 0
else
echo -e "${RED}${NC} Some settings may not be configured correctly"
echo " Please review the configuration files manually"
log "WARNING" "Configuration incomplete - Some settings missing"
exit 1
fi

View File

@@ -0,0 +1,295 @@
#!/bin/bash
#
# Script Name: create_ue5_project.sh
# Description: Create Dubai Metaverse Unreal Engine project
# Usage: ./create_ue5_project.sh [project_name]
# Author: Dubai Metaverse Team
# Date: 2024
# Version: 1.0
#
# Exit codes:
# 0: Success
# 1: General error
# 2: Invalid arguments
# 3: Missing dependencies
set -euo pipefail
# Configuration
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
LOG_FILE="${LOG_FILE:-$PROJECT_ROOT/logs/create_project.log}"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
# Logging
log() {
local level="${1:-INFO}"
shift
local message="$*"
local timestamp=$(date +'%Y-%m-%d %H:%M:%S')
echo "[$timestamp] [$level] $message" | tee -a "$LOG_FILE"
}
error_exit() {
log "ERROR" "$*"
exit 1
}
warning() {
log "WARNING" "$*"
}
success() {
log "SUCCESS" "$*"
}
# Parse arguments
PROJECT_NAME="${1:-DubaiMetaverse}"
UE_ROOT="${UE_ROOT:-$HOME/UnrealEngine}"
usage() {
cat << EOF
Usage: $0 [PROJECT_NAME]
Create Dubai Metaverse Unreal Engine project.
Arguments:
PROJECT_NAME Project name (default: DubaiMetaverse)
Environment Variables:
UE_ROOT Unreal Engine root directory (default: ~/UnrealEngine)
Examples:
$0
$0 DubaiMetaverse
UE_ROOT=/opt/UnrealEngine $0
EOF
}
# Validate prerequisites
validate_prerequisites() {
log "INFO" "Validating prerequisites..."
# Check for Unreal Engine
if [ ! -d "$UE_ROOT" ]; then
error_exit "Unreal Engine not found at: $UE_ROOT"
fi
local editor_path="$UE_ROOT/Engine/Binaries/Linux/UnrealEditor"
if [ ! -f "$editor_path" ]; then
error_exit "UnrealEditor not found at: $editor_path"
fi
log "INFO" "Using Unreal Engine: $UE_ROOT"
log "INFO" "UnrealEditor found: $editor_path"
}
# Create project file
create_project_file() {
log "INFO" "Creating project file: ${PROJECT_NAME}.uproject"
local project_file="$PROJECT_ROOT/${PROJECT_NAME}.uproject"
cat > "$project_file" << EOF
{
"FileVersion": 3,
"EngineAssociation": "5.4",
"Category": "",
"Description": "High-End Interactive Demo District of Dubai",
"Modules": [
{
"Name": "${PROJECT_NAME}",
"Type": "Runtime",
"LoadingPhase": "Default"
}
],
"Plugins": [
{
"Name": "ProceduralContentGeneration",
"Enabled": true
},
{
"Name": "VirtualProduction",
"Enabled": true
},
{
"Name": "MovieRenderQueue",
"Enabled": true
},
{
"Name": "ModelingTools",
"Enabled": true
},
{
"Name": "GeometryScript",
"Enabled": true
}
],
"TargetPlatforms": [
"Linux",
"Windows"
]
}
EOF
success "Project file created: $project_file"
}
# Create Source directory structure
create_source_structure() {
log "INFO" "Creating Source directory structure..."
mkdir -p "$PROJECT_ROOT/Source/${PROJECT_NAME}"
mkdir -p "$PROJECT_ROOT/Source/${PROJECT_NAME}/Public"
mkdir -p "$PROJECT_ROOT/Source/${PROJECT_NAME}/Private"
# Create basic module files
cat > "$PROJECT_ROOT/Source/${PROJECT_NAME}/${PROJECT_NAME}.Build.cs" << EOF
using UnrealBuildTool;
public class ${PROJECT_NAME} : ModuleRules
{
public ${PROJECT_NAME}(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] {
"Core",
"CoreUObject",
"Engine",
"InputCore"
});
PrivateDependencyModuleNames.AddRange(new string[] { });
}
}
EOF
cat > "$PROJECT_ROOT/Source/${PROJECT_NAME}/${PROJECT_NAME}.cpp" << EOF
#include "${PROJECT_NAME}.h"
#include "Modules/ModuleManager.h"
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, ${PROJECT_NAME}, "${PROJECT_NAME}" );
EOF
cat > "$PROJECT_ROOT/Source/${PROJECT_NAME}/${PROJECT_NAME}.h" << EOF
#pragma once
#include "CoreMinimal.h"
EOF
success "Source directory structure created"
}
# Copy configuration files
copy_config_files() {
log "INFO" "Copying configuration files..."
mkdir -p "$PROJECT_ROOT/Config"
if [ -f "$PROJECT_ROOT/Config/DefaultEngine.ini" ]; then
cp "$PROJECT_ROOT/Config/DefaultEngine.ini" "$PROJECT_ROOT/Config/DefaultEngine.ini.backup"
log "INFO" "Backed up existing DefaultEngine.ini"
fi
if [ -f "$PROJECT_ROOT/Config/DefaultEngine.ini.template" ]; then
cp "$PROJECT_ROOT/Config/DefaultEngine.ini.template" "$PROJECT_ROOT/Config/DefaultEngine.ini"
success "Copied DefaultEngine.ini from template"
else
warning "DefaultEngine.ini.template not found, using existing or creating default"
fi
if [ -f "$PROJECT_ROOT/Config/DefaultGame.ini.template" ]; then
cp "$PROJECT_ROOT/Config/DefaultGame.ini.template" "$PROJECT_ROOT/Config/DefaultGame.ini"
success "Copied DefaultGame.ini from template"
fi
}
# Generate project files
generate_project_files() {
log "INFO" "Generating project files..."
local project_file="$PROJECT_ROOT/${PROJECT_NAME}.uproject"
if [ ! -f "$project_file" ]; then
error_exit "Project file not found: $project_file"
fi
# Use UnrealBuildTool to generate project files
local ubt_path="$UE_ROOT/Engine/Binaries/DotNET/UnrealBuildTool/UnrealBuildTool.dll"
if [ -f "$ubt_path" ]; then
log "INFO" "Generating project files with UnrealBuildTool..."
dotnet "$ubt_path" -projectfiles -project="$project_file" -game -rocket -progress
success "Project files generated"
else
warning "UnrealBuildTool not found, project files will be generated on first launch"
fi
}
# Create Content directory structure
create_content_structure() {
log "INFO" "Ensuring Content directory structure exists..."
# Content structure should already exist, but verify
if [ ! -d "$PROJECT_ROOT/Content" ]; then
log "INFO" "Content directory not found, creating..."
mkdir -p "$PROJECT_ROOT/Content/{Maps,Assets,Blueprints,Materials,Textures,Audio}"
fi
success "Content directory structure verified"
}
# Main function
main() {
log "INFO" "Starting create_ue5_project.sh"
# Create log directory
mkdir -p "$(dirname "$LOG_FILE")"
# Parse arguments
if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then
usage
exit 0
fi
# Validate prerequisites
validate_prerequisites
# Create project file
create_project_file
# Create Source structure (optional, for C++ projects)
create_source_structure
# Copy configuration files
copy_config_files
# Create Content structure
create_content_structure
# Generate project files
generate_project_files
success "Project creation complete!"
log "INFO" "Project: ${PROJECT_NAME}.uproject"
log "INFO" "Location: $PROJECT_ROOT"
log "INFO" ""
log "INFO" "Next steps:"
log "INFO" "1. Launch Unreal Editor: $UE_ROOT/Engine/Binaries/Linux/UnrealEditor $PROJECT_ROOT/${PROJECT_NAME}.uproject"
log "INFO" "2. Configure project settings (Nanite, Lumen, World Partition)"
log "INFO" "3. Import geospatial data"
log "INFO" "4. Create blockout level"
}
# Run main if executed directly
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
main "$@"
fi

117
scripts/setup/master_setup.sh Executable file
View File

@@ -0,0 +1,117 @@
#!/bin/bash
# Dubai Metaverse - Master Setup Script
# Runs all setup and validation steps in sequence
set -e
echo "=========================================="
echo "Dubai Metaverse - Master Setup"
echo "=========================================="
echo ""
# Colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
# Function to print status
print_status() {
if [ $1 -eq 0 ]; then
echo -e "${GREEN}${NC} $2"
else
echo -e "${RED}${NC} $2"
fi
}
# Step 1: Project Setup
echo "Step 1: Running project setup..."
./scripts/setup_project.sh
print_status $? "Project setup"
# Step 2: Script Enhancement Check
echo ""
echo "Step 2: Validating scripts..."
./scripts/enhance_scripts.sh
print_status $? "Script validation"
# Step 3: Documentation Check
echo ""
echo "Step 3: Validating documentation..."
./scripts/generate_docs.sh
print_status $? "Documentation check"
# Step 4: Full Project Validation
echo ""
echo "Step 4: Running full project validation..."
./scripts/validate_project.sh
print_status $? "Project validation"
# Step 5: Python Dependencies Check
echo ""
echo "Step 5: Checking Python dependencies..."
if python3 -c "import overpy, geojson, rasterio, numpy" 2>/dev/null; then
print_status 0 "Python dependencies"
else
print_status 1 "Python dependencies (install with: pip install -r requirements.txt)"
fi
# Step 6: Git Status
echo ""
echo "Step 6: Checking Git status..."
if [ -d ".git" ]; then
echo " Repository: Initialized"
echo " Branch: $(git branch --show-current 2>/dev/null || echo 'N/A')"
echo " Commits: $(git log --oneline | wc -l)"
print_status 0 "Git repository"
else
print_status 1 "Git repository (not initialized)"
fi
# Step 7: Git LFS Check
echo ""
echo "Step 7: Checking Git LFS..."
if command -v git-lfs &> /dev/null; then
if git lfs version &> /dev/null; then
print_status 0 "Git LFS installed"
else
print_status 1 "Git LFS installed but not working"
fi
else
print_status 1 "Git LFS not installed (install manually)"
fi
# Step 8: Directory Structure Check
echo ""
echo "Step 8: Checking directory structure..."
MISSING_DIRS=0
REQUIRED_DIRS=("docs" "TASKS" "PROGRESS_REPORTS" "scripts" "houdini" "data" "TEMPLATES" "Config" "Content")
for dir in "${REQUIRED_DIRS[@]}"; do
if [ ! -d "$dir" ]; then
echo " ⚠ Missing: $dir/"
((MISSING_DIRS++))
fi
done
if [ $MISSING_DIRS -eq 0 ]; then
print_status 0 "Directory structure"
else
print_status 1 "Directory structure ($MISSING_DIRS missing)"
fi
# Summary
echo ""
echo "=========================================="
echo "Master Setup Complete"
echo "=========================================="
echo ""
echo "Next Steps:"
echo "1. Install Git LFS (if not installed): sudo apt install git-lfs && git lfs install"
echo "2. Install Unreal Engine 5.4 (follow UE5_SETUP.md)"
echo "3. Create UE5 project: DubaiMetaverse"
echo "4. Copy config templates to Config/ directory"
echo "5. Begin Phase 1, Week 2: Geospatial acquisition"
echo ""
echo "For detailed next steps, see: docs/setup/NEXT_STEPS.md"
echo ""

40
scripts/setup/run_next_steps.sh Executable file
View File

@@ -0,0 +1,40 @@
#!/bin/bash
# Master script to run all next steps after UE5 build completes
cd ~/projects/metaverseDubai
echo "=========================================="
echo "Dubai Metaverse - Next Steps Automation"
echo "=========================================="
echo ""
# Step 1: Verify Installation
echo "Step 1: Verifying UE5 Installation..."
./scripts/setup/verify_ue5_installation.sh
if [ $? -ne 0 ]; then
echo "⚠ Installation verification failed. Build may still be in progress."
echo "Check build status: ./scripts/monitoring/ue5_build_monitor.sh"
exit 1
fi
echo ""
echo "Step 2: Creating UE5 Project..."
read -p "Create project now? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
./scripts/setup/create_ue5_project.sh
else
echo "Skipped. Run manually: ./scripts/setup/create_ue5_project.sh"
fi
echo ""
echo "=========================================="
echo "Next Steps Complete!"
echo "=========================================="
echo ""
echo "Manual steps remaining:"
echo "1. Launch Unreal Editor and configure project settings"
echo "2. Import geospatial data"
echo "3. Create blockout level"
echo ""
echo "See NEXT_STEPS_AFTER_BUILD.md for detailed instructions"

97
scripts/setup/setup_blockout.sh Executable file
View File

@@ -0,0 +1,97 @@
#!/bin/bash
#
# Script Name: setup_blockout.sh
# Description: Prepare blockout level setup instructions
# Usage: ./setup_blockout.sh
# Author: Dubai Metaverse Team
# Date: 2024
# Version: 1.0
set -euo pipefail
# Configuration
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
echo "=========================================="
echo "Blockout Level Setup Guide"
echo "=========================================="
echo ""
cat << 'EOF'
## Blockout Setup Steps
### 1. Create Main Level
- Open Unreal Editor
- File > New Level > Empty Level
- Save as: Content/Maps/MainLevel
- Enable World Partition
### 2. Import OSM Data
- Run: python3 scripts/data/import_osm_data.py --output data/processed/dubai_marina_buildings.geojson
- Import GeoJSON to Unreal (may require plugin or conversion)
- Create building footprint meshes from OSM data
### 3. Generate Terrain
- Run: python3 scripts/data/gis_to_unreal.py data/elevation/dem.tif --output data/processed/terrain_heightmap.raw
- Import heightmap to Landscape tool
- Create landscape from heightmap
- Set scale to 1:1 (100 units = 1 meter)
### 4. Create Building Footprints
- Use OSM building data
- Create simple box meshes for each building
- Place at correct locations
- Set correct heights (from reference or estimation)
- Use gray materials for blockout
### 5. Create Road Network
- Use OSM road data
- Create splines for roads
- Use Road Tool or spline meshes
- Set road width from reference
### 6. Add Basic Navigation
- Add NavMeshBoundsVolume
- Build navigation mesh
- Test player navigation
### 7. Validate Scale
- Verify 1:1 scale (100 units = 1 meter)
- Check building heights
- Verify distances match real-world
### 8. Test Navigation Flow
- Place player start
- Test walking through district
- Verify navigation works
- Check for clipping issues
## Blockout Checklist
- [ ] Main level created
- [ ] World Partition enabled
- [ ] OSM data imported
- [ ] Terrain generated from elevation data
- [ ] Building footprints placed
- [ ] Road network created
- [ ] Navigation mesh built
- [ ] Scale validated (1:1)
- [ ] Navigation flow tested
- [ ] Blockout reviewed
## Next Steps After Blockout
1. Identify exact buildings needed
2. Create Tier 1 asset list (Hero: Cayan Tower)
3. Create Tier 2 asset list (Primary buildings)
4. Begin asset production (Phase 2)
EOF
echo ""
echo "For detailed instructions, see:"
echo " - docs/planning/BLOCKOUT_REVIEW.md"
echo " - TASKS/phase1_tasks.md (Week 2)"
echo ""

87
scripts/setup/setup_project.sh Executable file
View File

@@ -0,0 +1,87 @@
#!/bin/bash
# Dubai Metaverse - Project Setup Script
# This script sets up the initial project structure and configuration
set -e # Exit on error
echo "=========================================="
echo "Dubai Metaverse - Project Setup"
echo "=========================================="
echo ""
# Check if Git is installed
if ! command -v git &> /dev/null; then
echo "Error: Git is not installed. Please install Git first."
exit 1
fi
# Check if Git LFS is installed
if ! command -v git-lfs &> /dev/null; then
echo "Warning: Git LFS is not installed. Large file tracking will not work."
echo "Please install Git LFS: https://git-lfs.github.com"
read -p "Continue anyway? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
else
echo "✓ Git LFS is installed"
# Initialize Git LFS
git lfs install
echo "✓ Git LFS initialized"
fi
# Initialize Git repository if not already initialized
if [ ! -d ".git" ]; then
echo "Initializing Git repository..."
git init
echo "✓ Git repository initialized"
else
echo "✓ Git repository already initialized"
fi
# Create directory structure
echo ""
echo "Creating directory structure..."
mkdir -p TASKS
mkdir -p docs
mkdir -p scripts
mkdir -p PROGRESS_REPORTS
mkdir -p houdini
mkdir -p data/{osm,elevation,references,processed}
echo "✓ Directory structure created"
# Set script permissions
echo ""
echo "Setting script permissions..."
chmod +x scripts/*.sh 2>/dev/null || true
echo "✓ Script permissions set"
# Check Python installation (for Python scripts)
if command -v python3 &> /dev/null; then
echo "✓ Python 3 is installed"
PYTHON_VERSION=$(python3 --version)
echo " Version: $PYTHON_VERSION"
else
echo "Warning: Python 3 is not installed. Some scripts may not work."
fi
# Summary
echo ""
echo "=========================================="
echo "Setup Complete!"
echo "=========================================="
echo ""
echo "Next steps:"
echo "1. Review documentation in root directory"
echo "2. Follow UE5_SETUP.md to install Unreal Engine 5.4"
echo "3. Create Unreal Engine project"
echo "4. Follow PROJECT_SETTINGS.md to configure engine"
echo "5. Install plugins (see PLUGINS.md)"
echo "6. Begin Phase 1, Week 2: Geospatial acquisition"
echo ""
echo "For more information, see README.md"
echo ""

View File

@@ -0,0 +1,94 @@
#!/bin/bash
# Dubai Metaverse - UE5 Project Setup Script
# This script provides instructions and validation for UE5 project setup
set -e # Exit on error
echo "=========================================="
echo "Dubai Metaverse - UE5 Project Setup"
echo "=========================================="
echo ""
# Check if UE5 project file exists
if [ -f "DubaiMetaverse.uproject" ]; then
echo "✓ UE5 project file found: DubaiMetaverse.uproject"
else
echo "⚠ UE5 project file not found"
echo ""
echo "Please create the UE5 project manually:"
echo "1. Open Epic Games Launcher"
echo "2. Launch Unreal Engine 5.4"
echo "3. Create new project: 'DubaiMetaverse'"
echo "4. Template: Blank (or Third Person)"
echo "5. Blueprint (C++ can be added later)"
echo "6. Target Platform: Desktop"
echo "7. Quality Preset: Maximum"
echo "8. Starter Content: No"
echo "9. Save project in this directory"
echo ""
read -p "Press Enter when project is created..."
fi
# Check for Content directory
if [ -d "Content" ]; then
echo "✓ Content directory found"
# Check for expected folder structure
echo ""
echo "Checking folder structure..."
DIRS=("Content/Maps" "Content/Assets" "Content/Blueprints" "Content/PCG" "Content/Cinematics" "Content/Audio")
MISSING_DIRS=()
for dir in "${DIRS[@]}"; do
if [ ! -d "$dir" ]; then
MISSING_DIRS+=("$dir")
fi
done
if [ ${#MISSING_DIRS[@]} -eq 0 ]; then
echo "✓ All expected directories exist"
else
echo "⚠ Missing directories:"
for dir in "${MISSING_DIRS[@]}"; do
echo " - $dir"
done
echo ""
read -p "Create missing directories? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
for dir in "${MISSING_DIRS[@]}"; do
mkdir -p "$dir"
echo "✓ Created: $dir"
done
fi
fi
else
echo "⚠ Content directory not found"
echo "This script should be run from the UE5 project root directory"
exit 1
fi
# Check for Config directory
if [ -d "Config" ]; then
echo "✓ Config directory found"
else
echo "⚠ Config directory not found"
echo "This may be normal for a new project"
fi
# Summary
echo ""
echo "=========================================="
echo "UE5 Project Setup Check Complete"
echo "=========================================="
echo ""
echo "Next steps:"
echo "1. Open project in Unreal Editor"
echo "2. Configure project settings (see PROJECT_SETTINGS.md)"
echo "3. Install required plugins (see PLUGINS.md)"
echo "4. Set up World Partition"
echo "5. Begin asset import"
echo ""

View File

@@ -0,0 +1,157 @@
#!/bin/bash
# Verify project setup is complete
# Colors
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
echo "=========================================="
echo "Dubai Metaverse Project Setup Verification"
echo "=========================================="
echo ""
ERRORS=0
WARNINGS=0
# Check project file
if [ -f "DubaiMetaverse.uproject" ]; then
echo -e "${GREEN}${NC} DubaiMetaverse.uproject exists"
else
echo -e "${RED}${NC} DubaiMetaverse.uproject missing"
((ERRORS++))
fi
# Check config files
if [ -f "Config/DefaultEngine.ini" ]; then
echo -e "${GREEN}${NC} DefaultEngine.ini exists"
# Check Nanite
if grep -q "r.Nanite.ProjectEnabled=True" Config/DefaultEngine.ini; then
echo -e " ${GREEN}${NC} Nanite enabled"
else
echo -e " ${RED}${NC} Nanite not configured"
((ERRORS++))
fi
# Check Lumen
if grep -q "r.Lumen.ProjectEnabled=True" Config/DefaultEngine.ini; then
echo -e " ${GREEN}${NC} Lumen enabled"
else
echo -e " ${RED}${NC} Lumen not configured"
((ERRORS++))
fi
# Check Lumen GI
if grep -q "r.Lumen.DiffuseIndirect.Allow=1" Config/DefaultEngine.ini; then
echo -e " ${GREEN}${NC} Lumen Global Illumination enabled"
else
echo -e " ${YELLOW}${NC} Lumen GI not explicitly configured"
((WARNINGS++))
fi
# Check Lumen Reflections
if grep -q "r.Lumen.Reflections.Allow=1" Config/DefaultEngine.ini; then
echo -e " ${GREEN}${NC} Lumen Reflections enabled"
else
echo -e " ${YELLOW}${NC} Lumen Reflections not explicitly configured"
((WARNINGS++))
fi
# Check Virtual Shadow Maps
if grep -q "r.Shadow.Virtual.Enable=1" Config/DefaultEngine.ini; then
echo -e " ${GREEN}${NC} Virtual Shadow Maps enabled"
else
echo -e " ${YELLOW}${NC} Virtual Shadow Maps not configured"
((WARNINGS++))
fi
# Check World Partition
if grep -q "bEnableWorldPartition=True" Config/DefaultEngine.ini; then
echo -e " ${GREEN}${NC} World Partition enabled"
else
echo -e " ${RED}${NC} World Partition not configured"
((ERRORS++))
fi
else
echo -e "${RED}${NC} DefaultEngine.ini missing"
((ERRORS++))
fi
# Check DefaultGame.ini
if [ -f "Config/DefaultGame.ini" ]; then
echo -e "${GREEN}${NC} DefaultGame.ini exists"
else
echo -e "${YELLOW}${NC} DefaultGame.ini missing (optional)"
((WARNINGS++))
fi
# Check Source structure
if [ -d "Source/DubaiMetaverse" ]; then
echo -e "${GREEN}${NC} Source structure exists"
else
echo -e "${BLUE}${NC} Source structure not found (optional for Blueprint-only project)"
fi
# Check Content structure
if [ -d "Content" ]; then
echo -e "${GREEN}${NC} Content directory exists"
else
echo -e "${RED}${NC} Content directory missing"
((ERRORS++))
fi
# Check required plugins
echo ""
echo "Checking required plugins..."
REQUIRED_PLUGINS=(
"ProceduralContentGeneration"
"VirtualProduction"
"MovieRenderQueue"
"ModelingTools"
"GeometryScript"
)
PLUGINS_OK=0
for plugin in "${REQUIRED_PLUGINS[@]}"; do
if grep -q "\"Name\": \"$plugin\"" DubaiMetaverse.uproject 2>/dev/null; then
if grep -A1 "\"Name\": \"$plugin\"" DubaiMetaverse.uproject | grep -q "\"Enabled\": true"; then
echo -e " ${GREEN}${NC} $plugin enabled"
((PLUGINS_OK++))
else
echo -e " ${YELLOW}${NC} $plugin found but not enabled"
((WARNINGS++))
fi
else
echo -e " ${RED}${NC} $plugin missing"
((ERRORS++))
fi
done
echo ""
echo "=========================================="
echo "Verification Summary"
echo "=========================================="
echo ""
if [ $ERRORS -eq 0 ] && [ $PLUGINS_OK -eq ${#REQUIRED_PLUGINS[@]} ]; then
echo -e "${GREEN}✅ Project setup verification: PASSED${NC}"
if [ $WARNINGS -gt 0 ]; then
echo -e "${YELLOW}${NC} $WARNINGS warning(s) found (non-critical)"
fi
echo ""
echo "All required settings and plugins are configured!"
exit 0
else
echo -e "${RED}⚠ Project setup verification: FAILED${NC}"
echo -e " ${RED}Errors:${NC} $ERRORS"
echo -e " ${YELLOW}Warnings:${NC} $WARNINGS"
echo ""
if [ $ERRORS -gt 0 ]; then
echo "Run configuration script:"
echo " ./scripts/setup/configure_project_settings.sh"
fi
exit 1
fi

View File

@@ -0,0 +1,108 @@
#!/bin/bash
#
# Script Name: verify_ue5_installation.sh
# Description: Verify Unreal Engine 5.4 installation
# Usage: ./verify_ue5_installation.sh
# Author: Dubai Metaverse Team
# Date: 2024
# Version: 1.0
set -euo pipefail
# Configuration
UE_ROOT="${UE_ROOT:-$HOME/UnrealEngine}"
LOG_FILE="${LOG_FILE:-$HOME/projects/metaverseDubai/logs/verify_ue5.log}"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
# Logging
log() {
local level="${1:-INFO}"
shift
local message="$*"
local timestamp=$(date +'%Y-%m-%d %H:%M:%S')
echo "[$timestamp] [$level] $message" | tee -a "$LOG_FILE"
}
# Create log directory
mkdir -p "$(dirname "$LOG_FILE")"
echo "=========================================="
echo "UE5.4 Installation Verification"
echo "=========================================="
echo ""
# Check UnrealEngine directory
if [ ! -d "$UE_ROOT" ]; then
echo -e "${RED}${NC} UnrealEngine directory not found: $UE_ROOT"
exit 1
fi
echo -e "${GREEN}${NC} UnrealEngine directory found: $UE_ROOT"
# Check UnrealEditor binary
EDITOR_PATH="$UE_ROOT/Engine/Binaries/Linux/UnrealEditor"
if [ ! -f "$EDITOR_PATH" ]; then
echo -e "${YELLOW}${NC} UnrealEditor binary not found: $EDITOR_PATH"
echo " Build may still be in progress"
echo " Check build status: ~/projects/metaverseDubai/UE5_BUILD_MONITOR.sh"
exit 1
fi
echo -e "${GREEN}${NC} UnrealEditor binary found: $EDITOR_PATH"
# Check binary size (should be substantial)
BINARY_SIZE=$(du -h "$EDITOR_PATH" | cut -f1)
echo -e "${GREEN}${NC} UnrealEditor size: $BINARY_SIZE"
# Check version
echo ""
echo "Checking Unreal Engine version..."
if "$EDITOR_PATH" -version 2>&1 | grep -q "5.4"; then
VERSION=$("$EDITOR_PATH" -version 2>&1 | head -1)
echo -e "${GREEN}${NC} Version: $VERSION"
else
echo -e "${YELLOW}${NC} Could not verify version (may require GUI)"
echo " Version check requires running editor"
fi
# Check required plugins
echo ""
echo "Checking required plugins..."
PLUGINS_DIR="$UE_ROOT/Engine/Plugins"
REQUIRED_PLUGINS=(
"ProceduralContentGeneration"
"VirtualProduction"
"MovieRenderQueue"
)
for plugin in "${REQUIRED_PLUGINS[@]}"; do
if [ -d "$PLUGINS_DIR/$plugin" ]; then
echo -e "${GREEN}${NC} Plugin found: $plugin"
else
echo -e "${YELLOW}${NC} Plugin not found: $plugin"
fi
done
# Check disk space
echo ""
echo "Checking installation size..."
INSTALL_SIZE=$(du -sh "$UE_ROOT" 2>/dev/null | cut -f1)
echo -e "${GREEN}${NC} Installation size: $INSTALL_SIZE"
# Summary
echo ""
echo "=========================================="
echo "Verification Summary"
echo "=========================================="
echo -e "${GREEN}${NC} Unreal Engine 5.4 installation verified"
echo ""
echo "Next steps:"
echo "1. Create project: ./scripts/setup/create_ue5_project.sh"
echo "2. Launch editor: $EDITOR_PATH ~/projects/metaverseDubai/DubaiMetaverse.uproject"
echo ""
log "INFO" "Verification complete - Installation OK"

76
scripts/tests/README.md Normal file
View File

@@ -0,0 +1,76 @@
# Scripts Tests Directory
## Overview
This directory contains tests for automation scripts in the Dubai Metaverse project.
## Test Structure
### Unit Tests
- Test individual script functions
- Validate input/output
- Test error handling
### Integration Tests
- Test script interactions
- Validate end-to-end workflows
- Test script dependencies
### Validation Tests
- Test script correctness
- Validate script standards compliance
- Check script documentation
## Running Tests
```bash
# Run all tests
make test
# Run specific test
python3 -m pytest tests/test_script_name.py
# Run with coverage
python3 -m pytest --cov=scripts tests/
```
## Test Files
- `test_setup_scripts.py` - Tests for setup scripts
- `test_validation_scripts.py` - Tests for validation scripts
- `test_data_scripts.py` - Tests for data processing scripts
- `test_build_scripts.py` - Tests for build scripts
## Writing Tests
Follow these guidelines:
1. **Test one thing at a time**
2. **Use descriptive test names**
3. **Test both success and failure cases**
4. **Mock external dependencies**
5. **Keep tests fast and isolated**
## Example Test
```python
import unittest
from scripts.setup_project import validate_prerequisites
class TestSetupProject(unittest.TestCase):
def test_validate_prerequisites_success(self):
"""Test that prerequisites validation passes with all requirements"""
result = validate_prerequisites()
self.assertTrue(result)
def test_validate_prerequisites_missing_git(self):
"""Test that validation fails when Git is missing"""
# Mock missing git
# ...
with self.assertRaises(SystemExit):
validate_prerequisites()
```
---
**Last Updated**: 2024

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env python3
"""
Dubai Metaverse - Automated Test Suite
Runs automated tests for gameplay systems
"""
# Placeholder script - to be implemented during Phase 5, Week 11-12
# This script will run automated tests for gameplay systems
print("Automated Test Suite")
print("To be implemented during Phase 5, Week 11-12")

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env python3
"""
Dubai Metaverse - NPC Dialogue API Integration
Integrates ChatGPT API for dynamic NPC dialogue
"""
# Placeholder script - to be implemented during Phase 3, Week 8 (optional)
# This script will integrate ChatGPT API for NPC dialogue
print("NPC Dialogue API Integration")
print("To be implemented during Phase 3, Week 8 (optional)")

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env python3
"""
Dubai Metaverse - Lighting Validation Script
Validates lighting setup and performance
"""
# Placeholder script - to be implemented during Phase 3, Week 6
# This script will validate lighting configuration and performance
print("Lighting Validation Script")
print("To be implemented during Phase 3, Week 6")

12
scripts/tools/pcg_validation.py Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env python3
"""
Dubai Metaverse - PCG Validation Script
Validates Procedural Content Generation graphs and outputs
"""
# Placeholder script - to be implemented during Phase 2, Week 3
# This script will validate PCG graph outputs and placement rules
print("PCG Validation Script")
print("To be implemented during Phase 2, Week 3")

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env python3
"""
Dubai Metaverse - Performance Audit Script
Audits performance metrics and identifies bottlenecks
"""
# Placeholder script - to be implemented during Phase 4, Week 10
# This script will audit performance and generate optimization reports
print("Performance Audit Script")
print("To be implemented during Phase 4, Week 10")

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env python3
"""
Dubai Metaverse - Cinematic Render Script
Automates Movie Render Queue rendering
"""
# Placeholder script - to be implemented during Phase 4, Week 10
# This script will automate Movie Render Queue rendering
print("Cinematic Render Script")
print("To be implemented during Phase 4, Week 10")

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env python3
"""
Dubai Metaverse - Texture Validation Script
Validates texture resolution, format, and naming conventions
"""
# Placeholder script - to be implemented during Phase 2, Week 4-5
# This script will validate texture files for resolution, format, and naming
print("Texture Validation Script")
print("To be implemented during Phase 2, Week 4-5")

View File

@@ -0,0 +1,41 @@
#!/bin/bash
# Dubai Metaverse - Script Enhancement Script
# Adds error handling and improvements to all scripts
set -e
echo "=========================================="
echo "Dubai Metaverse - Script Enhancement"
echo "=========================================="
echo ""
# Check script syntax
echo "Checking script syntax..."
for script in scripts/*.sh; do
if [ -f "$script" ]; then
if bash -n "$script" 2>/dev/null; then
echo "$script - Syntax OK"
else
echo "$script - Syntax errors found"
fi
fi
done
echo ""
echo "Checking Python script syntax..."
for script in scripts/*.py; do
if [ -f "$script" ]; then
if python3 -m py_compile "$script" 2>/dev/null; then
echo "$script - Syntax OK"
else
echo "$script - Syntax errors found"
fi
fi
done
echo ""
echo "=========================================="
echo "Script Enhancement Complete"
echo "=========================================="

View File

@@ -0,0 +1,87 @@
#!/bin/bash
# Dubai Metaverse - Asset Validation Script
# Validates asset naming conventions and structure
set -e # Exit on error
echo "=========================================="
echo "Dubai Metaverse - Asset Validation"
echo "=========================================="
echo ""
# Check if Content directory exists
if [ ! -d "Content" ]; then
echo "Error: Content directory not found"
echo "Run this script from the UE5 project root directory"
exit 1
fi
ERRORS=0
WARNINGS=0
# Function to check naming convention
check_naming() {
local file="$1"
local basename=$(basename "$file")
# Check for spaces
if [[ "$basename" == *" "* ]]; then
echo " ❌ ERROR: Contains spaces: $basename"
((ERRORS++))
return 1
fi
# Check for special characters (except underscores and hyphens)
if [[ "$basename" =~ [^a-zA-Z0-9_\-\.] ]]; then
echo " ❌ ERROR: Contains invalid characters: $basename"
((ERRORS++))
return 1
fi
# Check prefix based on extension
local ext="${basename##*.}"
case "$ext" in
uasset)
if [[ ! "$basename" =~ ^(SM_|SK_|M_|MI_|BP_|ABP_|BT_|P_|A_|SQ_|CineCamera_|DA_|WBP_|PCG_|D_|PP_) ]]; then
echo " ⚠ WARNING: Missing prefix: $basename"
((WARNINGS++))
fi
;;
*)
# Other file types - basic validation only
;;
esac
return 0
}
# Scan Content directory for assets
echo "Scanning Content directory..."
echo ""
find Content -type f -name "*.uasset" -o -name "*.umap" | while read -r file; do
check_naming "$file"
done
# Summary
echo ""
echo "=========================================="
echo "Validation Complete"
echo "=========================================="
echo ""
echo "Errors: $ERRORS"
echo "Warnings: $WARNINGS"
echo ""
if [ $ERRORS -eq 0 ] && [ $WARNINGS -eq 0 ]; then
echo "✓ All assets passed validation"
exit 0
elif [ $ERRORS -eq 0 ]; then
echo "⚠ Some warnings found, but no errors"
exit 0
else
echo "❌ Validation failed. Please fix errors before committing."
exit 1
fi

View File

@@ -0,0 +1,98 @@
#!/bin/bash
# Dubai Metaverse - Full Project Validation Script
# Validates complete project structure and documentation
set -e
echo "=========================================="
echo "Dubai Metaverse - Project Validation"
echo "=========================================="
echo ""
ERRORS=0
WARNINGS=0
# Check required files
echo "Checking required files..."
REQUIRED_FILES=(
"README.md"
"docs/planning/PROJECT_CHARTER.md"
"docs/TECHNICAL_BRIEF.md"
"docs/ART_BIBLE.md"
"docs/planning/PROJECT_PLAN.md"
"docs/PIPELINE.md"
"docs/NAMING_CONVENTIONS.md"
"docs/setup/UE5_INSTALLATION.md"
"docs/setup/PROJECT_SETTINGS.md"
"docs/setup/PLUGINS.md"
"docs/setup/VERSION_CONTROL.md"
"docs/planning/MILESTONES.md"
)
for file in "${REQUIRED_FILES[@]}"; do
if [ -f "$file" ]; then
echo "$file"
else
echo "❌ Missing: $file"
((ERRORS++))
fi
done
# Check directories
echo ""
echo "Checking directory structure..."
REQUIRED_DIRS=(
"docs"
"TASKS"
"PROGRESS_REPORTS"
"scripts"
"houdini"
"data"
"TEMPLATES"
)
for dir in "${REQUIRED_DIRS[@]}"; do
if [ -d "$dir" ]; then
echo "$dir/"
else
echo "⚠ Missing: $dir/"
((WARNINGS++))
fi
done
# Check scripts
echo ""
echo "Checking scripts..."
if [ -d "scripts" ]; then
SCRIPT_COUNT=$(find scripts -type f \( -name "*.sh" -o -name "*.py" \) | wc -l)
echo "✓ Found $SCRIPT_COUNT scripts"
else
echo "⚠ Scripts directory not found"
((WARNINGS++))
fi
# Check documentation
echo ""
echo "Checking documentation..."
DOC_COUNT=$(find . -name "*.md" | wc -l)
echo "✓ Found $DOC_COUNT documentation files"
# Summary
echo ""
echo "=========================================="
echo "Validation Summary"
echo "=========================================="
echo ""
echo "Errors: $ERRORS"
echo "Warnings: $WARNINGS"
echo ""
if [ $ERRORS -eq 0 ]; then
echo "✓ Project validation passed"
exit 0
else
echo "❌ Project validation failed"
exit 1
fi