All About The Cache

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
User avatar
Lord.Ashes
Dragon
Posts: 350
Joined: Wed Jul 03, 2013 5:58 am

All About The Cache

Post by Lord.Ashes »

I have a campaign that is fairly large due to a larger number of high resolution images.

I don't want to discuss the merits of using a image repository or adding assets as needed to decrease the size of my campaign file...lets just keep it at the fact that I don't want to use a image repository and I need all the assets present at once so that I can layout everything in advance.

My understanding is that when a client first connects to a host, it downloads all the assets from the host that are needed immediately. In my case, since almost everything is needed right away, this means it would load almost all assets. Since my Campaign file is 50mb+ now and will be closer to 100mb when I am done, this could be a lengthy process. However, my understanding is that when the assets are downloaded they are cached on the client side so that future use of the asset will not require download.

What I would like to know is what are the exact conditions for a host/client generating cached versions of the assets? Will simply hosting the campaign file generate these cached assets? Or are they only generated when a client connects to a host?

The player that I am going to be using this campaign with is currently living locally but will soon be moving (hence why I am MapTooling our game). This means I have a chance, before our campaign starts, to generate the cached versions of the assets so that when we actually connect over the internet, the client will not have to load these assets.

What can I do to generate these cached assets on the client side?

For example, as mentioned above, if I copy the campaign file over and open it on the client will this created the cached assets? And, more importantly, will these cached assets work when someone else is hosting the same campaign (i.e. when the client connects to my host that is hosting the exact same campaign)?

Or do I need to connect a client to my host machine, wait until the assets are loaded (and cached) on the client machine and then copy the asset cache directory to the other clients?

The goal here is to bypass the downloading of assets during the campaign. I guess I could have the player connect to my host the day before (or hours before) and download the assets but if there is a manual way that I can do this, I would like to know about it.

Thanks.
"We often compare ourselves to the U.S. and often they come out the best,
but they only have the right to bare arms, while we have the right to bare breasts"
The Right To Bare Breasts by Bowser & Blue

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: All About The Cache

Post by Jagged »

Not sure why you object to a repository, since it does exactly what you are after. I don't think you have to host it on the interweb. I think you can create it and your players can install it in their client.

Someone please correct me if I am wrong ;)

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: All About The Cache

Post by wolph42 »

Jagged wrote:Not sure why you object to a repository, since it does exactly what you are after. I don't think you have to host it on the interweb. I think you can create it and your players can install it in their client.

Someone please correct me if I am wrong ;)
yup. you can use dropbox to set it up. Else your are indeed down to, login an hour ahead.

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: All About The Cache

Post by Full Bleed »

Lord.Ashes wrote:My understanding is that when a client first connects to a host, it downloads all the assets from the host that are needed immediately. In my case, since almost everything is needed right away, this means it would load almost all assets. Since my Campaign file is 50mb+ now and will be closer to 100mb when I am done, this could be a lengthy process.
Just a clarification on this. When a client connects they download all the assets of the current map they connect to. Not the entire campaign.

So if you want more nimble connections, you could break maps into smaller sections.

And while it is somewhat random which map players will connect to, they will only be sent to a map that is "Visible to Players".
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: All About The Cache

Post by Jagged »

Full Bleed wrote: And while it is somewhat random which map players will connect to, they will only be sent to a map that is "Visible to Players".
Which is why on all campaigns I run I have a "cover page" map. This is usually just the world map as the players currently know it. Then start with that as the only player visible map.

User avatar
Lord.Ashes
Dragon
Posts: 350
Joined: Wed Jul 03, 2013 5:58 am

Re: All About The Cache

Post by Lord.Ashes »

Thanks for the responses so far but I'd like to make an observation. I got 4 responses overnight to my post and none of them actually addressed the questions that I was asking (i.e. how caching works). I even specifically wrote in the original post that I do *not* wish to discuss the merits of alternatives (such as an Image Repository) but would like to know about the caching feature. Only one posted response came close and that was to say that MapTool only downloads the assets that are required by the current map...but even that isn't really providing information about caching which was the topic of my inquiry.

