There seem’s to be some continued confusion about how terrain tile’s work in Falcon.Though I have posted many time’s my understanding,through testing, observation and researching the CODE for 10+ year’s, we still seem to miss important thing’s.
So in this thread I wish to employ the KISS method in hope we ALL finally understand.
I know in past post’s here and @ PMC\FF\OF\Frug’s…etc. Fora I have been a bit facicious\abserbic on the subject.Sorry!!!BUT my feeling is,if you can’t understand the tool’s,concept’s,file structure…etc. in Falcon.Then you should not be modifying it 
In closing,PLEASE CODER’s,MODDER’s and USER’s FEEL FREE to add\correct where needed.This will further my philosphy of “We don’t know what we don’t know,BUT we can find out” in Falcon!!!
Here Go’s nothing:
1ST…A tile is an image/picture(Texture) that the GFX engine “draws” over a wireframe (the Terrain) No different at this point than a Google Earth tile used by map maker’s other than it is in a compressed format (.DDS) for Falcon.It in itself doe’s not contain any data other then pixel(picture element) count and pallette (color) After this Falcon has nothing more to do with it then put it on a list to be rendered by the GFX engine.
2nd…When we take these picture’s in Falcon and apply them to a certain XY coordinate on our MAP.She has a way for us to “Group” them together(16 images per group max,4096 total ATM).These are called “SET’s” and that DATA is saved in the texture.bin file.Basicly “Set’s” allow us to apply a “Terrain TYPE” to every texture in that “Group\Set”.This is essential for large area’s,say Mountain’s\Water,that we want to exclude\allow GU movement over.
3rd…Now we have our “Set’s” defined in the texture.bin.Let’s say we made the “Set Type” Water and it has an Airbase tile in it???Problem…exploding AC when you spawn on that tile.We can now define an “AREA” on said tile.So now we edit that tile in texture.bin and make an “AREA” of “Plain’s” on it, then wa’la,no more BoomBoom when you spawn
Get It???
4th…So we should understand now,I hope, that a “Set Type” define’s the “Terrain Type\AREA” for every tile in that “SET”,but we can edit any tile in that set and define a new “AREA” on it…kewl!!Here is where the confusion set’s in.“Hell,demer I did what you said,but they still won’t move” (direct quote from an old PM) I’ll get back to that in a minute.
5th…Now we have our “Tile” in a “SET” with a defined “AREA” on it.We would like the GU’s to move over it.How do we tell them that they can??? We define a “PATH” on the tile in texture.bin!!!Now “PATH’s” on a “Tile” have nothing to do with “Objective Link’s” at this point!!!Bear with me a minute and I’ll get back to it.
So we need to “PATH” this tile.HOW???Well you can draw just one ROAD pixel on it, then the cODE read’s the entire tile as “Pathed” and as long as the “Touching” tile is “Pathed” then they go on their merry way.IF you want to “FORCE” them to the road image,then you have to draw the entire path,as best you can,on the tile(Remember this Data is NOT stored in the .dds image,just in the texture.bin)
6th…Now we have a tile,in a set (insert your set TYPE here) with a defined area of plain’s and a “Road Path” defined on it, but there is a “River” path that intersect’s the road…HMMM??? Your GU’s stop and then go chasing off along the river until they find a point to cross or in worse case, not.We now need to define a “Bridge Path” over the “Road Path” so they can cross…Get IT???They don’t NEED a Bridge Objective\Feature there.They DON’T CARE,they just need a “Bridge PATH” to get over this…that is all.
7th…Getting back to “Hell,demer I did what you said,but they still won’t move” There is other DATA that Falcon use’s to determine where,how and when a GU can\cannot move over the Terrain.For this diatribe I am only concerned about the Terrain.There is another file at this point where DATA is stored and shared in Falcon that effect’s the GU’s movement over the entire “TERRAIN”.(NOT talking about “LINK’s” here,they are SEPERATE from TERRAIN!!!..Get IT???) It is often ignored or not understood by us.That is your .thr file.This file is the intersection of your terrain and your campain’\theater and contain’s Data that Falcon use’s,as in his case,he had no clue(Trying to make them drive up a mountain…;) )
_EDIT1:A little bit from “Baldeagles” Pathmaker manual circa ~2001,some of the naming convention’s have changed though (Thank’s Fred,saved me alot of headache’s over the year’s…:rtfm:LOL)
"Paths
- Paths are used in Falcon 4 to draw roads and rivers on the Ground Radar display. There are 4 Path Types available: River, Road, Bridge and Railway. The <theater>.thr’s Road along with Cover Type and Relief information are used to calculate the Cost to travel various routes from their current position to the Objective. When the units encounter a Bridge Path segment, a request is transmitted for the status of the bridge object over the river. The River Path delineates areas in the tile where the ground units cannot go without a means to cross the river. Although Railway type is checked in Falcon 4, I am not sure how ground units will use this type of path.
Areas
- Areas are used in Falcon 4 to determine the cost for ground units to follow a path through the Area type defined in a tile. There are 10 Area Types available: Water, Swamp, Plains, Brush, Thin Forest, Thick Forest, Rocky, Urban, Runway and Station. The defined Areas with Cover Type are used to calculate the Cost to travel various routes from their current position to the Objective. When there are high cost areas between the ground unit and its objective, the unit will try to take a lower cost route. Thus, high-cost areas in the tile might block the route through an area they should not travel, such as ocean, lakes, rocky areas or thick forest. The use of Runway and Station types is unknown. Station type sounds like a railway station area. Runway type may be for airbases, but it is not used in the original tile’s areas. From this discussion you can see how important it is to lay down good areas. Look at the original Korea tiles to get an idea of how the F4 developers defined paths. Be aware that not all of the F4 people did a good job. I have found many errors with the way paths and areas were defined."</theater>_
EDIT2: for you Ted…. <theater>.thr file…is built, in the various tool’s,i.e TerrainView,PathMaker,TerrainEditor from the Theater.L2 and Texture.bin file’s.Without getting into extreme detail,suffice it to say, there are “byte’s and bits” contained in the file for each tile in your theater….(WHEW!!! think about that math for a minute…LOL).
The three most important for your campain’s\theaters to run correctly are: Terrain\Cover\Set Type and Path Data from the Texture.bin.And Elevation Data from the Theater.L2.
ANYTIME you change ANY data in those two file’s you MUST rebuild your <theater>.thr file against the new data.Get it???</theater></theater>
_EDIT3: This is how the CODE see’s “PATHS\AREAS”
@*****:
Here you go……
// Return the type of ground under the specified point on the ground.
int GetGroundType( float x, float y ) {
// Grab the texture ID at location x,y int texID = Terrain.GetTexID( x, y );
// Check all segment features for inclusion int pathCount = 0; int i = 0; int type = -1; TexPath *path; Edge segment; TexArea *area; GET_NEXT_PATH; while ((type == -1) && path) { pathCount++; float r = path->width * 0.5f;
// Skip this one if we're not inside its bounding box if (path->x2 < path->x1) { if ((path->x2 > x+r) || (path->x1 < x-r)) { GET_NEXT_PATH; continue; } } else { if ((path->x1 > x+r) || (path->x2 < x-r)) { GET_NEXT_PATH; continue; } } if (path->y2 < path->y1) { if ((path->y2 > y+r) || (path->y1 < y-r)) { GET_NEXT_PATH; continue; } } else { if ((path->y1 > y+r) || (path->y2 < y-r)) { GET_NEXT_PATH; continue; } }
// Now check the line segment itself segment.SetupWithPoints( path->x1, path->y1, path->x2, path->y2 ); segment.Normalize(); d = (float)fabs( segment.DistanceFrom( x, y ) ); if (d < r) { type = path->type; } GET_NEXT_PATH; }
// Check all area features(Type's) for inclusion uint32 areas = 0; i = 0; area = TheTerrTextures.GetArea( texID, 0, i++ ); while ((type == -1) && area) { float dx = x - area->x; float dy = y - area->y; float d = dx*dx + dy*dy; if (d < (area->radius * area->radius)) { type = area->type; } area = TheTerrTextures.GetArea( texID, 0, i++ ); areas++; }
// Get the basic terrain type of this tile if (type == -1) { type = TheTerrTextures.GetTerrainType( texID ); } return type; }
Thank’s from a fellow Welshman ;)_
I really hope’s this help’s,sorry if I missed some point’s\question’s
No EGO demer