Skip to content

KUBA18i/QMDL-JSON-Tool

Repository files navigation

QMDL-JSON-Tool

Convert Quake family model formats to JSON and vice versa.

Purpose

I made this mainly to better understand the model formats themselves, and by chance also write C++ parsers and loaders for them, so they can be used as a basis for other programs.

As for the practical uses, the user has the ability to directly edit the model without fear of damaging the integrity of file, like with a hex editor. The program is best suited for small edits like skin paths or flags.

The reason why the JSON format script is in Python instead of C++ is because it uses RegEx to accomplish its task, and Python is simply much more efficient at doing so.

Supported formats:

  • Quake 1's MDL files (IDPO ident)
  • Hexen 2: Portal of Praevus's MDL files (RAPO ident)
  • Quake 2's MD2 files (IDP2 ident)
  • Kingpin: Life of Crime's MDX files (IPDX ident)
  • Daikatana's DKM files, both versions (DKMD ident)
  • Quake 3's MD3 files (IDP3 ident)

Usage manual

Drag and drop a model file to create a JSON file, and vice versa. If using the command line, you can just pass the path of the file you want to convert as an argument.

After you have a JSON file, you can use format_json.py to remove the unnecessary spaces and newlines from the file; this decreases the file size significantly. Doing this is optional though.

Compile

If using MSVS, open the SLN. If on Linux, you can use the included shell script. Otherwise:

g++ main.cpp Q1MDL.cpp H2PoPMDL.cpp Q2MD2.cpp KPMDX.cpp DKM.cpp Q3MD3.cpp -o QMDL-JSON-Tool_linux -I.

Copyright

This program was made by Jakub Majewski.
JSON parsing library was made by Niels Lohmann.
Quake was originally made by iD Software; its engine and model format was mostly devised by John Carmack. Most formats here are derivatives of it.
RAPO format is by Raven Software.
MDX format is by Xatrix Entertainment, aka Gray Matter Interactive.
DKM format is by Ion Storm.

References

The information on how to parse the model files was loosely based on the following sources:

Q1 MDL

H2PoP MDL

  • The source code of Hammer of Thyrion, a Hexen 2 source port.

Q2 MD2

KP MDX

DKM

Q3 MD3

About

Convert Quake family model formats to JSON and vice versa.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages