Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
959893a
gamestate: Apply*Effect components.
heinezen Sep 1, 2024
94238b6
gamestate: Create Apply*Effect components for new entities.
heinezen Sep 1, 2024
404da77
gamestate: API interface for Apply*Effect abilities.
heinezen Sep 1, 2024
5d57aa9
gamestate: Fix checking ability parents.
heinezen Sep 1, 2024
a38ed06
gamestate: Add Resistance component.
heinezen Sep 7, 2024
6bf6a28
gamestate: Add basic system skeleton for applying effects.
heinezen Sep 7, 2024
542748d
gamestate: resistance definitions.
heinezen Sep 7, 2024
1b4b287
gamestate: API layer for nyan effects.
heinezen Sep 7, 2024
d08c22f
gamestate: API layer for nyan resistances.
heinezen Sep 7, 2024
bddc34b
gamestate: Add LineOfSight component.
heinezen Sep 7, 2024
0aaaefc
gamestate: LineOfSight definitions.
heinezen Sep 7, 2024
fd31019
gamestate: Add missing definitions for already implemented abilities.
heinezen Sep 7, 2024
3c7ba1b
gamestate: Allow fractional values for attributes.
heinezen Sep 8, 2024
9bda7d3
gamestate: Calculate application for discrete FLAC effects.
heinezen Sep 8, 2024
39f9378
gamestate: Decrease log level of unrecognized components.
heinezen Sep 13, 2024
b7aa43f
gamestate: ApplyEffect command.
heinezen Sep 14, 2024
6c4c3b3
gamestate: Rename command classes and make them 'final'.
heinezen Sep 14, 2024
1b9da55
gamestate: Add condition for ApplyEffect command in activity system.
heinezen Sep 15, 2024
64dcfb8
convert: Add new activity conditions for applying effects.
heinezen Sep 15, 2024
17165b7
gamestate: Handle ApplyEffect in activity system.
heinezen Sep 15, 2024
04bf4c8
gamestate: Fix time calculations for applying effects.
heinezen Sep 15, 2024
826d498
gamestate: Move animation property handling to helper function.
heinezen Sep 15, 2024
6718a85
gamestate: Animate effect application.
heinezen Sep 15, 2024
7c64860
curve: Add compress argument for curve operations.
heinezen Oct 16, 2024
799b98e
curve: Rename argument for keyframes to 'keyframe'.
heinezen Oct 16, 2024
bfc62b6
curve: Compress operation on keyframe insertion.
heinezen Oct 16, 2024
b2ca950
curve: Compress method for curves.
heinezen Oct 18, 2024
4e935e7
curve: Add new unit tests for compress() method.
heinezen Oct 18, 2024
134c65e
curve: Fix compression method.
heinezen Oct 18, 2024
d968adc
curve: Pass through compression args.
heinezen Oct 19, 2024
85f6ce6
curve: Compress during curve sync.
heinezen Oct 19, 2024
0920ce5
renderer: Compress sync on animations curve.
heinezen Oct 19, 2024
c1ffbce
renderer: Make fetching from render entity more reliable.
heinezen Oct 20, 2024
ee36258
curve: Fix compilation for oider clang versions.
heinezen Oct 20, 2024
80ddc60
curve: Concept for curve values.
heinezen Oct 20, 2024
50db1d9
doc: Add documentation for curve compression.
heinezen Oct 22, 2024
2e19940
gamestate: Add activity node type for branching on value.
heinezen Nov 4, 2024
b4b533f
gamestate: Handle XorSwichGate in activity system.
heinezen Nov 5, 2024
d0d1c85
gamestate: Add unit tests for activity node types.
heinezen Nov 5, 2024
7b3f8a5
gamestate: Make a lookup function for next comand switching.
heinezen Nov 5, 2024
c3adc76
convert: Use new switch gate for command branching.
heinezen Nov 5, 2024
a2a843b
gamestate: Init new XorSwitchGate activity node type from nyan.
heinezen Nov 7, 2024
45210ea
gamestate: Resolve lookup func and node ID mapping for switch condition.
heinezen Apr 7, 2025
c952228
gamestate: Correctly subtract/add applied attribute value.
heinezen Apr 7, 2025
fc595b8
gamestate: Fix missing convert effect type.
heinezen Apr 9, 2025
b5ec69b
convert: Fix generated path of shared media files in modpack.
heinezen Apr 9, 2025
dc3d61d
gamestate: Only add apply effect command to game entities with matchi…
heinezen Apr 10, 2025
b4e2cdb
curve: Fix wrong assertion for interpolation.
heinezen Apr 10, 2025
a95396d
util: Get absolute difference between two fixed point values.
heinezen Apr 10, 2025
c54b66e
curve: Fix overflow for interpolation time offsets.
heinezen Apr 10, 2025
81db1fe
util: Add concepts for fixed point types.
heinezen Apr 11, 2025
1d9b655
curve: Cleanup docstrings in KeyframeContainer class.
heinezen Apr 11, 2025
5589ed3
input: Use ID texture in input game controller.
heinezen Apr 20, 2025
aa2870f
input: Send ApplyEffect command to simulation.
heinezen Apr 20, 2025
21158cc
util: Fix writeability check for Directory class.
heinezen Apr 20, 2025
4c6bd6a
renderer: Update docstrings.
heinezen Apr 21, 2025
98e2f3a
renderer: Swap order of texture targets in world render stage.
heinezen Apr 21, 2025
52d1596
renderer: Add r32ui as supported output format for writing texture to…
heinezen Apr 21, 2025
01424b5
gamestate: Process ApplyEffect command from input system.
heinezen Apr 21, 2025
a192190
renderer: Update docstring format for texture.h.
heinezen Apr 21, 2025
0d7242c
renderer: Allow resizing texture without recreating it.
heinezen Apr 21, 2025
934e16f
renderer: Resize all texture targets in render stages with new resize…
heinezen Apr 21, 2025
3f6c18e
input: Remove unnecessary resize callback for ID texture.
heinezen Apr 21, 2025
acadb96
renderer: Check if all textures of render target have the same size.
heinezen Apr 21, 2025
b22e7af
renderer: Figure out attachment points with switch command.
heinezen Apr 21, 2025
5aa35b9
gamestate: Reserve some game entity IDs for internal use.
heinezen Apr 22, 2025
0b0e098
convert: Change ability with range to use Ranged property.
heinezen May 4, 2025
79ee946
convert: Fix pylint complaints.
heinezen May 4, 2025
070a7cc
convert: Add new nyan objects for API 0.5.0.
heinezen May 10, 2025
6f3f4e1
gamestate: Refactor location of activity gate function definitions.
heinezen May 10, 2025
7b025cd
gamestate: Allow passing nyan objects in condition/switch functions.
heinezen May 10, 2025
a69c98c
convert: Change nyan objects for nyan API 0.5.0.
heinezen May 10, 2025
81a03c5
gamestate: Consolidate NextCommand condition functions into one.
heinezen May 10, 2025
9f79449
gamestate: Store current target of command.
heinezen May 11, 2025
e2ae406
gamestate: Allow checking for the Ranged property in nyan API.
heinezen May 11, 2025
cc35ed6
gamestate: Remove obsolete ranged apply effect abilities.
heinezen May 11, 2025
d19cfce
gamestate: Add reverse lookup for ability fqon to ability type.
heinezen May 11, 2025
664fba2
gamestate: Use switch statement for component assignment to new entity.
heinezen May 11, 2025
ea2393b
gamestate: Pass state to condition functions.
heinezen May 11, 2025
0b7f072
gamestate; Define initial game entity IDs as constants.
heinezen May 11, 2025
0572fa1
gamestate: Add lookup for ability type to component type.
heinezen May 11, 2025
c16b0a4
gamestate: Add condition for checking if a target is in range of an a…
heinezen May 11, 2025
6e8318f
gamestate: Store target of entity when receiving events.
heinezen May 11, 2025
2423d4f
convert: Add range check before apply effect ability in activity,
heinezen May 11, 2025
eea2d79
gamestate: Add API interface for checking generic API objects.
heinezen May 11, 2025
75ade57
gamestate: More reliable method to find API parent of nyan object.
heinezen May 11, 2025
c76f288
gamestate: Add method for checking if game entity/player exists.
heinezen May 11, 2025
d7f1e1f
input: Fix type of target ID send in command.
heinezen May 11, 2025
8ccf07c
gamestate: Make TargetInRange condition accessible for activity system.
heinezen May 11, 2025
28ed44c
gamestate: Remove unnecessary parameters from ApplyEffect system.
heinezen May 11, 2025
ffff0b1
convert: Add task nodes to nyan API loader.
heinezen May 11, 2025
98ecb0e
convert: Add clear queue task to default activity.
heinezen May 11, 2025
8894782
curve: Fix breakout condition when clearing queue.
heinezen May 11, 2025
b69e452
gamestate: Use clear queue task in activity system.
heinezen May 11, 2025
9ed03d5
gamestate: Make apply effect system use command information.
heinezen May 17, 2025
89d0267
gamestate: Remove separate queue for command queue targets.
heinezen May 18, 2025
d8b9789
gamestate: Add system for moving to target.
heinezen May 18, 2025
023b281
gamestate: Private default movement to deestination.
heinezen May 18, 2025
ee4de8d
convert: Move to target in default unit activity.
heinezen May 18, 2025
774a6e5
gamestate: Handle MoveToTarget task activity type.
heinezen May 18, 2025
4c72b8a
gamestate: Fix wrong log messages.
heinezen May 18, 2025
5949f88
gamestate: Clear command queue by default when new command is sent fr…
heinezen May 18, 2025
e95c440
convert: Add activity node for checking if the game entity has an abi…
heinezen May 18, 2025
d65a9d8
gamestate: Add condition function for AbilityUsable check.
heinezen May 18, 2025
1d009be
gamestate: Turn entity towards target before applying effect.
heinezen May 18, 2025
c3c5671
doc: Move system descriptions into code docs.
heinezen May 18, 2025
fef0bc5
doc: Move component descriptions into code docs.
heinezen May 18, 2025
6ff88b9
cfg: Update modpack version of converted games.
heinezen May 18, 2025
3a197e4
convert: Fix semantic version comparison.
heinezen May 18, 2025
8826885
curve: Add unit tests to check compressed curve size and content.
heinezen Aug 16, 2025
3f18674
curve: Remove explicit passing of container size in sync() of Keyfram…
heinezen Aug 16, 2025
04ab452
gamestate: Return NONE command if command queue is empty on switch co…
heinezen Aug 17, 2025
65bde30
gamestate: Use absolute difference for calculating angles.
heinezen Aug 17, 2025
6742098
gamestate: Use std::visit to process move target variant.
heinezen Aug 17, 2025
c7d9b6f
gamestate: Use nyan Object::extends to check for parent relationship.
heinezen Aug 17, 2025
b0d6eb4
Let nyan handle casting of ValueHolder to Value.
heinezen Aug 17, 2025
a8df5d5
gamestate: Rename condition_t to condition_function_t.
heinezen Aug 17, 2025
0c74ab9
gamestate: Replace optional+variant type with std::monostate.
heinezen Aug 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions cfg/converter/games/game_editions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ expansions = []
]

