Skip to content

Implement Mobile Control Schemes for Android/iOS Support #18

@stphung

Description

@stphung

Overview

Continuum currently only supports desktop keyboard controls, limiting its accessibility on mobile platforms. To expand the game's reach and provide a modern gaming experience, we need comprehensive mobile control schemes optimized for touch interfaces.

Current State

  • Desktop-only keyboard controls (WASD/Arrow keys, Spacebar, X/Z)
  • No touch input handling
  • No mobile UI adaptations
  • Missing haptic feedback integration
  • No consideration for different screen orientations

Requirements

Core Mobile Controls

Touch Movement System

  • Virtual joystick/d-pad for player movement
  • Drag-to-move alternative control scheme
  • Tilt-based movement using accelerometer (optional)
  • Customizable sensitivity settings

Firing Controls

  • Auto-fire toggle option (recommended for mobile)
  • Tap-to-fire manual control
  • Hold-to-fire continuous shooting
  • Gesture-based weapon switching (swipe left/right)

Special Actions

  • Bomb activation button (prominent, hard to accidentally trigger)
  • Weapon type switching controls
  • Pause/menu access (hardware back button + on-screen)

Mobile-Specific Features

Adaptive UI System

  • Touch-friendly button sizes (minimum 44pt touch targets)
  • Responsive layout for different screen sizes and aspect ratios
  • Orientation support (portrait primary, landscape optional)
  • Safe area handling for notched displays

Control Customization

  • Draggable UI elements for personalized layouts
  • Button size adjustment (small/medium/large)
  • Transparency/opacity controls for better visibility
  • Left/right-handed layout presets

Performance Optimization

  • Touch input pooling to reduce allocations
  • Efficient gesture recognition
  • Optimized for 60 FPS on mobile hardware
  • Battery usage considerations

Platform Integration

Android Specific

  • Hardware back button handling (pause menu)
  • Navigation bar integration
  • Support for different Android screen densities
  • Game Controller support (optional)

iOS Specific

  • Home indicator handling
  • Control Center gesture avoidance
  • Screen edge gesture management
  • Game Center integration prep

Cross-Platform

  • Haptic feedback for actions (weapon fire, explosions, damage)
  • Touch sound feedback option
  • Save control preferences across sessions

Technical Implementation

Godot Mobile Architecture

Input System Refactoring

# Unified input manager supporting multiple schemes
extends Node

class_name InputManager

enum ControlScheme {
    DESKTOP_KEYBOARD,
    MOBILE_TOUCH,
    MOBILE_TILT,
    GAMEPAD
}

signal movement_input(direction: Vector2)
signal fire_input(pressed: bool)
signal weapon_switch_input()
signal bomb_input()

func set_control_scheme(scheme: ControlScheme) -> void
func get_movement_vector() -> Vector2
func is_firing() -> bool

Mobile UI Components

# Touch controls overlay
extends Control

class_name MobileControls

@onready var virtual_joystick: VirtualJoystick
@onready var fire_button: TouchButton  
@onready var bomb_button: TouchButton
@onready var weapon_switch: SwipeGesture

func setup_for_device(screen_size: Vector2, safe_area: Rect2) -> void
func save_layout() -> void
func load_layout() -> void

Gesture Recognition

# Gesture detection for advanced controls
extends Node

class_name GestureDetector

signal swipe_detected(direction: Vector2)
signal pinch_detected(scale: float)
signal tap_detected(position: Vector2)
signal long_press_detected(position: Vector2)

Integration Points

Player System Updates

  • Modify Player.gd to accept input from InputManager
  • Add mobile-specific movement dampening
  • Implement auto-fire mode for touch controls

UI System Changes

  • Create mobile-specific scene variants
  • Implement responsive HUD scaling
  • Add touch control overlays

Settings System

  • Mobile controls configuration menu
  • Control scheme selection
  • Sensitivity and customization options

Design Considerations

Usability Principles

  • Thumb-friendly zones: Place frequently used controls within comfortable thumb reach
  • Visual clarity: High contrast controls that work in various lighting conditions
  • Accidental activation prevention: Sufficient spacing between critical buttons
  • Progressive disclosure: Hide advanced controls behind simple defaults

Accessibility

  • Motor accessibility: Large touch targets, customizable layouts
  • Visual accessibility: High contrast options, scalable UI elements
  • Cognitive accessibility: Simple, consistent control patterns

Performance

  • Touch latency: Minimize input-to-action delay (target <50ms)
  • Battery efficiency: Optimize touch polling and haptic usage
  • Thermal management: Prevent overheating during extended gameplay

Testing Strategy

Device Coverage

  • Various Android devices (different screen sizes, OS versions)
  • iOS devices (iPhone, iPad with different screen sizes)
  • Different aspect ratios (18:9, 19.5:9, 4:3 tablets)
  • Edge case devices (foldables, notched screens)

Control Testing

  • Precision testing for movement and firing
  • Gesture recognition accuracy
  • Simultaneous touch input handling
  • Performance under continuous touch input

User Experience Testing

  • First-time user experience (no tutorial needed)
  • Extended play session comfort
  • Control customization workflow
  • Accessibility with various motor abilities

Implementation Phases

Phase 1: Basic Touch Controls (High Priority)

  • Virtual joystick for movement
  • Touch buttons for fire/bomb
  • Basic mobile UI adaptation
  • Settings integration

Phase 2: Advanced Features (Medium Priority)

  • Gesture-based controls
  • Layout customization
  • Haptic feedback
  • Auto-fire modes

Phase 3: Platform Polish (Low Priority)

  • Platform-specific optimizations
  • Advanced gesture recognition
  • Accessibility enhancements
  • Controller support

Success Criteria

  1. Playability: Game is fully playable on mobile with touch controls
  2. Responsiveness: Input latency under 50ms for critical actions
  3. Customization: Players can adapt controls to their preferences
  4. Performance: 60 FPS maintained with touch input active
  5. Accessibility: Works for users with different motor abilities
  6. Polish: Professional mobile game control experience

Dependencies

  • Mobile export templates for Godot
  • Touch input testing devices
  • Mobile app store preparation (future)
  • Mobile-specific asset optimization

This feature is essential for expanding Continuum's audience and providing a modern mobile gaming experience that matches desktop quality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions