Author Topic: New image tagging  (Read 2672 times)

0 Members and 1 Guest are viewing this topic.

Offline h1262216

  • Jr. Member
  • **
  • Posts: 85
New image tagging
« on: July 13, 2021, 05:35:32 PM »
For the next version, I'm working on a new way of providing tags for image packs (in this context, image could also be an animation)
The current plan is something like the following:
* The tags will be encoded in an xml file that is distributed together with the images or clips. This means that you can make the pack compatible with the older version by using file names as before.
* There is going to be a fuckton of different tags. The idea is to have a relatively comprehensive set of tags that can describe well what is happening in an image. The game can then choose based on the combination of tags which image to display.
* The choice of images by the game is then as follows:
  Each situation where an image is displayed has a certain (string) code, e.g. "arena-lose-beast" for losing a fight against a beast in the arena. Then there is a config file that describes which tags are relevant for thus image code.
  - There is first a primary tag, which must be a match (primary tags will be something like "fetish", "sex", "tease", "profile", "activity" I think, though that may change), otherwise an image is directly discarded.
  - Then it goes to a list of required tags, and for each of the tags it finds in the image, a certain value (may be negative if you want a tag to exclude an image) is added to the score of the image.
  - If the image score is less than 0, or less than the highest scoring image minus 100, the image is also discarded.
  - For the remaining images, we do the same thing with a list of preference tags, i.e. we calculate a score based on the presence of certain tags. The higher scoring images are then more likely to be selected. In this second phase, a few more tags will be considered, e.g. the game will add tags based on the girls clothes, items, stats, traits etc. Higher scoring images will then have a higher chance of being selected. (I will probably add that an image that has recently been displayed gets a malus, to preserve variety).

The reason for having this first, primary tag phase is twofold:
1) It allows to discared a large amount of image early on, and thus reduces the computation required considerably
2) The system is mainly tuned to work by reacting to the tags you want in your image, so if there were no primary tags, each image type would need to list a large amount of tags with negative scores. With primary tags, this is not really necessary I hope.

The main problem I see with a system like that is that it increases the effort needed to properly tag an image pack in the first place, as some of you are making gigantic packs
Please let me know what you think about this approach

Offline grishnak

  • Jr. Member
  • **
  • Posts: 77
Re: New image tagging
« Reply #1 on: August 06, 2021, 04:17:06 AM »
HAve you tried Pytfall or Brothel King? I think they used a multiple tag system with priorisation too.
What i tried in WM6 which worked as well was to simply add a new structure of image tags. That way all older image packs were still useable, the new ones only allowed for more customization (like clothing and more action tags). It went as follows:
I mainly added new "subtags" to existing tags. For example in profile you had the basic old "profile", then the images had additional strings added like "nude" and "dress" and "indoors" and "outdoors". Since the old game read the strings from the left and took numbers from the right, it worked to have names like "profile", "profilenude" and "profiledress". Same for actions and location based tags like "swimpool" and "swimbeach" or "bedpose" and "bedrest" etc.. Apart from making the filenames longer this only required to change the image handling priorities a bit and add the specialized calls in the job files. Still it has the main annoying work having to rename the extra files.
Do you think there is an option to use your method that gives files not based on file name, but rather the file directory structure (like "lab rats")? So you would have the main tags as directories, then the subtags as subdirectories? This would change the work from renaming and adapting each image file to simply moving them in the proper directory...and if something changes in the tag structure you simply rename the directory, not the whole batches of files.

Offline h1262216

  • Jr. Member
  • **
  • Posts: 85
Re: New image tagging
« Reply #2 on: August 12, 2021, 01:59:33 PM »
thanks for the reply.
Yes, I've actually downloaded the tagging tools for both pytfall and brothel kind when I started thinking about this problem :) I've also looked at the tagging at sites like danboruu, but the've got 1000s of tags, so even just looking at them all would take a lot of time.
I'm planning to skip using the file system altogether for determining the tags of an image, and instead have an additional xml / json file that contains the tags for all images in a directory. Filename based tagging would then be only a fallback if no such file exists. Then you can use the same pack for the old and the new version, by naming the files according to old tags but specifying the new tags in the xml file.

I've also started working on a demo implementation in python, though I haven't had much time recently. This has already revealed a few problems:
1) Positive-only selection is problematic (already described in the first post a bit): What I mean is that if you specify which image you want by a list of tags the image should have, you get many unwanted images that have additional tags (e.g. you ask for a "sex" image, and get "sex,bdsm" image which is probably inappropriate in the game context). Now, with just a few tags, you could just make your specification more precise (e.g. "sex" tag, but not "bdsm" tag) but with fine-grained tagging with would explode ("sex", but not "spanking", "tied-up", "gagged", ...), and would result potentially in a lot of work when a new tag is added. Thus my idea is to have a small set of coarse-grained tags (e.g. "BDSM", "SEX", "PROFILE", "ACTIVITY") and always restrict the search for images to ones with the correct primary tag. This would also cut down a bit on the amount of computation required to find a fitting image.

2)  Non-contradicting tags: For some rare (few image) tags, a common strategy of pack makes seems to be to tag pictures that do not actively contradict that tag. For example, for any "preg" variant of a tag, choose an image where you cannot see the belly. This has the disadvantage that if someone produces an add-on pack that actually contains these images, the "wrongly" tagged images will end up mixed in. Similarly, there are some softcore packs where the "sex" tag is applied to some non-sex images to ensure that category is not empty. Therefore, I'll probably give packmakers the option of providing a list of fallback tags for the image. Then the game would first try to find a matching image using "real" tags, if that fails it would add the fallback tags, and if that still fails it would look through the default images.

3) Tagging images with multiple people. This is not really a problem for girl packs, where you can argue that all the tags apply to the main girl, but for tagging the default/fallback images this is not so easy. So I'll maybe split the tags into image-level tags and character-level tags, and allow multiple lists of character-level tags for each image.

The really nice thing about a working fine-grained tag system is that once it is implemented, I hope that I'll be able to provide a tagger program that should be able to export the set of tagged images as a WM6 pack; Pytfall pack; BrothelKing pack and WM7 pack. That would be really nice :)

Offline h1262216

  • Jr. Member
  • **
  • Posts: 85
Re: New image tagging
« Reply #3 on: October 23, 2022, 03:02:59 PM »
I've made some progress in implementing new image tagging. You can try out the current tagger from here,
feedback is very welcome.

Compared to the earlier version I only posted on the discord, there are some improvements:

* Added creator, comment, and date fields to image packs
* Added a filter function to the tagger tool to filter images by file name
* Added `Creampie` image tag. Not yet used by the game.
* Tagger will autocomplete if there is only a single matching option left
* Tagger can autocomplete some presets, e.g. `lesbian` sets tag to `sex` and participants to `lesbian`

Unfortunately, I cannot currently login to discord, so please leave any feedback either here or on github.