Hazelnut wrote: ↑Fri Oct 09, 2020 10:38 am
Do you have your code in github? I need to start thinking about how we make this compatible with Basic Roads.
It's on GitHub now, at long last! And some more good news: the compatibility fix is going to be extremely easy on your end. I generate the tileData (that the GenerateTileDataJob in the TerrainTexturer normally generates) during terrain sampling, then store the resulting byte array internally for use in the TerrainTexturer instead of the default GenerateTileDataJob. I've implemented a message handler intended for other mods to obtain the generated tileData in their own TerrainTexturer implementations. So all it takes is to skip the GenerateTileDataJob in BasicRoadsTexturing and obtain the tileData through my message handler instead (and for Interesting Terrains to not assign its own TerrainTexturer if Basic Roads is loaded - I'll make sure to do that). I've tested it out myself, and the roads get properly painted on top of the Interesting Terrains tilemap.
The bad news, however, is that the terrain smoothening on my end isn't going to be as easy. As far as I'm able to understand, from looking at your code, the road data consists of a single byte value per map pixel, and the byte value corresponds to a direction somehow (N, S, SE, W, etc). Beyond that, I honestly have no idea what to make of it, or how I would go about turning it into an array of roadpoints inside a given map pixel's 129x129 heightmap grid (I would need to be able to find the nearest road point for any given heightmap sampling point for a map pixel during the terrain sampling, in order to be able to smoothen the roads).