[Gtkradiant] Support for other games

sebarnolds [Seb / Frip] sebarnolds at hotmail.com
Mon Jan 28 16:44:04 CST 2008

Hi again.

I know it's been a while since your answer to my original post. I didn't had a lot of time to investiguate everything but now, I really started working on the .map compiler. However I don't understand Q3 maps texture coordinates.

The Worldcraft map stored textures coordinates as 
"[ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1" which means [U-axis (rotation) U-shift (translation)] [same for V] rotation (useless as already included in the axis) U-scale V-scale
Now, with GtkRadiant configured for Quake3, they are stored as
"0 0 0 0.5 0.5 0 0 0" which means... I don't know.

In fact, I looked at your code (hmap2) and I understood the following : it is no bpface (brush primitie) and no Half-Life texture definition. So, it seems you take two values to be stored in vecs[0][3] and vecs[1][3]... I would say these are U and V-shift (translation). They you take the rotation angle and two inverted scales (as you use scale[0] = 1.0 / scale[0] later on them). Then, you use the "fake proper texture vectors from QuakeEd style" part of the code I guess and you calculate some vectors and I don't really understand what vectors these are. Are they the U-axis and V-axis I had with my Worldcraft map ? What exactly are the different cases "X primary", "Y primary" and "Z primary" ? Are they only there to define which axis the rotation must be done on to ?

Any help ?

Thank you,

> Date: Fri, 6 Jul 2007 12:49:22 -0700
> From: lordhavoc at ghdigital.com
> To: gtkradiant at zerowing.idsoftware.com
> Subject: Re: [Gtkradiant] Support for other games
> 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...
> General metadata:
> 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 
> build tag)
> 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 
> here:
> 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:
> > Hi.
> > 
> > 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.
> > 
> > Sebastien
> -- 
> LordHavoc
> Author of DarkPlaces Quake1 engine and mod
> http://icculus.org/twilight/darkplaces/
> "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
> _______________________________________________
> Gtkradiant mailing list
> Gtkradiant at zerowing.idsoftware.com
> http://zerowing.idsoftware.com/cgi-bin/mailman/listinfo/gtkradiant

Helping your favorite cause is as easy as instant messaging. You IM, we give.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://zerowing.idsoftware.com/pipermail/gtkradiant/attachments/20080128/bd23eef0/attachment.htm 

More information about the Gtkradiant mailing list