Nice to know before "cooking" a map_c file
#1

Working on my Denmark map I was consistently getting very large "cooked" map_c files, in the order of 56000 kB or more (close to the limit, 65535 kB). However, inspecting the cooked map_c file revealed many chunks (32x32 pixel areas) seemingly "all white" were present (only one "all white" chunk should be in the cooked file). It turns out that during a previous blurring operation many of the white areas had been in fact assigned values between 230..254. This of course is detected as a "non-all white" and subsequently saved, drastically increasing file size. Thresholding all values between 128 (lowest land level) and 255 to 255 reduced the file size to approx. 19000 kB.

Hope this helps...
Reply
#2

Hiya Redwulf,

Interesting observation. Out of interest I checked out my Darwin map_c.tga and found two extra full white segments, but on inspecting one of the larger available addon maps discovered more than I could count.

Probably worth taking a closer look at some of these colossal map_c's and see if the same kind of optimisation could be used to get better performance, or even push further the size limits that are being achieved at the present time.

I would guess that you've checked one of the original cooked map_c's and confirmed that there should only be one all white and one all black 32x32 chunk?

Cheers, Neil Smile
Reply
#3

Hi Neil,

Yes, inspecting original cooked map_c.tga and the associated map_c.tga_table files was what allowed me to deduce the encoding used and build the Map_c Toolbox application. The original .tga's only contain one all white and one all black chunk. The .tga_table file is simply a list of what chunk number in the .tga file represents a particular map location, nothing fancy really. There might even be room for further optimisation by eliminating identical non-all white/black chunks but I doubt it's worth the effort - processor load would be prohibitive and the gains marginal.

As an experiment you could try and reassemble a file pair with the Map_c Toolbox, threshold the raw map_c so all grayscale values greater than 127 are set to 255 and re-cook. Would be interesting to see the reduction in the size of the cooked map_c.tga file. 8)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)