Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

A guide to reduce your Custom Overlay file sizes.

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Useful Material >> A guide to reduce your Custom Overlay file sizes. Page: [1]
Login
Message << Older Topic   Newer Topic >>
A guide to reduce your Custom Overlay file sizes. - 10/6/2013 9:51:13 AM   
brassem


Posts: 73
Joined: 10/2/2013
From: NE of YMML
Status: offline
A guide to reduce your Custom Overlay file sizes for Command Modern Air/Naval Operations.


6th October 2013. Version 1.00
1st November 2013. Version 2.00 Revised after viewing Tomcat84's tutorial.
4th April 2018. Version 3.00 New graphics after Photobucket extortion.

Introduction.

The feature of adding custom overlays to missions in this game will prove to be a significant benefit to the both the player and mission creator. However the game scenarios can cover some very large areas, to cover these with overlays will result in very large file sizes in the Gigabyte range that will crash the game. I hope the technique in this guide will allow users to get their overlay file sizes down to manageable levels while working within the game limits. The user will still have to be prudent on how they want detail added by the custom overlay, at the cost of file size. In this example GMAP is used to create a user defined Custom Overlay.

The process described here in this guide is a simple graphics technique of reduce and expand, at the cost of image quality, applied to CMANO Custom Overlays. This is very much a work in progress as the game evolves. The ingame tutorial used as the basis for this guide is: Basic Training Air Operations, 1983.scen. In this guide we will add some more detailed images to the map terrain of this scenario. Tactical and Mission critical detail can also be added.

Requirements.

You will need to know how to change image file sizes in a graphics application. If you do not, then don’t continue.
If you are running a 32bit computer, expect longer times and even lockups as the system tries to juggle large data chunks. If you have low disk space, don’t continue.

A graphics program where you know how to scale a png image. In this example Photoshop CS4 64bit is used.
GMAP. http://greatmaps.codeplex.com/ Just for the fact that you can create reference images that can be used as a guide to building a custom facility.
Low level text editor. Do not use Word as it adds un-needed data to the file.
Calculator.
Patience and determination.

Procedure.

This tutorial is supplementary to the Custom Overlays 101 as provided by the Slitherine Group in their e-book manual. ( 8.3 Custom Overlays 101. Page 121 ). It is assumed that you have GMAP installed and working. The game state used in this tutorial is Command v1.01 Release Candidate 2 (Build 439).
The Custom Overlay feature works as described. If you add one image and then another, the last loaded will overlay the first. This is where alpha channels and transparency will play a role in the overall graphic effect, so low resolution overlays should be loaded first, while the more detailed high resolution image loaded after. The working steps will then be to work with the detailed images first, followed by general low resolution images later as space will allow. Work in, then out, to see what you are left with.

Tomcat84 has done a brilliant youtube tutorial on custom overlays where he briefly shows the technique as described here for image reduction in video. Near the end he shows a better technique that rids the file of transparency data, that can help even further with file reduction. This video is a must see for overlays! (I am curious to how both techniques zip down. As transparency dead space should compress well.)
Tutorial by Tomcat on Custom Overlays

Ok, Lets get some terrain details in on the Basic Training Air Operations, 1983.scen mission. The known enemy target will be used in this example.

Start the scenario so that the target is revealed and we can use the mouse-over to write down the Global Position coordinates of it.



Pic01.

The general Global Position of the target is N39° 14’ 16”, W118° 14’ 33”. You need to convert this to a decimal coordinate to work with GMAP. You can use websites such as http://www.earthpoint.us/Convert.aspx to do the conversions, which yields 39.2377778° -118.2425000°. Once we have the decimal GP coordinates it will make further work easier.

Load up gmap and type those new GP coordinate values in. (Bing satellite view)
The red cross will be the location of the coordinates that you typed in. Zoom in to get a good overall picture on the screen of what you wanted to capture. Then drag out a box (plus Alt key) to the area you think would encompass the red targets. Start from the top left corner and drag down to the bottom right. The top left corner will be the actual reference coordinate used in the .pgw file. By how much you dragged across and down will be the scalars in the .pgw file.



Pic02.

