Skip to content

First Login

A scripted-but-AI-driven onboarding scene that doubles as character creation. New players land in Sector 1 (Sol/Earth area) and have to talk past a security guard to claim a ship. The dialogue is run through a multi-provider AI stack with a deterministic fallback.

Flow

  1. Account created → player is dropped into the Callisto Colony shipyard narrative scene.
  2. Initial confrontation — a Security Guard (driven by ARIA) presents 3+ ship options and demands ID.
  3. Free-form dialogue — player types responses. AI-generated follow-up questions probe identity, arrival, ship knowledge, situational awareness.
  4. Negotiation skill assessment — evaluator scores persuasiveness, confidence, consistency, originality.
  5. Resolution — guard either grants the claimed ship (success) or forces the player into the escape pod (failure path).

Ship-claim difficulty matrix

From services/first_login_service.py:DEFAULT_SHIP_CONFIGS. Numbers are persuasion-score thresholds (lower = easier to convince).

Ship Tier Spawn % Base credits Weak / Average / Strong threshold
Escape Pod 1 100 1,000 0.30 / 0.30 / 0.30
Light Freighter 2 50 2,500 0.40 / 0.35 / 0.30
Scout Ship 3 25 2,000 0.55 / 0.50 / 0.45
Fast Courier 3 20 3,000 0.55 / 0.50 / 0.45
Cargo Hauler 4 10 5,000 0.65 / 0.55 / 0.50
Defender 5 (rare) 7,000 0.80 / 0.70 / 0.60

Easter-egg mechanic: cat boost

If the player mentions the orange cat that appears in the opening narrative, persuasion gets a flat +15% before threshold checks. Tracked by the enhanced manual provider's pattern detection — works even with all AI providers offline. Players who trigger it qualify for the Orange Cat Society medal (currently 🚧 not implemented as an awarded medal but the detector exists).

AI provider chain

Defined in services/ai_provider_service.py (and configured via env vars):

AI_PROVIDER_PRIMARY=openai       # GPT-3.5/4 — primary
AI_PROVIDER_SECONDARY=anthropic  # Claude — quality fallback
AI_PROVIDER_FALLBACK=manual      # Enhanced manual (rule-based) — always available

Provider selection is per-request; on timeout/failure the chain advances. Each AI response analysis returns:

  • persuasiveness (0.0–1.0)
  • confidence_level
  • consistency vs prior turns
  • negotiation_skill (weak/average/strong)
  • inconsistencies[]
  • key_information (extracts player name, claimed ship, etc.)
  • overall_believability

The enhanced manual fallback (services/enhanced_manual_provider.py) replicates this scoring with rule-based pattern matching — cat detection, ship-tier scaling, contextual response generation — so first login works offline.

Starting state on success

After a successful claim, the player is created with:

  • The claimed ship (with that ship's standard ShipSpecification).
  • Base credits per the table above (1,000 to 7,000).
  • Default Player row defaults (models/player.py):
  • credits initialized to 10,000 default but first-login flow overrides with the table value.
  • turns = 1000, max_turns = 1000.
  • military_rank = "Recruit", rank_points = 0.
  • personal_reputation = 0, reputation_tier = "Neutral", name_color = "#FFFFFF".
  • aria_consciousness_level = 1, aria_bonus_multiplier = 1.0.
  • home_sector_id = 1, current_sector_id = 1.
  • first_login = {"completed": True}.

The starter ship is created via core/ship_specifications_seeder.py and assigned as Player.current_ship.

Failure path

If persuasion fails after multiple attempts (or the player insists on a ship they can't justify), the guard forces them into the escape pod:

  • Escape Pod ship.
  • 500 credits.
  • Negotiation-skill flag set to weak (affects later dialogue trees if any).

This is the floor — the worst outcome still produces a viable starting state.

Database trail

models/first_login.py: - FirstLoginSession — one record per attempt, stores dialogue history. - DialogueExchange — individual back-and-forth turns. - ShipPresentationOptions — which 3+ ships were offered. - PlayerFirstLoginState — persistent post-completion state (negotiation flags, cat-boost, claimed ship). - ShipRarityConfig — admin-tunable spawn probability for each ship tier.

Player-facing affordances

  • Full-screen narrative interface with shipyard backdrop.
  • Free-form text input + fallback response buttons.
  • Dialogue history visible.
  • Subtle UI cues for negotiation difficulty.
  • Ability to abandon the attempt and accept the Escape Pod outcome.

Source map

Topic Path
Orchestrator services/gameserver/src/services/first_login_service.py
AI dialogue helpers services/gameserver/src/services/ai_dialogue_service.py
Multi-provider AI services/gameserver/src/services/ai_provider_service.py
Enhanced manual fallback services/gameserver/src/services/enhanced_manual_provider.py
Ship specifications services/gameserver/src/core/ship_specifications_seeder.py
Models services/gameserver/src/models/first_login.py
API routes services/gameserver/src/api/routes/first_login.py
Admin first-login tools services/gameserver/src/api/routes/admin_first_login.py
Guard personalities services/gameserver/src/utils/guard_personalities.py