所以 Minecraft 使用程序网格,它们如何处理特定的块?他们如何将石块和泥块分开?
我的世界只是一个例子。我现在想知道它在技术上是如何工作的。
所以 Minecraft 使用程序网格,它们如何处理特定的块?他们如何将石块和泥块分开?
我的世界只是一个例子。我现在想知道它在技术上是如何工作的。
如果您谈论的是块模型,例如纹理是如何分层的,Minecraft 使用.json
文件作为最新 Minecraft 版本 1.8 的模型。该文件的示例.json
如下:
{
"ambientocclusion": false,
"textures": {
"particle": "blocks/glass",
"glass": "blocks/glass",
"obsidian": "blocks/obsidian",
"beacon": "blocks/beacon"
},
"elements": [
{ "__comment": "Glass shell",
"from": [ 0, 0, 0 ],
"to": [ 16, 16, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass" },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass" },
"north": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass" },
"south": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass" },
"west": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass" },
"east": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass" }
}
},
{ "__comment": "Obsidian base",
"from": [ 2, 0.1, 2 ],
"to": [ 14, 3, 14 ],
"faces": {
"down": { "uv": [ 2, 2, 14, 14 ], "texture": "#obsidian" },
"up": { "uv": [ 2, 2, 14, 14 ], "texture": "#obsidian" },
"north": { "uv": [ 2, 13, 14, 16 ], "texture": "#obsidian" },
"south": { "uv": [ 2, 13, 14, 16 ], "texture": "#obsidian" },
"west": { "uv": [ 2, 13, 14, 16 ], "texture": "#obsidian" },
"east": { "uv": [ 2, 13, 14, 16 ], "texture": "#obsidian" }
}
},
{ "__comment": "Inner beacon texture",
"from": [ 3, 3, 3 ],
"to": [ 13, 14, 13 ],
"faces": {
"down": { "uv": [ 3, 3, 13, 13 ], "texture": "#beacon" },
"up": { "uv": [ 3, 3, 13, 13 ], "texture": "#beacon" },
"north": { "uv": [ 3, 2, 13, 13 ], "texture": "#beacon" },
"south": { "uv": [ 3, 2, 13, 13 ], "texture": "#beacon" },
"west": { "uv": [ 3, 2, 13, 13 ], "texture": "#beacon" },
"east": { "uv": [ 3, 2, 13, 13 ], "texture": "#beacon" }
}
}
]
}
所有块模型都是在这样的文件中制作的,玩家可以修改这些文件。然后游戏进入并读取它们,从.json
数据中创建模型。有几个 3rd 方程序可以帮助制作这些文件。
如果您有兴趣了解文件是如何读取的,那么Minecraft Coder Pack.json
是另一个用于反编译 Minecraft 的好程序,它是另一个 3rd 方程序。
好吧,如果你想看看 Minecraft 如何区分石块和泥块,例如,他们会这样做:
.json
用于配置方块外观的文件,如下所示:{
"parent": "block/cube_all",
"textures": {
"all": "blocks/dirt"
}
}
Minecraft 还有blockstate
.json
一些文件,用于定义方块的变体,例如树苗的生长状态。