LFDatabase

Back to Assets

LFDatabase

Professional ScriptableObject Database System for Unity

Get on Unity Asset Store See Features
LFDatabase - Export, Populate, Import

Stop Managing ScriptableObjects Manually. Start Using Databases.

The Problem

Unity projects with lots of game data face the same challenges:

  • Manually creating and managing hundreds of ScriptableObject assets
  • No efficient way to search or filter entries at runtime
  • Performance issues when loading large datasets
  • Writing repetitive boilerplate code for every new data type
  • No built-in import/export for external tools or spreadsheets
  • Difficult to query data with LINQ or complex filters

The Solution

LFDatabase is a production-ready database management system built on top of ScriptableObjects. It provides a complete framework for creating, managing, and querying typed databases with automatic code generation, async loading, compression, and advanced search.

A 4-step setup wizard generates custom database classes from templates. The generated code is yours to own and extend. No vendor lock-in.

LFDatabase Workflow

Core Features

Code Generation Wizard

4-step visual setup creates custom database classes with type-safe entries, validation, and full LINQ support. Choose from 6 built-in templates or define custom fields.

Async Loading & Compression

Background loading with progress tracking. Automatic compression for databases over 1000 entries. LRU cache system with configurable size.

Advanced Search System

Cross-database search with regex support, relevance scoring, and intelligent filtering. Search by category, tags (AND/OR logic), or full-text queries.

Multi-Index Lookups

O(1) lookups by ID, category, or tags. Automatic index building on load. Fast retrieval for thousands of entries without performance loss.

JSON Import/Export

Full database serialization with validation. Export to JSON for version control, share templates between projects, or collaborate with designers.

11+ Editor Tools

Performance Monitor, Batch Operations, Database Validation, Find & Replace, Duplicate Detection, Database Merge, and more. All accessible from Tools menu.

6 Built-In Templates

Start with pre-configured templates or create custom databases from scratch.

Item Database

Weapons, equipment, consumables. Includes rarity, stack size, value, prefab references, and icon support.

Character Database

NPCs, enemies, player characters. Includes level, health, stats, portrait, and model prefab references.

Audio Database

Sound effects, music, ambient audio. Includes AudioClip references, volume, loop settings, and categories.

Dialogue Database

Conversations, NPC interactions. Includes speaker, text, choices, and dialogue flow support.

Quest Database

Objectives, rewards, quest chains. Includes requirements, objectives, completion criteria, and rewards.

Material Database

Crafting resources, ingredients. Includes Material references, textures, and shader property management.

Features in Action

JSON Import/Export

Performance optimized & noob friendly

Batch Operations

Zero boilerplate, maximum power

Asset Assignment

Empty templates to content in seconds

Documentation

Build systems in hours, not weeks

Setup Wizard Templates

Stop wrestling with data, start building

AI Assisted Content

AI-assisted content generation with JSON templates

Technical Architecture

Database Class Hierarchy

Type-safe generic base class with full C# support:

LFDatabaseSO<T> (Generic Base Class)
├── Type-safe LINQ queries
├── Automatic indexing (ID, Category, Tags)
├── Async/Sync loading
├── Compression support
└── Event system

Generated Database Classes:
├── CharacterDatabase : LFDatabaseSO<CharacterEntry>
├── ItemDatabase : LFDatabaseSO<ItemEntry>
└── CustomDatabase : LFDatabaseSO<CustomEntry>

Entry Base Class

Every database entry inherits from LFDatabaseEntry with built-in fields:

  • id - Unique string identifier
  • displayName - Human-readable name
  • description - Text description
  • category - Grouping/filtering category
  • tags - Array of searchable tags

Add custom fields through the Setup Wizard with full serialization support.

Performance Characteristics

  • Lookup Speed: O(1) for ID lookups via dictionary index
  • Category Search: O(1) for indexed categories
  • Tag Search: O(1) for indexed tags with AND/OR logic
  • Memory Overhead: ~1KB per indexed entry
  • Compression Ratio: 40-60% reduction for text-heavy data
  • Cache Size: Configurable LRU cache (default 500 entries)
  • Async Loading: Chunked index building (100 entries per chunk)

11 Editor Tools Included

Setup Wizard

4-step guided database creation with templates and custom field definition.

Performance Monitor

Real-time metrics, memory tracking, and optimization suggestions.

Database Registry

View all registered databases with stats and entry counts.

Batch Operations

Bulk modify, find and replace across multiple entries.

Database Validation

Integrity checking and error detection with auto-fix.

Duplicate Detection

Find and merge duplicate entries automatically.

Database Merge

Combine multiple databases with conflict resolution.

Find & Replace

Advanced text search and replacement across fields.

Import/Export

JSON import/export with validation and error reporting.

Benchmark Tool

Performance testing and profiling for large databases.

Documentation

Complete in-editor documentation with API reference and guides.

Database Registry System

Centralized management for all databases in your project:

  • Automatic Discovery: Finds all databases in project (editor) or Resources folder (runtime)
  • Type-Safe Access: GetDatabase<T>() with full IntelliSense support
  • Multi-Access Patterns: Get by type, name, or get all databases
  • Events: OnDatabasesRefreshed and OnDatabaseRegistered for observers
  • Statistics: Total entry counts, memory usage, and type information

Perfect For

RPG Games

Character databases, item inventories, quest systems, dialogue trees, and NPC management.

Strategy Games

Unit databases, building definitions, tech trees, resource management.

MMO Systems

Large-scale inventory systems, character data, server-side configuration.

Tool Development

Internal editor tools, asset management systems, pipeline automation.

Localization

Multi-language text databases with efficient lookups and version control.

Configuration

Game settings, balance parameters, event definitions, and telemetry data.

Why LFDatabase?

Generate, Don't Package

LFDatabase generates clean C# code that becomes part of YOUR project. You own it, modify it, and understand exactly how it works. No black box frameworks.

Production Ready

Built for real games, not prototypes. Async loading, compression, validation, error handling, and performance monitoring out of the box.

Type Safety

Full C# generic type support with compile-time safety. IntelliSense works everywhere. No magic strings or reflection overhead.

Scalable Architecture

Handles databases from 10 to 100,000+ entries. Automatic performance optimization based on size. Memory-efficient indexing.

Designer Friendly

Visual setup wizard, in-editor documentation, and comprehensive validation. Designers can create and manage databases without coding.

Zero Dependencies

Built entirely with Unity native systems. No third-party packages. Works with Unity 2022.3 LTS and newer.

Simple Runtime API

Basic Usage Example

// Get database from registry
var characterDB = LFDatabaseRegistry.GetDatabase<CharacterDatabase>();

// Load database (async with callback)
await characterDB.LoadAsync();

// Get entry by ID (O(1) lookup)
var hero = characterDB.GetEntryByID("hero_001");

// Search by category
var enemies = characterDB.GetEntriesByCategory("Enemy");

// Search by tags (AND logic)
var bossEnemies = characterDB.GetEntriesByTags(new[] { "Boss", "Elite" });

// Full-text search across all fields
var results = LFDatabaseSearch.SearchAcrossAllDatabases("dragon");

// LINQ queries (type-safe)
var highLevelCharacters = characterDB.Entries
    .Where(c => c.Level > 50)
    .OrderByDescending(c => c.Health)
    .ToList();

// Add new entry at runtime
characterDB.AddEntry(new CharacterEntry
{
    id = "npc_001",
    displayName = "Village Elder",
    category = "NPC"
});

Advanced Features

// Async loading with progress tracking
var loader = AsyncDatabaseLoader.Instance;
loader.LoadDatabase(characterDB, priority: 1, onComplete: () => {
    Debug.Log("Character database loaded!");
});

// Cross-database search with filters
var searchOptions = new LFDatabaseSearchOptions
{
    searchOperator = SearchOperator.Contains,
    categoryFilter = "Weapon",
    includeTags = new[] { "Rare", "Legendary" },
    sortBy = SortOption.Relevance
};
var weapons = LFDatabaseSearch.Search("sword", searchOptions);

// Export database to JSON
string json = LFDatabaseImportExport.ExportToJson(characterDB);
File.WriteAllText("characters_backup.json", json);

// Import from JSON with validation
var importResult = LFDatabaseImportExport.ImportFromJson(jsonString, characterDB);
if (importResult.success) {
    Debug.Log($"Imported {importResult.importedCount} entries");
}

Ready to Simplify Your Data Management?

Get LFDatabase on the Unity Asset Store today.

Get on Unity Asset Store

Free Version Available • Source Code Included • Full Documentation