[AOC.targetmods.aoe2_base]
version = "0.5.1"
version = "0.6.0"
versionstr = "1.0c"
min_api_version = "0.5.0"
min_api_version = "0.6.0"


[AOCDEMO]
Expand All @@ -63,9 +63,9 @@ expansions = []
blend = ["data/blendomatic.dat"]

[AOCDEMO.targetmods.trial_base]
version = "0.5.1"
version = "0.6.0"
versionstr = "Trial"
min_api_version = "0.5.0"
min_api_version = "0.6.0"


[AOK]
Expand Down Expand Up @@ -145,9 +145,9 @@ expansions = []
]

[AOE1DE.targetmods.de1_base]
version = "0.5.1"
version = "0.6.0"
versionstr = "1.0a"
min_api_version = "0.5.0"
min_api_version = "0.6.0"


[ROR]
Expand Down Expand Up @@ -185,9 +185,9 @@ expansions = []
]

[ROR.targetmods.aoe1_base]
version = "0.5.1"
version = "0.6.0"
versionstr = "1.0a"
min_api_version = "0.5.0"
min_api_version = "0.6.0"


[HDEDITION]
Expand Down Expand Up @@ -229,9 +229,9 @@ expansions = []
]

[HDEDITION.targetmods.hd_base]
version = "0.5.1"
version = "0.6.0"
versionstr = "5.8"
min_api_version = "0.5.0"
min_api_version = "0.6.0"


