Create readme.en.md
Browse files- readme.en.md +145 -0
readme.en.md
ADDED
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: "Smart MC Building Generator"
|
3 |
+
emoji: "๐๏ธ"
|
4 |
+
colorFrom: "blue"
|
5 |
+
colorTo: "purple"
|
6 |
+
sdk: "streamlit" # ๆ gradio ๅๅณไบไฝ ็ web ็้ข
|
7 |
+
app_file: "main.py"
|
8 |
+
pinned: false
|
9 |
+
---
|
10 |
+
|
11 |
+
# Smart MC Building Generator
|
12 |
+
|
13 |
+
## Project Overview
|
14 |
+
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.
|
15 |
+
|
16 |
+
---
|
17 |
+
|
18 |
+
[๐จ๐ณ ็ฎไฝไธญๆ](Muti_language_Readme/README.zh.md) | [๐ฌ๐ง English](Muti_language_Readme/README.en.md)
|
19 |
+
|
20 |
+
---
|
21 |
+
|
22 |
+
## Key Features
|
23 |
+
1. **Data Loading & Parsing**
|
24 |
+
โข Supports loading and parsing Minecraft `.schem` files.
|
25 |
+
2. **Data Augmentation**
|
26 |
+
โข Generates diverse building variants via rotation and mirroring.
|
27 |
+
3. **3D Visualization**
|
28 |
+
โข Preview structures as point clouds, colored cubes, or slice views.
|
29 |
+
4. **Prompt-Driven Generation**
|
30 |
+
โข Generate buildings from text prompts (e.g., "small house with a flat roof").
|
31 |
+
5. **Export Functionality**
|
32 |
+
โข Save generated structures as `.schem` files for direct use in Minecraft.
|
33 |
+
|
34 |
+
---
|
35 |
+
|
36 |
+
## Dependencies
|
37 |
+
โข **Python 3.8+**
|
38 |
+
โข **Core Libraries**:
|
39 |
+
โข `numpy`
|
40 |
+
โข `pyvista`
|
41 |
+
โข `nbtlib`
|
42 |
+
โข `torch` (for model training)
|
43 |
+
โข `flask` (for web interface)
|
44 |
+
|
45 |
+
**Installation**:
|
46 |
+
```bash
|
47 |
+
pip install numpy pyvista nbtlib torch flask
|
48 |
+
```
|
49 |
+
|
50 |
+
---
|
51 |
+
|
52 |
+
## Usage
|
53 |
+
|
54 |
+
### 1. Load & Parse Data
|
55 |
+
Place your `.schem` file in the project directory and run:
|
56 |
+
```python
|
57 |
+
from main import process_block_data
|
58 |
+
process_block_data("WoodHouse_3.schem")
|
59 |
+
```
|
60 |
+
|
61 |
+
### 2. Data Augmentation
|
62 |
+
Generate rotated/mirrored variants of existing structures:
|
63 |
+
```python
|
64 |
+
from main import generate_rotated_and_mirrored_data
|
65 |
+
generate_rotated_and_mirrored_data()
|
66 |
+
```
|
67 |
+
|
68 |
+
### 3. Visualization
|
69 |
+
Preview structures using:
|
70 |
+
```python
|
71 |
+
from main import preview_point_cloud, preview_cubes_with_colors, preview_slices
|
72 |
+
preview_point_cloud(output_data) # Point cloud view
|
73 |
+
preview_cubes_with_colors(output_data) # Colored cubes
|
74 |
+
preview_slices(output_data) # Slice view
|
75 |
+
```
|
76 |
+
|
77 |
+
### 4. Prompt-Based Generation
|
78 |
+
Generate structures from text prompts:
|
79 |
+
```python
|
80 |
+
from main import generate_from_prompt
|
81 |
+
generate_from_prompt("A small house with a flat roof and dark oak walls")
|
82 |
+
```
|
83 |
+
|
84 |
+
### 5. Export to `.schem`
|
85 |
+
Save generated structures:
|
86 |
+
```python
|
87 |
+
from main import save_as_schem
|
88 |
+
save_as_schem(house_data, "generated_house.schem")
|
89 |
+
```
|
90 |
+
|
91 |
+
### 6. Web Interface
|
92 |
+
Launch the interactive web server:
|
93 |
+
```bash
|
94 |
+
python main.py
|
95 |
+
```
|
96 |
+
Visit `http://Not_created_yet` to generate buildings via prompts.
|
97 |
+
|
98 |
+
---
|
99 |
+
|
100 |
+
## File Structure
|
101 |
+
```
|
102 |
+
MC_Building_Generator/
|
103 |
+
โโโ schem/ # put .schem files
|
104 |
+
โ โโโ WoodHouse_3.schem
|
105 |
+
โโโ npy/ # put .npy files
|
106 |
+
โ โโโ block_data_0.npy
|
107 |
+
โโโ main.py # Main entry point
|
108 |
+
โโโ block_data.txt # Parsed block data
|
109 |
+
โโโ metadata.txt # Metadata (dimensions, block IDs)
|
110 |
+
โโโ README.md # This document
|
111 |
+
```
|
112 |
+
---
|
113 |
+
|
114 |
+
## Examples
|
115 |
+
1. **Load a `.schem` file**:
|
116 |
+
```bash
|
117 |
+
python main.py
|
118 |
+
```
|
119 |
+
2. **Generate from a prompt**:
|
120 |
+
โข **Prompt**: `A small house with a flat roof and dark oak walls`
|
121 |
+
โข **Output**: `generated_house.schem`
|
122 |
+
|
123 |
+
---
|
124 |
+
|
125 |
+
## Notes
|
126 |
+
1. Ensure `.schem` files follow Minecraft's format specifications.
|
127 |
+
2. Use clear and specific prompts for optimal results.
|
128 |
+
3. Augmented data is saved in `block_data_*.npy` files.
|
129 |
+
|
130 |
+
---
|
131 |
+
|
132 |
+
## Roadmap
|
133 |
+
1. Support more building types and sizes.
|
134 |
+
2. Optimize generation speed and model accuracy.
|
135 |
+
3. Develop a real-time preview interface.
|
136 |
+
|
137 |
+
---
|
138 |
+
|
139 |
+
## Contact
|
140 |
+
For questions or feedback:
|
141 |
+
โข **Email**: [email protected]
|
142 |
+
โข **GitHub**: [https://github.com/fallingstars123/MC-AI-BuildingGenerate](https://github.com/fallingstars123/MC-AI-BuildingGenerate)
|
143 |
+
โข **Discord**: thomasw2004
|
144 |
+
|
145 |
+
---
|