Sign in to follow this  
Guest christian

New tool - tmfdecompress. Testers, please?

Recommended Posts

Help AVSIM continue to serve you!
Please donate today!

Great, looks very interesting. I will try it when I get home this evening :).

Share this post


Link to post
Share on other sites

Hi Jim.Great program!The bitmaps produced are vertically flipped, so you might want to fix that.Is there a palette scheme you used for the bitmap output?Dick

Share this post


Link to post
Share on other sites

Hi.> The bitmaps produced are vertically flippedInteresting. They *were* vertically flipped, but I already fixed it. What are you using to view them? I'll double-check in a few different programs myself. Looks like it needs to be un-fixed :)> Is there a palette scheme you used for the bitmap output?The colours were lifted from FS2004 screenshots which contained all the land/waterclass types. The class bitmaps are just the raw data with a bitmap header and palette attached, so palette entry 56 corresponds to landclass 56 etc.Regards,Jim Keir.

Share this post


Link to post
Share on other sites

Hi Jim.It appears if you specify a lat-lon then the image is OK... but unspecified it is vertically flipped.This is a lot of fun. I just had to make a bitmap of worldlc.bgl, and it only takes 2-3 minutes on my machine.Good news on the palette indexing... makes drawing landclass with a paint program quite possible.Dick

Share this post


Link to post
Share on other sites

Hi.>It appears if you specify a lat-lon then the image is OK...>but unspecified it is vertically flipped.A-ha! Ok, I'll track that one down tonight. I think I know what's causing it.>This is a lot of fun. I just had to make a bitmap of>worldlc.bgl, and it only takes 2-3 minutes on my machine.I made a rather nice composite image, using "worldlc.bgl", "worldwc.bgl" and "dem4km.bgl", lightsourced, as a 'hard light' layer to add texture.Try looking at the elevation data of some addon mesh sets - it tends to be a bit of an eye-opener...Regards,Jim Keir.

Share this post


Link to post
Share on other sites

Hi Jim.I suspect your bitmap formula is OK... I use Martin Wright's Show program as my default bitmap viewer. It shows them vertically flipped. But MSPaint and PSP7 are fine. So, it seems Martin's program has a problem with that format.Dick

Share this post


Link to post
Share on other sites

Not sure Dick. I also tested the tool. I use ACDSee as my image view program and it shows them correct in preview, but when I open them they do not show. Only after a refresh the BMP is loaded and it is loaded at 1% zoom all the time (so very small), while normally it is showed with a size to match full screen.So, there might be something different in these BMP files that confuses these programs.For the rest it works fine and it was fun to look at the land and waterclass data :).

Share this post


Link to post
Share on other sites

