FG Browser with search [CoreRPG, 5e, SWD, other]
This extension adds a browser-style functionality for the purposes of organizing and searching records and reference library data.
I made it for my own purposes as I was having a hard time managing all of the campaign records in a long-running game with a lot of recurring NPCs and other campaign records.
I also wanted a search feature to be able to perform full-text search of all records and library data in a single place, because I would often forget where something was and wanted an easier way to find NPCs based on data in their notes, find story records based on their content, or search the library reference data.
The example screenshots below are taken from the 5e ruleset just because that is a very popular game system, but the extension should work with any ruleset based on CoreRPG. I myself use it in my own homebrew ruleset.
Installation
This is available over on the Forge: FG Browser (with search)
Or if you prefer, you can manually download the ext file here and install in your Extensions directory.
Usage
It can be used in 2 ways, as a campaign record type, or as dynamic browser windows that will not be stored permanently.
To create a persisted browser type campaign record, it is available under the "Browsers" campaign record type on the sidebar. You can create a blank browser and add records either by drag/dropping them into the tab list, or by using the search page to look up records. Here is an example:
https://raw.githubusercontent.com/ba...al_example.gif
When using the search page, you can use the filter fields to filter the results by record class, name or the source of the record. You can either left-click on search results to open them in a new tab and immediately switch to the tab, or middle-click to open them in a new tab without switching to it (like most web browsers). Tabs can be closed via the middle mouse button.
Tabs can also be renamed either by double-clicking the tab, or right-clicking and using the edit option in the radial menu.
You can also use the browser without linking it to a campaign record. To do so, just use the chat command:
Code:
/foogle <search string>
The optional search string parameter, if provided, will perform a search automatically when opened.
If you have a dynamic browser window that you want to persist to the campaign data, you can right-click and there is a save option in the radial menu which will copy the dynamic browser to a persisted one. Here is an example of a dynamic browser:
https://raw.githubusercontent.com/ba...ge_example.gif
Update 1.1.0
Several people reached out to me to ask about improvements to the search functionality (mainly search performance). The initial version of the search was almost an afterthought, so it was pretty basic. The new version adds a search indexer that indexes the campaign and module records on campaign load, so that searches will have better performance. It also implements search scoring to try to sort the results so that the most relevant results are at the top.
The "Module Indexing" option button can be used to select which modules to index for search, and the "Rebuild Index" button can be used to trigger the indexer to run again if something gets messed up in the search index (or if "Index on-load" is disabled).
Update 1.2.1
The search indexing worked ok on very fast computers, but introduced issues in some environments (it was particularly sensitive to read speed on the drive holding the module data). To that end, in 1.2.1 I implemented a background event loop to handle the indexing (since the FG Lua environment doesn't support coroutines).
In order to work well across the widest possible range of environments, the indexing behavior can be modified to suit your needs:
https://github.com/bakermd86/FoogleB...c/settings.png
To keep things as simple as possible, there are some built-in config profiles accessible via the slash command:
Code:
/indexMode <min|low|normal|high|max>
If you only want to use the browser for tabbing records, and don't care at all about search, /indexMode min will disable indexing on-load entirely, and indexing will only run when you manually click the "Rebuild index" button. So if you want to have the browsers for organizing records, and don't care about search at all, then do that.
The others just gradually turn up the indexing workload and scheduling priority.
The main setting that is going to impact the responsiveness of the client UI is the "Event Loop Priority" setting. Lower values of this setting will make the indexing take longer, but will return control to the FG client loop more frequently, and so will make the client feel more responsive while indexing is running. If you notice stuttering or other performance issue with the UI while indexing, you can set this lower. If you want indexing to run faster, and the UI is sufficiently performant for your liking, you can turn it up.
There is also a blocking setting if you just want indexing to lock up the client and run as fast as it can.
The default setting for priority is "Automatic" which tries to adjust the scheduling priority dynamically every second to ensure that it is returning control to the FG client main thread at least 30 times / second. Automatic should well in most cases, but you can turn it up/down as desired.
You can also turn off indexing for non-text fields (number, image, dice, links, etc.) for a slight increase in performance, and you for formattedtext fields for a modest boost. Basic Indexing restricts indexing to simple string fields only, and uses a much simpler lexical tokenizer for a significant boost in indexing performance at the cost of a less thorough search feature.