[Gtkradiant] Support for other games
Forest `LordHavoc` Hale
lordhavoc at ghdigital.com
Fri Jul 6 14:49:22 CDT 2007
You can adapt the Q1Pack for your needs then, it reads/writes that format, I also made it support textures outside of wad files though I'm not sure how well that works now (as I wasn't really involved
in GTKRadiant 1.4 or 1.5 Q1Pack development, I developed it in 1.3).
You might want to poke at the BSP Quake Editor http://www.bspquakeeditor.com/ also, since it deals in q1 formats like WorldCraft does.
If you don't care about most of the Q3 map features such as quadratic bspline patches (a grid of 3x3 control point groups, similar to a bspline patch except with alternately hard/soft rows/columns),
brushprimitives texturing (allows texture lock to work on rotation and scaling), and the detail flag, it's just a matter of parsing two extra values after the s/t scale values, and the fact the
textures are all full gamedir-relative paths rather than pathless filenames.
You can also take a look at my parser in hmap2 which reads q1/hl/q2/q3/doom3 .map formats (although it skips the quadratic bspline patches), it even handles mixed formats for what it's worth.
http://svn.icculus.org/twilight/trunk/hmap2/map.c?view=markup - look at ParseBrushFace
As for the .game directory, I don't think there is any official documentation on this, and I can't really blame anyone for this fact as everyone involved is perpetually too busy.
From my own tinkering I've gathered that you need these files in the GTKRadiant installation directory...
games/yourgame.game - defines various filesystem information, such as the name of the default data path (in this example I'll use data)
Things that define menus:
yourgame.game/game.xlink - this contains URLs to documentation on level editing for your game
yourgame.game/default_build_menu.xml - this contains the commandlines for invoking your map compiler as shown in the menu, it can invoke multiple commands (by having multiple command tags inside the
Things that go in your data/ directory (whether in GTKRadiant's installation or your installed game, I'll illustrate with GTKRadiant's installation here):
yourgame.game/data/default_shaderlist.txt - if your game is 'quake3-like' (as defined in the games/yourgame.game file) in terms of having shader support you probably need this, it contains base names
of .shader files that should be loaded (the scripts/ prefix and .shader suffix are added by GTKRadiant).
And last but not least, your choice of QUAKED format (specially formatted comments) or XML entity definitions:
yourgame.game/data/entities.ent - this in XML format (unfortunately with no DTD for validation), the format is self explanatory, just read a bit.
yourgame.game/data/entities.def - this is in QUAKED format (as used by almost all quake editors), since the format is not completely intuitive I'll explain the basic format for box and brush enttiies
brush entity: /*QUAKED entityname (R G B) ? [FLAG1 [FLAG2 [FLAG3 [...]]]]
box entity: /*QUAKED entityname (R G B) (MINX MINY MINZ) (MAXX MAXY MAXZ) [FLAG1 [FLAG2 [FLAG3 [...]]]]
If you have any interest in using other editors you'll probably want to stick to the entities.def format (more commonly called entities.qc in other editors), as almost all of them (excluding
WorldCraft) use that format.
As an aside, a fun feature of the entities.def format is that many editors can read a directory of source files (in .c, .cpp, .qc, or any other similar format) and extract /*QUAKED comments from them,
I was very upset when this feature was removed from GTKRadiant as it makes maintenance of entity information in a changing codebase much more difficult.
(Granted it requires the gamecode source to be installed as well, but as that is commonly part of a modding SDK that isn't a problem)
Sebarnolds [Seb / Frip] wrote:
> Thank you both of you, it seems that I missed the game directory, I'll have
> a look at it next week (not time this week-end). Do you know if there is any
> documentation / tutorial about all the files and their parameters (in the
> *.game directory) ? I suppose I could learn by sample then, there are enough
> game configurations...
> About the compiler, in fact, I already have a compiler for the .map files
> produced by Worldcraft (quite old). I noticed differences in the .map format
> of the two applications, but they shouldn't be too difficult to spot.
> Anyway, if anybody has information / links about these differences, they are
> more than welcome to share them.
Author of DarkPlaces Quake1 engine and mod
"War does not prove who is right, it proves who is left." - Unknown
"Any sufficiently advanced technology is indistinguishable from a rigged demo." - James Klass
More information about the Gtkradiant