Hi Jim.Arno's post seems to confirm there's something wrong with your bitmap writing routine. :( Gives you something to do tonight?I did have a problem with the -c option. The decompressor crashed when I set it to 100 on a meshfile. 50 worked fine, and that was actually too much, but something to keep in mind. The meshfile was 38Megs and LOD10 ( and I must have made it right as I didn't nned to use the -c function at all ).I did confirm the odd LC value usages of the "ItalyLandpack.bgl" that seemed to aggrevate seasonal CTDs, and that it was tmfmerged, as a corner LOD5 chunk is missing, which your program converts to "0".I'm going to try some other odd files I have, and see what develops.Dick

Share this post


Link to post
Share on other sites

Hi Jim.I decompressed a chunk of dem4km.bgl ( FS9's LOD3 world ), and resampled that *elev.raw at LOD3, then resampled an LOD5-sized 1 arc second data of mine at LOD9, then merged the two TMFs and made a BGL.The resulting BGL is a large chunk of the world at LOD3 and a smaller area within it at LOD9. TMFViewer confirms this.When that BGL is tmfdecompressed, it makes the new RAW file, and INF, entirely at LOD9.I'm not surprised at this, but my computer is currently trying to resample the new data at LOD9... the RAW size ballooned to over 1GB in size! I hope to have the new BGL by morning. ;)This program works pretty good.Dick

Share this post


Link to post
Share on other sites

Hi Jim,Haven't tested your tool yet, but sounds great.How is the compression encoded? I was always suspecting RLE would be one of them, but I think there are several? Never tried RLE, because I never really needed decompression urgently...One thing you may want to consider is putting something about copyrights into the readme. This thing can open a can of nasty worms, since it allows people to decompress copyrighted data (like my NZ mesh scenery), modify it and sell it as their own. There is a slight chance you may get sued over this by someone who isn't happy about your program. I'm not saying that any case would hold up in court, but just getting sued or threatend is hassle enough, and I suspect you want to avoid it.So, you could put a statement into your readme that would address the issue. If you are paranoid now, you could also password protect the zip and send passwords out on request to people who want it and who you trust.I know you did this all in good intentions, and I personally can see some great uses (can it decrompress season data as well?). Just want to help you avoid personal hassles in times you get sued for all sort of ridiculous stuff.Cheers, Christian

Share this post


Link to post
Share on other sites

Hi Jim.There's a glitch in your landclass INF:Type = LandClassU8should be:Type = ClassU8==============================There are other interesting palettes that can be applied. The Olson landclass palette is one. That is the original source of MS land classification:http://forums.avsim.net/user_files/58728.jpgThe reduced size and compression don't do the pic justice, but it's very nice. This is North America ( with Central America, Carribean, and Hawaiian ). The Yellow is transparent value #254. From the default Worldlc.bglNote that there are no funny LOD5 lines or squares, and no merging of the source. The raw file or bitmap can be altered with a paint program. And the landclass extends into the ocean and lakes as it should, so coastal areas are not cut off by the water values.Dick

Share this post


Link to post
Share on other sites

Hi.>One thing you may want to consider is putting something about>copyrights into the readme. This thing can open a can of nasty>worms, since it allows people to decompress copyrighted dataYes, I know. I wasn't sure whether or not to let people know about it at all. The real problem is that MS have never released details of the compression, so this is on much shakier ground than showing the contents of LWM/VTP BGL files.I think I'll keep this more or less under my hat. Programs are less visible in these forums than, say, in the file library.Anyway, I had a quick tinker with the bitmap code and (I think) fixed the output problems. Also, the boundary checking on min/max coords is fixed and contrast of zero should now work, even though it's pointless. Regards,Jim Keir.

Share this post


Link to post
Share on other sites

Jim, this is another *very* useful program. I hope you continue to develop it. As Christian says, a suitable note in the readme should cover the copyright issue. I can immediately think of a use for this in AutoAsm. I was recently playing with the idea of automatically setting the elevations of lakes. As the program creates the asm file it would read the elevation from a terrain bitmap and set the lake elevations as appropriate. This would be quite easy to do. The only problem was, how to make a terrain elevation bitmap for, say, the local default scenery. And then your program pops up.... Best regards, Chris

Share this post


Link to post
Share on other sites

Hi Jim,Have you thought about putting support for regions and seasons in? Season support would be really handy, since seasons cover LOD2 quads, and it's tedious to extract the data from TMFViewer to change a smaller area. If you want any info on the season header structure, I can give that to you.Cheers, Christian

Share this post


Link to post
Share on other sites

Hi.>Have you thought about putting support for regions and seasons>in? Season support would be really handy> ...>the season header structure, I can give that to you.Sure, if you have any information then I'd appreciate a look. I've been a bit occupied over the last week but I should get some more time this weekend.I'm thinking of making this into a DLL that could be used in other software. Any takers?Regards,Jim Keir.

Share this post


Link to post
Share on other sites

ok, I'll start with the individual headers.You probably know that after the main header (and some other bits), you have the subheaders in this order:1 - mesh2 - unknown, not used3 - landclass4 - waterclass5 - regions6 - seasons(I hope I got the order right, it's been a while. It shouldn't matter because you most likely know what I'm talking about). Obviously, you know the format for 1-4. 5 works the same as 1-4. 6 (seasons) work very similar, but now you have 12 data blocks instead of 1 (one for each month). The data block is LOD2, rather than LOD5.The structure looks like this (oh my, it really has been a while, I should have written it down somewhere...):00 00 00 80 - header length00 00 00 0000 00 01 01 - x2 (like in 1-5) sets enable, I think00 00 00 FF00 00 00 0000 00 0F FF - don't know about the last 3 values anymore, don't think they matter (they are the same in my custom files)00 00 08 50 - x12 these point to the LOD tree in the back, of course we have 12 LOD trees now (lenght of LOD tree entry, like 1-5), this can be different to 00 00 08 50, if one doesn't do the whole worldXX XX XX XX - x12 pointers to the LOD tree entries (like 1-5)00 00 00 80 - start of data blockThat should do the trick...A dll would be great to have, but at this stage I couldn't think of a good use for me. A decompiler seems to be enough for me.Some other cool programs to have:A new compiler that supports regions and seasons, without the hacks I described in my TMF doc.A program that reads TMF mesh files and sets the lake elevations in a LWM file (no use for me since I have the elevation source data I need, but as Chris mentioned, this could be of use for some people).Cheers, Christian

Share this post


Link to post
Share on other sites

Hi.OK, I'll take a look soon. I've been a bit busy over the last few days with updating LWMViewer, and there's still a little that needs to be done.>A program that reads TMF mesh files and sets the lake>elevations in a LWM fileGood idea. I may be able to tweak something I've already got in this direction, in combination with LWMViewer's BMP export.Regards,Jim Keir.

Share this post


Link to post
Share on other sites

Hi.OK, regions and seasons added. At least, it saves out the contents of 'regions.bgl' and 'seasons.bgl' - I had a quick poke around other files but didn't find any other data to test with.Regards,Jim Keir.

Share this post


Link to post
Share on other sites

Thanks, Jim. I'll give it a spin.I think I'm the only one to ever have made a season file. It's for New Zealand and should be in the file archives here. I don't think there is any custom region file. The season support will be great though, as I said, it's LOD2 and noone is likely to ever substitute a whole LOD2 quad. So patching into the existing data is really easy now. (and since the season data has changed from FS2002 to FS2004 this has always been on my TODO list).Cheers, Christian

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this