PDA

View Full Version : Extension icon sprite sheet/atlas possible?



GEONE
April 17th, 2023, 20:47
Hello! I've been working on an extension which (among other things) adds over 2,000 unique icons (to be displayed on a buttoncontrol) and defines them all in a graphics_icons.xml file to give them a unique icon name. It works great, and doesn't take much time for the host to load a campaign using it, but the problem is when sending the filelist to clients that are connecting to the game, it takes over 22 minutes to "acquire filelist."

The size of the extension doesn't seem to be the issue, as if I combine all the icons into one big sprite sheet, it takes mere seconds for clients to connect, so the issue seems to be the sheer amount of images in the extension.

This lead me to wonder if it would be possible to define "bounds" for an icon in a larger image in the xml so that I can refer to individual icons on a larger sprite sheet/atlas. Would something like this even be possible in FG? If so, could anyone point me in the right direction? If it isn't possible, how might I go about mitigating this issue (aside from obviously purging the icons)? Any help would be appreciated, thanks!

Moon Wizard
April 17th, 2023, 21:19
The system is not really made for it to be used in that way, so there is no workaround such as sprite sheets or other optimizations.

* What's the purpose of making them into an extension of icon assets?
* How would a GM/player even be able to access them, since icon assets can only be defined/used by rulesets/extensions?
* If the GM/player would be interacting with them somehow, they should be graphic assets in the images/tokens area.

Regards,
JPG

GEONE
April 17th, 2023, 21:27
It is for a more robust version of this prototype concept I made a few days ago:

https://www.fantasygrounds.com/forums/showthread.php?77499-Showcase-of-Spell-Icons

In my attempt to give spells, weapons, and items unique visuals.

Trenloe
April 17th, 2023, 21:29
Hello! I've been working on an extension which adds over 2,000 unique icons (to be displayed on a buttoncontrol) and defines them all in a graphics_icons.xml file to give them a unique icon name. It works great, and doesn't take much time for the host to load a campaign using it, but the problem is when sending the filelist to clients that are connecting to the game, it takes over 22 minutes to "acquire filelist."
How is your extension packaged? Is it a folder in your <FG app data>\extensions directory? Or is it a .ext file?

GEONE
April 17th, 2023, 21:33
Currently a folder for faster testing and iteration, I'll try zipping it into an ext. If packaging it up as an ext makes it significantly faster to send to the clients, then that would be amazing.

Trenloe
April 17th, 2023, 21:47
I'll try zipping it into an ext. If packaging it up as an ext makes it significantly faster to send to the clients, then that would be amazing.
I can't test as I don't have an extension with that amount of graphics, but I think you'll find it probably will be a lot faster.

GEONE
April 17th, 2023, 22:07
It seems to have cut down the "acquiring filelist" time from 22 minutes to 17 minutes, but it increased the loading screen time from 30 seconds to 4 minutes, so overall not a huge improvement, and still not feasible for use. That's unfortunate.

Is there any way to dynamically include icons? or create icons from images in the campaign resource folders?

Trenloe
April 17th, 2023, 22:21
You can't dynamically assign icons.

Did you remove the folder from the <FG app data>\extensions directory and just have the .ext file present?

What filesize are each of the icons?

Please upload your logs from the player side after experiencing the long load time. Info on compiling the log files can be found in the Wiki here: https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/1242136781/How+to+Compile+Logs

Trenloe
April 17th, 2023, 22:29
If the extension is just for personal use, you could send the .ext file to the players before the session and they can install it locally.

GEONE
April 17th, 2023, 23:54
Did you remove the folder from the <FG app data>\extensions directory and just have the .ext file present?
Yes, I made sure of that.


What filesize are each of the icons?
They range from less than a kb to 2 kb each, all together they are about 20 MB. The file size isn't the issue though, as I can keep the files in the extension but remove the icon definitions (or replace all the icons and definitions with a large image of roughly the same size) and the issue doesn't occur. It's simply the sheer amount of icon definitions in the xml file that's causing the issue.


If the extension is just for personal use, you could send the .ext file to the players before the session and they can install it locally.
I was under the impression this didn't work. From some of my earlier research, I thought I read in a forum post that they would be downloaded from the GM regardless of if they have them locally installed. Maybe I was misinformed though, I'll give it a try.

GEONE
April 18th, 2023, 02:21
If the extension is just for personal use, you could send the .ext file to the players before the session and they can install it locally.

This worked really well. I moved all the icons and xml definitions to their own extension, zipped them into a .ext and sent them to my players. Took a minimal amount of time for them to join (like 30 seconds). Thanks!

Trenloe
April 18th, 2023, 15:01
This worked really well. I moved all the icons and xml definitions to their own extension, zipped them into a .ext and sent them to my players. Took a minimal amount of time for them to join (like 30 seconds). Thanks!
That's great to hear! :)

I wonder why the normal .ext coming from the GM had the issue - as the GM side should just send the equivalent of the .ext file to the players and then open it and process as if it was a local file. Weird.