Author Topic: <-- Archived --> *Image tagging concept  (Read 172046 times)

0 Members and 1 Guest are viewing this topic.

Offline rudistoned

  • Full Member
  • ***
  • Posts: 229
<-- Archived --> *Image tagging concept
« on: June 15, 2013, 06:54:50 PM »
Every game like PyTFall has to solve this problem: How can the game know which picture it should use to illustrate a scene? Several solutions are possible. For various reasons we decided to use tags to describe our images in a way the game can understand.

What are tags?


Tags are keywords, labels that describe the contents of the picture. A picture of Sakura running through the woods, trying to escape some evil monster, could have the tags "Sakura", "run", "afraid" and "forest" and a picture showing Tenten jogging on the beach could have the tags "Tenten", "run", "beach".

How are tags added to images?

Image Tagger (see release thread) allows to edit image tags in a graphical user interface. This tool will store the tags as XMP metadata inside the images.


How does the game learn which tags are on which image?

The game searches the directory tree starting at "pytfall/game/content/chars" for files named "tags.json". Those files contain a list of tags for every image and are read by the game.


How does the game decide which image should illustrate a scene?


The game knows which image has which tags. To find an image, the game uses a set of tags that describe the scene. For example, Aegis dancing with a nobleman in a bar could be described with the tags "Aegis", "dance", "aristocrat", "bar". Using these tags, the game looks for an image that has all of these tags and returns it.
Various more elaborate search methods are possible and could be used if necessary.


How can I add images to an existing character?

The character images are located in subdirectories of "pytfall/game/content/chars".
To add images to any of these characters:
1) copy your image files into the folder where the other images of your character are
2) find the "tags.json" file where the other images of your character are described. You can open the "tags.json" files with any text editor.
3) add entries similar to those you find in that file. Use only tags that are already there, or the game will not be able to use your new
images. Tags the game currently understands (yes, some of those are wrong; expect changes, its an early alpha):
0quest0, 0quest1, 0quest2, Aegis, Chie_Satonaka, Fuuka_Yamagishi, Hinata, Mitsuru_Kirijo, Naoto_Shirogane, Rise_Kujikawa, Sakura, Tenten, Tifa, Yukari_Takeba, Yukiko_Amagi, anal, battle, battle_sprite, bdsm, blowjob, combat, date, datebeach, death, ecchi, ent, group, haruhi, les, les0, mast, nude, profile, profileangry, profilehappy, profileneural, profileneutral, profilesad, quest, quest1, quest2, questangry, questhappy, questneutral, questnormal, questsad, rest, sex, shop, strip, tenticles


How can I add a new character?

1) The characters ressources are located in subfolders of "pytfall/game/content/chars". Create a new folder there and name it after your character.
2) Copy at least one profile image into the folder you just created.
3) Create a "tags.json" file and add all the images you copied into said folder. Look at the "tags.json" files of other characters to learn how they should look.
4) Create a "data.xml" file for your new character. Look at the "data.xml" files of other characters to learn how they should look.
« Last Edit: December 13, 2014, 08:08:04 AM by Xela »

Offline rudistoned

  • Full Member
  • ***
  • Posts: 229
Re: Image tagging concept
« Reply #1 on: June 15, 2013, 07:00:23 PM »
I selected the first images with the new system today (the code is available in tags branch on SF). Only profile images are currently selected via the new system.

What should happen if no image for this particular tag combination can be found? For example, haruhi has currently no strip images.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Image tagging concept
« Reply #2 on: June 16, 2013, 06:46:05 AM »
I selected the first images with the new system today (the code is available in tags branch on SF). Only profile images are currently selected via the new system.

What should happen if no image for this particular tag combination can be found? For example, haruhi has currently no strip images.

Right now it falls back on profile pics... I think this is a decent solution, at least for now.
Like what we're doing?

Offline rudistoned

  • Full Member
  • ***
  • Posts: 229
Re: Image tagging concept
« Reply #3 on: June 16, 2013, 06:54:18 AM »
Alright, I've implemented the same behaviour (profile pics as fallback) for the new system now. I don't see any problems currently, so I'll merge with master now. Any objections?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Image tagging concept
« Reply #4 on: June 16, 2013, 06:57:32 AM »
Alright, I've implemented the same behaviour (profile pics as fallback) for the new system now. I don't see any problems currently, so I'll merge with master now. Any objections?

If it work and doesn't break anything, be my guest. I'll take a look at it right after the merge.
Like what we're doing?

Offline rudistoned

  • Full Member
  • ***
  • Posts: 229
Re: Image tagging concept
« Reply #5 on: June 16, 2013, 08:11:37 AM »
I tested the elements I modified (next day reports, girl profile pics) and could not find any problems, so I pushed my changes into the SF master branch :-)
Please let me know if you run into any problems or have questions.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Image tagging concept
« Reply #6 on: June 16, 2013, 08:29:40 AM »
I tested the elements I modified (next day reports, girl profile pics) and could not find any problems, so I pushed my changes into the SF master branch :-)
Please let me know if you run into any problems or have questions.