No big issue...I'd rather get some responses than none at all :D

Having said that, I initially ruled out a Image Repository because hosting an Image Repository in cyberspace would not really solve my issue...it would just change the source from which the client (player) needed to download the images (i.e. from the repository as opposed to the host). However, someone suggested the use of a local image repository which seemed more like a desired solution. Ideally I would like to keep everything in a single campaign file but I'm willing to reconsider that if I can't find a better work around.

So for the moment let me diverge from the original questions in this post to consider a local image repository...

How does one use a local image repository? I mean I have added local image folders using the Add Repository feature to campaigns before but when such a asset is used, as far as I know, it then adds the asset to the campaign file. So the two questions that this leads to are:

1. How do I specify an image asset so that the asset uses a local repository reference as opposed to adding the image asset to the campaign file?
2. Will this work with tables?

Most of my tokens in the campaign make use of my N-State Framework which sets the token's image and portrait based on image tables.


With respect to the original post, can someone fill in the following details:

1. Under what conditions does MapTool cache assets in the asset cache? (e.g. as soon as an asset is used? only when a client connects to a host? etc)
2. What is the scope of assets in the asset cache? Are they only usable in that one session (I suspect not)? Are they only available in that campaign? Or are they available to all campaigns that use the exact same resource?
"We often compare ourselves to the U.S. and often they come out the best,
but they only have the right to bare arms, while we have the right to bare breasts"
The Right To Bare Breasts by Bowser & Blue

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: All About The Cache

Post by wolph42 »

I did read the op carefully and I did notice the remark, however I don't think there are many user active currently who can answer your question. Azh should know this but as you know he's occupied. And as you said: better to have some response then not at all

User avatar
Lord.Ashes
Dragon
Posts: 350
Joined: Wed Jul 03, 2013 5:58 am

Re: All About The Cache

Post by Lord.Ashes »

So in light of not getting the cache info any time soon ;-)

Does anyone know how to set up a table that would use images from a local repository (as was suggested by one of the earlier posts) as opposed to images embedded in the campaign file?

I'm gathering that tables images are normally embedded in the campaign file because most of my tokens use images from tables and my campaign file is large (i.e. if tables were normally by reference then my campaign file would be much smaller).
"We often compare ourselves to the U.S. and often they come out the best,
but they only have the right to bare arms, while we have the right to bare breasts"
The Right To Bare Breasts by Bowser & Blue

User avatar
Lord.Ashes
Dragon
Posts: 350
Joined: Wed Jul 03, 2013 5:58 am

Re: All About The Cache

Post by Lord.Ashes »

Okay...I would the following statement on RPToos Wiki...
To create a repository file, open your campaign in MapTool and go to File -> Export -> Campaign Repository File. This will create a zip file that contains the repository information.

Unzip the file. (This is very important! MapTool cannot use the repository if it remains zipped!) Inside should be a folder called "assets" and a file called index.gz. Upload both the assets folder and the index.gz file to your web storage. Make sure they are in the same directory. (Do not put the index.gz file inside the assets folder. It should be at the same level as the assets folder.)

Make a note of the URL for to your index.gz file. You can test the URL by typing it or copying and pasting it into your browser's address bar. If you have the address right you should see a page full of letters and numbers that won't mean much to you.

In MapTool, go to Edit -> Campaign Properties then go to the Repositories tab. Delete any links that are already there, then add the URL of your index.gz file.

Save your campaign. Now when clients connect to your server they will get the campaign files from the repository online instead of your PC.

If you make changes to your campaign file you will need to re-export the campaign repository file and re-upload it to your web space. You will not need to re-add the URL to the Repositories tab of the Campaign Properties unless you changed the location where your files are being kept.
From the text that precedes this information on how to create a repository, it says that hosting image resources on a web repository is in most cases faster than loading them from the host. So there should be a time saving even just using a web repository but if I can figure out how to reference a local URL then I should be able to make a local image repository (as was suggested in a previous post) which should be even faster.

