PDA

View Full Version : Sharing module files between FGU and FGC



brustmlj
August 17th, 2020, 02:05
I have created a large number of modules in FGC and I am seeing the are transporting pretty well to FGU. In my modules I place pins, place tokens on map, place encounter tokens on maps. I have used the module data.xml files very well to this extent and learned the supported xml tags from FGC.

In coming up to speed with unity two things are clear. It so far has understood what I have coded in my modules is recognized by FGU. The second is that if I use the same process I was using in FGC in FGU much different xml is produced. In general I do not have a problem with this but I do have some questions.

I would like to make modules that work in both FGC and in FGU. It seems this should be possible but there becomes special cases and so I will try an document the ones I see.

I see the where pins use to be in a shortcuts section with x,y coordinates. Now it seems each pin becomes a new shortcut layer with a matrix component for x,y. So it seems FGU can figure out where to put the x,y from the old format. I am sure the FGC does not understand the layer or matrix format. So if I want to have a module support both FGC and FGU I need to have both formats in my module file. A few questions arise. What happens in FGU if it has both formats and they have different positions? Another question would be how can I convert the matrix to an x,y set to ensure they are the same. Another use for this is that I want to move move module creation process to FGU and I want to be able to convert the matrix to x,y so I do not have to repeat the process in FGC.

Now it seems tokens placed directly on the map are a very similar situation. And a similar set of solutions would be used to solve for this.

Encounter tokens seem a different scenario. It seems that in FGU the encounter tokens which used to have a x,y component simply in the encounter now have both an x,y component in the encounter and a new layer and matrix in the image area. Again the question arises what happenes if the x,y and the matrix evaluate differently.

In general I am assuming FGC with simply ignore all the new layer information produced for FGU. As such it needs the x,y information for pins and tokens in the same old places it used to be.

For FGU the question remains what happens when the x,y and matrix are different?

And importantly can someone tell me how to convert a matrix to x,y?

Thanks

LordEntrails
August 17th, 2020, 02:41
To make modules compatible with both FGC and FGU, they need to be created in FGC. Things like pins will be updated to FGU format as needed when openeing in FGU.

No you do not need to use both formats in your modules, only use FGC formats and you will be fine, FGU will convert as needed.

No, FGC will not ignore FGU data formats, it will error out. Modules created in FGU can not be used in FGC.

Do not use ASCII characters above code #128, FGU will not recognize them because they are not compliant with the ISO standard FG ustilizes (FGC would ignore they were not compliant and allow and display them, FGU will not).

brustmlj
August 17th, 2020, 02:50
I guess I was hoping for too much. So I cannot go into my modules and add a bunch of new features like layers and line of sight and expect FGC to simply ignore stuff it does not understand. You are saying if I want a module to support new FGU features I have to create a separate module for FGC and and new one for FGU.

A much better support system would ensure FGC simply ignores XML blocks it does not understand. This would definitely make module creation much simpler.

Say levy I guess.

Still the question persists for me. Can someone please explain how to convert a matrix block to x,y coordinates? Additionally can someone explain why in FGU encounter token placement uses both x,y in the encounter and matrix in the layer.

At least if I could convert matrix to x,y and visa versa I could easily convert an FGU mod to an FGC mod.

Can someone explain what the 16 elements of the matrix component represent?

LordEntrails
August 17th, 2020, 02:55
There is the ability to add LOS to a module and have FGC ignore it. Check out the crowd source project sticky in the FGU sub-forum. I think it's detailed there. It's also detailed somewhere in the new/FGU wiki. I believe it ends up being an xml file with the map/asset name. But not sure.

No idea about the matrix elements. Could guess they are probably position, scaling, rotation? Not sure. Remember, FGU images can be composed of multiple image files. FGC can not. So it's not a simple conversion back to FGC.

brustmlj
August 17th, 2020, 03:10
As I understand if you create an xml file with the same name as the map file with LOS info in it. It is not quite the same and all the other new features like pins an tokens on maps. I would like to be using layers and features in FGU. I do not want to have to go through the whole token placement process in both FGC and FGU as it is already a time consuming process in FGC.

Any comment on why encounter tokens are in two places?

I suppose I can try to reverse engineer the matrix by seeing x,y generated in FGU and compare to the matrix. But it would still be good to understand the 16 components of the matrix.

Is there some other place to ask how the matrix component is composed?

I have not moved to using maps composed of tiles in FGU so maybe the conversion is a little simpler.

Thanks

LordEntrails
August 17th, 2020, 03:20
Give this thread time, let see if someone who knows the specifics jumps in.

