Cleaning up the Tile Cache

I can’t replicate that. Copies of already-tiled modules do not tile for me.

This is exactly what I’d expect to happen if you move a module while the Module Manager is open.

Ditto.

Not a copy of already tiled module. More a completely different module, just renamed to the same name as the tiled module. For ex modules abc and xyz. Tile abc. Move abc to somewhere else and then rename xyz to abc. abc and xyz do need to be different modules for different games.

This is exactly what I’d expect to happen if you move a module while the Module Manager is open

Doh. You are implying that if I move a tile folder while the module manager is closed then, when the module manger is then activated it will search for and find the moved tile cache? Sounds akin to disbelief occurring at this point. Vassal is great, but not god. Ditto for the next point.

That is the correct behavior. If you’re loading a module with no tile cache, one will be created.

Absolutely not. There’s nothing in Vassal which would do that.

If you move a tile folder, Vassal won’t be able to find it after that. Moving a tile folder won’t cause anything to break while Vassal is not running. What will cause things to break is if you move a tile folder while Vassal is using it.

enough. what I would like and what the system does will remain a moot point, but obsolescence reigns.

I confess I don’t understand what more you want.

I made clearing the tile cache much faster; that change will be in 3.6.11, which we aim to release in a few days. You still appear to want to be able to clear tile caches for individual modules. I stated the requirements which must be met for that, and that I would review a PR which does it if one is made. You now have everything I can give you: a description of our requirements, and an offer to review the code if someone does the work.

If you think our requirements cannot be met by any change that will satisfy you, please clearly state so. If you think they can, then it’s up to you to organize making the changes.

The ball is in your court.

You still appear to want to be able to clear tile caches for individual modules. I stated the requirements which must be met for that, and that I would review a PR which does it if one is made. You now have everything I can give you: a description of our requirements, and an offer to review the code if someone does the work.

Wrong. The subsequent conversation deals with the directory naming protocol. Nothing to do with your brilliant revamp of the clear tile cache solution. I am more than totally happy with the solution. I have never stated that I want to be able to clear individual module caches, except that if I do want to do this via windows explorer, the current tile directory naming convention is indecipherable.
I like to see directory names that I can actually understand what they relate to. 2fd3ccff000c13919fda14bb57218d636a800b87 is not a directory name, it is hexadecimal gobblygook.
If that same directory file actually stated ‘WiF CE Maps and Units Ver 3_291’ (with perhaps vmod), then I 100% know what module that tile directory is for. For me it is that simple. I do not want a hexadecimal name, I want plain english (or whatever language a player uses).
The last time I use hexadecimal (and octal for that matter) for programming was back in 1974.

If you’re not interested in clearing the tile caches for individual modules, then why do you care what the tile cache directories for modules are named? What do you intend to do with the information you’d get from those directories having human readable names?

I get to delete the ones I want to delete. A hexadecimal name tells me nothing. A name that corresponds to the actual module I want to remove the tile cache is logical and simplicity. See pics.


vassal tile folder

There are obviously more modules available in the Vassal window than there are tile caches. But which is which? I want to remove those older versions from the Vassal window and keep at least the current version +/- 1. The + being the developmental new version and the - the obsolete old version. I then also want to delete the concomitant tile cache, if it exists. (ps I do not physically delete old versions, I remove them from Vassal and send the files to another directory)

Yes, I can delete all that I want to delete. Select clear tile cache. and then go through the tedious caching tiles process for every version I would like to keep (for now). I say tedious as that what the tiling process is. The time it takes is, as far I can ascertain, dependent on a person’s PC processing ‘power’. For me that is enough time to make a cup of tea and a concomitant cigarette. Those with real grunt take a less.

And?

I’m obviously interested in clearing the tiles caches for individual modules.

Why else would I posit this?

Regardless, original proposal stands. Use ‘human’ readable names. To me, anything else is (this is where asinine raise its ugly head again, but I’ll not use that word) (how about) banal.

So ban me.

I have made plus/good and minus/bad suggestions/remarks/comments on this forum. Yep, some have been real bad. But some have been real good. Swings and roundabouts.

