Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure TIN/Photogrammetry/MTX file format #2

Open
muumimorko opened this issue Dec 17, 2020 · 10 comments
Open

Azure TIN/Photogrammetry/MTX file format #2

muumimorko opened this issue Dec 17, 2020 · 10 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@muumimorko
Copy link
Owner

muumimorko commented Dec 17, 2020

Figuring out TIN file format, being able to generate (and inject) TIN tiles to the game, would allow for arbitrarily high resolution.

TIN source for the game is https://kh.ssl.ak.tiles.virtualearth.net/tiles/mtx{quadkey}?g={genid}&tf=3dv3&n=z

Example files, suspecting they each contains a TIN mesh and bitmap texture at least.
02301231130300222 (https://kh.ssl.ak.tiles.virtualearth.net/tiles/mtx02301231130300222?g=9003&tf=3dv3&n=z)
mtx02301231130300222.zip
Texture resolution 1024x512 pixels

mtx0230123113030022.zip
Texture resolution 512x1024 pixels

mtx023012311303002.zip
Texture resolution 512x1024 pixels.

First 6 byte seems to be identical
04 28 B5 2F FD A0

@muumimorko muumimorko added enhancement New feature or request help wanted Extra attention is needed labels Dec 17, 2020
@muumimorko muumimorko mentioned this issue Dec 17, 2020
@Gjanosh61
Copy link

"TIN source for the game is https://kh.ssl.ak.tiles.virtualearth.net/tiles/mtx{quadkey}?g={genid}&tf=3dv3&n=z"

Bad Request

@muumimorko
Copy link
Owner Author

Need to replace {quadkey} with valid quadkey (eg. '023012311303002') and {genid} with genid {eg. '9003'} like in example below it.

@Gjanosh61
Copy link

https://kh.ssl.ak.tiles.virtualearth.net/tiles/mtx{023012311303002}?g={9003}&tf=3dv3&n=z
Bad Request

https://kh.ssl.ak.tiles.virtualearth.net/tiles/mtx02301231130300222}?g=9003}&tf=3dv3&n=z
Bad Request

Directly accessing the Bing Maps tiles
https://docs.microsoft.com/en-us/bingmaps/rest-services/directly-accessing-the-bing-maps-tiles
"It should be noted that the tile URLs for Bing Maps change regularly and as such directly accessing tiles from a hardcoded URL is not allowed."

I thank you, for having opened a new horizon but it's all new and hard for me to follow ... but I don't give up I always accept new challenges.

@mohitvashistha
Copy link

I am also trying to understand this file format.

I use Maps app in Win10 with fiddler to get the URLs. Even though if you will crack the file format, you cannot store the tiles as per Microsoft's term of use (as per my understanding).

I think they have a collaboration with Cesium to get their 3D Tileset. Is this 3D tile format

@muumimorko
Copy link
Owner Author

Good point about not storing data, not intending to do that.

Another thing is that the game uses more advanced tls key exchange (ECDHE_RSA, IIRC), when actually retrieving tile data from Azure, which can not be "decrypted" (at least not as easily).

@muumimorko
Copy link
Owner Author

I think they have a collaboration with Cesium to get their 3D Tileset. Is this 3D tile format

If that is the the file format, specifically "b3dm", the mtx is compressed/encrypted container, as there is no structure in the mtx file.

There is a Unity Maps SDK from microsoft, it has a sample for using 3D data, maybe it could help fiquring the format out. https://github.com/microsoft/MapsSDK-Unity/

Another thing is that the game uses more advanced tls key exchange (ECDHE_RSA, IIRC), when actually retrieving tile data from Azure, which can not be "decrypted" (at least not as easily).

There is no need to break TLS, just directing traffic to middleman https server, via for example changing hosts-file, works.

kh.ssl.ak.tiles.virtualearth.net - Satellite imagery, Photogrammetry, Color correction data (Filter that makes everything green)
khstorelive.azureedge.net - CGLs
kh-k8s-prod-cdn.azureedge.net - Metar

Started a new repository for a "Proxy" server: https://github.com/muumimorko/MSFS2020_Proxy
Example results of blocking color correction data and injecting texture tiles cut from aerial photographs.
NoGreenComp

@derekhe
Copy link

derekhe commented Aug 9, 2021

@muumimorko
There is a way to replace the bing map with google, find it out here: https://github.com/derekhe/msfs2020-google-map/blob/main/README.EN.md

@seanisom
Copy link

seanisom commented Aug 9, 2021

Hi @derekhe, great work on the proxy server. If I understand correctly, that is replacing the aerial (a/kha/cci) tiles and not the photogrammetry (mtx) tiles?

It would theoretically be possible to replace mtx tiles with google photogrammetry, assuming you could convert the coverage maps where the two data sets converge. I have the Bing mtx format(s) and the Google rocktree protobuf format is described here: https://github.com/retroplasma/earth-reverse-engineering

However, it would be expensive to perform the format conversion between the 3d formats at runtime, one might want to do this offline and only proxy mtx tiles from a local cache.

@derekhe
Copy link

derekhe commented Aug 9, 2021

@seanisom yes, that's aerial tiles, that would fix the China mainland's old image issue.
I'd like to see if other things can be replaced, local cache is a good idea.

@lucascavatoni
Copy link

Hi @muumimorko,

You mentioned :

kh-k8s-prod-cdn.azureedge.net - Metar

I guess you were not referring to meteorological METARs, were you ? Anyway, it would be very interesting if we could block the METARs from being downloaded, to only have meteoblue weather data.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants