Null Bolt
Studio
reference

API reference

The public surface, condensed. Everything lives in the flat ItemGeneratorSystem namespace; the engine is static classes and plain data — no MonoBehaviours.

The engine

MemberTypeDescription
ItemGenerator.Generate(request)static ItemInstanceRoll one item. Returns null (with a warning) on missing item type or rarity.
ItemGenerator.GenerateBatch(request, count)static ItemInstance[]Roll N items with per-index seeds derived from request.Seed.
ItemGenerationRequestclassTemplate, ItemType, SubType, Rarity (required), Seed, Settings (required).
ItemGeneratorCallbacks.OnPostGeneratestatic event Func<ItemInstance, ItemInstance>Chained per-item hook run before Generate returns (and again on snapshot restore). Unsubscribe when done — it’s static.
SeedUtilitystatic classGenerateRandomSeed() (entropy for new rolls) and DeriveVariationSeed(baseSeed, index) (batch seeds).

Generated data

MemberTypeDescription
ItemInstanceclassThe result: ItemName, RarityTypeLabel, type/sub-type/rarity refs, Icon/Prefab, BaseStats, ImplicitModifiers, RandomAffixes, SocketCount, LegendaryEffect, SellValue, MaxDurability, MaxStackSize, ItemLevel, GenerationSeed, GeneratorVersion, GenerationTimestamp, SourceTemplateName.
StatModifierclassOne rolled value: stat ref, value, GetDisplayString() ("+150 Attack", "+12.5% Crit Chance").
GeneratedAffixclassA rolled affix: source AffixDefinition ref + its rolled StatModifiers.
LegendaryEffectclassEffectName, EffectDescription, EffectIcon, EffectId — the id is your gameplay lookup key. IsValid checks id + description.
ItemDefinitionScriptableObjectAn ItemInstance frozen as a project asset (editor GENERATE output); PopulateFromInstance() copies one in.

Content definitions (ScriptableObjects)

All created under Assets ▸ Create ▸ Item Generator ▸ …:

MemberTypeDescription
GeneratorSettingsregistryAvailableRarities/Affixes/ItemTypes/SubTypes/Templates + NameConfig, output path & asset-name format, default seed options. Populated by Auto-Discover Content.
StatDefinitionSOOne stat: id, display name, StatValueType (Flat/Percentage/Multiplier), StatCategory.
RarityDefinitionSOSortOrder, colors, affix & socket ranges, StatValueMultiplier, MinimumRollQuality, sell/durability multipliers, legendary flags, MaxNameAffixCount.
ItemTypeDefinitionSOBase stat pool, implicit modifiers, allowed stats, base value/durability/stack, default icon & prefab.
ItemSubTypeDefinitionSOParent type + InheritanceMode (Inherit/Override/Extend/Restrict) + per-field overrides; Resolve…() methods expose the effective values.
AffixDefinitionSOStatGrants, Weight, AffixType (Prefix/Suffix — display metadata), MinimumRarity/AllowedRarities, type/sub-type restrictions, ExclusionGroup.
ItemTemplateSOBase name/description/icon/prefab, stat & economy overrides, ForcedAffixes, AllowedRarities (+ IsRarityAllowed()), LegendaryEffect, ItemLevel.
NameGenerationConfigSOPrefixes / Suffixes / BaseNamePool / UniqueNames (NameFragment[]) + PrependArticleToUniqueName.
StatPoolEntry / NameFragmentclassThe reusable range entry (stat, min, max, weight) and the weighted, condition-gated name text.

Persistence

MemberTypeDescription
ItemInstancePersistence.Capture(item)static ItemInstanceSnapshotSix plain fields: seed, generator version, and the four definition names.
ItemInstancePersistence.Restore(snapshot, settings)static ItemInstanceResolves names through GeneratorSettings and regenerates. Null on unresolvable names; warns on version drift.

Enums & helpers

MemberTypeDescription
StatValueTypeenumFlat, Percentage, Multiplier.
StatCategoryenumOffensive, Defensive, Utility, Resource.
AffixTypeenumPrefix, Suffix.
InheritanceModeenumInherit, Override, Extend, Restrict.
ValueCalculatorstatic classCalculateSellValue(base, rarityMult, affixCount) and CalculateDurability(base, rarityMult).
StatRoller / AffixRoller / NameGenerator / WeightedSelectorstatic classesThe pipeline internals — public if you want to build custom generation flows from the same parts.
CardPalettestatic classThe shared card colors, font sizes, and glyphs used by the demo card, editor preview, and ItemDefinition inspector — reuse it to match your own tooltips.
IGSDebugstatic classLogging gate — verbose logs compile only with the ITEM_GEN_DEBUG scripting define; warnings/errors always on.
// note
Threading: the RNG travels through the pipeline as a ref struct — generation is single-threaded by design. Don't share one ItemGenerationRequest across threads (GenerateBatch temporarily mutates its seed, restoring it in a finally).