Here are my suggestions, regarding to all heatmaps, not only hl1 engine
1. Change of the recieving data
by finding max and min values in kill positions in (x,y), we can thus define the area that is used (read, where people die)
Area has its AreaHeight and AreaWidth

2. This leads us to find the coordinates of the center of that area (cx,cy)
CenterX = Min(X)+(Max(X)-Min(X))/2
CenterY = Min(Y)+(Max(Y)-Min(Y))/2
so that we got now a vector by which we must move the area to have it centered in the OX,OY
vector end point is CenterX, CenterY, so we must negate its values
In the effect we got area centered in OX,OY
3. With that data we can now scale the data, quite simple, cause we know the output area (for example 1280x1024)
scaleFactorX = AreaWidth / OutputWidth
ScaleFactorY = AreaHeight / OutputHeight
ScaleFactor = MAX(scaleFactorX,scaleFactorY) (or max, i don't rember
we can increase ScaleFactor by 0.1 to fit image better (to avoid entering to the edges)

4. Now we can flip the data, usually we are interested in flipping it by Y
5. Now we can rotate the data, usually we just need to rotate by 90 deg, which in fact is just changing x->y and y->x coords
rotation by the bigger angle like 180 is in fact flipping by X and Y

6. Finally, move the output by the default offset vector that is related to the overview resolution (1280/2;1024/2)

Sum up:
We need those functions
move_by_vector(array,coord_x;coord_y,coord_z)
rotate(array,a); where a is int:
0 = no rotation
1 = 90 CW
2 = 180 CW
3 = 270
flip(array,axis)
where axis:
0 = X
1 = Y
z = Z
I believe the whole can be done by the single function with quite many parameters, producing mysql query with the data used to draw directly the heatmap.
We can grab whole 10K records to memory, it may take time and resources to iterate by that amount of data, so running sql query with parameters would be desireable, mysql would calc it for us on the fly.
Red maps - reported issue with the whole maps completely red
Below text is a rough idea, maybe not so birlliant due to the number of data it would output ;D
well, it is by th fact that we use absolute number of kills in the area (AFAIR) which leads to the saturation of the places
thats why the data should be changed to relative, in percentage
but then we would have to change the area to the smaller areas - for example cut the whole area to 100 rows and 100 columns and find the block with the most kills
that would lead us to KillScale = Kills/TotalKills
and then we would apply that scale to every block
in the effect we would get heatmaps with less colour but i think with much less red areas
Such converted data we could store back in sql, just adding kills to the given area block.
So instead of milions of kill records with coordinates we could store just data with the bloks and the number of kills that occured in the block
Add Z axis and we are movind to the 3D and it would be number of kills in small cubicle.
Map would be then split to the 294912000 (yay) cubicles in total - 1280x1280x1280, not every one of them would contain number of kills actually, so they could be removed
of course 1px cubicle resolution would be overkill, i think 4 or even 8px would be enough, so we would end up with:
32768000 4px
or
4096000 8px
cubicles, but not all of them would be used.
Then, this data could be exported as xml and used in for example flash or amxx plugins for showing heatmaps in game!
yes, I'm insane.

Help












