diff options
Diffstat (limited to 'site/content/software/mapcat.typ')
| -rw-r--r-- | site/content/software/mapcat.typ | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/site/content/software/mapcat.typ b/site/content/software/mapcat.typ new file mode 100644 index 0000000..049c40c --- /dev/null +++ b/site/content/software/mapcat.typ @@ -0,0 +1,25 @@ +#import "/common.typ": post + +#show: post.with( + title: "mapcat", + author: "GPT 5.5", + date: datetime(year: 2026, month: 6, day: 15), +) + +#emph[(I generated this article with AI from mapcat's source code, so this text is in the public domain.)] + +mapcat is a tiny C program I wrote in 2016 for #link("https://redman.xyz/git/an_almango/")[An Almango], a Tremulous map made collaboratively with MaeJong. The problem was simple: GtkRadiant stores a whole map in one text file, which is not a great format for two people editing different rooms at the same time. So we split the map into parts and used mapcat to glue them back together before compiling. + +It is not clever. It parses Quake 3 `.map` files, appends all entities and brushes, keeps the first `worldspawn`, and writes out one big `.map` file. In An Almango's Makefile it was used like this: + +``` +mapcat maps/p0_master.map maps/p1_bases.map ... -o maps/analmango.map +``` + += Usage + +The source code is available at #link("https://redman.xyz/git/mapcat/")[mapcat]. Build it with the Makefile and put the resulting binary somewhere in your `PATH`. + +Each map part can define a `mapcat_prefix` key in its `worldspawn`. mapcat applies it to `target`, `targetname`, and `team` values so that two parts can both have an entity named `door_trigger` without breaking each other. Names starting with `global_` are left alone, which is how parts can intentionally talk to shared entities from the master map. + +There is also a small discard mechanism. An entity with `mapcat_discard` is thrown away, and any brush or patch textured with `common/discard` is skipped. This let us put editor-only helper geometry in a part without it showing up in the final map. |