brustmlj
August 17th, 2020, 03:34
Will do thanks

Sulimo
August 17th, 2020, 03:54
I did what you are attempting to do. There is no need to go converting the matrix data, or any other XML coding.

Basically the best practice if you want to be compatible with both is to create it in FGC.

From there you load the module that was created in FGC in FGU, and create the LoS data following the process outlined here (https://fantasygroundsunity.atlassian.net/wiki/spaces/FGU/pages/260440084/Developer+Guide+-+Extracting+LOS+Data+for+Modules).

I did the above, and except for a weird issue with the Dates (https://www.fantasygrounds.com/forums/showthread.php?60706-File-Creation-Date-issue-(Core-RPG)) on the files inside the .zip file, it worked fine.

I was able to test the new module (with LoS) in both FGC and FGU, and it worked just fine. FGU saw the LoS data, and FGC ignored it.

brustmlj
August 17th, 2020, 04:00
I was hoping this would be the case. What I was trying to avoid was to require using both FGC and FGU in the creation process. I am working towards a very similar process as you are describing. I am trying to eliminate the need to develop in both FGC and FGU. In fact I was hoping once I was confident in the process I could simply remove FGC and not have to duplicate the diskspace required for all the modules under both FGC and FGU.

I see how the process you are describing would work. I am hoping to optimize even more by simply programatically being able to convert the FGU data back to the FGC data.

Thanks.

Sulimo
August 17th, 2020, 05:28
I was hoping this would be the case. What I was trying to avoid was to require using both FGC and FGU in the creation process. I am working towards a very similar process as you are describing. I am trying to eliminate the need to develop in both FGC and FGU. In fact I was hoping once I was confident in the process I could simply remove FGC and not have to duplicate the diskspace required for all the modules under both FGC and FGU.

I see how the process you are describing would work. I am hoping to optimize even more by simply programatically being able to convert the FGU data back to the FGC data.

Thanks.

Sounds like that will be quite an undertaking to be able to do that programmatically. If one of the devs sees this they might be able to give you some insight.

However, the image files are radically different between FGU and FGC.

In FGC, images are pretty much just images.

In FGU, images can be lots of different things. They might have an LoS layer, or an effects layer, or any number of other layers. They can also be tiles, so a bunch of images stitched together (that is not possible with FGC except to do it in some other program).

I am pretty sure the formats are not backwards compatible from FGU to FGC, mostly because of the aforementioned layers that are available in FGU that are not available in FGC.


With the method I used, it is the same amount of time either way, it adds maybe 5 minutes total.

Create a new campaign in FGC, add story, items, npcs, encounters, maps, pins, etc.

Export the module.

Open the module in FGU, add LoS to the maps you want to add it to.

Extract the LoS data as per the Wiki article.

Add the LoS files to the module.

The one I did this way worked great. No issues whatsoever.



If you are concerned about drive space, FGU and FGC don't take up a bunch of space. If you only use FGU for the LoS stuff it will take up a lot less space.

FGU Install directory and Data folder (about 600MB):
https://i.imgur.com/hzbKUYy.png


FGU Install directory and Data folder (about 1GB, probably because I have some old campaign I don't need):
https://i.imgur.com/s73fJFN.png


If your concern is instead that you don't want the two programs interfering with each other, I would suggest using a VM. Drive space is cheap, and VMs are easy to setup. That is how I have it setup right now, and it works really well for me.

brustmlj
August 17th, 2020, 06:09
For those who might care in the future I have done some amount of trying to determine the matrix components. I see that it is a 16 element field. Of those fields I believe these are the components. If anyone knows more it would be great if it could be shared.

1 Scale x
2 (some part of rotation)
3 (unknown most often 0)
4 (unknown most often 0)
5 (some part of rotation)
6 Scale y
7 (unknown most often 0)
8 (unknown most often 0)
9 (unknown most often 0)
10 (unknown most often 0)
11 (unknown most often 1)
12 (unknown most often 0)
13 x
14 -y
15 (unknown most often 0)
16 (unknown most often 1)

Additionally it seems that the encounter tokens only require a layer to maintain current location and visibility types of information like fow. In other words it seems this info is more dynamic information and not used to initially place the token on the map. It would be good to understand if the encounter x,y is what is used to add a token to a map or whether a layer matrix will over ride it.

Additionally if anyone knows the meaning of the parentid and how to possibly calculate it automatically that would be interesting. I have seen it be a decreasing negative number from generation but I have also seen it jump all around in example xml files.

Thanks again

brustmlj
August 17th, 2020, 06:24
Well drive space can be a thing even these days. I have over 4.75 Gigs of module files I have created. Duplicating that would be 9+ Gigs. Keeping a backup on Drobox even more space and sync time.

Also functionally I don't want to be firing up fantasy ground all the time it already takes forever to load. So having to fire up FGC and FGU to accomplish a task is just a pain. I am not as concerned about the programs interfering with each other as much as I am about the maintenance and startup cost really. I do a lot of my module development without FG running and simply fire up fantasy grounds to run a game or build the map info needed for a module.

Building on my aspirations I look to a time in the future where I can actually have much larger maps in an FGU version. With this being the case and with my own carefully cultivated asset plans I should be able to possible create FGU maps with a grid of 300 and FGC maps with a grid of 150 and with the data already collected scale x/y to either map and have a single set of meta data automatically generate token and pin placement on either sized map. This understandably breaks the first goal of having a single module file. But the advantages may well be worth it.

I am not to far from this. It is really about understanding the xml definition a little more deeply.

Thanks for the ideas

Zacchaeus
August 17th, 2020, 09:40
If your modules are for publication and therefore will need to be compatible with FGC then the process is as described in Post #8.

If you don't need compatibility with FGC then you can create solely in FGU.

brustmlj
August 17th, 2020, 14:47
Well the reason I asked the question in the first place was to have a single module support both. That being said the process in post #8 is not the only way to create a module which supports both. It is a valid way but as I have described my module development process is a bit different and not fully based inside Fantasy Grounds. I think having a documented description of the fields in the matrix block and what they mean is greatly helpful. Playing with FGU and generating XML files can only get so far. The fields input in the layers windows do not directly map to the generated XML.

I will do my best to figure it our for myself but is seems the module xml definition could be better documented and only result in developer generating better FG mods.

Zacchaeus
August 17th, 2020, 14:58
I'm probably just misunderstanding what it is you require. In an earlier post you said you hoped to cut out FGC altogether and if that is the case then you can do that now; just create in FGC. As I said unless you need backward compatibility with FGC you can create everything in Unity.

brustmlj
August 17th, 2020, 14:59
I would like to cut FGC out of my module creation process. I am not looking to cut out FGC support in my modules.

Zacchaeus
August 17th, 2020, 15:02
I would like to cut FGC out of my module creation process. I am not looking to cut out FGC support in my modules.

OK, I did misunderstand what it is you require.

brustmlj
August 17th, 2020, 15:27
I muddied the water when I discussed using different resolution maps for FGU and FGC so I can see why it was not clear.

I basically have a module build process that builds and rebuilds all my modules outside of FG. I can change many things in a generic way and push a button to rebuild all the modules taking advantage of base level changes. Part of my process involved starting FG to do token placement, pin placement (now FOW generation) and taking the data from that process and feeding it back into the module build pipeline. I would rather only fire up one FG to do a lot of this.

I fully understand there are features (like FOW) that do not translate back to FGC.

But I do think things like pin placement, token placement and scaling, can be derived from FGU and applied to FGC.

brustmlj
August 21st, 2020, 17:26
I am currently having problems sharing map token placement between FGC and FGU. I have a map that I have placed a bonfire token on. In my module I have the following image definition

<img_map_theglassblower_sshrine_jpg>
<name type="string">Map - The Glassblower's Shrine</name>
<image type="image">
<bitmap type="string">images\Map - The Glassblower's Shrine.jpg</bitmap>
<gridsize>100</gridsize>
<gridsnap>on</gridsnap>
<shortcuts>
<shortcut>
<x>175</x>
<y>730</y>
<class>encounter</class>
<recordname>encounter.enc_theglassblowersshrine@DDEX02-05 Flames of Kythorn</recordname>
</shortcut>
</shortcuts>
<tokens>
<idcounter>1</idcounter>
<scalelock>0.75</scalelock>
<token>
<prototype>tokens\Bonfire.png@DDEX02-05 Flames of Kythorn</prototype>
<id>1</id>
<x>1351</x>
<y>351</y>
<scale>1</scale>
<orientation>7</orientation>
</token>
</tokens>
</image>
<locked type="number">1</locked>
<toolbar type="number">1</toolbar>
</img_map_theglassblower_sshrine_jpg>

This properly opens the map and places the token on the map scaled and oriented properly. When open in FGU the x,y placement is correct, the orientation seems correct. The scale is very tiny. I have tried changing the scalelock and scale parameters. Making scalelock 1 and scale 1.48 also displays the token properly in FGC but not if FGU.

In order for the token to be more properly place I needed to adjust in FGU which resulted in the following image xml in the moduledb file.

<img_map_theglassblower_sshrine_jpg>
<image type="image">
<allowplayerdrawing>on</allowplayerdrawing>
<grid>on</grid>
<gridsize>100,100</gridsize>
<gridsnap>on</gridsnap>
<brushsize>10,10</brushsize>
<layers>
<layer>
<name>Map - The Glassblower's Shrine.jpg</name>
<id>0</id>
<parentid>-3</parentid>
<type>image</type>
<bitmap>images/Map - The Glassblower's Shrine.jpg@DDEX02-05 Flames of Kythorn</bitmap>
<matrix>1,0,0,0,0,1,0,0,0,0,1,0,850,-550,0,1</matrix>
<locked>true</locked>
</layer>
<layer>
<name>tokens/Bonfire.png@DDEX02-05 Flames of Kythorn</name>
<id>1</id>
<parentid>-2</parentid>
<type>token</type>
<token>
<name />
<prototype>tokens/Bonfire.png@DDEX02-05 Flames of Kythorn</prototype>
<id>1</id>
<orientation>7</orientation>
<publicedit />
<visibility>mask</visibility>
</token>
<matrix>0.9716797,0.9698486,0,0,-0.9716797,0.9698486,0,0,0,0,1,0,1351,-351,0,1</matrix>
</layer>
<layer>
<id>2</id>
<parentid>-1</parentid>
<type>shortcut</type>
<shortcut>
<class>encounter</class>
<record>encounter.enc_theglassblowersshrine@DDEX02-05 Flames of Kythorn</record>
</shortcut>
<matrix>1,0,0,0,0,1,0,0,0,0,1,0,175,-730,0,1</matrix>
</layer>
</layers>
</image>
</img_map_theglassblower_sshrine_jpg>

So it seems in fact that pin placement work pretty well using the FGC format in the module. Token placement seems very much hit and miss. I have seen some token which are properly displayed in FGU but more often than not they aren't.

Finally I have tried placing the exact xml generated by the moduledb in the actual db.xml generated for the module. It seems no matter what I do the all layers information I try to place in the module is ignore and I get an empty map in FGU.

I am not making much progress here at all.

LordEntrails
August 21st, 2020, 17:43
Not sure if this is related to any of your issues, but I see you like putting spaces in names, make sure you have no double spaces anywhere, especially in file names.

As for token scaling, you might investigate what resolution your tokens are at as well as if your campaign options for lock token scale and automatic token scaling are on or off.

brustmlj
August 21st, 2020, 18:00
The campaign settings for Auto-scale to grid and Effect Icon Size are set to 80% and Standard in both FGC and FGU

brustmlj
August 21st, 2020, 19:06
I was able to solve the fact that the FGU module would not read any layer data put in the db.xml file of my zipped module by changing the version in the root xml statement at the top of the file.

<root version="3.0">

to

<root version="4" dataversion="20200528">

This makes sense to me. However I do see that the file currently running in FGC seem to be using

<root version="3.3" release="8|CoreRPG:4" integrity="64854e6a0c8835a913d17abc914519975495aedf">

Trying FGC with 4.0 root version seems to work ok.

I am still having problems scaling the tokens using a single db.xml file in my module. At this point the only way I can seems to get it to work is the legacy way with FGC and the new way with FGU.

brustmlj
August 21st, 2020, 19:22
After further investigation changing the root version to 4.0 in FGU prevent loading of the legacy image information present available in the FGC format in the module. FGC seems to operate normally so far with root version 4.0.

brustmlj
August 23rd, 2020, 03:54
Am am uploading some screen shots. This shots are from loading my module in clean campaigns in FGC and FGU. There are no module db files in the campaign directories. I need help to figure out how to scale tokens properly for FGU. It is not working. The image xml for the map loaded is:

<img_map_theglassblower_sshrine_jpg>
<name type="string">Map - The Glassblower's Shrine</name>
<image type="image">
<bitmap type="string">images\Map - The Glassblower's Shrine.jpg</bitmap>
<gridsize>100</gridsize>
<gridsnap>on</gridsnap>
<shortcuts>
<shortcut>
<x>175</x>
<y>730</y>
<class>encounter</class>
<recordname>encounter.enc_theglassblowersshrine@DDEX02-05 Flames of Kythorn</recordname>
</shortcut>
</shortcuts>
<tokens>
<idcounter>1</idcounter>
<scalelock>0.85</scalelock>
<token>
<prototype>tokens\Bonfire.png@DDEX02-05 Flames of Kythorn</prototype>
<id>1</id>
<x>1351</x>
<y>351</y>
<scale>1</scale>
<orientation>7</orientation>
</token>
</tokens>
</image>
<locked type="number">1</locked>
<toolbar type="number">1</toolbar>
</img_map_theglassblower_sshrine_jpg>

It also does not seems possible to build modules only for FGU. Setting things up in the campaign be can made to work but this cannot at this time be transferred to a db.xml file in a module and have that state be opened up properly as a default module state.
38736
38737

brustmlj
August 23rd, 2020, 03:55
Another example. The Big ship is embedded in the map. The little ship is a token so it can be moved around.

<img_map_stormgate_jpg>
<name type="string">Map - Storm Gate</name>
<image type="image">
<bitmap type="string">images\Map - Storm Gate.jpg</bitmap>
<gridsize>50</gridsize>
<gridsnap>on</gridsnap>
<shortcuts>
<shortcut>
<x>128</x>
<y>81</y>
<class>encounter</class>
<recordname>encounter.enc_9_stormgate@DDEX02-13 The Howling Void</recordname>
</shortcut>
<shortcut>
<x>128</x>
<y>128</y>
<class>table</class>
<recordname>tables.tab_windandsoundeffectstable@DDEX02-13 The Howling Void</recordname>
</shortcut>
</shortcuts>
<tokens>
<idcounter>1</idcounter>
<scalelock>2</scalelock>
<token>
<prototype>tokens\30350-Airship_5.png@DDEX02-13 The Howling Void</prototype>
<id>1</id>
<x>1401</x>
<y>276</y>
<scale>0.957143</scale>
</token>
</tokens>
</image>
<locked type="number">1</locked>
<toolbar type="number">1</toolbar>
</img_map_stormgate_jpg>

38739
38740

brustmlj
August 24th, 2020, 18:59
Here is an example with a map without a grid that also has a problem scaling tokens in FGU

<img_background_anappealtologic_jpg>
<name type="string">Background - An Appeal to Logic</name>
<image type="image">
<bitmap type="string">images\Background - An Appeal to Logic.jpg</bitmap>
<tokens>
<idcounter>20</idcounter>
<scalelock>12.4375</scalelock>
<token>
<prototype>tokens\Intellect 1 - Transmuter.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>1</id>
<x>150</x>
<y>950</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Intellect 2 - Diviner.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>2</id>
<x>200</x>
<y>1000</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Intellect 3 - Enchanter.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>3</id>
<x>250</x>
<y>1050</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Intellect 4 - Abjurer.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>4</id>
<x>300</x>
<y>1100</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Intellect 5 - Elementalist.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>5</id>
<x>350</x>
<y>1150</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Strength 1 - Avenger.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>6</id>
<x>620</x>
<y>950</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Strength 2 - Paladin.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>7</id>
<x>670</x>
<y>1000</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Strength 3 - Soldier.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>8</id>
<x>720</x>
<y>1050</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Strength 4 - Mercenary.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>9</id>
<x>770</x>
<y>1100</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Strength 5 - Myrmidon.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>10</id>
<x>820</x>
<y>1150</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Wealth 1 - Swashbuckler.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>11</id>
<x>1090</x>
<y>950</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Wealth 2 - Philanthropist.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>12</id>
<x>1140</x>
<y>1000</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Wealth 3 - Trader.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>13</id>
<x>1190</x>
<y>1050</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Wealth 4 - Merchant.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>14</id>
<x>1240</x>
<y>1100</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Wealth 5 - Guild Member.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>15</id>
<x>1290</x>
<y>1150</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Wisdom 1 - Monk.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>16</id>
<x>1560</x>
<y>950</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Wisdom 2 - Missionary.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>17</id>
<x>1610</x>
<y>1000</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Wisdom 3 - Healer.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>18</id>
<x>1660</x>
<y>1050</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Wisdom 4 - Shepherd.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>19</id>
<x>1710</x>
<y>1100</y>
<scale>10.0</scale>
</token>
<token>
<prototype>tokens\Wisdom 5 - Druid.png@CCC-ODFC02-02 Palace of the Efreeti</prototype>
<id>20</id>
<x>1760</x>
<y>1150</y>
<scale>10.0</scale>
</token>
</tokens>
</image>
<locked type="number">1</locked>
<toolbar type="number">1</toolbar>
</img_background_anappealtologic_jpg>

38777
38778

Moon Wizard
August 24th, 2020, 19:53
@brustmlj,

You've provided a lot of very detailed information; but can you take a step back and summarize what your concern/issue is?

The expectation is that any content to be used in both FGC/FGU must be created in FGC.

Regards,
JPG

brustmlj
August 24th, 2020, 23:46
I have many modules created for FGC I can use in FGU. In general this is working fine. I have encounter tokens and pins place on maps and these work when the module is loaded into FGU.

What does not work is placing tokens directly on a map scaling them and orienting them. What the screen shots, in this thread show, is that tokens placed on a map, scaled and oriented show up on the map in the proper location with the proper scaling in FGC. It does not seem to matter if there is a grid set or not. The proper size and orientation is depicted in The Screenshot FGC files. The Screenshot FGU files show what happens when the module is loaded in FGU. Location and orientation appear to be correct but the scale is all wrong. The screenshots are from the same modules being loaded in a brand new Campaign both for FGC and FGU.

The above is what I am looking to make work in the short term.

Below is longer term troubleshooting and development I have been working on.

While trying to resolve the issues with token placement I attempted to create a module with the xml syntax for FGU. I realize this is a completely different image syntax and would only work with FGU. Even working only in FGU and applying the new xml syntax I could not build an FGU module with tokens scaled and placed in the proper location on a map. I could get a map setup properly. I could remove the moduledb xml and see the default behaior return. Putting the moduledb back the token properly placed, oriented and scaled. I could not put the same xml from the moduledb file in a db.xml in a module and product the same behavior. Even with xml directly copied from the moduledb I could not get tokens placed, oriented, and scaled properly. Actually I could not even seem to get the base map placed properly when opening a module.

To this end I think the tiling and layering functions of FGU are great. I would like to build modules (obviously for FGU only) which use the image layers more extensively. Is this going to be possible when FGU officially releases? It does not seem to be possible to replicate the functionality of the moduledb file created in FGU into a db.xml for a modules to be loaded by FGU?

So as a second request I am looking for an outlook on when modules will be able to be built with the FGU xml syntax for images. I fully understand the process for adding occluders to a separate map.xml and adding them to a FGC modules. I have this working. I am talking about using more of the layer features in FGU within a module.

Thank you for your attention and assistance.

Moon Wizard
August 26th, 2020, 05:54
At this time, there is no plan to allow modules to be built within FGU, and useable within FGC. Also, tokens are not exportable with maps (neither in FGC nor FGU); so the expected usage for placing tokens on maps is to use encounters for pre-placement.

We already have our hands full with getting FGU released; as well as lining up the next set of features after that. (such as vision and lighting)

Regards,
JPG

brustmlj
August 26th, 2020, 14:36
I did not in my request ask for FGU content in FGC. I ask for the ability to build a module using FGU features for FGU. Additionally I did not request for any changes in the export process. There are other ways to build modules than simply export. What I asked for was the ability to build a module with tokens placed on a map scaled and oriented properly. This is not about token placement for encounters. As can be seen by the screen shots I have provided include puzzle placement of token without a grid, bonfire placement larger than any npc size, magical effect placement. I also use it for things like covering hidden doors, placing huge vehicles on a map that can be moved around. All of this works properly in FGC. It does not work for a module built for FGC in FGU.

The tokens and maps I am using I have fully purchased from sources external to fantasy grounds. I am not pulling assets from within fantasy grounds therefore I do not need them exported from fantasy grounds. Additionally I am building my stories, encounters, random encounters, tables, NPCs, and everything else outside of fantasy grounds.

LordEntrails
August 26th, 2020, 16:42
...There are other ways to build modules than simply export. What I asked for was the ability to build a module with tokens placed on a map scaled and oriented properly. This is not about token placement for encounters. ...
This is great that you have a way to do this in FGC. What I believe Moon is saying is that this behavior has never been supported. Its not something that in the near future they have the resources to implement.

There are some similar ideas on the Wish List. You may wish to review them and vote, and if they don't meet your needs then go ahead and add a new idea;
https://fg2app.idea.informer.com/proj/?ia=134089
https://fg2app.idea.informer.com/proj/?ia=134280

brustmlj
August 26th, 2020, 17:47
Yes neither of these ideas is related exactly to what I am saying. The tokens I am talking about are not related to any NPC objects and thus have no relationship to the combat tracker.

I do not agree that this behavior has never been supported. This behavior is defined in the XML format. You can place tokens on a map with XML, they can be scaled, they can be oriented. This just works in FGC. It may be proper to say that it is not supported and not planned to be supported in FGU but saying it is not supported in FGC is not true.

The use cases I have detailed I think are very important for Fantasy Grounds today. Some of them may be solved in different ways in FGU by using layers or other FGU features. I am fine with the answer that FGU may in fact solve this differently. Related to that though my second request was how do I build modules for FGU only which support maps, layers, tokens, pins, etc. My attempts to do this do not work at this point as I cannot seem to get the main map positioned properly using on FGU XML.

It seems to me anything that Fantasy Grounds can do in a campaign related to map preparation should be able to be duplicated in a module. I am not looking for a way to export art assets inappropriately to make my own modules, as I have said I have purchased or created all of my art assets.

LordEntrails
August 26th, 2020, 19:05
There is a difference between what works and what is supported. For instance, ASCII characters above #128 work in FGC, but they were never supported. There have been many things that work or can be done with FG that the developers don't support, but they have never been opposed to the community doing or using those things. As long as the community knows that if something breaks, SmiteWorks can not be responsible for fixing it. Hence this is how all the community extensions work.

Moon as said, everything that can be done in a module is NOT supported in module export. (Token placement on a map and image masks are two that have never been supported). It doesn't mean that creative folks like you can not figure out a way to make it work, but that SmiteWorks has not intentionally developed that functionality to be available and if it does or does not work it is on the community member to resolve.

All that said, if you want them to support this function, add it to the wish list. Then put a link to it in this thread so that other folks who want the function can also vote on it. Then when SmiteWorks does their periodic increment planning, they can use those ideas and votes to help decide what their priorities are.

brustmlj
August 26th, 2020, 19:22
I guess this is part of my point. I am not asking for this to be supported in export. I understand it not supported in export. But it is supported in a module. And if is supported in a module in FGC I think it should be supported in FGU. If there is a clear definition somewhere of all the features supported in a module, plus those defined in XML but are not supported, I have never seen this.

LordEntrails
August 26th, 2020, 20:11
There is no list. The lead developer has stated in this thread the capability is not supported. If you want it supported, add it to the Wish List :)

brustmlj
August 26th, 2020, 21:52
I guess I am being a bit dense here. I have not heard the main developer say that token placement, orientation, and scaling is not supported in a FGC module. What I read in moon wizards reply is that tokens export is not supported and never has been supported. I accept this.

Since FGU is not officially release I supposed nothing it officially supported in an FGU module at the moment.

If moon wizard states token placement, orientation, and scaling are not supported in an FGC module I guess I will have to accept that and move on.

If it is supported in an FGC module (which it definitely works today). Then it should be supported in FGU. We know it does not work in FGU (as documented by my screenshots). I would hope it does not become we don't plan to ever make it work in FGU with the FGC syntax and therefore we simply say we never really supported it in FGC.

To that end I am also content with the answer this will not work until we fully move to FGU and this will be solved in a new way for FGU (without backwards compatibility to FGC). This is ok for me too.

Moon Wizard
August 26th, 2020, 22:02
While they may or may not work, token placement/orientation/scaling on images is not exported by the standard export procedure nor officially supported at this time. We currently have no plans to do so; since we don't have the resources right now.

If you are making FGU specific modules, I would suggest using image layers instead of tokens to set up solutions that involve moveable pieces.

Regards,
JPG

brustmlj
August 26th, 2020, 22:53
Ok I accept this is not supported at this time. I will try to get layers to work in an FGU only module.

Is it appropriate to open a new thread to discuss problems building a module with map layers in FGU at this time or will that also simply be noise to you guys at the moment? I have yet to be able to make an FGU module with a map with token, shortcut, and image layers work at this point. I will endeavor to make that work and move on. Thank you all for you attention.

I am sorry if this have taken you away from moving FGU forward.

Moon Wizard
August 26th, 2020, 23:05
Image layers and shortcut exports should work fine. Tokens are not exported; and thus not going to be officially supported in a module. Definitely post if you have issues with exports of image layers and/or shortcuts. We definitely want to be prepared as our user base and DLC developers migrate to FGU.

Regards,
JPG

LordEntrails
August 27th, 2020, 00:08
Is it appropriate to open a new thread to discuss problems building a module with map layers in FGU at this time

I don't see that Moon answered this, I don't see any problem starting a thread to try and figure out how to do this. Normally I might suggest the Workshop, but also in the FGU forums are probably appropriate too. Someone else might have a thought on that. I would probably go the Workshop route, as I think folks there are going to more technically inclined/aware.

brustmlj
August 27th, 2020, 19:17
Thanks all

brustmlj
August 31st, 2020, 04:10
To those who may care I have worked through a programmatic solution to the issues I raised. I have been able to create FGU only modules using the new FGU imaging XML format. Additionally I have been able to create a way to generate the FGU modules directly from the input information available in a FGC mod. This was a painstaking process and it is multi-step which I will list here.

The solution revolves around being able to generate the matrix elements for the various different types of layers. The first type of layer is a base image itself. The base image layer placement turns out to simply be related to the dimensions of the base image. Once the image dimensions are found the following Java function can build the needed matrix string.

public buildMatrixForModule(Dimension iDimension) {
Double width = iDimension.getWidth() / 2;
Double height = iDimension.getHeight() / 2;
return "1,0,0,0,0,1,0,0,0,0,1,0,"+width.toString()+",-"+height.toString()+",0,1";
}

By setting the base image matrix correctly all map token placement already available in an FGC mod will directly apply to the FGU mod. Pins are also very straightforward. Simply using the existing x and y coordinates can build the proper matrix string. The Java function below provides an example of how.

private String buildMatrixForPin(String xPin, String yPin) {
return "1,0,0,0,0,1,0,0,0,0,1,0,"+xPin+",-"+yPin+",0,1";
}

Token scaling, orientation and placement were the hardest nut to crack. I have created the Java function below for creating matrix components based on the FGC parameters available. This function has been successful in creating matrix strings that work form both FGU token and image layers. I have found that when a image is to be interacted with by player such as a vehicle, puzzle piece, or other object the characters should be able to move it is best to make a token layer. One thing I could not solve when using token layers was how to ensure the tokens appeared below any tokens added by inserting encounters to the combat tracker. The token layers always seemed on top. Image layers seem best for things which DMs should move like hidden door coverings, trap covers, environmental pieces, etc. Vehicles are a prime candidate which it would be nice to make tokens that the characters could move but end up being images so they are not always on top of character tokens. Any ideas in these areas are appreciated. Below is the Java function which can take the FGC input and build the needed FGU matrix. Part of the most interesting debugging resulting in the scale parameters interactions with the 45 degree orientations. All in all the function is meeting all my use cases without warping the image. I am still learning on how the matrix object can be used to warp the object.

private String buildMatrixForToken(String scalelock, String scale, String orientation, String tokenx, String tokeny) {
Double tmpScale = 1.0;
Double one = 0.0;
Double two = 0.0;
Double three = 0.0;
Double four = 0.0;
if ((scalelock != null) && (!scalelock.isEmpty())) {
tmpScale = tmpScale / Double.valueOf(scalelock);
}
if ((scale != null) && (!scale.isEmpty())) {
tmpScale = tmpScale * Double.valueOf(scale);
}
if ((orientation == null) || (orientation.isEmpty())) {
one = tmpScale * 1.0;
two = tmpScale * 0.0;
three = tmpScale * 0.0;
four = tmpScale * 1.0;
} else if (orientation.equals("1")) {
one = tmpScale * 0.7;
two = tmpScale * -0.7;
three = tmpScale * 0.7;
four = tmpScale * 0.7;
} else if (orientation.equals("2")) {
one = tmpScale * 0.0;
two = tmpScale * -1.0;
three = tmpScale * 1.0;
four = tmpScale * 0.0;
} else if (orientation.equals("3")) {
one = tmpScale * -0.7;
two = tmpScale * -0.7;
three = tmpScale * 0.7;
four = tmpScale * -0.7;
} else if (orientation.equals("4")) {
one = tmpScale * -1.0;
two = tmpScale * 0.0;
three = tmpScale * 0.0;
four = tmpScale * -1.0;
} else if (orientation.equals("5")) {
one = tmpScale * -0.7;
two = tmpScale * 0.7;
three = tmpScale * -0.7;
four = tmpScale * -0.7;
} else if (orientation.equals("6")) {
one = tmpScale * 0.0;
two = tmpScale * 1.0;
three = tmpScale * -1.0;
four = tmpScale * 0.0;
} else if (orientation.equals("7")) {
one = tmpScale * 0.7;
two = tmpScale * 0.7;
three = tmpScale * -0.7;
four = tmpScale * 0.7;
}
return one.toString()+","+two.toString()+",0,0,"+three.toString()+","+four.toString()+",0,0,0,0,1,0,"+tokenx+",-"+tokeny+",0,1";
}

End result I could not make a single module to support FGC and FGU. I can, however, from the same input data generate both FGC and FGU modules. This is a big win for me. I am hoping maybe this helps someone else.