Skip to content

Latest commit

 

History

History
43 lines (35 loc) · 3.77 KB

IconExtraction.md

File metadata and controls

43 lines (35 loc) · 3.77 KB

Extracting Map Marker icons

Prerequisites and assumptions

Note

Map marker extraction is optional, as map marker images are already stored in the repository. You should only need to run this step if you believe the map marker icons have changed since a game release. The database summary will indicate if any new markers are used, but not if any marker images have themselves changed. The Image Asset Validator will also identify that all required files are present.

Process overview

Fallout 4 uses SWF (Flash) to power most if its UIs, this includes the map menu and markers inside.
This stage ensures Commonwealth Cartography has all of the required SVG images to render map marker icons if the user enables that setting.
We first extract the SWF menu files from the game, and then decompile those to find the stored map marker icons inside, then rename and move them, verifying all icons are accounted for.

Extracting the SWFs

Launch BAE and hit 'File' > 'Open File', navigate to your Fallout 4 installation path, and its data folder. Select the file Fallout4 - Interface.ba2.
Press 'extract' and select any temporary output folder. BAE should extract 100+ SWF files.

Extracting SVG sprites from the SWF

In your files extracted from BAE, under the interface folder, find the file MapMarkers.swf. Open this file with JPEXS. Some questions may appear, select 'Yes to all'.
In JPEXS, on the left hand side displaying the contents of MapMarkers.swf, select the sprites folder.
Under File > Export, select 'Export selection'. Ensure the file type is set as SVG, and the zoom is at 100%.
Press OK and select the output location as CommonwealthCartography\MapIconProcessor\extract\.
If errors appear, select 'Ignore All'. The bottom-left of the window will indicate when the extract has finished.
This should now populate a sprites folder filled with around 50 sub-folders all prefixed "DefineSprite".

Repeat the above again but for the file Pipboy_MapPage.swf. This will overwrite some but not all of the previously extracted icons.
Delete the extracted folder DefineSprite_69_MetroMarker as this conflicts with the correct version of the Metro marker.

MapIconProcessor

Now in CommonwealthCartography.sln, compile and run the MapIconProcessor project.
This is a small program whose job is to copy only the necessary map marker icon images, rename them suitably, and verify that all icons requested by the database are accounted for.
If there are any missing or unavailable marker images, this will be raised as an error in the console output, and additionally a file will be written to the repository to ensure it cannot be missed.
The MapIconProcessor accesses the database to identify which map markers are required, so you are required to have built the database in order to run it.
The processor will then use RegEx to find the map markers in their folders, rename them and copy them to the main Commonwealth Cartography GUI at CommonwealthCartography\CommonwealthCartography\img\mapmarker\

Next steps

You may wish to validate the exported images with the Image Asset Validator, or also optionally render the background images if not already.
Otherwise, you can now move on to development of the actual end-user GUI program, Commonwealth Cartography.