Click the [Get Static] button on the right panel. In the new pop up box, tick the make world file box and set zoom to 17. Click the [Generate] button and prepare to wait while GMAP does its stuff. The dialog box reported 1 of 1054. This is not going to take a lot of time.
After a few seconds there is a .png and .pngw file on the desktop. Renamed and moved to the tutorial directory. The .png file is the graphics file while the renamed .pgw file is the Global Position data text file.



Pic03.

The .png image file of the selected area is 98MB. It needs to be 3MB or less without sacrificing too much image detail. The ingame image is;



Pic04.

This zoom level is good. You can determine what targets need to be taken out on a unit basis to effectively shut down this facility on what you actually see. Unfortunately the file size is too large for this simulation programme to handle in quantity.

What we reduce in image we increase in scale factor.

In your graphics programme, you load up this .png file. Apply a 50% reduction in file size and save.



Pic05

We are going from 163MB to 40MB (in Photoshop it adds the alpha layer so file sizes are increased as it processes). The red arrow shows the origin of the GP image as defined in the .pgw file. By reducing the image we have shrunk the image size by 50%, yet lost 75% of the actual data using the graphics programme algorithm. The quality of the compression is a factor of what programme you are using.



Pic06.

The image is way off! How do we correct it? The answer is in the .pgw file. The contents are;



Pic07.

In this particular case, the structure of the .pgw file is;

01 Latitude Scale Factor
02 Top Left Hand Latitude (Offset?)
03 Top Left Hand Longitude (Offset?)
04 Longitude Scale Factor
05 Top Left Hand Longitude actual Global Position location
06 Top Left Hand Latitude actual Global Position location

Because the image was reduce by 50% the scale factor must be doubled.
The lines 01 and 04 get doubled and edited into the .pgw file. That yields for the file contents of;

0.000021457672
0.0000000
0.0000000
-0.000016620316
-118.284130096436
39.264290857282

After reloading the CO ingame, it shows that the quality is still there but with a much smaller file size. Going from 93MB down to 31.1MB in a single hit.



Pic08.

Applying the technique two more times yielded a 1.98MB file. Not as sharp but you would rarely be viewing the game down to this resolution during game play.



Pic09.

If you really want to, use a sharpen filter to bring back some detail lost.



Pic10.

After using smart sharpen in Photoshop



Pic11.

There now is a 8km x 8km Red target area that has a pretty accurate CO.



Pic12.

This was using the GMAP 17 zoom for accurate unit position. To now flesh out the surrounding areas, you can now use a general lower quality zoom factor to create and Underlay. In this example 13.



Pic13

After 10 minutes and 1680 tiles later the .png created is 212MB in size. Using the technique twice yields a 16.5MB image. Plus it appears that there is no shift in location.



Pic14.

RESULTS.

After adding the 13 zoom .png first as the underlay, and then adding the 17 zoom .png custom overlay. Some Ingame action screenshots to see if this all works and if it is necessary to convey the actual warfare being simulated.



Pic15.



Pic16.

Tomcat84 has shown an excellent technique for processing the transparency issue in his video. Although the resultant images might be better cropped further in to reduce dead space and thus image size. Plus he addresses the fact that underlay images of zoom less than 17 are shifted, the actual 17 zoom gmap capture are geographically correct. (Whew!) The zip size comparison may be for another thread.

I hope you get the idea behind the process, it can be applied to all graphics. Many thanks to Warfare Sims LTD, the Slitherine Group and Matrix games for another great simulation game.

Good Hunting.

Brassem.




< Message edited by brassem -- 4/4/2018 12:48:23 AM >


_____________________________

i7-3930K@3.2Ghz&H100liquid|ASUSP9X79Deluxe>X680/OC|32GBGSkillPC2400|2TBRaid0|Antec1200&1200WTruePower|ASUSGV278H-3D|SBX-FiT-Pro|TurtlebeachDPX21|Win7-64U
Post #: 1
RE: A guide to reduce your Custom Overlay file sizes. - 10/6/2013 11:37:04 AM   
Tomcat84

 

Posts: 1952
Joined: 7/10/2013
Status: offline
Would love to read this. if you PM me i will post the link for you?

