Author Topic: Creating a Square Tile (airfield etc) for AH3  (Read 689 times)

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10881
Creating a Square Tile (airfield etc) for AH3
« on: May 20, 2019, 09:26:57 PM »
This will be useful to the CM team, AvA staff and custom arena terrain builders. Custom shapes are not allowed in MA terrains unless approved by HTC.

This is a description of the files needed to create a square tile, and where to find the output files, and where to land them. The user is expected to become familiar with the Object Editor and have the ability to add, move and rotate the objects desired for the square tile.

Included is the formats and sizes of textures, and the addition of trees and ground clutter, and how these relate. The name used here for the ground is ‘name1x1m’ and the name of the object is ‘name0’ to distinguish the two.
Brackets, [ ], indicate variables to be filled in, such as [myTerr], terrset[00], [name], etc.
Acknowledged is the fact that square tiles do not have room for all the textures used in skinning vehicles, but some of that knowledge is useful. This text uses the simplified texture extensions instead of the old RGB channel designations.

A square tile needs the following for the ground:

1. [name1x1m].ac   ac3d format   creates the shape file
2. [name1x1m].bmp   indexed256   the visible diffuse texture*
3. [name1x1m]_A.bmp   grayscale   ‘blends’ the visible texture into the terrain
4. [name1x1m]_D.bmp   grayscale   Detail, roads etc
5. [name1x1m]_S.bmp   grayscale   Sun reflection
6. [name1x1m]_n.bmp   32bit   normal map

*Currently, all these textures must be 512x512 pixels for each 1x1 square mile in a tile. A 4x4 mile city is 4 x 512 pixels square, or 2048 x 2048 pixels. This resolution is not a variable. Btw, this is very close to the same resolution of the 1016 atlas1 terrain tiles.

When the .ac file is 'Converted', it produces the following files in the userlib folder*:
1. [name1x1m].shp
2. [name1x1m].htx
3. [name1x1m]_NEP.htx

When the .til file is 'Built', it adds the following into the newshps folder:
4. [name1x1m]_CL.htx**
5. [name1x1m]_EV.htx
6. [name0].shp
7. [name0].swa – the Tree file - more on this below, click the link.

A copy of each of these files must then move into the terrain’s texsrc folder to be available in that terrain when loaded by the Terrain Editor. Be sure to leave the originals in the userlib folder or they won’t be available in the OE.

* When the 'tile' is built, items 4 and 5 are also created/updated in the userlib folder.
** If these files are not built or updated, there is a problems with the textures. Bitmap format is usually the problem, or improper texture size.
« Last Edit: May 20, 2019, 09:48:39 PM by Easyscor »
Easy in-game again.
Since Tour 19 - 2001

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10881
Re: Creating a Square Tile (airfield etc) for AH3
« Reply #1 on: May 20, 2019, 09:27:49 PM »
Object Editor Exported Textures

Like the AH Skin viewer, the OE exports many textures that are not particularly useful as a teaching aid to the builder in their exported form. The _EV and _CL can be ignored and there is no output for a detail map.

The OE regurgitates the htx textures created for use in-game, not the source textures. Attempts to modify and re-import these textures will likely result in frustration as some are modified for use by several "channels" at once, including "collisions".

Although of limited value, they are interesting, non the less. The .ac files can be the source for beginning a new square tile.
Easy in-game again.
Since Tour 19 - 2001

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10881
Re: Creating a Square Tile (airfield etc) for AH3
« Reply #2 on: May 20, 2019, 09:28:20 PM »
Square Tile ac3d Shape

