LOS in tiles/10 (so 50 means 5 tiles)

Moderators: rbodleyscott, Slitherine Core, Gothic Labs

Post Reply
Ubberdorc
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 31
Joined: Thu Aug 07, 2014 11:03 pm

LOS in tiles/10 (so 50 means 5 tiles)

Post by Ubberdorc »

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)
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28261
Joined: Sun Dec 04, 2005 6:25 pm

Re: LOS in tiles/10 (so 50 means 5 tiles)

Post by rbodleyscott »

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)
The former.
Richard Bodley Scott

Image
Ubberdorc
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 31
Joined: Thu Aug 07, 2014 11:03 pm

Re: LOS in tiles/10 (so 50 means 5 tiles)

Post by Ubberdorc »

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.
Athos1660
Major-General - Elite Tiger I
Major-General - Elite Tiger I
Posts: 2657
Joined: Wed May 29, 2019 3:23 pm

Re: LOS in tiles/10 (so 50 means 5 tiles)

Post by Athos1660 »

Ubberdorc wrote: Sat Dec 14, 2019 3:43 pm Is there anything that makes a unit hard to see?
Obstacles and terrain ?
Ubberdorc
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 31
Joined: Thu Aug 07, 2014 11:03 pm

Re: LOS in tiles/10 (so 50 means 5 tiles)

Post by Ubberdorc »

Yeah Forests work real well - I was just hoping to have a good ambush unit.

Athos1660 wrote: Sat Dec 14, 2019 3:51 pm
Ubberdorc wrote: Sat Dec 14, 2019 3:43 pm Is there anything that makes a unit hard to see?
Obstacles and terrain ?
Athos1660
Major-General - Elite Tiger I
Major-General - Elite Tiger I
Posts: 2657
Joined: Wed May 29, 2019 3:23 pm

Re: LOS in tiles/10 (so 50 means 5 tiles)

Post by Athos1660 »

Ubberdorc wrote: Sat Dec 14, 2019 4:27 pm Yeah Forests work real well - I was just hoping to have a good ambush unit.
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.
Cronos09
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 326
Joined: Thu Feb 22, 2018 4:28 pm

Re: LOS in tiles/10 (so 50 means 5 tiles)

Post by Cronos09 »

Ubberdorc wrote: Sat Dec 14, 2019 3:43 pm Is there anything that makes a unit hard to see?
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
and SOOR.BSF in SOOR scenario by Edward77 using a certain number of 'visible' tiles

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);
				}
		}
	}
FUNCTION SkewedRandom(min, max, skew_type)

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;
}
Athos1660
Major-General - Elite Tiger I
Major-General - Elite Tiger I
Posts: 2657
Joined: Wed May 29, 2019 3:23 pm

Re: LOS in tiles/10 (so 50 means 5 tiles)

Post by Athos1660 »

Thus visibility and weather conditions (fog...), darkness, etc. can be scripted ? Nice !
Ubberdorc
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 31
Joined: Thu Aug 07, 2014 11:03 pm

Re: LOS in tiles/10 (so 50 means 5 tiles)

Post by Ubberdorc »

Nice thank you!
Post Reply

Return to “Modders Corner”