Jump to content

Syntax for 1.1 part tagging?


awang

Recommended Posts

For example, here are the tags for the LV-909 Terrier:

    tags = lander orbit propuls rocket (terrier vacuum

What is the opening parenthesis before "terrier" supposed to mean? I've seen it in other parts for other tags, too.

I *think* I understand how the tagging system works otherwise (matching words or start of word). Are there any other features I may have missed?

@Arsonide

Edited by awang
Link to comment
Share on other sites

The search is split up into individual words, and then each individual search term is compared against every tag in the part. Every term in the search needs to be matched to at least one tag using one of ten algorithms for the part to be matched.

There are many tags that match in one direction, from the search term to the tag, or the tag to the search term. There are also those that go in both directions, which we use most of the time for flexible searches. Having access to all of these algorithms helps avoid collisions in searches without having something as slow and complex as regex. Here's the gist of them...

  • ? : The tag and the search term need to be exactly the same.
  • [ : The search term starts with the tag.
  • ] : The search term ends with the tag.
  • { : The tag starts with the search term.
  • } : The tag ends with the search term.
  • ( : Either the search term starts with the tag, or the tag starts with the search term.
  • ) : Either the search term ends with the tag, or the tag ends with the search term.
  • < : The search term contains the tag.
  • > : The tag contains the search term.
  • No Symbol : Either the search term contains the tag, or the tag contains the search term.
Edited by Arsonide
Link to comment
Share on other sites

There are also "auto-tags" applied to every part at runtime, based on their characteristics. This is why on some parts you see obvious words missing from the list of tags. The auto-tags are there so that parts added via mods, or new parts, are immediately searchable to a mediocre extent before the modder and/or developer even opens up notepad to tag them. :D If they are modified or updated, their auto-tags shift with the modifications. I'll list the auto-tags here for each part for the sake of completeness.

Every word in the part's title and manufacturer is auto-tagged, but with the bidirectional "starts with" algorithm "(". The reasoning there is that these words were not initially created with tagging in mind, and when we use contains, they cause a ton of collisions that you wouldn't normally expect, making searching a pain.

We auto-tag parts with several size related words based on their bulkheadProfiles as shown below...

  • 0.625m : 0.625, )mini, small, tiny, little, micro
  • 1.25m : 1.25, FL-T, regular, standard, average, medium
  • 2.5m : 2.5, huge, jumbo, large, big
  • 3.75m : 3.75, enormous, massive, gigantic, giant
  • Surface Attached : surface, attach

Additionally, if a part is only ever surface attached, as in that is its only bulkheadProfile, we tag it as "radial" automatically. There are a few extra things we tag automatically...

  • Crossfed Parts : cross, feed
  • Parts with crew capacity and a command module : (crew, (mann, kerbal
  • Parts with no crew capacity and a command module : (uncrew, (unmann

You will notice in many places that we have partial tags in place, like "unmann" or "statio". This is generally so we can either dodge a common collision (station, and ion), or to match multiple words with one tag. Consider the "elect" tag on batteries, which matches both "electricity" as well as "electrical". Adding more tags does come with a cost in speed, however small that cost may be. More tags means slightly longer searches. The delay that a single tag might cause is insanely menial, and nobody will ever actually notice it, but I'll take a bit of optimization where I can get it. :P It's the same reason we avoided regex. With this many tags and parts it chokes the game up for a full second or two after every search.

Edited by Arsonide
Link to comment
Share on other sites

  • 1 year later...

Hello all,

reviving this thread intentionally because it is perfectly on topic. I try to figure out, why some parts are just not show up on the editor.
To have a minimal setup, I have just installed MKS 0.55 (because they are well tagged) on KSP 1.4.1. And took the Duna_Agriculture part into testing.
One can see the original title+tags below and in a 2nd run I removed special/wildcard chars from the title and tag fields, which has not changed anything.

From what I read above, searching for "Duna" should find it. Also searching for "MKS", as it is a tag and also it starts with MKS.
But with "Duna" you didn't find anything at all, with "MKS" I find some things, but definitely not all parts which names are beginning with MKS.

So I wonder, is this syntax still correct? If yes, why it didn't find the tag Duna and why it didn't find the auto-tag name beginning with MKS?

Anyone having an idea?
 

Spoiler

title = MKS 'Duna' Agriculture Module
manufacturer = USI - Kolonization Division
description = This module brings more advanced farming techniques to your colony.  While it's own space is limited, it can take advantage of other more expansive modules to help replenish your supplies through a variety of agriculture options.

tags = USI MKS Duna Crew Hatch ?eva ?iva Control command base lander colony agriculture farm agroponics greenhouse resource convert cultivate colony USI logistics MKS ScienceContainter LifeSupport Recycle LifeSupport Substrate MaterialKits Supplies Ore Recyclables SpecializedParts Fertilizer Dirt Organics Water Mulch ElectricCharge e/c Kerbal

 

Spoiler

title = MKS Duna Agriculture Module
manufacturer = USI - Kolonization Division
description = This module brings more advanced farming techniques to your colony.  While it's own space is limited, it can take advantage of other more expansive modules to help replenish your supplies through a variety of agriculture options.

tags = USI MKS Duna Crew Hatch Control command base lander colony agriculture farm agroponics greenhouse resource convert cultivate colony USI logistics MKS ScienceContainter LifeSupport Recycle LifeSupport Substrate MaterialKits Supplies Ore Recyclables SpecializedParts Fertilizer Dirt Organics Water Mulch ElectricCharge Kerbal

 

BR
JebsSY

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...