Contact us before you begin

Getting Started

Prerequisites

Before you begin training your agent, ensure you have:
  • Unity 2022.3 LTS or newer
  • Python 3.8+ with pip installed
  • ML-Agents Toolkit from Unity
  • PyTorch or TensorFlow for training

Installation Steps

1

Install Unity ML-Agents

pip install mlagents
2

Clone HypeDuel Training Template

git clone https://github.com/hypeduel/agent-training-template
cd agent-training-template
3

Install Dependencies

pip install -r requirements.txt
4

Open in Unity

Open the project in Unity Hub and load the training scene

Training Configuration

Agent Behavior Parameters

Configure your agent’s learning parameters in the config.yaml file:
behaviors:
  HypeDuelAgent:
    trainer_type: ppo
    hyperparameters:
      batch_size: 1024
      buffer_size: 10240
      learning_rate: 3.0e-4
      beta: 5.0e-4
      epsilon: 0.2
      lambd: 0.99
      num_epoch: 3
      learning_rate_schedule: linear
    network_settings:
      normalize: false
      hidden_units: 128
      num_layers: 2
    reward_signals:
      extrinsic:
        gamma: 0.99
        strength: 1.0
    max_steps: 500000
    time_horizon: 64
    summary_freq: 10000

Observation Space

Your agent will receive observations including:
  • Arena State: Current positions, health, and power-ups
  • Opponent Behavior: Movement patterns and recent actions
  • Environmental Data: Arena boundaries, obstacles, and hazards
  • Game State: Time remaining, score differential, and power-up availability

Action Space

Agents can perform actions such as:
  • Movement: Forward, backward, left, right
  • Combat: Attack, defend, special abilities
  • Strategy: Positioning, power-up collection, defensive maneuvers

Training Process

Local Training

Start training your agent locally:
mlagents-learn config.yaml --run-id=hypeduel-agent-v1

Training Metrics

Monitor your agent’s progress with key metrics:

Cumulative Reward

Track total rewards earned per episode

Episode Length

Monitor how long your agent survives in battles

Win Rate

Percentage of battles won against baseline opponents

Policy Loss

Measure learning convergence and stability

Arena Submission

Once your agent is trained:
  1. Test Performance: Validate against benchmark opponents
  2. Model Optimization: Ensure efficient inference speed
  3. Submit to HypeDuel: Upload your .onnx model file
  4. Arena Registration: Register your agent for specific arenas

Best Practices

Training Tips

  • Start Simple: Begin with basic behaviors before complex strategies
  • Reward Engineering: Design rewards that encourage desired behaviors
  • Regular Evaluation: Test against diverse opponents frequently
  • Incremental Complexity: Gradually introduce advanced mechanics

Performance Optimization

  • Observation Normalization: Scale inputs for stable training
  • Action Space Design: Balance expressiveness with training efficiency
  • Memory Management: Optimize for both training and inference
  • Model Compression: Reduce model size for faster arena deployment

Troubleshooting

Common Issues