{"id":4204,"date":"2020-12-27T16:38:54","date_gmt":"2020-12-27T08:38:54","guid":{"rendered":"https:\/\/www.gridsagegames.com\/blog\/?p=4204"},"modified":"2021-04-06T16:52:13","modified_gmt":"2021-04-06T08:52:13","slug":"item-searching-filtering","status":"publish","type":"post","link":"https:\/\/www.gridsagegames.com\/blog\/2020\/12\/item-searching-filtering\/","title":{"rendered":"Item Searching and Filtering"},"content":{"rendered":"<p>Many years ago,\u00a0Cogmind&#8217;s predecessor <a title=\"X@COM\" href=\"xcomrl.blogspot.com\/\">X@COM<\/a> pioneered the idea of using a pop-up label system in an ASCII game to identify objects like items, beneficial both to help teach new players as well as a natural quality of life improvement. This allows players to more quickly know exactly what an item is, useful when there are otherwise few ways to depict differences beyond the typical character and color options. Labels can appear in various situations such as automatically when new items come into view, when a specific item needs to be pointed out for some reason, or when the player wants to label everything at once.<\/p>\n<div id=\"attachment_4207\" style=\"width: 497px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/xcomrl_labels_demo_items.gif\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4207\" class=\"size-full wp-image-4207 \" title=\"XCOMRL Item Label Demo\" src=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/xcomrl_labels_demo_items.gif\" alt=\"xcomrl_labels_demo_items\" width=\"487\" height=\"535\" \/><\/a><p id=\"caption-attachment-4207\" class=\"wp-caption-text\">An early demo of X@COM&#8217;s item label system, where ground items appear in gray, and soldier-held items in green. Weapons can also use color coding to differentiate their amount of remaining ammo.<\/p><\/div>\n<div id=\"attachment_4208\" style=\"width: 557px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/xcomrl_labels_demo_units.gif\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4208\" class=\"size-full wp-image-4208 \" title=\"XCOMRL Actor Label Demo\" src=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/xcomrl_labels_demo_units.gif\" alt=\"xcomrl_labels_demo_units\" width=\"547\" height=\"564\" \/><\/a><p id=\"caption-attachment-4208\" class=\"wp-caption-text\">Using the same system to label soldiers and visible aliens. Soldier labels can be color-coded by remaining health.<\/p><\/div>\n<p>As a descendant of X@COM, Cogmind also shares this important feature, but by necessity has since expanded it even further. Particularly in Cogmind it&#8217;s not uncommon to have a huge number of items visible at once across the map, or even within a small area, so what do we do in cases where there&#8217;s a ridiculous number of labels all over the place?<\/p>\n<p>In X@COM one of the first things I did (because it was easy :P) is allow item labels to overlap one another but randomly shuffle their z-order over time so that labels on the bottom would at least have a chance to be completely visible at some point while observing them. Not ideal, but worked okay.<\/p>\n<p>Cogmind doesn&#8217;t do that, but does color code labels to make it easier to focus on different item properties, or easier to find whatever the player might be searching for at the time. And even more useful for avoiding overlap, Cogmind allows labels to extend out from an object in any one of six different directions, ensuring that more of the labels are likely to be completely visible when multiple objects are near one another. Early on, labels also started to carry useful extra bits of info that don&#8217;t take up much room, like an item&#8217;s rating, and whether it&#8217;s of a type the player has never used before (in case they&#8217;d like to collect it for their gallery).<\/p>\n<div id=\"attachment_4210\" style=\"width: 757px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_label_concept_integrity_color_labels.gif\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4210\" class=\"wp-image-4210 \" title=\"Cogmind Item Labels Integrity Coloring Concept (2017)\" src=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_label_concept_integrity_color_labels.gif\" alt=\"cogmind_item_label_concept_integrity_color_labels\" width=\"747\" height=\"284\" \/><\/a><p id=\"caption-attachment-4210\" class=\"wp-caption-text\">The original 2017 demo for when Cogmind&#8217;s item label system was switched over to coloration by integrity (the new default).<\/p><\/div>\n<p>Labels were later updated to include even an item&#8217;s current integrity <em>if<\/em> <em>damaged.<\/em><\/p>\n<p>None of this helps with the sheer number of labels, however, which can be significant, so we ideally need ways to manage that as well, ways I&#8217;ve gradually been adding over the years&#8230;<\/p>\n<h2>Automatic Item Filter Settings<\/h1>\n<p>To start tackling the excessive label issue, at least with a few simple tweaks as a start, back in 2018 with <a title=\"Cogmind Beta 5 Release Notes\" href=\"https:\/\/www.gridsagegames.com\/forums\/index.php?topic=1015.0\">Beta 5<\/a> I added some adjustable filters to automatically exclude some items from being labeled.<\/p>\n<p>So-called &#8220;mass labeling&#8221; of items (manually labeling all items at once) would become a two-stage process, where the first attempt would ignore all faulty items, broken items, heavily-damaged items, or those with low ratings relative to the current depth--basically those things which players are much less likely to be looking for at any given time. Attempting to label items <em>again<\/em> within a short duration would label <em>everything<\/em>, regardless of these filter settings. All such automatic filters can be tweaked in the options for players who want to adjust their behavior, or turn them off completely.<\/p>\n<div id=\"attachment_4211\" style=\"width: 413px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_label_filters.gif\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4211\" class=\"size-full wp-image-4211 \" title=\"Cogmind Item Labels Automatic Filters Demo\" src=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_label_filters.gif\" alt=\"cogmind_item_label_filters\" width=\"403\" height=\"227\" \/><\/a><p id=\"caption-attachment-4211\" class=\"wp-caption-text\">Demonstration of automatic filtering of item labels for those heavily-damaged by an explosion. Notice a quick subsequent call for labels will include them anyway, making it possible to have two levels of detail via the same command.<\/p><\/div>\n<p>This doesn&#8217;t go nearly far enough in terms of mitigating all of the excessive label situations, but it&#8217;s a good start and definitely helpful.<\/p>\n<h2>Manual Item Category Filters<\/h1>\n<p>At the highest level there are five main categories of items, corresponding to the four types of slots items can be attached to, plus non-part items. And it&#8217;s a fairly frequent need to find an item of a particular category, for example propulsion when you&#8217;re literally on your &#8220;last legs&#8221; (or worse xD), or just any old power source when you&#8217;ve lost (or are about to lose) your last one and can foresee an impending energy crisis, or any number of other more nuanced situations.<\/p>\n<p>As such, limiting the labels to only those items belonging to a particular category is an effective way to vastly reduce their number and make it easier to quickly see what nearby relevant options are available.<\/p>\n<p>For this purpose I&#8217;ve more recently added the ability to cycle through the various categories while item labels are open, automatically reopening them and applying the new category.<\/p>\n<div id=\"attachment_4215\" style=\"width: 733px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_label_category_filtering.gif\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4215\" class=\"wp-image-4215 \" title=\"Cogmind Item Label Category Filtering\" src=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_label_category_filtering.gif\" alt=\"cogmind_item_label_category_filtering\" width=\"723\" height=\"575\" \/><\/a><p id=\"caption-attachment-4215\" class=\"wp-caption-text\">Filtering item labels by category.<\/p><\/div>\n<p>The cycling sequence switches between all items -&gt; power sources -&gt; propulsion -&gt; utilities -&gt; weapons -&gt; non-part items (there are three different sets of key options for this interaction, each of which can be reversed as well). Not opening any labels for ten seconds resets the system back to &#8220;all items &#8221; again.<\/p>\n<p>Automatic label filter settings are also applied in these modes, and can be overridden by calling labels a second time as usual (the demo above includes example of this, with the weapons and utilities).<\/p>\n<h2>Item Searching<\/h1>\n<p>Automated and\/or simple solutions are nice, but sometimes we need to pull out&#8230; the big guns of the item-seeking world: full-featured search. For this I built a more powerful system capable of both filtering and searching through all known items across the entire map according to a range of customizable criteria.<\/p>\n<p>Now this new dedicated interface is going to be overkill if just checking out a handful of items scattered around in the local area, but sometimes in Cogmind you might encounter a huge war, or maybe you&#8217;re just a deadly and determined Cogmind rampaging across a map where there&#8217;s no cleanup crew (or they simply can&#8217;t keep up with you :P), and the map becomes littered with a mess of salvageable items.<\/p>\n<div id=\"attachment_4216\" style=\"width: 2710px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_pimski_access_farm_destruction.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4216\" class=\"size-full wp-image-4216 \" title=\"Cogmind Massive Destruction Player Screenshot (Tiles)\" src=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_pimski_access_farm_destruction.png\" alt=\"cogmind_pimski_access_farm_destruction\" width=\"2700\" height=\"2803\" \/><\/a><p id=\"caption-attachment-4216\" class=\"wp-caption-text\">Looking through a mess like this could be challenging even with a robust labeling system :P<\/p><\/div>\n<div id=\"attachment_4219\" style=\"width: 1384px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_zxc_access_destruction.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4219\" class=\"size-full wp-image-4219 \" title=\"Cogmind Massive Destruction Player Screenshot (ASCII)\" src=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_zxc_access_destruction.png\" alt=\"cogmind_zxc_access_destruction\" width=\"1374\" height=\"900\" \/><\/a><p id=\"caption-attachment-4219\" class=\"wp-caption-text\">Another example of wide-scale destruction from running battles in a late-game map, this one in ASCII.<\/p><\/div>\n<p>There might be parts you want in there, but it can take a little while to sort through them. And although with experience the process gets faster, why not make it fast for everyone, and vastly increase the speed of doing so, by allowing the player to describe specifically what they want, or at least some aspect(s) of it.<\/p>\n<p>Activating the new search feature opens a window over the right side of the HUD initially listing all known items:<\/p>\n<div id=\"attachment_4221\" style=\"width: 489px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_search_ui.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4221\" class=\"size-full wp-image-4221 \" title=\"Cogmind Item Search UI\" src=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_search_ui.png\" alt=\"cogmind_item_search_ui\" width=\"479\" height=\"523\" \/><\/a><p id=\"caption-attachment-4221\" class=\"wp-caption-text\">Item search window showing a list of nearby items.<\/p><\/div>\n<p>Items in the list are ordered by their current direct distance from your position, near to far, not taking into account walls or available paths (this is a more meaningful approach in Cogmind, since terrain destruction and making your own paths where helpful is common practice). Those items currently within Cogmind&#8217;s FOV display their distance in blue, whereas those outside FOV display it in a shade of gray depending on distance. To the right of each item is its last known integrity, if available.<\/p>\n<p>Once in this mode, simply typing enters text into the Search bar, where the most basic filter is text which must be found in the item name. For example &#8220;Imp&#8221; will list all items with the Imp. prefix, but technically also include &#8220;Impulse Thruster&#8221; (unless a period is added, of course, to search for &#8220;Imp.&#8221;).<\/p>\n<div id=\"attachment_4224\" style=\"width: 488px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_search_ui_demo_text.gif\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4224\" class=\"size-full wp-image-4224 \" title=\"Cogmind Item Search UI Demo (Text)\" src=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_search_ui_demo_text.gif\" alt=\"cogmind_item_search_ui_demo_text\" width=\"478\" height=\"523\" \/><\/a><p id=\"caption-attachment-4224\" class=\"wp-caption-text\">Searching for items via text.<\/p><\/div>\n<p>Combine separate strings (requiring all of them to be present, but not consecutive) by using a comma. For example searching for for &#8220;par,char&#8221; would return any Particle Chargers. (Searches are not case sensitive.)<\/p>\n<p>As usual, standard text editing commands are available, such as the Delete key, Arrows to move the cursor, and Ctrl-Backspace to erase the current text. The Enter key also simply resets the current search.<\/p>\n<p>This interface is an easy way to look for very specific items, or quickly find the precise location of an item you remember to be somewhere on the map, because the list items are also interactive! Clicking on an item name (or using Ctrl-a~z) both centers the map view on it and highlights the shortest known path to reach that position:<\/p>\n<div id=\"attachment_4225\" style=\"width: 926px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_search_ui_demo_centering.gif\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4225\" class=\"size-full wp-image-4225 \" title=\"Cogmind Item Search UI Demo (Centering)\" src=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_search_ui_demo_centering.gif\" alt=\"cogmind_item_search_ui_demo_centering\" width=\"916\" height=\"481\" \/><\/a><p id=\"caption-attachment-4225\" class=\"wp-caption-text\">Centering on items via the search interface, also highlighting the path to reach them.<\/p><\/div>\n<p>Double-clicking (or repeating the keyboard command) will then also automatically move to that item.<\/p>\n<div id=\"attachment_4226\" style=\"width: 687px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_search_ui_demo_pathfinding.gif\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4226\" class=\"size-full wp-image-4226 \" title=\"Cogmind Item Search UI Demo (Pathfinding)\" src=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_search_ui_demo_pathfinding.gif\" alt=\"cogmind_item_search_ui_demo_pathfinding\" width=\"677\" height=\"385\" \/><\/a><p id=\"caption-attachment-4226\" class=\"wp-caption-text\">Using the item search interface to path to a desired target.<\/p><\/div>\n<p>But the item search feature is about more than just names--it&#8217;s made much more powerful with support for specifying other required properties.<\/p>\n<p>Special filters are available using the period prefix. For example &#8220;.power&#8221; will list all items that count as parts equippable to a power slot, or &#8220;.treads&#8221; will list all tread items. Generally only the first few letters are actually required to specify a particular filter, as indicated in the reference list below, but the full word is fine as well.<\/p>\n<div id=\"attachment_4227\" style=\"width: 482px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_search_filters_manual.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4227\" class=\"size-full wp-image-4227 \" title=\"Cogmind Item Search UI Filter List (manual)\" src=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_search_filters_manual.png\" alt=\"cogmind_item_search_filters_manual\" width=\"472\" height=\"571\" \/><\/a><p id=\"caption-attachment-4227\" class=\"wp-caption-text\">The current list of special filters for item searching, as found in the manual.<\/p><\/div>\n<p>Multiple special filters can be combined with one another, as well as used alongside name filters if desired, again using a comma to delineate separate filters. For example &#8220;rifle,.th&#8221; would list any items with &#8220;rifle&#8221; in the name which are also capable of dealing thermal damage. Or &#8220;.hov,5,70%&#8221; would list all hover propulsion of at least rating 5 with a minimum of 70% current integrity.<\/p>\n<div id=\"attachment_4232\" style=\"width: 486px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_search_ui_demo_filters.gif\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4232\" class=\"size-full wp-image-4232 \" title=\"Cogmind Item Search UI Demo (Filters)\" src=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_search_ui_demo_filters.gif\" alt=\"cogmind_item_search_ui_demo_filters\" width=\"476\" height=\"523\" \/><\/a><p id=\"caption-attachment-4232\" class=\"wp-caption-text\">Applying various filters to the item search list.<\/p><\/div>\n<p>Under the search UI the extra space in the HUD is filled with a persistent list of helpful commands as a teaching tool and reminder:<\/p>\n<div id=\"attachment_4230\" style=\"width: 488px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_search_ui_help.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4230\" class=\"wp-image-4230 \" title=\"Cogmind Item Search UI (Help)\" src=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2020\/12\/cogmind_item_search_ui_help.png\" alt=\"cogmind_item_search_ui_help\" width=\"478\" height=\"280\" \/><\/a><p id=\"caption-attachment-4230\" class=\"wp-caption-text\">Search UI help text.<\/p><\/div>\n<p>For most cases I imagine the manual item category filters for mass labeling will generally be more useful since backtracking is not something a lot of builds want to do in Cogmind, and you&#8217;re generally trying to browse a low to medium amount of nearby parts anyway, but there are definitely some cases where a more powerful search feature will come in handy, so I decided to add both :)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Many years ago,\u00a0Cogmind&#8217;s predecessor X@COM pioneered the idea of using a pop-up label system in an ASCII game to identify objects like items, beneficial both to help teach new players as well as a natural quality of life improvement. This allows players to more quickly know exactly what an item is, useful when there are [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":4216,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[140,4,13],"class_list":["post-4204","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gui","tag-accessibility","tag-cogmind","tag-ui"],"_links":{"self":[{"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/posts\/4204","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/comments?post=4204"}],"version-history":[{"count":14,"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/posts\/4204\/revisions"}],"predecessor-version":[{"id":4364,"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/posts\/4204\/revisions\/4364"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/media\/4216"}],"wp:attachment":[{"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/media?parent=4204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/categories?post=4204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/tags?post=4204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}