FallingStars123 commited on
Commit
a7ff374
ยท
verified ยท
1 Parent(s): d6a022c

Create README.md

Browse files

---

# Smart MC Building Generator

## Project Overview
The Smart MC Building Generator is an AI-powered tool that automatically generates Minecraft structures based on user prompts (e.g., "flat roof", "dark oak walls"). It combines data augmentation, 3D generative models, and Minecraft data format conversion to create 10x10x10 structures from single images or text prompts, exporting them as `.schem` files.
---
[๐Ÿ‡จ๐Ÿ‡ณ ็ฎ€ไฝ“ไธญๆ–‡](Muti_language_Readme/README.zh.md) | [๐Ÿ‡ฌ๐Ÿ‡ง English](Muti_language_Readme/README.en.md)
---

## Key Features
1. **Data Loading & Parsing**
โ€ข Supports loading and parsing Minecraft `.schem` files.
2. **Data Augmentation**
โ€ข Generates diverse building variants via rotation and mirroring.
3. **3D Visualization**
โ€ข Preview structures as point clouds, colored cubes, or slice views.
4. **Prompt-Driven Generation**
โ€ข Generate buildings from text prompts (e.g., "small house with a flat roof").
5. **Export Functionality**
โ€ข Save generated structures as `.schem` files for direct use in Minecraft.

---

## Dependencies
โ€ข **Python 3.8+**
โ€ข **Core Libraries**:
โ€ข `numpy`
โ€ข `pyvista`
โ€ข `nbtlib`
โ€ข `torch` (for model training)
โ€ข `flask` (for web interface)

**Installation**:
```bash
pip install numpy pyvista nbtlib torch flask
```

---

## Usage

### 1. Load & Parse Data
Place your `.schem` file in the project directory and run:
```python
from main import process_block_data
process_block_data("WoodHouse_3.schem")
```

### 2. Data Augmentation
Generate rotated/mirrored variants of existing structures:
```python
from main import generate_rotated_and_mirrored_data
generate_rotated_and_mirrored_data()
```

### 3. Visualization
Preview structures using:
```python
from main import preview_point_cloud, preview_cubes_with_colors, preview_slices
preview_point_cloud(output_data) # Point cloud view
preview_cubes_with_colors(output_data) # Colored cubes
preview_slices(output_data) # Slice view
```

### 4. Prompt-Based Generation
Generate structures from text prompts:
```python
from main import generate_from_prompt
generate_from_prompt("A small house with a flat roof and dark oak walls")
```

### 5. Export to `.schem`
Save generated structures:
```python
from main import save_as_schem
save_as_schem(house_data, "generated_house.schem")
```

### 6. Web Interface
Launch the interactive web server:
```bash
python main.py
```
Visit `http://Not_created_yet` to generate buildings via prompts.

---

## File Structure
```
MC_Building_Generator/
โ”œโ”€โ”€ schem/ # put .schem files
โ”‚ โ””โ”€โ”€ WoodHouse_3.schem
โ”œโ”€โ”€ npy/ # put .npy files
โ”‚ โ””โ”€โ”€ block_data_0.npy
โ”œโ”€โ”€ main.py # Main entry point
โ”œโ”€โ”€ block_data.txt # Parsed block data
โ”œโ”€โ”€ metadata.txt # Metadata (dimensions, block IDs)
โ””โ”€โ”€ README.md # This document
```
---

## Examples
1. **Load a `.schem` file**:
```bash
python main.py
```
2. **Generate from a prompt**:
โ€ข **Prompt**: `A small house with a flat roof and dark oak walls`
โ€ข **Output**: `generated_house.schem`

---

## Notes
1. Ensure `.schem` files follow Minecraft's format specifications.
2. Use clear and specific prompts for optimal results.
3. Augmented data is saved in `block_data_*.npy` files.

---

## Roadmap
1. Support more building types and sizes.
2. Optimize generation speed and model accuracy.
3. Develop a real-time preview interface.

---

## Contact
For questions or feedback:
โ€ข **Email**: [email protected]
โ€ข **GitHub**: [https://github.com/fallingstars123/MC-AI-BuildingGenerate](https://github.com/fallingstars123/MC-AI-BuildingGenerate)
โ€ข **Discord**: thomasw2004

---

Files changed (1) hide show
  1. README.md +0 -0
README.md ADDED
File without changes