There are Physics under SPWaW !

Trade tips and tricks, workarounds maps, and graphics mods. Why certain scenarios or campaigns are favorites, or how to improve stinkers. Attach your work to share/critique.

Moderator: MOD_SPWaW

Post Reply
User avatar
CatLord
Posts: 312
Joined: Mon Oct 21, 2002 1:35 pm
Location: Lausanne, Switzerland
Contact:

There are Physics under SPWaW !

Post by CatLord »

If you ever use Chandla's WaWEdit editor to place at random trees and rough hex, you may want to know that there is an interesting Physics problem hidden there...

Have you ever asked yourself the question:
- If I put not many trees, a fast unit can circulate easily around them and cross my little forest as if it did not exist.
- OTOH, if I put many trees, it becomes too dense and it is not nice looking.
I would like to know how much trees I should put so that there would be (or not) a road between them...

This problem is very well known in Physics, and is called the "percolation" effect.

I am not going to explain everything to you, but roughly, you must know that this is threshold phenomen:
- Below a certain % of chance to have a tree in an hex, you will always have a road that cross the whole tree area.
- Above the same %, there will never be one and your forest will become harder to cross.

For a 2D square latice, the critical % is around 54% (IIRC). I don't know it for an hexagonal lattice, like a SPWaW map, but if someone does, I would be very happy to learn it...

Cheers,

Cat Lord
Member of the Revolution Under Siege development team.
Svennemir
Posts: 445
Joined: Fri Nov 02, 2001 10:00 am
Location: Denmark
Contact:

Post by Svennemir »

I'm not quite sure I know exactly what you mean....
- Below a certain % of chance to have a tree in an hex, you will always have a road that cross the whole tree area.


If placement is random there'll always be a chance of this not occuring. There's a small chance that the area will be blocked continuously. So it cannot be "always" like stated above. Or am I misunderstanding?

Also remember that difficulty of passing a forest or other terrain is dependant on the angle of movement to lattice directions. This is especially noticeable in 2d square lattices - if you have to move diagonally and something is blocking, it will take time to cross. If you're not moving diagonally you can easily redirect movement past obstacles wasting no time at all.
I am not going to explain everything to you


Awwww :( Come on!
User avatar
CatLord
Posts: 312
Joined: Mon Oct 21, 2002 1:35 pm
Location: Lausanne, Switzerland
Contact:

Post by CatLord »

Originally posted by Svennemir
If placement is random there'll always be a chance of this not occuring. There's a small chance that the area will be blocked continuously. So it cannot be "always" like stated above. Or am I misunderstanding?

Also remember that difficulty of passing a forest or other terrain is dependant on the angle of movement to lattice directions. This is especially noticeable in 2d square lattices - if you have to move diagonally and something is blocking, it will take time to cross. If you're not moving diagonally you can easily redirect movement past obstacles wasting no time at all.
I will explain better with a figure found on the internet:

Image

Imagine your forest is a 2d square lattice.
On one square, there could be a tree or not (black or white), with a certain % of chance, identical for all the square of the latice.

You want to know if you can travel across the forest (not using the diagonals) from top to bottom with a direct route without any tree.

You may think that the probability that a path exists, which depend of the % of chance a square contains a tree or not, is linear, but it is not. That's what percolation is all about, it is a threshold phenomena.

If you have % of having a "white square" > threshold (around 54% IIRC), you always have a path of white square from top to bottom.

Note that inverting the % for the other colour is false: You need to reach the same % of black squares (i.e. threshold), to find a black path from bottom to top.

So, if you are in between (50 % black, 50% white), there is almost no chance that you find neither a white path nor a black path...

Is it clearer ?

For myself, I was just curious if some people would have known the probability for a 2d hexagonal lattice...

Cat
Member of the Revolution Under Siege development team.
User avatar
CatLord
Posts: 312
Joined: Mon Oct 21, 2002 1:35 pm
Location: Lausanne, Switzerland
Contact:

Woops

Post by CatLord »

I was not recalling correctly, the critical % is closer to 60%:

pc = 0.5927

A very good site explaining percolation a bit, but more important, with a small applet showing you the result:

http://fafnir.phyast.pitt.edu/myjava/perc/percTest.html

Enjoy !

Cat
Member of the Revolution Under Siege development team.
User avatar
rbrunsman
Posts: 1795
Joined: Thu Jan 31, 2002 10:00 am
Location: Phoenix, AZ

Post by rbrunsman »

My head is spinning.:) But that is very interesing stuff.
Everyone is a potential [PBEM] enemy, every place a potential [PBEM] battlefield. --Zensunni Wisdom
User avatar
tracer
Posts: 1841
Joined: Wed Nov 22, 2000 10:00 am
Location: New Smyrna Beach, FL USA
Contact:

Post by tracer »

When you place a hex of trees on a map using the editor within SPWAW, it is identical to every other treed hex...only the visible graphic varies. Of course if the hex has other characteristics (slope, rough, road, etc) they will affect how the hex is read and treated by the game engine. With Chandla's editor you can change the properties of any hex, but these changes are manually inputted by the user.

Are you referring to the spacing between separate treed hexes (and its effect of movement)?
Jim NSB ImageImage
User avatar
CatLord
Posts: 312
Joined: Mon Oct 21, 2002 1:35 pm
Location: Lausanne, Switzerland
Contact:

Post by CatLord »

Hi,

I am referring to when you use "Import bitmap", in Chandla's editor, importing a green and red image of your map to place rough hex or tree hex randomly.

The level of green you use, above 155 and up to 255, is to obtain between 0% and 100% of chance of having a tree in a hex.

If you make a large area with green composant < certain value (that alas I don't know, let's assume it is near the 2d square lattice critical value of 0.6, so it means green < "195" , so that non-green probability > 60 %) you are very likely to create a "forest" with a clear patch crossing it from side to side. So if your aim was to "create" a forest not esily crossable by a scout vehicle with lot of movement, you probably failed.

On the contrary, if you use green composant > "215" you are very likely to create a "forest" not only without any clear patch crossing it from side to side, but probably with a big chunk of trees running from one side to the other. So it will become very dense and will slow down most of the vehicles at least on one hex of trees they will have to cross for sure...

Cheers,

Thomas
Member of the Revolution Under Siege development team.
Post Reply

Return to “SP:WaW Scenarios/Campaigns”