Looks good, no question so far but it will take some time to figure out new code :)

No problems to run into either!
« Last Edit: June 16, 2013, 09:04:25 AM by Xela »
Like what we're doing?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Image tagging concept
« Reply #7 on: October 05, 2013, 06:42:56 AM »
What image tags are we going to use?

The once we use now obviously... however what other categories do we need/will we use?

First question we have to answer is how to approach tagging in itself, do we simply load an insane amount of tags into the game and try to describe every image in detail or do we agree on a limited selection of tags and expand it as we add new modules to the game (like slave training that will require new tags and images for example). Then we can start coming up with possible tags.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: Image tagging concept
« Reply #8 on: October 05, 2013, 08:24:17 AM »
Tags are useless if you won't use them in the code. That version of image tagger I tried recently had a lot of potentially useful tags already. What do you think of them?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Image tagging concept
« Reply #9 on: October 05, 2013, 09:00:29 AM »
Tags are useless if you won't use them in the code. That version of image tagger I tried recently had a lot of potentially useful tags already. What do you think of them?

0.2 right? The one Rudi released this week?

Yeap, that would work, but the trouble is that we could end up with a number of useless tags and for thousands of images, it means more loading time. But tags are really easy to add and remove through JSON.

From what I gather, you favor the maximum tagging off the bat approach?

In any case, we need to know CW's opinion on this one before making a decision, he was interested in tagging system as well.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: Image tagging concept
« Reply #10 on: October 05, 2013, 09:08:52 AM »
Not sure. Do we need tags for places, for example? Like beach, garden, forest, street, room? Some characters have them, some not.
I guess we could use more universal bikini tag instead of beach though.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Image tagging concept
« Reply #11 on: October 05, 2013, 09:15:57 AM »
Not sure. Do we need tags for places, for example? Like beach, garden, forest, street, room? Some characters have them, some not.
I guess we could use more universal bikini tag instead of beach though.

Places tags are amongst the most useful I think...
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: Image tagging concept
« Reply #12 on: October 05, 2013, 09:26:58 AM »
Well, for profile we could use happy/sad/neutral/angry(/afraid? some girls have it too). Also some profile pictures can be used for meeting in the city and some can't, so I guess we need meeting tag too. Or maybe we should use places tags for it instead?

Places we already have are city, park=forest (something with trees), room (any), bathroom (with girl taking a bath usually), beach(=bikini) won't hurt too. Some girls have casino and bar pics too.
What could we need in the future? Maybe dungeon too (any not bdsm).

Do we need any specifics for sex categories? Doggy/straight? Handjob/whateverjob?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Image tagging concept
« Reply #13 on: October 05, 2013, 09:42:32 AM »
Well, for profile we could use happy/sad/neutral/angry(/afraid? some girls have it too). Also some profile pictures can be used for meeting in the city and some can't, so I guess we need meeting tag too. Or maybe we should use places tags for it instead?

There is a mood dropdown window under character, we'll use that to specify the kind. Perfect for the city would be cleaned up images without the background, cleaned or no bg should definitely be a tag, as well as solid bg (one color)... we'll work on that as time permits. Once we have places, I can add events like girl/customer having sex in the garden if that's available and also prevent pictures of sex in nature or caves or beach popping up for brothel...

Places we already have are city, park=forest (something with trees), room (any), bathroom (with girl taking a bath usually), beach(=bikini) won't hurt too. Some girls have casino and bar pics too.
What could we need in the future? Maybe dungeon too (any not bdsm).

I think park/forest should simply become "nature", room = "building", I don't think there are many bathroom pics, maybe "onsen" category for any of that kind?

Future is unpredictable... slavetraining and dungeon are not even designed as concepts yet.

Do we need any specifics for sex categories? Doggy/straight? Handjob/whateverjob?

Yeah, It's a must, we'll be able to write better texts during jobs.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: Image tagging concept
« Reply #14 on: October 05, 2013, 10:00:34 AM »
Perfect for the city would be cleaned up images without the background, cleaned or no bg should definitely be a tag
I guess we already have quest tag/category for it? So we won't need to use profile pics for meetings then.

I think park/forest should simply become "nature", room = "building", I don't think there are many bathroom pics, maybe "onsen" category for any of that kind?
Ok, so nature, building, onsen, bikini=beach, street. If none of these, then the picture should be considered as universal.

Yeah, It's a must, we'll be able to write better texts during jobs.
We should decide what specifics we going to use for sex, anal, bj, group and bdsm (maybe mast?) then, even if we don't use bdsm yet.


What about nude catagory/tag? You avoided answering last time I asked you, so I'm asking again: how are you going to use it?  :)

We also need strip tag for strip category, I guess. Same for dance, maid, etiquette, beauty, battle for battle sprites, date, rest, shop.

What to do with pics where girl eating, playing some game or musical instrument, etc? Right now they are mostly in ent category.
« Last Edit: October 05, 2013, 10:06:23 AM by DarkTl »