Garux / netradiant-custom

The open-source, cross-platform level editor for id Tech based games.
https://garux.github.io/NRC/
Other
300 stars 52 forks source link

Call of Duty 1 / United Offensive Game Support #112

Closed stoofphen closed 5 months ago

stoofphen commented 1 year ago

Call of Duty 1 (and the expansion pack United Offensive) have a couple of unique traits that separate it out from the other idTech based games (listed below). While there are mod tools for them, the radiant is a bit dated thus would be a good integration for NetRadiant (more a request than an issue).

In addition to the usual Detail and Structural BSP geometry, there are 'Weapon Clip' and 'Non-colliding' brush types. All four of these have specific face flag values in the brush metadata in the .map file. Sample size (lightmap scale) is also included in the brush face metadata.

A second type of patch mesh (Simple Terrain Mesh), which is specifically used for terrain (and does not subdivide / tessellate as the typical idTech Simple Patch Mesh does), which is defined as patchTerrainDef3. My understanding is that the metadata for this considers per-vertex colour and alpha values, which is then manipulated through the Advanced Patch Editing Tools dialogue in the CoD Radiant. The Advanced Patch Editing Tools are quite useful for Simple Patch Mesh as well, might be worth considering for NetRadiant?

Capture

In addition to the usual shaders being in the scripts/ directory, there is a specific shadertype feature of CoD so that textures can be named shadertype@texturename.extension. For example, grass@grass_01.jpg - this means that this will use the 'grass.stype' shadertype, which is a generic shader that applies to the texture (allows for easy reuse of similar shaders).

Model files are the proprietary 'xmodel' formats (version 5 for CoD 1 I believe). Not sure how complicated it would be to integrate into the model loader.

There are a couple more details around things like items, weapons, aitypes. Can provide these if support for Call of Duty 1 gets serious consideration

ensiform commented 1 year ago

For model loading you may check with assimp if they support it, or ask them to add it. As it is used for model loading now. But q3map2 support is unlikely. You'll still have to use the original map compiler if any serious effort comes here to the editor.

Garux commented 1 year ago

This is a lot of job, so no plan to look into this soon. The more general aspect is game packs and textures. What are their formats in CoD1?

c-d-a commented 1 year ago

Quake 4 has "shader guides" - templates that allow you to reuse generic materials with a substituted texture. Same idea, different syntax. Since Quake 4 is supported by NRC (to some extent), sounds like it would make sense to first implement the guides, and then extend them to CoD specifics.