[AOE2DE]
Expand Down Expand Up @@ -278,9 +278,9 @@ expansions = []
]

[AOE2DE.targetmods.de2_base]
version = "0.6.0"
version = "0.7.0"
versionstr = "Update 118476+"
min_api_version = "0.5.0"
min_api_version = "0.6.0"


[SWGB]
Expand Down Expand Up @@ -320,6 +320,6 @@ expansions = ["SWGB_CC"]
]

[SWGB.targetmods.swgb_base]
version = "0.5.1"
version = "0.6.0"
versionstr = "1.1-gog4"
min_api_version = "0.5.0"
min_api_version = "0.6.0"
29 changes: 29 additions & 0 deletions doc/code/curves.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Curves are an integral part of openage's event-based game simulation.
1. [Queue](#queue)
2. [Unordered Map](#unordered-map)
3. [Array](#array)
4. [Compression](#compression)


## Motivation
Expand Down Expand Up @@ -133,6 +134,9 @@ Modify operations insert values for a specific point in time.
| `set_insert(t, value)` | Insert a new keyframe value at time `t` |
| `set_last(t, value)` | Insert a new keyframe value at time `t`; delete all keyframes after time `t` |
| `set_replace(t, value)` | Insert a new keyframe value at time `t`; remove all other keyframes with time `t` |
| `compress(t)` | Remove redundant keyframes at and after time `t`; see [Compression] for more info |

[Compression]: #compression

**Copy**

Expand Down Expand Up @@ -292,3 +296,28 @@ Modify operations insert values for a specific point in time.
| Method | Description |
| ---------------- | ------------------------------------------------------------------------------------------------ |
| `sync(Curve, t)` | Replace all keyframes from self after time `t` with keyframes from source `Curve` after time `t` |


## Compression

Curves support basic lossless compression by removing redundant keyframes from the curve.
Keyframes are considered redundant if they do not change any interpolation results, i.e.
the result of `get(t)` does not change.

The most straight-forward way to use compression with primitive curves is the `compress(t)`
method. `compress(t)` iterates over the curve and removes all redundant keyframes after
or at time `t`. The runtime has linear complexity `O(n)` based on the number of elements
in the keyframe container.

Furthermore, primitive curves support incremental compression during insertion for the
`set_insert(t, value)` and `set_last(t, value)` methods via their `compress` argument.
If compression is active, `(t, value)` is only inserted when it is not a redundant
keyframe. `sync(Curve, t)` also supports compression with a flag `compress` passed as
an argument.

Compression may be used in cases where the size should be kept small, e.g. when the curve
is transferred via network or recorded in a replay file. Another application of compression
is in the [renderer](/doc/code/renderer/README.md) for the discrete curves storing an object's
animations. Since compression removes redundant animation entries, the renderer can determine
when the current animation has started much easier as this is then returned by the keyframe
time in `frame(t)`.
71 changes: 60 additions & 11 deletions doc/code/game_simulation/activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ configurable.

1. [Motivation](#motivation)
2. [Architecture](#architecture)
3. [Node Types](#node-types)
3. [Workflow](#workflow)
1. [Initialization](#initialization)
2. [Advancing in the graph](#advancing-in-the-graph)
4. [Node Types](#node-types)


## Motivation
Expand All @@ -32,7 +35,20 @@ and event triggers that indicate which path to take next. By traversing the node
its paths, the game entities actions are determined. The currently visited node in the graph
corresponds to the current action of a unit.

Activities are reusable, i.e. they are intended to be shared by many game entities Usually,
Advancement to the next node can be initiated in several ways, depending on the
[node type](#node-types) of the current node.
It can happen automatically or be triggered by an event. In the latter case,
the event is handled by the `GameEntityManager` which calls an activity *system*
that processes the event to choose the next node.

Advancing in the graph, i.e. visiting nodes and performing actions costs no ingame time. Time
delays of actions, e.g. for using an game mechanic like movement, are instead handled by
scheduling and waiting for events at certain nodes in the graph (e.g. `XOR_EVENT_GATE` nodes).
This means that when running the activity system, the directed edges of the nodes are followed
until a node that waits for an event is reached. This allows the activity graph to support
complex action chains that can be executed in sequence.

Activities are reusable, i.e. they are intended to be shared by many game entities. Usually,
all game entities of the same type should share the same behaviour, so they get assigned
the same activity node graph.

Expand All @@ -45,14 +61,47 @@ representation. You don't need to know BPMN to understand the activity control f
we explain everything important about the graphs in our documentation. However,
you can use available [BPMN tools](https://bpmn.io/) to draw activity node graphs.

## Node Types
Like all game data, activities and node types for game entities are defined via the
[nyan API](doc/nyan/openage-lib.md).


## Workflow

![Activity Workflow](images/activity_workflow.png)

### Initialization

When a game entity is spawned, the engine first checks whether entity's `GameEntity` API object
has an ability `Activity` assigned. If that is the case, the activity graph is loaded from
the corresponding API objects defining the graph. Most of this step involves creates the
nodes and connections for the graph as well as mapping the API objects to node actions.

The loaded activity graph is stored in a `Activity` component that is assigned to the game
entity. At this point, the activity state of the entity is still uninitialized which allows
the entity or the component to be cached for faster assignment to entities using the same graph.
To let the entity become active, the `init(..)` method of the Activity component should be
called after the entity is completely initialized. This sets the activity state to the start
node of the actvity graph.

### Advancing in the graph

After the game entity is spawned, the `GameEntityManager` is called once to trigger the initial
behavior of the game entity. This advances the activity state until the first event branch where
an event is required for further advancement. The `GameEntityManager` now waits for events
for the entity to further advance in the graph.

A game entity's current activity state is stored in its `Activity` component in form of
a reference to the current node. Additionally, the components stores the list of events
the entity currently waits for to advance.

## Node Types

| Type | Inputs | Outputs | Description |
| ---------------- | ------ | ------- | ------------------------- |
| `START` | 0 | 1 | Start of activity |
| `END` | 1 | 0 | End of activity |
| `TASK_SYSTEM` | 1 | 1 | Run built-in system |
| `TASK_CUSTOM` | 1 | 1 | Run custom function |
| `XOR_EVENT_GATE` | 1 | 1+ | Wait for event and branch |
| `XOR_GATE` | 1 | 1+ | Branch on condition |
| Type | Description | Inputs | Outputs |
| ----------------- | ------------------------- | ------ | ------- |
| `START` | Start of activity | 0 | 1 |
| `END` | End of activity | 1 | 0 |
| `TASK_SYSTEM` | Run built-in system | 1 | 1 |
| `TASK_CUSTOM` | Run custom function | 1 | 1 |
| `XOR_EVENT_GATE` | Wait for event and branch | 1 | 1+ |
| `XOR_GATE` | Branch on condition | 1 | 1+ |
| `XOR_SWITCH_GATE` | Branch on value | 1 | 1+ |
130 changes: 0 additions & 130 deletions doc/code/game_simulation/components.md

This file was deleted.

Loading
Loading