(in reply to brassem)
Post #: 2
RE: A guide to reduce your Custom Overlay file sizes. - 10/6/2013 12:57:14 PM   
Tomcat84

 

Posts: 1952
Joined: 7/10/2013
Status: offline
That is unfortunate as I would very much like to know how to reduce the overlay filesize
Post #: 3
RE: A guide to reduce your Custom Overlay file sizes. - 10/6/2013 4:51:54 PM   
SilentHunter


Posts: 216
Joined: 9/29/2013
From: United States
Status: offline
me too

(in reply to Tomcat84)
Post #: 4
RE: A guide to reduce your Custom Overlay file sizes. - 10/7/2013 6:12:51 AM   
Tomcat84

 

Posts: 1952
Joined: 7/10/2013
Status: offline
Nice!!!! Looking forward to trying this. Also curious about part two as I've been wondering myself if there is a way to blend it in.
Also I wondered if it was possible to use jpg instead of png to reduce size but didn't seem to work
Post #: 5
RE: A guide to reduce your Custom Overlay file sizes. - 10/7/2013 6:51:01 AM   
brassem


Posts: 73
Joined: 10/2/2013
From: NE of YMML
Status: offline
Going to investigate further. The .png file format has some problems with transparency. I've found .jpg can causes some horrible graphics distortions if the compression is too much. I've never used .jpg ingame so I will report what I find.


_____________________________

i7-3930K@3.2Ghz&H100liquid|ASUSP9X79Deluxe>X680/OC|32GBGSkillPC2400|2TBRaid0|Antec1200&1200WTruePower|ASUSGV278H-3D|SBX-FiT-Pro|TurtlebeachDPX21|Win7-64U

(in reply to Tomcat84)
Post #: 6
RE: A guide to reduce your Custom Overlay file sizes. - 10/7/2013 7:40:15 AM   
Tomcat84

 

Posts: 1952
Joined: 7/10/2013
Status: offline
Maybe tga would work for transparency?

(in reply to brassem)
Post #: 7
RE: A guide to reduce your Custom Overlay file sizes. - 10/7/2013 12:34:04 PM   
chemkid

 

Posts: 1238
Joined: 12/15/2012
Status: offline
.

< Message edited by chemkid -- 4/25/2018 7:28:17 AM >


_____________________________


(in reply to brassem)
Post #: 8
RE: A guide to reduce your Custom Overlay file sizes. - 10/7/2013 9:35:32 PM   
JiminyJickers


Posts: 290
Joined: 10/4/2011
From: New Zealand
Status: offline
Thanks, very useful guide.

(in reply to chemkid)
Post #: 9
RE: A guide to reduce your Custom Overlay file sizes. - 10/7/2013 10:50:55 PM   
SilentHunter


Posts: 216
Joined: 9/29/2013
From: United States
Status: offline
Brilliant > Brassem < Brilliant

Thank you I was not able to use those huge files previously in Command, but can now using your guide. I'm wanting to convert areas the size of state of Florida in the United States, which Gmap will do at zoom level 13 but no higher due to limitations with GMAP unless you cut down on the size. Command would never load those files, I assume due to the sheer size 700+ MEG. Your process literally cut my 700 Meg file down to 32 MEG and command now loads it without issue. I was basically able to get half of Nevada converted at zoom 13 and loaded in game now which I could not do prior, being able to layer on top more detailed areas at zoom 15 and 17 is exactly what I was hoping for. Good job!

Now, my stretch dream is how do we get whole countries into command at zoom 17 in one shot !

< Message edited by SilentHunter -- 10/7/2013 11:24:38 PM >

(in reply to JiminyJickers)
Post #: 10
RE: A guide to reduce your Custom Overlay file sizes. - 10/24/2013 9:07:45 PM   
Tomcat84

 

Posts: 1952
Joined: 7/10/2013
Status: offline
This should really be stickied because it is awesome

(in reply to SilentHunter)
Post #: 11
RE: A guide to reduce your Custom Overlay file sizes. - 10/25/2013 9:19:02 AM   
brassem


Posts: 73
Joined: 10/2/2013
From: NE of YMML
Status: offline
Thanks guys,

If it is to be stickied, could the mods remove my wasted "10 posts before I can link an image" posts.


