- Messages
- 6,172
- Country
Hi Sean.
Any updates for us?
Any updates for us?
Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.
By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.
It's been a while since CGLdec (0.2.130.0) doesn't give any news.Thanks Dick. I should have an update ready to go in about a week that can write vector data.
cgldec decompress -f "C:\FS\MSFS\Official\Steam\fs-base-cgl" -t dem -p 032010 -o "C:\CGL"
cgldec extract -f "C:\FS\MSFS\Official\Steam\fs-base-cgl" -t dem -q 032010013113 -o "C:\CGL"
Time makes fools of us all. Unfortunately I don't have much news to share, as life has often gotten in the way, other than that writing vector tiles is in progress, and something that I very much still want to complete. It actually is a significantly more complex task than initially anticipated, however it is still possible.It's been a while since CGLdec (0.2.130.0) doesn't give any news.
Thanks for the update, you are still working on it. Can you open sourced the code and let us know how to figured this out?A quick progress update: Good news and bad news!
The good news is I can read at least building footprint geometry from arbitrary bldo/bldn tiles. These are called ".bld" files in Blackshark parlance, and the file format is an unbelievably convoluted proprietary mess.
View attachment 83473
The bad news: first, there is a lot of additional metadata there that is going to be even more convoluted to decode. I can perhaps get the code to a point where I can write some arbitrary bytes in some of these areas and observe the effect in-sim, but this is really going to be a slog. But first, there's an even more pressing problem:
View attachment 83474
The 16-bit fixed point grid is stretched/skewed over the tile bounds (and as you'd expect give the above, in longitude the tiles overlap, and have a gap in latitude). The amount of stretch/skew depends on Lat/Lon of the tile, but is not 0 at the equator as you would expect if this was related to projection distortion. I've tried countless projection techniques and I can get close, but have not found an algorithm yet that perfectly fits without manually tweaking a single tile, which obviously does not scale. This doesn't affect vec* tiles, which project fairly cleanly to web mercator - however the sim reads these directly instead of the PGG engine, two different codebases. To compound this, it's not really just a 16-bit grid, the algorithm selectively expands vertices to 32-bit at tiles bounds (for normalized values below 0.0, or greater than 1.0) to handle buildings with coordinates that overlap a tile boundary.
I'm going to keep investigating and hopefully figure something out. But I've been doing terrain programming for years, even decades now, and believe me I am stumped.
Anyways, thanks for your patience and cgldec updates to follow soon!
A quick progress update: Good news and bad news!
The good news is I can read at least building footprint geometry from arbitrary bldo/bldn tiles. These are called ".bld" files in Blackshark parlance, and the file format is an unbelievably convoluted proprietary mess.
View attachment 83473
The bad news: first, there is a lot of additional metadata there that is going to be even more convoluted to decode. I can perhaps get the code to a point where I can write some arbitrary bytes in some of these areas and observe the effect in-sim, but this is really going to be a slog. But first, there's an even more pressing problem:
View attachment 83474
The 16-bit fixed point grid is stretched/skewed over the tile bounds (and as you'd expect give the above, in longitude the tiles overlap, and have a gap in latitude). The amount of stretch/skew depends on Lat/Lon of the tile, but is not 0 at the equator as you would expect if this was related to projection distortion. I've tried countless projection techniques and I can get close, but have not found an algorithm yet that perfectly fits without manually tweaking a single tile, which obviously does not scale. This doesn't affect vec* tiles, which project fairly cleanly to web mercator - however the sim reads these directly instead of the PGG engine, two different codebases. To compound this, it's not really just a 16-bit grid, the algorithm selectively expands vertices to 32-bit at tiles bounds (for normalized values below 0.0, or greater than 1.0) to handle buildings with coordinates that overlap a tile boundary.
I'm going to keep investigating and hopefully figure something out. But I've been doing terrain programming for years, even decades now, and believe me I am stumped.
Anyways, thanks for your patience and cgldec updates to follow soon!
Thanks for the reply. I have tried renaming the output.bin to output.raw directly and opening it in photoshop, then inputted image width and height with numbers of nRows and nCols from output.inf file and it loaded perfectly! Now I just have to change the RGB value and recompile it. Thank you very much for your help.Hi @PK-LKP! If you rename the .bin file to .bil and use the .hdr file it spits out, you should be able load it in QGIS: https://www.qgistutorials.com/en/docs/open_bil_bip_bsq_files.html
Likewise, the file itself should be compatible with SbuilderX .raw if you rename it, although I haven't tried this workflow myself.
Does that meet your needs? I could explore adding Photoshop Large Document Support if not, but it is not a pleasant format to work with.