Jump to content
AL|EN

Mod metadata - brainstorming

Recommended Posts

5 hours ago, AL|EN said:

 

Weidu treat tp2 basename of setup-mymod and mymod as the same. But my mod installer app is not weidu so when I match mymod + .ini, it doesn't match for setup-mymod tp2 basename. I can add "detect mymod.ini and setup-mymod.ini but it makes the algorithm ineffective because it has to process 2x more detection checks at one step. Next, I would have to preform 2x more detection for mod config files etc.

If you expect that it would match, I can make such compromise but I really concern about performance when application is trying to scan 100+ mods.

That should take a fraction of a second, even on 100+ mods.

Share this post


Link to post
4 hours ago, Jarno Mikkola said:

How ? Aka, as you said it to be easy, give use the universally compatible code then... yes, I have low enough self-esteem to ask this.

I'm sure you're familiar with regexes enough, this is a simple case. The thing to realize is that reading from the disk several times is a bad idea, so read info should be cached. If I remember correctly, he's using powershell, which is OOP, so it can be done cleanly through the use of custom objects.

Share this post


Link to post
17 hours ago, CamDawg said:

My lone concern with removing setup- from tp2 names is whether it would affect MOD_IS_INSTALLED calls since they use the full file path.

So that was you concern all the time? Don't worry, it's working fine with or without 'setup-' prefix.

5 hours ago, lynx said:

Why change any checks, it's just one regex to remove the setup- prefix if it's present.

3 hours ago, DavidW said:

That should take a fraction of a second, even on 100+ mods.

Both true. My concern is: when Im thinking about "the same as tp2 filename", should I always account "with or without setup-" even for things which aren't weidu and there is no reason for such extra cases? I'm always in favor of more standardization but it won't be a big deal to handle.

 

Share this post


Link to post
1 hour ago, lynx said:

I'm sure you're familiar with regexes enough, this is a simple case. The thing to realize is that reading from the disk several times is a bad idea, so read info should be cached. If I remember correctly, he's using powershell, which is OOP, so it can be done cleanly through the use of custom objects.

Yeah, but I was asking on how you would do it, after all, you said you said you had an answer that you decided to be sufficient, so with that fox-tail to lure you into a trap.

Let's not forget the BWS (& crazy imp) that has a mod with *modname*-setup.tp2 file too, that it didn't make. Check out: "Sylmar Battlefield v1.0257"... and "Sandrahtot-setup.tp2" etc ... if you don't believe.

Share this post


Link to post

OK, I've reread this thread to try to understand what the potential issue is supposed to be.

- Alien originally proposed assuming that <mymod>.ini was a file with metadata in.

- I objected that it was dangerous to assume some ini file contained metadata unless the metadata was explicitly marked as such.

- My own suggestion for how to do this was to reserve 'metadata.ini' for metadata. 

- Alien preferred to mark metadata, within a .ini file, using a [Metadata] section header

- The concern is now: how does Alien's autoinstaller know which .ini file contains the metadata? Is it mymod.ini, or setup-mymod.ini, or something else?

If I've got that right, this is a non-problem. Metadata is unambiguously marked as such. So just look for the .ini file in the game directory and parse it. If there's more than one, parse all of them! The time cost is not a meaningful part of the overall install time.

Share this post


Link to post

@DavidW

Just to be clear: I'm not dealing with install time, im dealing with the 'scan extracted mods folder' time. But anyway, I got my answer: follow weidu "with or without setup-". Let's see how it will work. I've summarized everything some time ago at the wiki page but I'm still at the alpha stage.

Also, It's the first time when I see [Metadata] as file header. Current'y, it's [Mod] as a leftover from BWS which allows to simply copy <modname>.ini from BWS into the mod and that's it. It doesn't really matter anyway.

BTW: I rejected 'metadata.ini' filename proposal because it would be impossible to provide metadata for tp2-only like 'setup-ModA.tp2' mods which are located at the main game directory.

 

Edited by AL|EN

Share this post


Link to post

What's the point of a repo if you're just uploading exes though?

