-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBMPTools.html
More file actions
177 lines (169 loc) · 10.3 KB
/
Copy pathBMPTools.html
File metadata and controls
177 lines (169 loc) · 10.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>TileZed - BMP Tools</title></head><body>
<h1>TileZed's BMP Tools</h1>
Every map has 2 images the same size as the map with one pixel per tile position.<br>
The pixel colors of the images are used to automatically generate tiles according to a set of rules.<br>
A map starts without any rules; the rules must be imported from 2 text files and are saved in the map's .tmx file.<br>
The text files are the same as those used by WorldEd's BMPToTMX command, Rules.txt and Blends.txt.<br>
<p><strong>Do not confuse this Rules.txt with the Automapper manifest.</strong>
The BMP Tool's <strong>Import Rules</strong> and <strong>Reload</strong> actions
load terrain, vegetation, alias, rule, and tile blocks into the map. Automapper
instead loads a short <code>automapping-rules.txt</code> list of rule-map TMX
files. They are separate systems even though older projects may use the
ambiguous filename <code>rules.txt</code> for an Automapper manifest.</p>
<p>Once BMP Rules are loaded, changes on a target layer can require nearby
terrain and blend tiles to be regenerated. PZTools restricts that work to the
actual changed regions plus the two-tile blend border. Disconnected parts of a
fast stroke remain separate instead of becoming one large rectangular update.
Resolved tiles and blend candidates are indexed, while the temporary ground
eraser performs only its local calculation. A remaining
recalculation of 250 ms or more is written to the TileZed log with the requested,
dirty, and processed bounds. Exact rule-tile references take priority over
similarly named custom or test sheets, so a sheet name ending in a non-numeric
suffix cannot replace one of a rule's numbered tiles.</p>
<h2>Setting up your map for the BMP tools</h2>
<ol>
<li>Click on one of the BMP tools. This will display the floating Bmp Tool Window.</li>
<li>Notice the Rules page is empty. You need to add some rules!</li>
<li>In
the Options page, click each of the Import buttons to load Rules.txt
and Blends.txt. Those files are in WorldEd's directory but you
may load them from some other location.</li>
<li>You should now see a list of rules in the Rules page.</li>
<li>Make sure your map has all the layers needed by Rules.txt and
Blends.txt. By default, this means your map must have 0_Floor,
0_FloorOverlay/2/3/4 and 0_Vegetation.</li>
<li>Your map also needs all the tilesets used by Rules.txt and Blends.txt.<br>
</li>
</ol>
<h2>Interaction with existing map tiles</h2>
The pixels in a map's BMP images are used to generate tiles
on-the-fly. These tiles are displayed in the layers determined by the
map's rules and blends. These automatically-generated tiles will
<span style="font-style: italic;">override</span> the map's own tiles. So if a rule specifies that a tile
should be placed in the 0_Floor layer, that tile will replace any tile
in the 0_Floor layer that was drawn by the user.<br>
<br>
The whole point of the BMP tools is to allow you to "touch up" an
existing map by drawing paths, roads, patches of grass, etc
without having to place all the blended tiles around the edges yourself
(which is time-consuming). In order for this blending to work
correctly in areas adjacent to the areas painted by the tools (i.e.,
where only black pixels exist next to painted pixels), the blending
code will look at the existing map tile in the 0_Floor layer and see if
it matches one of a rules' tiles. If the map tile does match one
of a rules' tiles, the black pixel is replaced by the rule's
color. This allows blending of painted areas with adjacent
non-painted areas, and allows trees/grass to be painted (when a rule
has a "condition" color specified) onto parts of the map where you
didn't paint any ground pixels.<br>
<h2>How random tile choices work</h2>
Some rules have multiple choices for which tile is placed. The
tile that is used at each map location is randomly chosen from the
rule's list of tiles. In order to keep the same tile choices
between editing sessions, a random number is assigned to each tile
location when the map is loaded. This is done by setting a fixed
"seed" for the random number generator. As long as the map's size
doesn't change, the same random number will be used at each tile
location every time the map is loaded. If a map is resized, a
whole new set of random numbers will be generated for the map,
resulting in different tiles being displayed!<br>
<h2>The BMP Tool Window</h2>
The Rules page shows a list of all the rules you may paint with.<br>
<ul>
<li>"index" determines which of the two BMPs the rule will affect.
The index is either 0 or 1. Rules with index=0 typically put
tiles into 0_Floor. Rules with index=1 typically put tiles into
0_Vegetation.<br>
</li>
<li>"color" is the red-green-blue color of the pixel that is painted in a BMP.</li>
<li>"condition"
is another red-green-blue color that is only used by rules with
index=1. When "condition" is not "0,0,0", the rule will only
generate tiles if the pixel in the index=0 BMP image has the same color
as the "condition" color.</li>
<li>Each rule has one or more tiles displayed. When a BMP image has a
pixel with the same color as the rule, one of the rule's tiles will be
<span style="font-style: italic;">randomly chosen</span> and placed in the map.</li>
<li>Some rules might have a "none" tile. This just means that no tile will be placed sometimes when randomly choosing a tile.<br>
</li>
</ul>
Selecting one of a rule's tiles determines which pixel color and which
BMP image is affected by the BMP tools. This means that painting,
erasing and selecting only affects one BMP image at a time. It
doesn't matter which tile is selected if a rule has more than one tile;
the tiles of a rule all use the same pixel color and which tile is
actually placed in the map is always randomly determined.<br>
Removing a tileset from the Tilesets window is undoable. TileZed
stops MiniMap rendering before the removal and rebuilds the automatic Rules
and Blends layers afterward. Embedded Rules and Blends metadata is kept,
so its references become active again when the tileset is restored.<br>
<h2>The BMP Tools</h2>
Use the BMP tools to draw and erase pixels in a map's BMP images.
The selected rule determines which BMP image is the current one
affected by the tools. Usually the tools only affect the pixels in one BMP image at a time.<br>
<h3>Brush Tool<br>
</h3>
The Brush Tool paints pixels using a brush. The size and shape of
the brush may be changed in the Options page of the BMP Tool
Window. Left-click-drag to paint. Hold down the CTRL key to
erase pixels instead of painting.<br>
<h3>Rectangle Tool</h3>
The Rectangle Tool draws a filled rectangle. Left-click-drag to
trace out a rectangle, then release the left mouse button to paint the
pixels. Hold down the Shift key to draw a square. Right-click
while drawing to cancel.<br>
<h3>Bucket Fill Tool</h3>
The Bucket Fill Tool performs a flood-fill. It looks at the pixel
under the cursor, then replaces that pixel and any pixels of the same
color that touch it with the current rule's color. Moving the
mouse pointer around highlights the area that will be affected.
Left-click to paint.<br>
<h3>Rectangle Select Tool</h3>
The Rectangle Select Tool selects a rectangular area of tiles.
Left-click-drag to trace out a rectangle, then release the left mouse
button to change the selection. Right-click while tracing out a
rectangle to cancel. Hold down Ctrl to subtract from the current
selection. Hold down Shift to add to the current selection.
Hold down both Ctrl and Shift to intersect the current selection.<br>
<br>
Left-click outside the current selection to clear the selection.<br>
<br>
You can move and duplicate selected pixels using this tool.
Left-click-drag in the selected area to move the selection, then
release the left mouse button to move the pixels, erasing the original
pixels. Hold down the Ctrl key when <span style="font-style: italic;">releasing</span> the left mouse button to duplicate the selected pixels. Hold down the Shift key when <span style="font-style: italic;">releasing</span> the left mouse button to move/duplicate the pixels in both BMP images, not just the current one.<br>
<h3>Fuzzy Select Tool</h3>
The Fuzzy Select Tool changes the selection using a flood-fill (similar
to the Bucket Fill Tool). Otherwise this tool behaves the same as
the Rectangle Select Tool.<br>
<h3>Eraser Tool</h3>
The Eraser Tool erases pixels using a brush. The size and shape
of the brush may be changed in the Options page of the BMP Tool
Window. Left-click-drag to erase pixels in the current BMP
image. Note that erasing actually means painting black pixels.<br>
<br>
You can also erase all the pixels in the selected area using Edit >
Delete (the Delete key). This only works when one of the BMP
tools is active.<br>
<h3>Prevent Blending Tool</h3>
The Prevent Blending Tool stops automatically-generated blend tiles
being placed. Left-click-drag to trace out a rectangle, then
release the mouse button to toggle the prevent/don't-prevent setting at
each location within the rectangle. This tool can only be used in
the blend layers defined in Blends.txt (0_FloorOverlay,
0_FloorOverlay2, etc).<br>
<br>
Holding down the Shift key when drawing with this tool causes the changes to be made to <span style="font-style: italic;">every known blend layer</span> in the map, not just the current layer.<br>
<br>
When this tool is active and a known blend layer is current, a special
tile is drawn to indicate the locations in that layer where blending is
prevented.<br>
<h3>BMP To Layers Tool</h3>
The BMP To Layers Tool puts the automatically-generated tiles into the
map's tile layers and erases the BMP images. Use this tool if you
aren't happy with some of the automatically-generated tiles in an area
of the map and want to edit them with the regular tile-editing tools.<br>
Normally you won't see any visible changes to the map's appearance after using this tool (but sometimes you will).<br>
</body></html>