Core Concepts

From Archon Wiki
Jump to: navigation, search

Summary

Archon is a family of engines build on a common core of functionality which includes a scripting language, 3D renderer, and other basic components for games. Iteration is the key driving aim of the engine, which is why you can iterate shaders, scripts, and textures without leaving a running game.

Archon is also based on the idea of allowing us to support developers as fully as possible. Control of the codebase allows for new features and requests to be turned around in a matter of hours, rather than weeks or until some unknown release window.

Archon engines come in a number of 'flavours' - with the core functionality wrapped with engines focused on specific gameplay types or styles. These include tile and hex map turn-based games (in the style of Pike&Shot or Battle Academy), and region map games (a la Legion or Risk). It's important to note that these flavours do not restrict the gameplay at all - all game mechanics and UI are implemented by the developer. An example of this is that the 3 games using the previous generation STUB engine (Battle Academy 2, Pike&Shot (and Pike&Shot:Campaigns), and Hell are all using the same EXE - all the gameplay, UI, AI, etc differences are driven by scripting.

A Running Start

From the first day you your game will have large chunks of functionality already integrated and working, including:

PBEM++

The lobby, turn exchange, and stste saving is all built in. As well as Server Messaging for players, pushing information to them from you. This also means that your game starts off Tournament-ready for the automated online Tournament system.

DLC

A system for DLC, including on Steam, comes built-in.

Modding

Modders get to use all the same tools that you do, and you get access to your own space to host vetted mod packs which can then be downloaded from ingame with a single click.


Scripting

Scripting allows a developer to control all aspects of the game design at all levels from the UI to game mechanics. The system has been designed to be resilient to bugs (hard to crash) as well as providing detailed feedback of errors during development. It also includes an integrated debugger. Scripts can be reloaded at any time while the game is running, even if structures or variables have been changed, with all data still valid.

A huge library of integrated functions are included in each flavour, including routefinding, data file parsing, visual effects (particle systems, text), and many more.

The basic scripting syntax is similar to the C language, and supports structures and arrays.

#define MAX_DATA 8  // macro expansions are supported

struct TData  // define a structure
{
  char name[32] ;
  int value ;
  int data[MAX_DATA] ;
}

TData gData[256] ;  // global variable, these are shared across scripts

FUNCTION ProcessData(int index)  // define a function
{
TData a ;

  a = gData[index] ;

  a.value += 1 ;
  a.data[0] = a.value ;

  gData[index] = a ;  // we could of course just operate on gData[index] directly

  return a.value ;  // functions can only return int values
}

Scripts are hooked into the system at a variety of points, ranging from UI events and updates, to rendering of controls or 3D objects. The script framework needed to (for example) customise a UI screen is common, so developers need only write the logic that is needed. An example is the way that some of the flavours implement unit orders, which is via a script with the following form

FUNCTION CHECK_ALL_MyAction(me, tilex, tiley)
{
   // return either the cost of the action ,or -1 for disabled, -2 to hide order
}

FUNCTION ALL_MyAction(me, tilex, tiley)
{
   // do the action
}

So adding these two functions (and their internals) is all that is needed for a new order to pop up ingame (something that can happen without even restarting the running application). Additional functions can be added to control the rendering of the order button, tooltips, etc. But this is just a simple example, the developer also has the ability to run per-tick and per-turn functions, as well as complete control of the AI turn. But want a new, specific, hook? We can add it quickly and easily.

Graphics

Archon is built for high quality graphics using Shader Model 3.0, which allows for high quality visuals while still running on a wide variety of machines - critical given the ongoing popularity of laptops and older machines.

An importer allows models and other assets to be built in a variety of tools and exported as industry-standard FBX files. These can then be previewed and tweaked in the tool before exporting as compact and quickloading game files. The tool also allows for custom shaders to be applied to models and sub-meshes.

And talking of shaders, while the initial drop includes a set of default shaders (supporting a normal-mapped, specular shader across static and skinned models) these are just to start you off. If desired you can rewrite them, or add additional special-case shaders for use on your models. Shaders can even be iterated and reloaded at runtime, allowing you to see your changes immediately.