I know that on Windows machines, in most cases, you can use a URL like file:///C:/Documents/Image001.png to get resources but my player will be playing on a Mac and I am not sure if this convention is a URL standard or just a Windows feature. I suppose I can also try just referencing the folder as a local reference.

If anyone knows the syntax for referencing local image repositories (as opposed to web URL based image repositories) your information would be much appreciated.
"We often compare ourselves to the U.S. and often they come out the best,
but they only have the right to bare arms, while we have the right to bare breasts"
The Right To Bare Breasts by Bowser & Blue

User avatar
Lord.Ashes
Dragon
Posts: 350
Joined: Wed Jul 03, 2013 5:58 am

Re: All About The Cache

Post by Lord.Ashes »

Full Bleed wrote: So if you want more nimble connections, you could break maps into smaller sections.

And while it is somewhat random which map players will connect to, they will only be sent to a map that is "Visible to Players".
Seriously? I haven't played much with multiple maps per campaign since I have only built one RPG campaign. Most of my campaign are ports of Card Games or Board Games to MapTools for the purpose of playing these games over the internet. Thus in almost all cases the entire campaign (card game or board game) is one map.

But it seems really odd to me that the map the players get connected to would be random. I imagine that if a GM creates a full campaign which many maps he would not want his/her player randomly being connected to one of the maps that will be used later in the campaign and potentially uncovering part of the Fog of War.

I would think there should be (although there probably isn't at this time) a setting when the GM starts to host a campaign which dictates that map that players start on.

Or am I misunderstanding what you mean by
Full Bleed wrote:somewhat random which map players will connect to
?
"We often compare ourselves to the U.S. and often they come out the best,
but they only have the right to bare arms, while we have the right to bare breasts"
The Right To Bare Breasts by Bowser & Blue

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: All About The Cache

Post by Jagged »

Lord.Ashes wrote:I even specifically wrote in the original post that I do *not* wish to discuss the merits of alternatives (such as an Image Repository) but would like to know about the caching feature.
I did read that, but I believe an image repository does exactly what you asked for. It does not have to be hosted anywhere. You can create the repository from your campaign file, distribute it to your friends and they can install it in their Maptool client.

User avatar
Lord.Ashes
Dragon
Posts: 350
Joined: Wed Jul 03, 2013 5:58 am

Re: All About The Cache

Post by Lord.Ashes »

Jagged wrote:
Lord.Ashes wrote:I even specifically wrote in the original post that I do *not* wish to discuss the merits of alternatives (such as an Image Repository) but would like to know about the caching feature.
I did read that, but I believe an image repository does exactly what you asked for. It does not have to be hosted anywhere. You can create the repository from your campaign file, distribute it to your friends and they can install it in their Maptool client.
The instructions for using MapTool Image Repositories that I found on Wiki describe the process for internet hosted repositories (i.e. you specify the URL of the repository). From the fact that you say it does not have to be hosted (i.e. can be local) there is obviously a way to specify the location as a local file system reference instead of a URL. Do you happen to know the the correct syntax for a local repository is? Or if I specify a folder it will automatically be used as a local reference repository because it is not a valid URL? Also, I would think that a relative local reference would be better than a absolute path since different clients will specify absolute paths differently (e.g. something like D:\Repositories\MapTool may work on a Windows client but would likely be unacceptable by a Linux client).
"We often compare ourselves to the U.S. and often they come out the best,
but they only have the right to bare arms, while we have the right to bare breasts"
The Right To Bare Breasts by Bowser & Blue

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: All About The Cache

Post by Full Bleed »

Lord.Ashes wrote:But it seems really odd to me that the map the players get connected to would be random. I imagine that if a GM creates a full campaign which many maps he would not want his/her player randomly being connected to one of the maps that will be used later in the campaign and potentially uncovering part of the Fog of War.
They are randomly connected to a map that is "Visible to Players". So if the GM didn't want to see them accidentally connect to a map to be used later in the campaign, just don't have the map visible yet.

But, yes, it would be a nice feature in MT to be able to set what map players connected to on start up. I'm sure that there is a quirky reason for the random connection... I just don't know what it is.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Post Reply

Return to “MapTool”