Is this helpful?
- Yes
- No
0 voters
Greetings.
I am requesting for a developer to consider the following option for a simple 3D Line of Fire code. The essence of the idea, is that, while even Vassal is 2D in nature, a simple tool can be acheived to use a 3D representation. Albeit the variation of this 3D is different from game to game, I have a proposed programming solution:
The algorythm idea is as follows. It is incomplete, but I lack knowledge of the specific language to produce a finer version.
Let A1 be the Altitude of Model 1, and H1 its height. Default value is 0. Model 1 is Marker 1.
Developers of modules would have to manually insert Heights as a model stat, and Altitude is a game mechanic, chosen from the drop down menu after selecting a Marker. Default is 0 for both Height and Altitudes, unless Developers or Players choose otherwise. If a prone Option exists, is changes the value to the rule-set defined value (Developer’s responsibility).
Let A2 be the Altitude of Model 2, and H2 its height. Default value is 0. Model 2 is Marker 2.
Run the following:
H = (H1 + A1) - (H2 + A2) ; (Measures relative height from Marker 1’s Height and Marker 2’s Height, with relative Altitudes.)
Let D be the 2D horizontal distance from Center to Center of both Markers. (or developer defined as Center to Center, Edge to edge, etc).
Let R be the Real 3D Distance between two modes.
R = (H^2 + D^2)^(1/2)
Let T be the value of:
T = arctan(X/D)
This gives a real distance between Marker 1 and Marker 2, based on their 2D Distance, their Heights and their Elevation values.
Now, for the part I have no idea about.
Between [0, D] map points where Y(i) is a Integer. Place the value of Y(i) near the point, marking the point in some discernible fashion. These points, called here by Y(i), are defined on the Horizontal scale, thus:
X(i) = Y(i) * cotan(T)
Where X(i) belongs to [0, D], and Y(i) is an Integer. Halt when X(i) isn’t contained in [0, D].
This would produce a line, with vertical distances signalled along the course of the line, and is obstacles were present, with a defined Height, it would be simpelto see wether the Line of Fire was blocked or not by the obstacle, as its value would always have to be inside, or outside, of a Line of Fire vertical interval. Say you had an obstace between a portion of the ine that was between 3 inches and 2 inch tall, and your obstacle was 3 inches tall. Since both values are smaller or equal to the obstacle’s height, the LOF would be blocked.
Would it be complicated to implement such a code in a future version of Vassal?