Game Development Reference
In-Depth Information
response curves, when we change the size of one bucket, we also affect the edge
values of all the buckets after the changed one. It is a requirement that we rebuild
the edge values in the vector any time the data changes so the change is reflected in
all the edge values. For example, let's look again at the data from the above uneven
distribution:
i
Size
Edge
Result
0
12
12
100
1
11
23
101
2
10
33
102
3
9
42
103
4
8
50
104
5
7
57
105
6
6
63
106
7
5
68
107
8
4
72
108
9
3
75
109
If we arbitrarily decide to change the weight (“size�) of the result “104� from 8
to 10, we need to make a number of changes. Obviously, the first change is that the
bucket at index 4 would now have an edge of 52 rather than 50. (It now stretches
from 43 to 52.) However, looking now at the bucket at index 5, when we add its size
of 7 to the new edge of 4, we arrive at 59 rather than 57. This process cascades down
to the last bucket, whose edge we increase by 2 to a value of 77. The contents of the
new vector are (changes from above are emphasized in bold):
i
Size
Edge
Result
0
12
12
100
1
11
23
101
2
10
33
102
3
9
42
103
4
10
52
104
5
7
59
105
6
6
65
106
7
5
70
107
8
4
74
108
9
3
77
109
Search WWH ::




Custom Search