I have been working on multiple TAW upgrade projects, however, there are two which are considered major projects. I will discuss one of them, the Surface Texture Solution Project, here.
This project started out as a simple desire to solve one of the problems of TAW, visual target acquisition and to upgrade the graphics, at least temporarily until we can get some more permanent model upgrades.
In an effort to define the problem some of you were having with the difficult target acquisitions issue, I identified one major obstacle to obtaining improved targets was the muted default textures which are often difficult to see, especially against the background of the bright new terrain colors in 2.0.
In order to accommodate for that problem I attempted to modify the code in the .3D object files but was frustrated by the inflexibility of the coding. Therefore I discovered a method to exploit the channels used for texture mapping.
In general, the .3 file determines the texture or the color of the specific object as Mikew previously explained:
Finally, we have lines 0019 to 0033 which describe the polygons.
Lines 0019 & 0020 should be treated as a pair:
0047001D00030000008900B70089000E007B
002F0003000500020006
This can be broken down as follows:
0047 This is the opcode for a textured polygon
001D Index number of texture from the file 'redXXXX.ini' in the 3 folder (cam3_7)
0003 Three sided figure, ie triangle
0000 0089 Texture coordinate of vertex 5 (taken from 002F line)
00B7 0089 Texture coordinate of vertex 2
000E 007B Texture coordinate of vertex 6
The texture coordinates are referenced to the top left corner of the texture, with an X coordinate between 0-255dec, and a Y coordinate in the range 0-191dec.
Lines 0021 to 0026 describe 3 more textured polygons.
Then comes 3 shaded polygons in lines 0027 to 0032. The following must be trated as a pair:
004CBABAC000
0080000500060004
The '004C' opcode is for shaded triangle, and taken together with the following '0080' line, can be interpreted thus:
Vertex 0005 uses palette colour BA
Vertex 0006 uses palette colour BA
Vertex 0004 uses palette colour C0
In this case,vertices 0005 and 0006 will be the same colour and there should be a smooth gradient across the triangle to the colour at vertex 0004.
The following lines can be treated similarly, noting that the 004E/0081 opcode combination relates to 4 sided polygons.
In TAW Texture mapping of building textures is switched on or off in Game.cfg using the key “BUILD_TEXTURE =1” or 0. If the textures are off (0), then the indexed texture is not used, in this case, the program uses the color determinants for the vertex indices which are given after the palette index in that string. If the texture is off in options the executable will only use the colors coded. Until now, these were the only options a player was priviledged to use. Now that has changed and a great many new options are going to be made available as I have determined that, if the Textures are ON the executable calls the time appropriate Redxxxx,ini file [surface] section which is where I found a way to intercept and manipulate the process for graphically improved targets. The [surface] section will accommodate, and defaults to, texture mapping. It will now also however accommodate a total of four types of surface treatments:
1.) Textures: txtr
2.) Colors: colr
3.) Flat Shading: flat
4.) Gourard Shading: gour
I have developed a number of full Templates to facilitate the efficient import of texture shader transitions into the redxxxx.ini files. Below I have given the first few lines of several of my basic Templates.
Examples:
TAW DEFAULT TEMPLATE[surface]
0=txtr 4,(0,0),(31,0),(31,31),(0,31);N CONCRETE
1=txtr 4,(32,0),(63,0),(63,31),(32,31) ;NE CONCRETE
2=txtr 4,(64,0),(95,0),(95,31),(64,31) ;E CONCRETE
GOURAUD SHADER TEMPLATE[surface]
0=gour ;N CONCRETE
1=gour ;NE CONCRETE
2=gour ;E CONCRETE
COLOR TEMPLATE[surface]
0=colr ;N CONCRETE
1=colr ;NE CONCRETE
2=colr ;E CONCRETE
FLAT SHADER TEMPLATE[surface]
0=flat ;N CONCRETE
1=flat ;NE CONCRETE
2=flat;E CONCRETE
The colors and shades of the individual polygon (tris and quads) vertices can be individually and specifically implemented and controlled by describing the desired index value.
Example:
[surface]
0=flat 6,7,8,9 ;N CONCRETE
ie. Flat shading of polygons progressing from the palettes Dark red (index=6) to Bright light red (index=9).
Assigning vertex shading values can control the Lighting conditions within the graphics environment using the directional assignment keys (;N, NE:, etc). This is a marvelous way to simulate time of day conditions, sun, moon effects. (It must be kept in mind, however that 3D object rotational variations must be considered for proper lighting effects outcomes). Flat shading, while one of the earlier shading techniques, works well and can be advantageous for TAW because of its significant improvement when used in the modeling of boxy objects.
Example:
[surface]
0=flat 0,0,0,6 ;N CONCRETE
1=flat 0,0,0,6 ;NE CONCRETE
2=flat 0,0,0,7 ;E CONCRETE
3=flat 0,0,0,7 ;SE CONCRETE
4=flat 0,0,0,8 ;S CONCRETE
5=flat 0,0,0,8 ;SW CONCRETE
6=flat 0,0,0,9 ;W CONCRETE
7=flat 0,0,0,9 ;NW CONCRETE
8=flat 0,0,0,0 ;BOT CONCRETE
9=flat 0,0,0,0 ;TOP CONCRETE
The Gouraud Shader is the smoothest and most advanced of the shaders in this application. The volatility of the color transitions was initially difficult for me to control. Mostly as a result of the shaders color interpolations of the 3D models specular highlights. Because TAW surface objects have large polygons with low counts, Gouraud interpolates the specular highlights at the vertices and then produces the progression of the highlight across neighboring polygons with a “fade-in”, “fade-out” pattern that, with any rotation of the object or the viewers perspective, gives off an intense color barrage. I have been able to better control that volatile interpolation pattern but still working on a best solution.
Digital Image Design continues to impress (especially that Steve Hunt guy), with each discovery, the talent, skill and dedication they placed in this simulation. For reasons of their choosing, DID determined to use textures exclusively for their surface object solution. It was, apparently, the simplest practical solution to implement in 1997, given the state of PC power and graphics at the time.
It is important to note that truly good power resides within the TAW palette, as the colors have true functional affective capacity and can dictate events in the game experience. A part of the ongoing challenge is to discover the functional impact of all given colors, textures and shaders.
It would seem logical that a significant enhancement to TAW can now be had by implementing a hybrid solution upgrade. That is, using a combination of textures, colors and shaders.
I now submit to you the Power of the Palette…(textures colors and shaders included)
Any Questions?
