Skip to content

The repository for the game 'ProjectHypnos' (development name) for development and bookkeeping sakes

Notifications You must be signed in to change notification settings

MattyTD/ProjectHypnos

Repository files navigation

Project Hypnos - Battle System Proof of Concept

Overview

Project Hypnos is an innovative turn-based combat system that combines traditional JRPG mechanics with real-time timer management and rhythm-game-inspired defensive mechanics. The system features a unique "pseudo-reverse ATB" approach where player actions are constrained by time rather than strict turn counts.

Core Combat Philosophy

Unlike traditional turn-based RPGs where each character gets exactly one action per turn, Project Hypnos uses a time-based set system:

  • Each party member has a limited time window (default: 12 seconds) to act
  • Multiple actions can be taken if time remains
  • A "set" continues until all party members' timers reach zero
  • Strategic time management becomes as important as action selection

Battle System Components

1. Battlefield Layout

The battlefield uses a compass-oriented positioning system with four quadrants:

  • North - Top position
  • East - Right position
  • South - Bottom position
  • West - Left position (starting position for all party members)
  • Center - Enemy position

All units are positioned logically/UI-based rather than moving in 3D space. Multiple party members can occupy the same position simultaneously.

2. Turn Flow ("Set" System)

Player Set Structure:

  1. Battle begins with up to 4 party members (m1-m4) at the West position
  2. Units act in turn order (m1 → m2 → m3 → m4)
  3. Each unit has a real-time countdown timer (customizable, default 12s)
  4. Timer decreases while making decisions (moving, targeting, menu navigation)
  5. Only attack/skill animations pause the timer
  6. After all units act once, if any unit has remaining time, the cycle repeats
  7. Set ends when all unit timers reach zero

Enemy Turn:

  • Uses traditional single-action turn system
  • Can target specific positions
  • Can exploit elemental weaknesses
  • Multiple actions based on enemy strength

3. Actions & Turn Logic

Actions that END the current unit's turn:

  • Melee attack
  • Use item
  • Use EO skill
  • Use Ranti skill
  • Pass (explicitly skip turn)

Actions that DO NOT end the turn:

  • Transform to EO form
  • Move to different position
  • Check enemy turn order (T key)

4. Time Manipulation Mechanics

TFN (Time For Now)

  • Triggered by hitting enemy weaknesses
  • Applies to the next unit in turn order
  • Slows their timer tick rate (e.g., 0.75x, 0.5x speed)
  • Capped at minimum 0.25x speed
  • Visually displayed in UI with speed multiplier indicator

SP (Stockpile)

  • Also earned by hitting weaknesses
  • Adds bonus time to that unit's timer in the next set
  • Example: +2s SP means 14s instead of 12s next set
  • Displayed in unit status area

5. Combat Actions

Melee Attacks (Base Form Only)

Features a Mario & Luigi / Paper Mario inspired action command system:

  1. Select enemy target using WASD
  2. Attack animation begins
  3. Action command ring appears with buttons: E, Q, R, ⎵ (Space)
  4. Four prompts appear randomly assigned to buttons:
    • Delta - 100% damage (Amazing)
    • Theta - 75% damage (Great)
    • Alpha - 50% damage (Good)
    • Beta - 25% damage (OK)
  5. Player has 0.8 seconds to press the correct button
  6. Sequence repeats 3 times per attack
  7. Total damage = sum of all three inputs (max 300%)
  8. Successful timing grants EO gauge increase

In EO Form: Melee attacks are single animated strikes with no action commands.

Skills

  • Only accessible in EO (Egbe Orun) form
  • Consume MP (Mana Points)
  • Accessed via Skills menu (E button when in EO form)

Items

  • Accessed via Items menu (R button)
  • Available in both base and EO forms

Ranti Skills (Combo Moves)

  • Require specific unit combinations and positions
  • Can be unit-activation specific (only certain units can initiate)
  • May require units in base form, EO form, or mixed states
  • Consume MP/HP depending on the skill
  • Example: "m1 in North + m2 & m3 in East" configuration requirement

6. Defense Mechanics (Real-Time Reactions)

Defense varies based on position occupancy:

When 2+ Units Share a Position:

  • Guard: Always successful, reduces damage, minor EO gain
  • Dodge: Timed input, zero damage on success, moderate EO gain
  • Parry is not available in group positions

When 1 Unit is Alone:

  • Dodge: Easier timing window, zero damage, minor EO gain
  • Parry: Tight timing window, counterattacks + major EO gain
  • Guard is not available when alone

