Skip to content

agentx-cgn/Hannibal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hannibal

An AI/Bot for 0 A.D.

Intro

Hannibal is a new approach to reduce the complexity of programming a bot for 0 A.D., a free, open-source, cross-platform real-time strategy game under development by Wildfire Games. Hannibal tackles the complexity of an RTS with hundreds of units by organizing them into a society of autonomous groups, each with its specific task.

Blog

Read development notes at agentx.svbtle.com

Features

  • A triple store to interfere features of cultures, like
    who can gather fields, can a healer melee?

  • A query language to retrieve information as a set of nodes from the triple store
    "food.grain GATHEREDBY WITH costs.metal = 0, costs.stone = 0, costs.wood = 0 SORT < costs.food"

  • A group system describing the behavior of groups of units
    (grain-picker, hunter, warrior, guerrilla, miner, etc)

  • A domain specific language called group script, based on JavaScript method and property chaining to define a fluent interface and describe the behaviour of groups in a near natural language

  • An economy model with an order queue, a cost analyzer and
    a statistic module providing metrics based on resource flows with trends and forecast.

  • A HTN Planner to calculate economic development, advancing to next phase and planning attack strategies

  • Map Analysis & Pathfinder for intelligent and adequate game play

Try Out

Prerequisites

  • Check game paths for your system
  • Locate folder \binaries\data\mods\ within 0 A.D. installation
  • Copy the zip + readme from latest release into mods/

Play

  • Start 0 A.D.,
  • Open mod selection and activate Hannibal
  • Select single player/new game, and choose Hannibal as bot
  • Choose a difficulty from the settings dialog

Test & Development

  • Start 0 A.D. with params: -quickstart -autostart=aitest03 -autostart-ai=1:hannibal
  • Customize launcher.py and launch 0 A.D. from commadline (Linux only)

HTML Data Explorer

Testing

Hannibal extensively logs against standard output until switched off in config.js. On Windows best seen using DebugView with option carriage returns unforced.

Progress

  • The web interface aka explorer generates basic plans
  • Added data browsing to explorer

Roadmap

A18

  • Saved games, given engine support (cancelled, for the time being)
  • Shared, dynamic and exclusive buildings
  • Plan based economy, taking resource availability into account
  • Advanced map analysis
  • Fortified cities (towers, walls?)
  • Take advantage of all available technologies
  • Basic attack plans and execution

A19

  • Walls, palisades
  • Advanced attack plans
  • Policies via SWOT analysis

A20

  • Seafaring, naval operation

Technology

  • SpiderMonkey 29/31
  • Javascript 1.85 + partially ES6
  • FF30+

Useful Ingame Hotkeys

  • F11: Enable/disable real-time profiler (toggles through the displays of information)
  • F12: Show time elapsed since the beginning of the game
  • F2: Take screenshot (in .png format, location is displayed in the top left of the GUI
  • Alt + F: Show/hide frame counter (FPS)
  • Alt + K: Show the 0 A.D. logo and copyright notice as a watermark for images.
  • Alt + G: Hide/show the GUI
  • Alt + D: Show/hide developer overlay (with developer options)
  • Space: If timewarp mode enabled (in the developer overlay), speed up the game
  • Backspace: If timewarp mode enabled (in the developer overlay), go back to an earlier point in the game
  • More: http://trac.wildfiregames.com/wiki/HotKeys

Project Links

Videos

Further Readings and Links

Literature

License

tbd