AC3D is beyond the scope here except to note that radical changes in the color and reflective properties of the diffuse texture can be achieved by including material (mat #) designations in the polys.

No instructions on how to accomplish this will be answered in this thread.

Never use double sided polys in any AH shape.
Easy in-game again.
Since Tour 19 - 2001

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10881
Re: Creating a Square Tile (airfield etc) for AH3
« Reply #3 on: May 20, 2019, 09:29:07 PM »
Square Tile Diffuse
[name1x1m].bmp - indexed256

A diffuse texture is probably the usual starting point simply because it needs to be included in the ac3d shape source file. Each pixel represents a square on the ‘ground’ that measures 10.31 feet, or 3.14 meters on a side. This translates to 512 pixels per mile and square tiles come in 512x512 pixels for a 1x1 mile, 1024x1024 for 2x2 mile, and 2048x2048 pixels for 4x4 mile sizes.

This is the only pixel scale available as of this posting.

After the initial diffuse texture is created, it will be necessary to undergo several changes before the final version is satisfactory.

Every square tile’s diffuse texture must be a 256 indexed color bitmap. It is still best to attempt to color coordinate the diffuse texture with the expected terrain tile textures nearby to reduce the chance of color clashing. Sometimes, the difference can be quiet jarring even with a good alpha.

Trees disappear at a noticeable maximum visual range, and to a lesser extent, the larger buildings as well. The Object Editor provides the Create Ortho Image button as a method to export an image of the trees, and another of the buildings placed in a square tile.

The ortho image of the trees, if not the smaller buildings also, should be incorporated in the square tile diffuse texture to mitigate the disappearance of the trees at range.
Easy in-game again.
Since Tour 19 - 2001

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10881
Re: Creating a Square Tile (airfield etc) for AH3
« Reply #4 on: May 20, 2019, 09:29:50 PM »
Square Tile _Alpha
[name1x1m]_A.bmp - grayscale - values 0 to 255

The _Alpha texture masks the diffuse texture to allow the underlying terrain texture to show through. Understand that this has no effect upon trees or clutter. This is a grayscale texture with white for the square tile’s diffuse and black for the terrain texture’s image. Values between black and white blend the two accordingly.

A quick method of shading the edges of the alpha is to down scale the image and then upscale it back to the original size causing most programs to apply antialiasing to the hard edges. It will still need hand work for blending.

Easy in-game again.
Since Tour 19 - 2001

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10881
Re: Creating a Square Tile (airfield etc) for AH3
« Reply #5 on: May 20, 2019, 09:31:49 PM »
Square Tile _Detail
[name1x1m]_D.bmp - grayscale - values 0x00 to 0xF0 in increments of 16 (0x10)

objdet    _D

0  00 asphalt01.bmp
2  10 asphalt03.bmp
3  20 concrete01.bmp
4  30 concrete02.bmp
5  40 3secconcrete.bmp
6  50 4secconcrete.bmp
7  60 grass1obj.bmp
8  70 dirt02.bmp
9  80 gravel01.bmp
10 90 rocks.bmp
11 A0 grassrock2.bmp
12 B0 brick05.bmp
13 C0 brick02.bmp
14 D0 dirtroad.bmp
15 E0 concrete04.bmp
16 F0 dirtroad.bmp

This is a grayscale bitmap that determines the visible, fine detail shapes of the ground’s surface. The values are separated on gray increments of 16 to facilitate enough difference for the human eye to perceive.

GIMP has a textbox in the color dialog window that allows direct input of hexadecimal codes such as ffffff, or a0a0a0, etc. These values represent 24 bit RGB values respectively. The assumption is that Photoshop has a similar functionality.

In ways similar to the visible boundary anomalies between disparate terrain types used in the Terrain Editor, the detail types suffer the same issues of showing intermediate detail types between.
Going from brick, 0xb0, to grass1, 0x60, transitions through four intermediate types leaving a hint of each one. There is no work-around in a close quarter urban environment, however, for suburban and rural settings, the alpha can be used to hide the boundary with the underlying terrain texture.

For sharp divisions, the game expects the ac3d shape to include such things as sidewalk shapes to be included with dedicated polys as evident in the airfield town shape.

The detail map accomplishes two tasks. It displays the square tile’s ground type, and it removes terrain tile clutter such as tree stumps and boulders.
Incidentally, objects like buildings placed into the sq. tile with the OE accomplish the same thing for those locations.

Modifying the objdet atlas should have consequences for the default square tile objects such as airfields in the game. As yet, haven’t tried that.

Easy in-game again.
Since Tour 19 - 2001

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10881
Re: Creating a Square Tile (airfield etc) for AH3
« Reply #6 on: May 20, 2019, 09:32:56 PM »
Square Tile _Sun Reflection
[name1x1m]_S.bmp - grayscale - Sun reflection

Skinners will be familiar with this one.
Neutral solar reflection is grayscale 129 decimal or 0x81 hex.
Lighter gray is more reflection, brighter. And darker gray is less reflection.

A completely black texture will kill all reflection from the suns position. On the other extreme, a water body would be highly reflective and uses white.

Easy in-game again.
Since Tour 19 - 2001

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10881
Re: Creating a Square Tile (airfield etc) for AH3
« Reply #7 on: May 20, 2019, 09:33:59 PM »
Square Tile _Normal Map
[name1x1m]_n.bmp - 32bit - normal map

Skinners will be familiar with this one also.

This can have several sources, depending upon the previously created textures. Sometimes, embossing, and bumpmap filters can be applied prior to creating the normal map.

The GIMP normal map plug-in still works in version 2.10.8 on Win10. However, only version 2.8.x supports the additional preview window.
V2.8, 64 bit with the plug-in works on Win8.1. (I have each version running on two different machines.)

Easy in-game again.
Since Tour 19 - 2001

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10881
Re: Creating a Square Tile (airfield etc) for AH3
« Reply #8 on: May 20, 2019, 09:35:13 PM »
Square Tile Tree file
[name0].swa – a text file

The tree file serves two purposes, in addition to placing trees and bushes, a single tree, or bush, will cause the game engine to delete any trees or bushes from poking through from the underlying terrain tile.

Any square tile object is built from the .til text file stored in the “tiles” folder.
C:\Hitech Creations\Aces High III\ah3terr\tiles\[name0].til

This file designates which objects are included in the tile. It does not determine the ‘Tile Set’ to be used, such as ETO Summer. That is apparently done by the existence of the matching tree file.

The Object Editor also places the trees used for the tile, but creates and uses the separate [name0].swa tree file. It can be found here:
C:\Hitech Creations\Aces High III\ah3terr\tiles\spdtree\swa\[name0].swa

Similar to the OE’s output of shape and htx files, the [name0].swa file must be moved into the terrain projects folder. It goes here:
C:\Hitech Creations\Aces High III\ah3terr\[myTerr]\terrset[00]\spdtree\swa [name0].swa

Before the Terrain Editor can find and process the new .swa file, it must have a text file with an .sta file extension. The path and name of this file follows:
C:\Hitech Creations\Aces High III\ah3terr\[myTerr]\terrset[00]\shapesswa.sta

Inside this shapesswa.sta text file is a list of any .swa files for the terrain’s square tile objects. For example, the text file would contain the name, [name0] without any extension, plus a linefeed.

If there are more than one square tile objects they would also be listed in sequence with no visible linefeed between, simply a linefeed after each entry. If an entry is found but no .swa file exists, it is ignored.
[name0]
[name1]
[name2]

If there is a custom terrset, the names of those tiles would NOT need to be included in this list. They are picked up in the terset atlas0 or atlas1.
« Last Edit: May 20, 2019, 09:38:22 PM by Easyscor »
Easy in-game again.
Since Tour 19 - 2001

Offline CptTrips

  • Platinum Member
  • ******
  • Posts: 7826
Re: Creating a Square Tile (airfield etc) for AH3
« Reply #9 on: May 20, 2019, 11:37:40 PM »
Priceless.
:salute
Toxic, psychotic, self-aggrandizing drama queens simply aren't worth me spending my time on.

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10881
Re: Creating a Square Tile (airfield etc) for AH3
« Reply #10 on: May 20, 2019, 11:51:43 PM »
Thanks. Three years ago I had all this figured out but when trying to upgrade my previous work recently, I used the wrong size textures and spent months trying to figure out what went wrong. Now anyone interested can avoid that pitfall.
Easy in-game again.
Since Tour 19 - 2001

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10881
Re: Creating a Square Tile (airfield etc) for AH3
« Reply #11 on: May 21, 2019, 03:44:00 AM »
Addenda:
I did not explain how using a tree or bush to suppress trees from the underlying terrain works.

Each square mile of a square tile has 8 rows and 8 columns of 660 ft. squares that fill with trees from the either the terrain tile OR the square tile. A single tree from the square tile within any of these 660' squares disables the trees from the terrain tile in that square. A single bush will do.
Easy in-game again.
Since Tour 19 - 2001

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10881
Re: Creating a Square Tile (airfield etc) for AH3
« Reply #12 on: May 22, 2019, 12:32:44 AM »
Here are some examples of a finished tile, subject to the usual tendency to add and tweak.
If you've done Tank Night in the AvA, you're familiar with the 2016 version.



« Last Edit: May 22, 2019, 12:34:39 AM by Easyscor »
Easy in-game again.
Since Tour 19 - 2001