Defense Timing Windows:

  • Dodge Perfect: 0.1s (100ms)
  • Dodge Good: 0.3s (300ms)
  • Parry Perfect (Counter): 0.05s (50ms)
  • Parry Good: 0.15s (150ms)

All defensive actions are rhythm-game style real-time reactions during enemy attacks.

7. EO System (Egbe Orun / Limit Break)

Building the EO Gauge:

  • Gradual fill after each turn/set
  • Blocking, dodging, and especially parrying build EO
  • Successful action commands during melee also build EO

EO Transformation:

When the gauge is full, units can transform:

Visual Changes (planned for future):

  • 2D sprite → 3D low-poly PS1-style model

Mechanical Changes:

  • Stat boosts applied
  • Unlock MP bar and magic/special skills
  • HP damage redirects to EO bar instead
  • If EO bar depletes from damage → forced de-transformation

Stressed Out (SO) Debuff:

Triggered when EO bar is fully depleted by enemy attacks:

  • HP immediately drops to 25% of max (if higher)
  • Unit reverts to base form
  • EO gain rate reduced by 50%
  • Makes future transformations harder to achieve

8. Elemental System

Units have elemental weaknesses and resistances:

  • Physical - Standard melee damage
  • Fire, Water, Earth, Air - Classic elements
  • Light, Dark - Special elements

Weakness Exploitation:

  • Deals increased damage (multiplier based on resistance value)
  • Grants SP time to attacker
  • Applies TFN to next unit
  • If in EO form, depletes EO bar faster
  • Enemies gain extra turns if exploiting player weaknesses

UI Layout

Bottom Left Corner

  • W/A/S/D - Positional movement indicators
  • T - View enemy turn order

Command Circle (Left of Active Unit)

A circular menu (placeholder, will be dreamcatcher graphic) with four buttons:

Button Position Base Form Function EO Form Function
E North EO Transform Skills Menu
West Melee Attack Simple Melee
R East Items Menu Items Menu
Q South Ranti Skills Ranti Skills

Below Command Circle:

  • 1 Key - Retry battle (reset to start state)
  • N Key - Pass turn

Top Left Corner

  • Active unit name header
  • Enlarged timer bar for current unit
  • Timer speed indicator (when TFN active)

Top Center

  • Player Set / Enemy Set indicator (text placeholder for icon)

Top Right Corner

Party Status Display (vertical, by turn order):

  • Current unit shown largest at top
  • Remaining units below in turn order
  • Each unit shows:
    • HP bar + value
    • EO bar + value
    • MP bar + value (only visible in EO form)
    • Status effect icons/labels (SO, TFN, SP)

Other Units (Not Active):

  • Small timer bars displayed above their heads in the battlefield

Technical Architecture

Core Classes

ACombatUnit (CombatUnit.h/cpp)

The base class for all combatants (players and enemies).

Key Properties:

  • Health (HP), Timer, EO gauge, MP
  • Elemental resistances
  • Position tracking
  • Status effects (Stressed Out, Incapacitated)

Key Functions:

  • ResetTimer() - Applies SP bonuses and resets for new set
  • TakeDamageCustom() - Handles elemental damage and EO/HP routing
  • TransformToEO() / ExitEOForm() - Transformation management
  • GainEO() - EO gauge building
  • ApplyStressedOut() - SO debuff application

ABattleManager (BattleManager.h/cpp)

Central controller for battle flow and state management.

Key Responsibilities:

  • Turn order management
  • Set completion tracking
  • Timer tick management (paused during animations)
  • TFN/SP system orchestration
  • Battle state transitions

Key Functions:

  • StartBattle() - Initialize battle state
  • EndCurrentUnitTurn() - Progress to next unit or end set
  • PassTurn() - Explicit turn skip
  • RetryBattle() - Reset to battle start
  • AttackUnit() - Process attacks with elemental calculations
  • HandleWeaknessHit() - Apply TFN and SP rewards

APositionManager (PositionManager.h/cpp)

Manages unit positioning and position-based logic.

Key Functions:

  • MoveUnitToPosition() - Handle unit movement
  • GetUnitsAtPosition() - Query position occupancy
  • CanUseGuard() / CanUseParry() - Position-based defense availability

ADefenseManager (DefenseManager.h/cpp)

Handles all defensive mechanics and timing evaluation.

Key Functions:

  • AttemptGuard() / AttemptDodge() / AttemptParry() - Process defense attempts
  • EvaluateDefenseResult() - Timing accuracy evaluation
  • CalculateDamageReduction() - Defense effectiveness
  • ProcessDefenseAttempt() - Complete defense resolution with EO gain
  • OnCounterAttack() - Trigger parry counterattacks

