Official development blog

Item Searching and Filtering

Many years ago, Cogmind’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 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.

xcomrl_labels_demo_items

An early demo of X@COM’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.

xcomrl_labels_demo_units

Using the same system to label soldiers and visible aliens. Soldier labels can be color-coded by remaining health.

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’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’s a ridiculous number of labels all over the place?

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.

Cogmind doesn’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’t take up much room, like an item’s rating, and whether it’s of a type the player has never used before (in case they’d like to collect it for their gallery).

cogmind_item_label_concept_integrity_color_labels

The original 2017 demo for when Cogmind’s item label system was switched over to coloration by integrity (the new default).

Labels were later updated to include even an item’s current integrity if damaged.

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’ve gradually been adding over the years…

Automatic Item Filter Settings

To start tackling the excessive label issue, at least with a few simple tweaks as a start, back in 2018 with Beta 5 I added some adjustable filters to automatically exclude some items from being labeled.

So-called “mass labeling” 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 again within a short duration would label everything, 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.

cogmind_item_label_filters

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.

This doesn’t go nearly far enough in terms of mitigating all of the excessive label situations, but it’s a good start and definitely helpful.

Manual Item Category Filters

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’s a fairly frequent need to find an item of a particular category, for example propulsion when you’re literally on your “last legs” (or worse xD), or just any old power source when you’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.

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.

For this purpose I’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.

cogmind_item_label_category_filtering

Filtering item labels by category.

The cycling sequence switches between all items -> power sources -> propulsion -> utilities -> weapons -> 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 “all items ” again.

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

Item Searching

Automated and/or simple solutions are nice, but sometimes we need to pull out… 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.

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’re just a deadly and determined Cogmind rampaging across a map where there’s no cleanup crew (or they simply can’t keep up with you :P), and the map becomes littered with a mess of salvageable items.

cogmind_pimski_access_farm_destruction

Looking through a mess like this could be challenging even with a robust labeling system :P

cogmind_zxc_access_destruction

Another example of wide-scale destruction from running battles in a late-game map, this one in ASCII.

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.

Activating the new search feature opens a window over the right side of the HUD initially listing all known items:

cogmind_item_search_ui

Item search window showing a list of nearby items.

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

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 “Imp” will list all items with the Imp. prefix, but technically also include “Impulse Thruster” (unless a period is added, of course, to search for “Imp.”).

cogmind_item_search_ui_demo_text

Searching for items via text.

Combine separate strings (requiring all of them to be present, but not consecutive) by using a comma. For example searching for for “par,char” would return any Particle Chargers. (Searches are not case sensitive.)

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.

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:

cogmind_item_search_ui_demo_centering

Centering on items via the search interface, also highlighting the path to reach them.

Double-clicking (or repeating the keyboard command) will then also automatically move to that item.

cogmind_item_search_ui_demo_pathfinding

Using the item search interface to path to a desired target.

But the item search feature is about more than just names--it’s made much more powerful with support for specifying other required properties.

Special filters are available using the period prefix. For example “.power” will list all items that count as parts equippable to a power slot, or “.treads” 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.

cogmind_item_search_filters_manual

The current list of special filters for item searching, as found in the manual.

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 “rifle,.th” would list any items with “rifle” in the name which are also capable of dealing thermal damage. Or “.hov,5,70%” would list all hover propulsion of at least rating 5 with a minimum of 70% current integrity.

cogmind_item_search_ui_demo_filters

Applying various filters to the item search list.

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:

cogmind_item_search_ui_help

Search UI help text.

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’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 :)

This entry was posted in GUI and tagged , , . Bookmark the permalink. Trackbacks are closed, but you can post a comment.

Post a Comment

Your email is never published nor shared. Only the anti-spam entry is required. See here for the privacy policy.

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>