LOS in tiles/10 (so 50 means 5 tiles)
Moderators: rbodleyscott, Slitherine Core, Gothic Labs
LOS in tiles/10 (so 50 means 5 tiles)
In the Squads file what do these do?
LOS in tiles/10 (so 50 means 5 tiles)
LOS to infantry in cover/10
Are they representative of how far the unit can see (like I got my binoculars out looking - scouting distance)
or
How far the unit itself can be seen (like I am hiding - stealth)
LOS in tiles/10 (so 50 means 5 tiles)
LOS to infantry in cover/10
Are they representative of how far the unit can see (like I got my binoculars out looking - scouting distance)
or
How far the unit itself can be seen (like I am hiding - stealth)
-
- Field of Glory 2
- Posts: 28261
- Joined: Sun Dec 04, 2005 6:25 pm
Re: LOS in tiles/10 (so 50 means 5 tiles)
The former.Ubberdorc wrote: ↑Thu Dec 12, 2019 3:55 pm In the Squads file what do these do?
LOS in tiles/10 (so 50 means 5 tiles)
LOS to infantry in cover/10
Are they representative of how far the unit can see (like I got my binoculars out looking - scouting distance)
or
How far the unit itself can be seen (like I am hiding - stealth)
Richard Bodley Scott


Re: LOS in tiles/10 (so 50 means 5 tiles)
Thank you.
I was hoping it was the other way around like the scenario design PDF said. Is there anything that makes a unit hard to see?
4.9 LOS
200 Divide by 10 to get number of tiles away that unit can be seen.
4.10 CoverLOS
20 Divide by 10 to get number of tiles away that unit can be seen when under cover.
I was hoping it was the other way around like the scenario design PDF said. Is there anything that makes a unit hard to see?
4.9 LOS
200 Divide by 10 to get number of tiles away that unit can be seen.
4.10 CoverLOS
20 Divide by 10 to get number of tiles away that unit can be seen when under cover.
Re: LOS in tiles/10 (so 50 means 5 tiles)
There are also other kinds of terrains and obstacles that offer concealment to troops.
See manual, section 14.4, if you haven't yet.

Moreover, obstacles offer protection (14.6).
I guess that, at that time, in terms of stealth, nothing could equal a small group of detached musketeers approaching an enemy camp at night (for scouting, stealing...). However, the day and night cycle has no effect on visibility in game.
Re: LOS in tiles/10 (so 50 means 5 tiles)
It may be scripted very easily. I can give two different examples of the scripts: Lutzen.BSF (...\Campaigns\1ThirtyYearsWar\Scenarios\) using SkewedRandom function
Code: Select all
// CUSTOM - Set variable visibility for fog etc.
visibility = SkewedRandom(2, 6, 1) * 10;
// visibility = 300; // For demo only.
for (j = 0; j < 2; j++)
{
for (i = 0; i < GetUnitCount(j); i++)
{
id = GetUnitID(j,i);
if (id != -1)
{
v = visibility;
// Increase visibility for units on windmill hill
if (GetTileHeight(GetUnitX(id), GetUnitY(id)) >= 50)
{
v += 60;
}
SetAttrib(id, "LOS", v);
}
}
}
// END CUSTOM
Code: Select all
if ((turn == 0) || (turn == 1))
{
visibility = 30;
}
if ((turn == 2) || (turn == 3))
{
visibility = 50;
}
if ((turn == 4) || (turn == 5))
{
visibility = 70;
}
if (turn > 5)
{
visibility = 120;
}
if (turn > 7)
{
visibility = 160;
}
for (j = 0; j < 2; j++)
{
for (i = 0; i < GetUnitCount(j); i++)
{
id = GetUnitID(j,i);
if (id != -1)
{
v = visibility;
// Increase visibility for units on heights
if (GetTileHeight(GetUnitX(id), GetUnitY(id)) >= 50)
{
v += 20;
}
SetAttrib(id, "LOS", v);
}
}
}
Code: Select all
// Returns skewed randomly generated number.
FUNCTION SkewedRandom(min, max, skew_type)
{
int result;
int randomizer;
int difference;
if (skew_type == 0) // Uniform distribution
{
result = Rand(min,max);
}
if (skew_type == 1) // Bell-shaped distribution
{
result = Rand(min,max) + Rand(min,max);
result /= 2;
}
if (skew_type == 2) // Left skew (low values predominant)
{
// This version is equivalent to (Rand(0, max - min) ^ 2) / ((max - min) ^ 1) + min.
// It gives an average value of approximately 2/3 of the average of a non-skewed range.
difference = max - min;
result = Rand(0, difference);
result *= result;
result /= difference;
result += min;
}
if (skew_type == 3) // Right skew (high values predominant)
{
// Not yet implemented.
Log ("Skew Type 3 not yet implemented");
result = Rand(min,max); // To avoid crashing if it is attempted to be used.
}
return result;
}
Re: LOS in tiles/10 (so 50 means 5 tiles)
Thus visibility and weather conditions (fog...), darkness, etc. can be scripted ? Nice !
Re: LOS in tiles/10 (so 50 means 5 tiles)
Nice thank you!