UBattleHUDWidget (BattleHUDWidget.h/cpp)

UMG widget for the battle UI.

Key Responsibilities:

  • Real-time timer display updates
  • Unit status visualization (HP/EO/MP bars)
  • Button state management (enabled/disabled based on context)
  • TFN/SP/SO status indicators
  • Command circle interaction

Current Implementation Status

Implemented

  • Core battle flow (sets, turn order, timer system)
  • Position management (4 quadrants + center)
  • Basic attack system with elemental damage
  • TFN (Time For Now) mechanic
  • SP (Stockpile) mechanic
  • EO gauge building and transformation
  • Stressed Out debuff
  • Defense system framework (Guard/Dodge/Parry)
  • Position-based defense availability
  • UI widget structure
  • Retry battle functionality
  • Turn skip detection for KO/incapacitated units

In Progress / TODO

  • Melee action command minigame (button prompts, timing system)
  • Defense timing minigame (rhythm-game input detection)
  • Enemy AI (currently placeholder)
  • Skills system (skill definitions, MP costs, targeting)
  • Items system (inventory, item effects)
  • Ranti skills system (combo configurations, multi-unit requirements)
  • Visual transformations (2D sprite → 3D model for EO form)
  • Animation system (attack animations, skill VFX)
  • Sound effects (action feedback, transformation audio)
  • Enemy turn order display (T key functionality)
  • Complete UI polish (dreamcatcher command circle, icons)

Getting Started

Prerequisites

  • Unreal Engine 5.6
  • Visual Studio 2022 (or compatible C++ IDE)
  • Basic understanding of UMG (Unreal Motion Graphics)

Project Setup

  1. Clone the repository
  2. Open ProjectHypnos.uproject in Unreal Engine
  3. Compile the C++ code (Build → Build Solution in Visual Studio)
  4. Open the Content Browser and navigate to Battle System blueprints

Creating a Test Battle

  1. Place BattleManager actor in your level
  2. Place PositionManager actor in your level
  3. Place DefenseManager actor in your level
  4. Create 4 CombatUnit blueprints for player units
  5. Create 1+ CombatUnit blueprints for enemy units
  6. Assign units to BattleManager arrays:
    • Add player units to PlayerUnits array
    • Add enemy units to EnemyUnits array
  7. Create a BattleHUDWidget blueprint (parent: UBattleHUDWidget)
  8. Design the UI layout with required widget bindings
  9. Call BattleManager->StartBattle() to begin

Key Configuration Points

BattleManager:

  • BaseTimerDuration - Time per unit (default: 12s)
  • TFNSpeedMultiplier - Timer slowdown amount

CombatUnit:

  • MaxHP - Unit health
  • MaxEO - EO gauge capacity
  • MaxMP - Mana capacity (EO form only)
  • TimerDuration - Per-unit timer override
  • ElementalResistances - Weakness/resistance configuration

DefenseManager:

  • DodgePerfectWindow - Perfect dodge timing (0.1s)
  • ParryPerfectWindow - Perfect parry timing (0.05s)
  • GuardDamageReduction - Guard effectiveness (50%)
  • ParryEOGain - EO gained from successful parry (25)

Design Inspirations

This battle system draws inspiration from:

  • Persona 3 Reload / Persona 5 - UI design, weakness system, turn order display
  • Metaphor: ReFantazio - Command circle layout, retry functionality, menu aesthetics
  • Paper Mario: TTYD / Mario & Luigi - Action command timing mechanics
  • Final Fantasy X - Turn order visualization, status display
  • Clair Expedition 33 - Rhythm-based defensive reactions
  • Deltarune - Turn-based structure with interactive elements

Future Roadmap

Phase 1: Core Gameplay Loop (Current Phase)

  • Basic battle flow
  • Action command minigames
  • Defense timing system
  • Enemy AI

Phase 2: Content Systems

  • Skills database and implementation
  • Items and inventory
  • Ranti skill configurations
  • Enemy variety and behaviors

Phase 3: Polish & Feel

  • Visual effects and animations
  • Sound design and music integration
  • UI refinement (dreamcatcher command circle)
  • EO transformation visuals (2D → 3D)

Phase 4: Advanced Features

  • Multiple enemy encounters
  • Battle formations
  • Status effect variety
  • Equipment system
  • Difficulty scaling

Contributing

This is currently a proof of concept for a personal project. Feedback and suggestions are welcome!

License

Copyright © 2025. All rights reserved.


Project Hypnos - Where time is your greatest weapon and your harshest limitation.

About

The repository for the game 'ProjectHypnos' (development name) for development and bookkeeping sakes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published