Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 134 additions & 0 deletions CONSOLIDATION_PLAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Documentation Consolidation Plan

## Redundancies Found

### 1. **Port Configuration (MAJOR DUPLICATION)**
- **ColdStarter doc:** Full port config (sleep_handler, start_delay, check_activity, finish_after_command)
- **Scrolls doc:** EXACT same port config in Field Reference section
- **Solution:** Keep only in Scrolls doc, remove from ColdStarter

### 2. **"95 Scrolls" Mentioned 3 Times**
- ColdStarter: "All 95 published scrolls support ColdStarter"
- Scrolls: "95 published scrolls:" with full breakdown
- Scrolls: "Supported Games" section at bottom
- **Solution:** Remove game counts entirely, just link to repository

### 3. **Minecraft Example Duplication**
- ColdStarter: Links to minecraft.lua
- Scrolls: Shows PaperMC complete example with same minecraft.lua
- **Solution:** Keep in Scrolls only (where it's relevant)

### 4. **ColdStarter is Scroll Configuration**
- ColdStarter doc explains scroll.yaml port options
- It's already documented in Scrolls
- **Solution:** Merge ColdStarter into Scrolls as subsection

### 5. **DruidUI Package Docs Are Repetitive**
- All 5 packages: Installation → Usage → Options → See Also
- Same structure, similar content
- **Solution:** Consolidate into single "Packages Reference" page

### 6. **Nix Explanation is Too Long**
- "Why Nix?" lists benefits
- "How It Works" explains process
- Multi-version example
- **Solution:** Cut in half, keep only essentials

### 7. **Multiple scroll.yaml Examples**
- Minimal example (11 lines)
- Complete example (45 lines)
- Creating Your Own example (12 lines)
- **Solution:** Keep 2 examples max

## Proposed Structure

### Option A: Merge ColdStarter into Scrolls
```
docs/scrolls/
├── introduction.md # Main scroll system docs
│ ├── What are Scrolls?
│ ├── scroll.yaml Format
│ ├── Field Reference
│ ├── ColdStarter (subsection) ← Move here
│ └── Nix Integration
└── creating-scrolls.md # Separate guide for creating scrolls
```

### Option B: Keep ColdStarter Separate (Simplified)
```
docs/cli/
└── coldstarter.md # Ultra-short: What, Why, Config link

docs/scrolls/
└── introduction.md # Full scroll.yaml reference with ColdStarter details
```

### Option C: Consolidate DruidUI Packages
```
docs/druid-ui/
├── introduction.md # Overview
└── packages.md # Single page with all 5 packages (short sections)
```

## Recommended Changes

### 1. ColdStarter → Make it 30 lines
```markdown
# ColdStarter

Wakes server when players connect, sleeps when idle. ~85% cost savings.

Configured via scroll.yaml ports. See [Scroll System](../scrolls/introduction.md#coldstarter).

## Custom Handlers

Create Lua packet handler:
```lua
function handle(ctx, data)
if isConnect(data) then finish() end
end
```

[Full docs →](../scrolls/introduction.md#coldstarter)
```

### 2. Scrolls → Add ColdStarter subsection
Move all port config details here. One place for everything.

### 3. DruidUI Packages → Merge into one page
Each package gets 10-15 lines:
- What it does
- Installation
- Basic usage
- Link to GitHub

### 4. Remove All Game Counts
Instead of "95 published scrolls", just say:
"Browse available scrolls at github.com/highcard-dev/scrolls"

### 5. Cut Nix Section in Half
Remove:
- "Why Nix?" explanation
- "How It Works" 4-step process
Keep:
- One-line explanation
- Multi-version example (it's good)
- Link to nixpkgs

### 6. Remove One scroll.yaml Example
Keep:
- Minimal example (shows structure)
- Complete example (shows all features)
Remove:
- "Creating Your Own" example (redundant)

## Impact

**Current:** 1077 lines total
**After consolidation:** ~650 lines (40% reduction)

**Benefits:**
- No duplicate information
- Easier to maintain
- Single source of truth for scroll.yaml
- Less overwhelming for users
74 changes: 17 additions & 57 deletions docs/cli/coldstarter.md
Original file line number Diff line number Diff line change
@@ -1,94 +1,54 @@
---
sidebar_position: 2
title: ColdStarter
description: Wake-on-demand system for cost savings
description: Wake-on-demand for cost savings
---

# ColdStarter

ColdStarter automatically wakes your server when players connect, then puts it to sleep when idle. You only pay for active time.
Automatically wakes your server when players connect, sleeps when idle. **~85% cost savings.**

## How It Works

1. **Idle**: No players → server sleeps (minimal cost)
2. **Connect**: Player tries to join → ColdStarter intercepts
3. **Wake**: Server starts in background (10-30 seconds)
4. **Play**: Player connects to running server
1. Server sleeps when idle → minimal cost
2. Player connects → ColdStarter intercepts
3. Server wakes (10-30 seconds)
4. Player connects to running server

Your server still shows as "online" in server browsers while sleeping.

## Cost Savings

Typical hobby server:
- **Without ColdStarter**: 720 hours/month (24/7)
- **With ColdStarter**: 100 hours/month (actual playtime)

**Result**: ~85% cost reduction
Server still shows "online" in browsers while sleeping.

## Configuration

Configured per-scroll via `scroll.yaml`:
Configured via `scroll.yaml` ports:

```yaml
ports:
- name: game
port: 25565
protocol: tcp
sleep_handler: packet_handler/minecraft.lua
start_delay: 10
check_activity: true
```

### Port Options

- `sleep_handler` - Path to Lua packet handler (required for ColdStarter)
- `start_delay` - Seconds to wait before port is ready
- `check_activity` - Enable idle detection
- `finish_after_command` - Wait for command to finish before opening port
**Full port configuration:** See [Scroll System](../scrolls/introduction.md#port-configuration)

## Packet Handlers

Lua handlers respond to game protocols while server is asleep.

**Example:** [minecraft.lua](https://github.com/highcard-dev/scrolls/blob/main/scrolls/minecraft/papermc/1.21.7/packet_handler/minecraft.lua)

### Lua API

```lua
-- Send data to client
sendData(string)

-- Trigger server wake
finish()

-- Get snapshot/queue status
get_queue()
get_snapshot_percentage()
get_finish_sec()
```

## Supported Games

All 95 published scrolls support ColdStarter:
- Minecraft (all variants)
- Rust (Vanilla, Oxide)
- Hytale
- 10 LGSM games (Palworld, ARK, CS2, etc.)

## Custom Handlers

Create `packet_handler/game.lua` in your scroll:
Lua handlers respond to game protocols while sleeping:

```lua
function handle(ctx, data)
-- Parse packet
if isStatusRequest(data) then
sendData("Server starting...")
end

-- Wake on connect
if isConnectionAttempt(data) then
finish()
finish() -- Wake server
end
end
```

**Example:** [minecraft.lua](https://github.com/highcard-dev/scrolls/blob/main/scrolls/minecraft/papermc/1.21.7/packet_handler/minecraft.lua)

**Lua API:** `sendData()`, `finish()`, `get_queue()`, `get_snapshot_percentage()`

**Full details:** See [Scroll System](../scrolls/introduction.md#coldstarter)
5 changes: 2 additions & 3 deletions docs/cli/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ This is the documentation for [druid-cli](https://github.com/highcard-dev/druid-
It is recommended, but not manditory to use the druid-cli inside a container, to ensure all the coditions are meet for the process.
Simpler setups should also work without containers.

Processes and process structures **are called scrolls**.
A scroll is an OCI Artifact, wich you can store in any OCI registry, like Dockerhub.
Processes are managed via **scrolls** - OCI artifacts stored in registries. See [Scroll System](../scrolls/introduction.md) for details.

## Architecture

Expand All @@ -26,7 +25,7 @@ A scroll is an OCI Artifact, wich you can store in any OCI registry, like Docker
F[Start Process and Log Watcher] --> G[Start Webserver]
```

A command can depend on the success of a different command. You can see more in the [scroll section](/cli/scroll).
Commands can depend on other commands. See [Scroll System](../scrolls/introduction.md) for details.

## Installation

Expand Down
Loading