gather

package
v0.7.41 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gather answers "where do I mine, pick or fish X?" and "where should I gather at my level?" from the player's own QuestieDB objects, read at runtime: the zones with the most nodes or schools that yield the item, the character's own zone first, with a sample coordinate or two. The rules are in docs/professions.md and docs/design/questie-interop.md.

Index

Constants

View Source
const (
	Herb = "herb"
	Ore  = "ore"
	Fish = "fishing"
)

Kinds of gathering, named for the skill they use.

View Source
const FromQuestie = "from your Questie database"

FromQuestie marks every place read from the player's QuestieDB.

View Source
const MaxZones = 3

MaxZones is how many zones an answer lists.

Variables

This section is empty.

Functions

func KindOf

func KindOf(s string) string

KindOf maps a profession or verb the player used to a kind; empty when it is none.

func Line

func Line(zones []Zone) string

Line is the planner's "gather here" clause for zones: "Zone: Node (x, y); Zone: ...".

Types

type Gatherer

type Gatherer struct {
	// contains filtered or unexported fields
}

Gatherer holds the classified nodes of one QuestieDB. A nil Gatherer knows no nodes.

func New

func New(qx *questie.Index, ds store.DataStore) *Gatherer

New classifies the Questie objects that yield items. The rule, in order, for each object that is not a container:

  1. the dataset names it as a Herbalism or Mining node: that profession (and its skill);
  2. its name says vein or deposit (ore), or school, wreckage or similar (fishing);
  3. it yields an item that a Mining recipe uses as a reagent: ore;
  4. it yields an item that an Alchemy or Inscription recipe uses and no Mining recipe does: herb.

The node's skill is the curated profession_notes figure for its name, else the dataset's skill_required, else the lowest required level of what it yields. A nil index, or one with no object rows, gives a Gatherer with no nodes.

func (*Gatherer) Count

func (g *Gatherer) Count() int

Count is how many gathering nodes were classified.

func (*Gatherer) Find

func (g *Gatherer) Find(c character.Character, item, verb string) Result

Find answers "where can I find/mine/pick/fish X?". verb may be empty. It names up to MaxZones zones, with the character's own zone first and then the zones with the most spawns of the nodes or schools that yield the item, each with sample coordinates.

func (*Gatherer) ForLevel

func (g *Gatherer) ForLevel(c character.Character, kind string) Result

ForLevel answers "where should I mine/herb/fish at my level?". The character's skill comes from their professions. A node suits them when its skill is at most theirs; the best are those within 50 points under it (still worth the trip), else the highest they can take. Skills the notes and the yielded items do not give count as suiting everyone. Up to MaxZones zones, the character's own first, then the most spawns.

func (*Gatherer) ItemZones

func (g *Gatherer) ItemZones(item int64, at questie.Where) (kind string, zones []Zone)

ItemZones are the zones where the item with that id can be gathered, for the profession planner: the character's zone first, then the busiest. Nil when no classified node yields it.

type Node

type Node struct {
	questie.Node
	Kind  string
	Skill int // the skill the node needs; 0 when no number is known
}

Node is a Questie object that the classification rule accepted as gatherable.

type Result

type Result struct {
	Query       string `json:"query,omitempty"`
	Kind        string `json:"kind,omitempty"`
	Item        string `json:"item,omitempty"`
	Skill       int    `json:"skill,omitempty" jsonschema:"the character's skill, for a level answer"`
	Zones       []Zone `json:"zones"`
	FromQuestie bool   `json:"from_questie,omitempty"`
	Text        string `json:"text"`
}

Result is an answer.

type Zone

type Zone struct {
	Zone   string         `json:"zone"`
	Spawns int            `json:"spawns" jsonschema:"how many nodes or schools spawn there"`
	Here   bool           `json:"here,omitempty" jsonschema:"the character is in this zone"`
	Spots  []questie.Spot `json:"-"`
	Coords [][2]float64   `json:"coordinates,omitempty" jsonschema:"sample places, map percent"`
	Nodes  []string       `json:"nodes" jsonschema:"the node or school names that spawn there"`
	Skill  int            `json:"skill,omitempty" jsonschema:"the lowest skill a node there needs; 0 when unknown"`
}

Zone is one zone to gather in.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL