Module - Image Line of Sight Data

Generating Line of Sight (LoS) Data

If a module is exported from Fantasy Grounds Unity, then the Line of Sight (LoS) information will automatically be exported for that module.

Modules you build for personal use can use whatever LOS Style you want. Any module that is officially sold in the Fantasy Grounds Store or on Steam must follow the LOS Style Guide (linked below) in order to be accepted by SmiteWorks for distribution.

Link: Map Line of Sight Style Guide

Manual Image LoS Metadata Export

If you need to export the Line of Sight (LoS) metadata separately, this can be accomplished via right clicking on any layer in the image data panel of an unlocked image record, and selecting the Export Metadata radial menu option. This will create an XML file that should be included alongside the map graphic it should be applied to, with the same file name except for XML instead of PNG/JPG/etc.

As part of the community effort to enhance older FG products, you can provide any metadata files you create and manually export to the following thread. Please include the module product ID and let us know whether or not you add lights and LOS.

FGU Sharing LOS and Light Definitions

Manual Image LoS Metadata Export (Video)

Legacy - Preparing a FGC Module with LoS Data for use in FGU

Fantasy Ground Unity (FGU) can load Fantasy Grounds Classic (FGC) modules. However, FGC modules do not come with any LoS data, since that feature did not exist in FGC.

To add LoS data to an existing FGC module, the additional steps below will allow the developer to add the additional XML files that specify the LoS data for FGU without having to rebuild the module in FGU.

Part 1 - Creating LoS Metadata Files

  1. Create a new blank campaign in FGU and call it something like LOS - [FGC Module Name].

  2. Open your FGC Module within the new FGU campaign.

  3. Go to Library > Assets > Images and locate the folder for your module. Leave Assets window open.

  4. Open your Images & Maps campaign list from the sidebar. Leave Images list window open.

  5. Drag the map image asset that needs LoS onto to the Campaign Images folder. This will create a new image record in the FGU campaign for this asset.

  6. Unlock the image and set the following:

    1. Set the grid size and adjust the grid if necessary. This is important even for graphics that don’t have line of sight data since it is used to set the object scale.

    2. The image should be centered by default. Do not move the image around.

    3. Define all LOS. Please refer to the Map Line of Sight Style Guide

  7. Right click on one of the image layers in the image data panel when the image record is unlocked, and select the Export Metadata radial menu option.

  8. Save the XML image LoS metadata file with the same base file name as the asset image file, but with the .xml file extension.

Note: When metadata is exported, only LoS and lighting information will be exported; any points close to edges of image will be snapped to edge, and any toggle-able LoS features will be toggled closed.

Part 2 - Inserting LoS Metadata Files into FGC Module

  1. Make a backup of the original FGC module to a safe location.

  2. Extract the files from the original FGC module to a new folder using a zip tool such as the built-in Windows compressed file handling or 7-Zip. Note: You may need to rename the file to the .zip extension to use with built-in Windows zip tools.

  3. Copy the LoS XML metadata files you exported earlier into the new extracted module folder alongside the image file that they are meant to be linked with. (i.e. the files should be in the same folder and have the same name; just a different file extension (.xml vs .png/.jpg/…).) It should look similar to the following picture.

  4. Once all the LoS metadata files are in place, then use a zip tool to rebuild the updated .mod file. Note: If using the built-in Windows zip tools, you may need to compress to .zip file, then rename to .mod file.

  5. Place the updated module with the LoS metadata files into the FGU modules directory.

If you are re-exporting from FGU, you can do the following to auto-import the LoS into your campaign prior to export:

  1. Open the image record in FGU and unlock it

  2. Note that one of the layers is the one for the map 

  3. Find that same asset in your Assets window under "Campaign" 

  4. Drag that image into the Layers window. It will make a duplicate layer with the same image, but you should see the LOS indicator

  5. You can then delete the old layer that doesn't have LOS

  6. Re-export

Part 3 - Test Updated Module in FGU

  1. Create a new blank campaign in FGU and call it something like LOS TEST - [FGC Module Name].

  2. Open the updated module via the Library > Modules > Activation window from the sidebar.

  3. Open the Campaign > Images window from the sidebar.

  4. Open any of the image records that you updated previously to review the LoS in play.

Sample XML file

<root> <grid>on</grid> <gridsize>100,100</gridsize> <occluders> <occluder> <id>1</id> <points>14.4,-51.3,18.6,-36.3,25.1,-14.8,19.4,17.5,18.2,35.9,14.6,48.9</points> </occluder> </occluders> </root>