_____________________________

i7-3930K@3.2Ghz&H100liquid|ASUSP9X79Deluxe>X680/OC|32GBGSkillPC2400|2TBRaid0|Antec1200&1200WTruePower|ASUSGV278H-3D|SBX-FiT-Pro|TurtlebeachDPX21|Win7-64U

(in reply to Tomcat84)
Post #: 12
RE: A guide to reduce your Custom Overlay file sizes. - 10/25/2013 9:23:38 AM   
Dimitris

 

Posts: 13282
Joined: 7/31/2005
Status: offline
Done

And thanks!

_____________________________


(in reply to brassem)
Post #: 13
RE: A guide to reduce your Custom Overlay file sizes. - 10/25/2013 10:53:31 AM   
Tomcat84

 

Posts: 1952
Joined: 7/10/2013
Status: offline
You didn't actually sticky it though I think? lol

[edit] it is now :)

< Message edited by Tomcat84 -- 10/27/2013 1:28:15 PM >

(in reply to Dimitris)
Post #: 14
RE: A guide to reduce your Custom Overlay file sizes. - 7/15/2014 12:09:41 AM   
Rudd

 

Posts: 1501
Joined: 7/10/2013
Status: offline
Wow! I too had a hard time loading some overlay files and I've been reluctant to try this because of my cpu skill level but this is a really easy way to shrink'em.

for the .png
I'm using paint.net. To resize Image>Resize...> click "By percentage", enter 50%. save

for the .pgw
open with the notepad and double lines 1 and 4. save

It's that easy.

I wish I would of tried this sooner.

Thanks guys




< Message edited by Rudd -- 7/15/2014 1:10:17 AM >

(in reply to Tomcat84)
Post #: 15
RE: A guide to reduce your Custom Overlay file sizes. - 4/2/2016 6:09:01 PM   
darkhelix


Posts: 61
Joined: 3/26/2016
Status: offline
I have made several overlays for various missions.
Sometimes the map is offset by a small amount but enough that it appears 1cm offset with the border outlines in game.
I know that I can manually (tediously) correct this in the .pgw file but wonder why, if I give coordinates taken from the game, that the overlay is not a perfect match.
Does this have something to do with curvature of the earth or is it something else?
Thanks,
Toby


< Message edited by darkhelix -- 4/2/2016 6:10:55 PM >

(in reply to Rudd)
Post #: 16
RE: A guide to reduce your Custom Overlay file sizes. - 3/23/2017 6:12:03 PM   
AgustusGlue

 

Posts: 1
Joined: 3/23/2017
Status: offline
What a great option. I compress the image in Microsoft Publisher. That converts it from 960 dpi to 96 dpi. Then I just remove a zero from line one and four. It changed a 94 mb image to 1500 kb. It's still in color and still looks pretty decent. Good enough for targeting, anyway.

(in reply to brassem)
Post #: 17
RE: A guide to reduce your Custom Overlay file sizes. - 3/12/2018 7:39:55 PM   
Grouiiik

 

Posts: 1
Joined: 3/12/2018
Status: offline
Hi all,

I have modified GMap Net to adapt it to Command.

I can't post sites url yet, so :
it's on github
/Grouiiik/greatmaps/releases

New functions are :
Same Latitude and longitude format as in the game
BingSatelliteMap selected by default
You can choose a destination folder
Both generated files have the right extension
The image is automatically resize, with max size, and the Global Position data text file change accordingly !

I hope it will help you making faster overlays.

If you have advices, i will take them all !

And sorry for my english...

< Message edited by Grouiiik -- 3/12/2018 7:42:59 PM >

(in reply to AgustusGlue)
Post #: 18
RE: A guide to reduce your Custom Overlay file sizes. - 2/11/2022 1:57:21 PM   
ClaudeJ


Posts: 1213
Joined: 3/8/2006
From: Belgique
Status: offline
Hey there,

I'm still getting up to speed with CMO (with I'm having so much fun right now, it feels like catching up with an old friend).

Are custom overlay files still a thing in CMO ?

(in reply to Grouiiik)
Post #: 19
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Useful Material >> A guide to reduce your Custom Overlay file sizes. Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

1.967