| Index | Location |
|---|---|
| 0 | (0, 0) (Top Left) |
| 1 | (1, 0) (Top Right) |
| 2 | (1, 1) (Bottom Right) |
| 3 | (0, 1) (Bottom Left) |
0---1---0 | | | | 0 | 1 | | | | 3---2---3 | | | | 2 | 3 | | | | 0---1---0The numbers in the center are the indices of the water tiles in the precomputed block, called the "mode" in the current code. The numbers at the junctions are the indices of the points in water tile 0; the values in tile 0 for these vertices are copied to the other tiles as shown in the diagram. This pattern is tiled over the whole map so that the edges of adjacent water tiles are seamless. The algorithm for deciding which "mode" a water tile has (which of the precomputed tiles it corresponds to above) is as follows:
(tile_index>>watershift)&2 + tile_index&1Where "watershift" is the floor of the base-two logorithm of the map width (e.g. 3 for maps < 16 tiles wide, 4 for maps narrower than 32 tiles, etc.). This algorithm only seems to work if the map width is a power of two and in the range [8, 512], but this is not enforced by the map loader -- therefore maps with other widths will have water that is not seamless. -- ElminI - 23 May 2004
| Topic MapDataNotes . { Edit | Attach | Ref-By | Printable | Diffs | r1.3 | > | r1.2 | > | r1.1 | More } |
|
Revision r1.3 - 27 Apr 2005 - 19:09 GMT - ElminI Parents: WebHome |
Copyright © 1999-2003 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems regarding EgoWiki? Send feedback. |