Using ‘human’ (people) friendly directory naming conventions is far more intuitive to the majority of your users, but also more aligned with the greater user community in the world. Using a hexadecimal based directory naming convention, to suit a select few, is contrary to the mass of human directory name conventions. Get with it. 99% go with ‘human’ names (my guess for 99%, but I am sure I am not that far off).

Oh, if removed for consideration and informed debated because I used a couple of ‘bad’ words, like asinine and banal, be advised that I rarely see the ‘your post has been binned’ until long after the expiry date for editing/amendment chance.

Still, all in all, you guys do damn well with what you have. Your progress from the near perpetual 3.2.17 (around there anyway), has been phenomenal. Your responses to user input ditto. I wish I was developing my Vassal modules now, knowing what I know now and the far, far greater capability of the current Vassal. I really look forward to Vassal 4. I also do not envy you with the task of porting those existing game modules to V4.

So you would be happy to have:

46616d696c792050686f746f73204368726973746d61732032303232

instead of:

Family Photos Christmas 2022

I know what my preference is.

The just-released 3.6.12 has the following item which might be of interest:

  • 12013: Reinstate removal of module tile cache when a module is removed from the Module Manager

From 3.6.12 onward, when you remove a module from the Module Manager and no modules are open, the tile cache for the removed module will also be removed.

With regard to changing the tile cache naming scheme, I will restate the requirements:

  • Tile directory names must continue to work after module file renaming or movement.
  • A tile directory must not be incorrectly found when a different module has the same filename as the one for which the tile directory was created.

If someone proposes a scheme which meets these requirements and someone does the work to implement it, I’ll review that work and consider it for inclusion in a future version. Neither of those someones will be me.

The first step is to propose a scheme that meets the requirements.

Noted that in notes for 3.6.12. Thanks.

I am still very much confused what you really mean with:

With regard to changing the tile cache naming scheme, I will restate the requirements:

  • Tile directory names must continue to work after module file renaming or movement.
  • A tile directory must not be incorrectly found when a different module has the same filename as the one for which the tile directory was created.

These requirements make no sense to me, at all. Please enlighten me. Perhaps an example or so by way of elucidation.

Examples:

If you have a module a.vmod and you rename it to b.vmod without altering it in any other way, then if it already had a tile cache, that tile cache should still be usable for it.

If you have a module c.vmod which is different from a.vmod and you rename c.vmod to a.vmod, then the new a.vmod should continue to use whatever tile cache it had before being renamed.

That is inherent within the module. One may change the file name, but unless you change the actual module’s info then Vassal accepts a rename as irrelevant.


Change one of those fields, will trigger a retile. Change a file name, without changing one of those fields will not. Suggest you try that for yourself.

Yes, the tile cache directory name for a module is currently the SHA1 hash of the module name and version separated by an underscore:

DigestUtils.sha1Hex(getGameName() + "_" + getGameVersion())

If you’re aiming to use module names instead of module filenames as tile directory names, then you have to contend with an additional constraint: Filesystems have rules about what constitutes a permissible path and what paths are equivalent.

There are both path length and character restrictions, and they vary across filesytem types. E.g., colons are not permitted in NTFS path components, but you’ll find an awful lot of module names which contain them. NTFS is case-preserving but case-insensitive, so you’ll also have the problem that “Some Module” and “some module” cannot both be children of the same directory. HFS+ and APFS decompose Unicode characters, which means that some paths which you would not expect to be equivalent are. A lot of filesystems have path length limits, and they’re not all the same.

Oh FFS. More gobbly gook. Your aims are met, why persist with extraneous errata. How about when saving a module everybody is presented with a pop up window that allows that person the input a name for that tile cache. That is what windoze does, so why not vassal? Jeez, all this toing and froing for what? Something that already exists within vassal re file saving and tile caching, or your somewhat dark personal preferences re the same.
Vassal is not just about you, the developers, it is also about the module developers and users. Guess which one has the greater number of people?
I’m very close to defamatory comments.

Wow. You’re really complaining about a developer who is working for free not being willing to put in extra work for something that you are literally the only person asking for? Do you not see how ridiculous your position is?

To put it simply; the current system works reasonably well for just about everyone (except, apparently, you), and the alternate you want would be much more prone to errors. Therefore, it would be silly to change it. Not to mention that version 4 will almost certainly use a completely new system, anyway; would you rather Joel spends his time completely ripping out and changing a currently working system in V3, or developing V4?

1 Like

If you generate directory names automatically, they must respect filesystem naming rules. I don’t have to go far into our module library alphabetically to find one which would be a problem: You simply cannot create a directory named 13 Days: The Cuban Missile Crisis on Windows. Dealing with this is not optional.

If you ask users to come up with tile cache names, hardly any of them will understand why you’re pestering them, and none of them will thank you for it. We would have multiple complaints within days of a release which did this.

Feel free to submit a patch, or organize somebody else submitting a patch. You have to convince me that what you’re proposing will work, not the other way around. I see little evidence that you understand what’s involved at this point. If it’s so simple, do it.

You do not get it, at all.
Joel and I are having an interesting and diverse conversation.
Your illusionary statement (and the alternate you want would be much more prone to errors) is just that -BS.
Can you explain how a different file naming system is more prone to errors? I sure as hell cannot.
What Joel and I have is difference in terminology. My tertiary education dates from the 1970’s. Joel’s tertiary education is, way obviously, post that decade.
My IQ, back then, was rated as 140+. I strongly suspect the Joel’s IQ is higher. He has the advantage of current tech, I do not have that. I do have experience and a claim to being an old fart.
I just cannot comprehend what Joel is stating. Perhaps I should just pass this topic to my sons. Both IT pros. Even then I suspect they would be somewhat lost.
Joel’s absolute, stated, needs are well met by vassal itself, with no mods required.
My want is miniscule, aka, a tile folder naming system that “I” understand. Not some hexadecimal name that has NO relevance to the module being tiled.

Finally. Do you contribute to the Vassal voluntary donation system? I do and have done so for a bit over a year. I donate $10 a month, which is really around $16 Australian due to exchange rates. She who must be obeyed has not, ever, questioned this donation. She is a good person.

Joel already explained the difference between the current system and the one you want, but I guess you didn’t understand.

The current system uses a hash of the module name plus the module version number to generate a filename that is guaranteed to be unique and valid for all file systems: it contains no characters that are illegal for any known file system, and is a fixed length, and therefore, will not go beyond the file system’s path length limitations (unless the tile cache is buried too deep in the file structure, in which case VASSAL modules won’t work at all).

On the other hand, module names can be practically any characters at all. You could name a module “*($&#^)(:JNGFHTIHJ:LK$%#@()” and VASSAL probably wouldn’t complain, but good luck creating a file by that name in any existing file system! Joel already gave a more realistic example: 13 Days: The Cuban Missile Crisis. This contains a colon, which cannot be part of a filename on any Windows system.

Yes, we could filter out all illegal/reserved/restricted characters, but you still have the issue of filename length. What is someone gives a module a ridiculously long name? Now, suddenly, you have a filename that may work on some systems (those where the tile cache is very shallow, such as C:\VTC (for VASSAL Tile Cache–I’m assuming the existence of an option to allow you to specify the exact path to the Tile Cache), but fails utterly on systems where the path to the tile cache is deeper, such as C:\Users\ridiculously long user name\Application Data\VASSAL\tile cache). How should we account for that?

About the only possibility then would be to arbitrarily cut the filename short, say at 20 characters. Now, what happens if you have 2 related modules with very long names, where the only difference is at the end, say, for example, Battles of the Napoleonic Wars: Waterloo: Day 1 and Battles of the Napoleonic Wars: Waterloo: Day 2? If you cut that off anywhere, the 2 names are now identical. How now are you going to differentiate the tile caches for these 2 modules?

In conclusion, the hash system is simple to program and has no exceptions to have to deal with; directly using the module names is fraught with possible problems that would need to be accounted for.

I thank you for donating to VASSAL, but donating is entirely voluntary and in no way gives you any more say in how VASSAL is developed than any other person.

1 Like