Creating Overlay Tiles

Post Reply
blaze1711
Private First Class - Opel Blitz
Private First Class - Opel Blitz
Posts: 2
Joined: Mon Feb 08, 2016 8:54 pm

Creating Overlay Tiles

Post by blaze1711 » Wed Dec 11, 2019 1:22 pm

I was looking at creating some new overlay tiles but keep running into an issue where they do not autoedge to neighbouring tiles of the same type.

As an example:
NorthernEurope_Overlay/Tiles.txt has Tile 8 which is a road with a track coming off one side. When placed this auto edges to any neighbouring roads and tracks (although the orientation does not work automatically but that is fine). I wanted to create a crossroad so that a track can come off either side of the road. In the NorthernEurope example, the tile is defined as TRACK_ROAD_T and works as expected. If I try to create a TRACK_ROAD_CROSSROAD tile, it does not autoedge to neighbouring roads and tracks.

Would someone be able to provide a reason why this does not work, or at least why TRACK_ROAD_T does work and how the system works out that it is both a track and a road tile? And ideally a solution for how I might get this working?

Thanks in advance.

rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 22707
Joined: Sun Dec 04, 2005 6:25 pm

Re: Creating Overlay Tiles

Post by rbodleyscott » Wed Dec 11, 2019 2:23 pm

The autoedging for tracks/roads is hard-coded in the engine.

The ROAD line tells it what type of road/track configuration the tile represents, but the autoedging can only handle the configurations specifically named in the engine code.
blaze1711 wrote:
Wed Dec 11, 2019 1:22 pm
Would someone be able to provide a reason why this does not work, or at least why TRACK_ROAD_T does work and how the system works out that it is both a track and a road tile?
Well as far as I can see TRACK_ROAD_T only half works, so I think it struggles to do so.

I suspect that the hard coding in the engine does not have any code at all to tell it what to do with a TRACK_ROAD_CROSSROAD tile. [I don't have access to the engine source code, so I cannot check.]

There are similar issues with streams and rivers.

The solution is to turn off the Autoedging temporarily before you place the special overlay tile.
Richard Bodley Scott

Image

blaze1711
Private First Class - Opel Blitz
Private First Class - Opel Blitz
Posts: 2
Joined: Mon Feb 08, 2016 8:54 pm

Re: Creating Overlay Tiles

Post by blaze1711 » Thu Dec 12, 2019 10:19 am

Thanks for the reply Richard.

I had a feeling that the autoedging was handled in the engine code, it's a shame there aren't any modding options for this built in to allow defining new configurations.

Turning off autoedging when placing these tiles seems to be the way to go, however you have to also turn off autoedging when placing any tile next to the special overlay tile too. This is particularly awkward when trying to using random map generation. I guess it's just a quirk to work around.

Thanks again for the quick response :)

Post Reply

Return to “Field of Glory II: Modding”