Share this post


Link to post

@lynxIt's the source for autoupdate, documentation (I prefer markdown files edited via VSCode). I'm still looking for a best place for my app or eventually I will create a site for it.

Edited by AL|EN

Share this post


Link to post

I can add support for translated metadata files. But what would be the best way (for modders and translators) to store translated metadata?

1. Via another ini sections:

[Mod-French]
Description = <translated>

single file but not very nice way to update it by various translators

2. Via separate metadata file

cdtweaks-French.ini and put there only 'Description = <translated>' keyword

Using separate files will be easier to maintain/update for translators, that one big file which modder would have to merge manually.

Edited by AL|EN

Share this post


Link to post

I'd rather not have my mod directory cluttered with lots of translations.

Why not have ini entries that point to the translation files? As in:

	[Metadata-translations]
	French=ini/french.ini
	German=ini/german.ini
	

Share this post


Link to post

What's the problem with a single file? I don't see how it would cause usability issues for translators.

Share this post


Link to post
On 1/22/2019 at 2:53 AM, DavidW said:

I'd rather not have my mod directory cluttered with lots of translations.

Understood. At the same time, I really want to have a design which require only one thing to do in order to include translated mod metadata: extraction to the mod folder and that's it.

On 1/22/2019 at 2:53 AM, DavidW said:

Why not have ini entries that point to the translation files? As in:


	[Metadata-translations]
	French=ini/french.ini
	German=ini/german.ini
	

 

I also need to cover tp2-only mods. There is no reason to define language names: for full language name, ISO names should be used like English instead of American and Spanish instead of Castelano. Beamdog use "ISO Language Code Table" and POSIX definition so we should follow it. There is no need to define the custom name for mod metadata because it's unnecessary work for modder/maintainer/translator and it can be avoided by defining it by specification.So ifthere is not reason to define custom language names and folder for metadata, how about something like this:

<tp2name-ISOLanguageName>.ini/JSONC/HJSON/JSON5/JSON
<tp2name-English>.ini/JSONC/HJSON/JSON5/JSON
<tp2name-French>.ini/JSONC/HJSON/JSON5/JSON

And as alternative for mods with mod data folder:

%MOD_FOLDER%\Metadata\<tp2name-ISOLanguageName>.ini/JSONC/HJSON/JSON5/JSON
%MOD_FOLDER%\Metadata\<tp2name-German>.ini/JSONC/HJSON/JSON5/JSON
%MOD_FOLDER%\Metadata\<tp2name-French>.ini/JSONC/HJSON/JSON5/JSON

Also, I can add requirements of specific file header:

[Metadata:French]
Name = Mod French Name
Description = Mod French Description

if it's gona be protected from false-positive detection. Will this be ok for you?

BTW: You keep using [Metadata] inside you posts so I must really be a name which hooked you up. I come to conclusion that the topic title has 'metadata', the purpose of the file is to provide metadata for mod so I'm replacing [Mod] with [Metadata] for mod metadata file specification.

 

On 1/22/2019 at 1:26 PM, lynx said:

What's the problem with a single file? I don't see how it would cause usability issues for translators.

If the design dictates that 6 different people with different OS, encoding and codepages will maintain one file, then it's asking for trouble when you actually have to maintain it/merge data etc. Except extraction into mod folder, nothing else should be required in order to add translated metadata for any language without possibility to affect other translations.

Edited by AL|EN

Share this post


Link to post

Come on, it's 2019, everyone is using unicode now. And the mods that have a safety against this are exactly the ones hosted in version control, which can be another motivator to use it.

Share this post


Link to post
1 hour ago, lynx said:

Come on, it's 2019, everyone is using unicode now. And the mods that have a safety against this are exactly the ones hosted in version control, which can be another motivator to use it.

You would be surprised how strong old habits are :happy: I wonder if there is a way to support single and multiple files at the same time. Let me think about it.

Share this post


Link to post

But you're literally defining specifications, there's no need to be stuck in the past. :)

Share this post


Link to post
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...