Worldbuilding
Ability Function Theory
The mathematical abstraction of character abilities, covering Ability Functions, spells, and the Nabla spell.
This section introduces the theory of Ability Functions. An Ability Function is the mathematical abstraction of a character’s power in a two-dimensional world, and it serves as the foundation for understanding and designing character abilities.
Definition of Ability Functions
In the mathematical model of a two-dimensional world, a character’s special ability can be abstracted as a mapping relation, which we call an Ability Function. This function rigorously describes how an ability transforms inputs (targets or conditions of action) into outputs (effects produced by the action).
Let be the Input Space of an ability, containing all possible targets, initial conditions, or trigger states upon which the ability may act. Let be the Output Space of the ability, containing all possible resulting effects.
An Ability Function is a mapping
that maps each input to a unique output .
In this case:
- is called the input or preimage of the ability.
- is called the output or image of the ability under input .
- The specific form of the mapping embodies the rules of how the character’s ability operates and the effects it produces.
Ability Functions have the following important characteristics:
- Breadth of Input and Output Spaces: the input space and output space are not limited to traditional number sets; they may instead be: - sets of concrete entities such as characters and objects;
- sets of attribute values such as HP, MP, and status conditions;
- continuous domains such as spatial coordinates and time intervals;
- vectors, matrices, or other abstract mathematical structures.
- Constraints of the Worldview: all Ability Functions within the same worldview must obey the fundamental laws established by that world.
- Determinacy: for a given input , the Ability Function must produce a definite output .
Two Basic Types of Ability Functions
Depending on the mathematical nature of the input and the way it is processed, Ability Functions exhibit two basic operational modes in practice, and are therefore divided into two fundamental types: discrete Ability Functions and continuous Ability Functions.
Discrete Ability Functions
When the inputs of an Ability Function are discrete, countable objects, its mode of operation is discrete.
If the input space of an Ability Function is a discrete set (either finite or countably infinite), then is called a Discrete Ability Function. Its effect is realized by directly applying the function to each input element:
If, in a given activation of the ability, the targeted input set is only , then the corresponding output set is:
where is the specific set of targets selected in this activation of the ability.
Continuous Ability Functions
When the input of an Ability Function is an element of a continuous space, and its effect must be computed through accumulation, its mode of operation is continuous.
If the input space of an Ability Function is a continuous domain (for example, a spatial region or a time interval), and its total effect is obtained by integrating an Effect Density Function defined on , then is called a Continuous Ability Function. Its total effect set is expressed as:
where is an infinitesimal element over the domain , and is the density function, which may itself be regarded as a local, pointwise Ability Function.
Formally speaking, the expression of a Continuous Ability Function does not differ from that of a Discrete Ability Function; both may be written as . However, their methods of computation and scenarios of use are fundamentally different:
- Discrete Ability Functions: with the expression , one can directly evaluate the function on each discrete input, making them suitable for single-target or finitely many targets.
- Continuous Ability Functions: although the expression is likewise , direct evaluation is not possible; instead, one accumulates the effect density over a continuous domain by integration, making them suitable for area-based, region-based, or duration-based abilities.
Spells
Spells are a special class of Ability Function operators in this worldview. By altering the mapping rules of an Ability Function itself, they create new abilities.
Let be the set of all Ability Functions within a given worldview. A Spell is a mapping from the set of Ability Functions to itself:
It maps one Ability Function to another new Ability Function .
For any object of action , the effect of the new Ability Function is determined by:
The Spell changes the operational rule of the ability itself, rather than merely modifying its output value.
The key difference between a Spell and simple function composition is that a Spell acts on the function itself as a mapping rule, rather than on specific input-output values. Common types of Spells include:
- Linear Amplification Spell : redefines the output of an Ability Function as times its original output
- Exponential Decay Spell : causes the effect of an Ability Function to decay exponentially with spatial or temporal coordinates. If is a spatially dependent Ability Function, then after this Spell acts upon it, it becomes:
- Range Restriction Spell : restricts the effective domain of an Ability Function to the region
The composition of Spells, written , is defined as:
In general, Spell composition is not commutative; that is, .
The sound combination and application of Spells form one of the core mechanisms by which characters in WeiKnight’s worldview develop their abilities.
Nabla Spell
The Nabla Spell is one of the most powerful Spells for spatial transformation in WeiKnight’s worldview, and is generally written as . This Spell can simultaneously manipulate multiple rates of change in space, and through different combinations can realize powerful effects such as the Gauss formula and Green’s formula.
Concept of the Nabla Spell
In three-dimensional space, the Nabla Spell is defined as:
This Spell may act on either a scalar Ability Function or a vector Ability Function , producing different effects:
In the two-dimensional plane, the Spell may be defined analogously as:
When a Continuous Ability Function takes effect, it forms a field. This field is also called an Ability Field.
Applications of the Nabla Spell
The Nabla Spell can produce powerful effects. Its principal effect is the dimensional elevation of the scope of action.
When the Spell is combined with the closed surface integral , it can realize the transformation of the scope of action from a surface domain to a spatial domain:
In this case, the range of action expands from the enclosing surface domain of a space to the spatial domain itself.
In the two-dimensional plane, the Spell is combined with the closed curve integral :
This realizes a transformation of the scope of action from a curve to the plane enclosed by that curve.
For a spatial curve, the Spell is combined with the closed curve integral :
In this case, the scope of action is transformed from a spatial curve into a spatial surface.