This project provides utilities to parse and generate Universal Doom Map Format (UDMF) maps. UDMF is a human-readable representation of map data, widely recognized in modern DOOM mapping. The parsing of UDMF file is done using PLY parser, build according to the official UDMF specification. The binding of parsed data to Python classes is done for specification-standardised fields and ZDoom extensions.
-
Parsing UDMF Maps: Quickly turn UDMF-formatted text into a structured representation using the
parse_udmf
function. -
Writing UDMF Maps: Convert structured map data back into the UDMF text format for use in map editors or game engines.
-
Customizable bindings: The parser and writer are built in a way that lets you easily adapt or extend them for specific needs.
from udmf_parser import parse_udmf
parsed_data = parse_udmf("TEXTMAP.lmp")
print(parsed_data)
from udmf_writer import write_udmf_map
write_udmf_map(parsed_data, "path_to_output_file.txt")
The core functionality is built using classes and mixins, allowing for easy customization or extension. For instance, the UDMFMixin class provides a convenient way to convert any object to its UDMF string representation. Check out classes like UDMFLinedef, UDMFSidedef, etc., to see how this can be applied to specific DOOM map structures.
Extensive unit tests are provided to ensure the correct behavior of both the parser and the writer. To run the test
python -m unittest discover -s tests
0BSD