The zen game engine started as port of the Zenlib in Rust, but has since then matured into a own game engine with the capability to load different Fileformats used in the original Gothic Games, respectively the Zengine.
- At the moment you can open VDFS-Archives, and export Multiresolution-Meshes (.mrm) aswell as normal Zengin-Meshes (.msh) from the archives to gltf files.
- The corresponding textures will also be exported (similiar to dds textures), or you can export those textures one by one aswell.
- I am working on the export of Zengin World Scenes (.zen) to gltf and a Daedalus (scripting language) virtual machine to execute the bytecode.
- Expect breaking changes
use std::{fs::File, io::Write};
use zen_archive::Vdfs;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let vdf_file = File::open("/home/user/../Gothic II/Data/Sounds.vdf")?;
let vdf = Vdfs::new(vdf_file)?;
let entry = vdf.get_by_name_slice("CHAPTER_01.WAV").unwrap();
let mut audio_file = File::create("/home/user/../files/audio/chapter_01.wav")?;
audio_file.write(&entry.data)?;
Ok(())
}
use std::fs::File;
use zen_daedalus::prelude::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let file =
File::open("/home/user/../Gothic II/_work/Data/Scripts/_compiled/CAMERA.DAT")?;
let code = Code::new(file)?;
let mut machine = Machine::new(code);
machine.run();
Ok(())
}
use std::{convert::TryFrom, fs::File, io::Cursor};
use zen_archive::Vdfs;
use zen_mesh::{gltf, mrm::MrmMesh, GeneralMesh};
use zen_types::path::INSTANCE;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let vdf_file = File::open(INSTANCE.meshes())?;
let vdf = Vdfs::new(vdf_file)?;
let mesh_entry = vdf
.get_by_name("ORC_MASTERTHRONE.MRM")
.expect("Should be there!");
let cursor = Cursor::new(mesh_entry.data);
let mesh = MrmMesh::new(cursor, "ORC_MASTERTHRONE")?;
let mesh = GeneralMesh::try_from(mesh)?;
let _gltf = gltf::to_gltf(mesh, gltf::Output::Binary);
Ok(())
}
use std::{convert::TryFrom, fs::File, io::Cursor};
use zen_archive::Vdfs;
use zen_mesh::{gltf, msh::MshMesh, GeneralMesh};
use zen_types::path::INSTANCE;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let vdf_file = File::open(INSTANCE.meshes())?;
let vdf = Vdfs::new(vdf_file)?;
vdf.filter_list("MSH");
let mesh_entry = vdf.get_by_name("MFX_FEAR4.MSH").expect("Should be there!");
let cursor = Cursor::new(mesh_entry.data);
let mesh = MshMesh::new(cursor, &mesh_entry.name)?;
let mesh = GeneralMesh::try_from(mesh)?;
let _gltf = gltf::to_gltf(mesh, gltf::Output::Binary);
Ok(())
}
- MIT