Skip to content
This repository was archived by the owner on Aug 25, 2020. It is now read-only.

DevelopersDocumentation.wiki

Serge Camille edited this page Aug 24, 2015 · 1 revision

Introduction

SimulationCraft never had much of a Documentation about its code. While this might be a big setback for new developers, there is always the risk of information becoming outdated very quickly and documentation is nearly always badly maintained.

So this Wiki page doesn't want to create a extensive documentation, but give you more of a broad and conceptual overview about the architecture of SimC. It might be more of a guide/how to, to help you getting started.

The basics

The core structure

  • The top layer of SimC is the class sim_t:

    • It parses all options passed to the program
    • It creates and initializes players and sets up everything for the simulation
    • It runs the actual simulation: It controls the event wheel, starts and ends combat, analyzes at the end.
  • player_t represents the player layer.

    • It contains all information on how to create and initialize a player, what buffs and procs he has, manages his stats and resources and everything else which has to do with the player.
  • action_t is the foundation of all actions/abilities

    • It contains all ability information ( base dmg, coefficient, cooldown, etc. )
    • It defines the functions to execute an action. Important ones are execute(), ready(), cost(), impact( target ), tick()

The class modules

  • <class>_t inherits from player_t and takes care of everything specific about that class. Let's look at sage_sorcerer_t as an example:
    • Most functions in player_t are of virtual nature: this allows class module to override, or append to them. Example:
virtual double sage_sorcerer_t::force_bonus_multiplier() const
{
  return player_t::force_bonus_multiplier() + buffs.tremors -> stack() * 0.01;
}

This redefines the sage_sorcerer_t::force_bonus_multiplier() function by combining the value of the parent function ( player_t::force_bonus_multiplier() ) with another 1% per tremors stack.

The class abilities

  • <class>_action_t is inherited from action_t and defines some generic functions and behaviour applying to ALL abilities of that class
  • <class>_<melee/force/range/etc.>_t is derived from <class>_action_t and usually defines all class abilities of a certain attack-type.
  • Actual abilities inherit from this <class>_<attack_type>_t and define everything specific to the ability, including how talents affect it.

Advanced functions

  • event_t: Event class used for creating custom events. Defining the inherited execute() function is mandatory, defining what happens when the event is executed. To add the event to the timing wheel, use sim -> add_event( event_t*, timespan_t delta_time );
Clone this wiki locally