Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
ce46a92
gamestate: Apply*Effect components.
heinezen Sep 1, 2024
3e6ec24
gamestate: Create Apply*Effect components for new entities.
heinezen Sep 1, 2024
0481db8
gamestate: API interface for Apply*Effect abilities.
heinezen Sep 1, 2024
bde650c
gamestate: Fix checking ability parents.
heinezen Sep 1, 2024
9cc0296
gamestate: Add Resistance component.
heinezen Sep 7, 2024
7090f3b
gamestate: Add basic system skeleton for applying effects.
heinezen Sep 7, 2024
39a8556
gamestate: resistance definitions.
heinezen Sep 7, 2024
b93aa12
gamestate: API layer for nyan effects.
heinezen Sep 7, 2024
055018c
gamestate: API layer for nyan resistances.
heinezen Sep 7, 2024
e7e9a58
gamestate: Add LineOfSight component.
heinezen Sep 7, 2024
949b66c
gamestate: LineOfSight definitions.
heinezen Sep 7, 2024
8a2b815
gamestate: Add missing definitions for already implemented abilities.
heinezen Sep 7, 2024
96624e8
gamestate: Allow fractional values for attributes.
heinezen Sep 8, 2024
f722016
gamestate: Calculate application for discrete FLAC effects.
heinezen Sep 8, 2024
55248fd
gamestate: Decrease log level of unrecognized components.
heinezen Sep 13, 2024
f9f517e
gamestate: ApplyEffect command.
heinezen Sep 14, 2024
1071ac0
gamestate: Rename command classes and make them 'final'.
heinezen Sep 14, 2024
b447094
gamestate: Add condition for ApplyEffect command in activity system.
heinezen Sep 15, 2024
b19942f
convert: Add new activity conditions for applying effects.
heinezen Sep 15, 2024
003b864
gamestate: Handle ApplyEffect in activity system.
heinezen Sep 15, 2024
c6eff84
gamestate: Fix time calculations for applying effects.
heinezen Sep 15, 2024
7c3df4a
gamestate: Move animation property handling to helper function.
heinezen Sep 15, 2024
f4e37cc
gamestate: Animate effect application.
heinezen Sep 15, 2024
185efff
curve: Add compress argument for curve operations.
heinezen Oct 16, 2024
74d70c3
curve: Rename argument for keyframes to 'keyframe'.
heinezen Oct 16, 2024
437e4b5
curve: Compress operation on keyframe insertion.
heinezen Oct 16, 2024
b292105
curve: Compress method for curves.
heinezen Oct 18, 2024
63ababf
curve: Add new unit tests for compress() method.
heinezen Oct 18, 2024
ddb8483
curve: Fix compression method.
heinezen Oct 18, 2024
163b40e
curve: Pass through compression args.
heinezen Oct 19, 2024
5d03402
curve: Compress during curve sync.
heinezen Oct 19, 2024
7992af4
renderer: Compress sync on animations curve.
heinezen Oct 19, 2024
cbb3962
renderer: Make fetching from render entity more reliable.
heinezen Oct 20, 2024
8c98932
curve: Fix compilation for oider clang versions.
heinezen Oct 20, 2024
b1d242a
curve: Concept for curve values.
heinezen Oct 20, 2024
59eaaec
doc: Add documentation for curve compression.
heinezen Oct 22, 2024
e3bde38
gamestate: Add activity node type for branching on value.
heinezen Nov 4, 2024
85676b2
gamestate: Handle XorSwichGate in activity system.
heinezen Nov 5, 2024
7640084
gamestate: Add unit tests for activity node types.
heinezen Nov 5, 2024
1a4f4e4
gamestate: Make a lookup function for next comand switching.
heinezen Nov 5, 2024
3717f67
convert: Use new switch gate for command branching.
heinezen Nov 5, 2024
3f5ec2e
gamestate: Init new XorSwitchGate activity node type from nyan.
heinezen Nov 7, 2024
f066157
gamestate: Resolve lookup func and node ID mapping for switch condition.
heinezen Apr 7, 2025
0ef81d0
gamestate: Correctly subtract/add applied attribute value.
heinezen Apr 7, 2025
f9925f5
gamestate: Fix missing convert effect type.
heinezen Apr 9, 2025
add3251
convert: Fix generated path of shared media files in modpack.
heinezen Apr 9, 2025
ea4ca84
gamestate: Only add apply effect command to game entities with matchi…
heinezen Apr 10, 2025
94a42c1
curve: Fix wrong assertion for interpolation.
heinezen Apr 10, 2025
a6fcaa5
util: Get absolute difference between two fixed point values.
heinezen Apr 10, 2025
8b8f618
curve: Fix overflow for interpolation time offsets.
heinezen Apr 10, 2025
1a30920
util: Add concepts for fixed point types.
heinezen Apr 11, 2025
ac2c1de
curve: Cleanup docstrings in KeyframeContainer class.
heinezen Apr 11, 2025
1a1e3c2
input: Use ID texture in input game controller.
heinezen Apr 20, 2025
e783063
input: Send ApplyEffect command to simulation.
heinezen Apr 20, 2025
596f889
util: Fix writeability check for Directory class.
heinezen Apr 20, 2025
8947cea
renderer: Update docstrings.
heinezen Apr 21, 2025
78281ea
renderer: Swap order of texture targets in world render stage.
heinezen Apr 21, 2025
49f240e
renderer: Add r32ui as supported output format for writing texture to…
heinezen Apr 21, 2025
8d9add3
gamestate: Process ApplyEffect command from input system.
heinezen Apr 21, 2025
489b6ea
renderer: Update docstring format for texture.h.
heinezen Apr 21, 2025
d15844d
renderer: Allow resizing texture without recreating it.
heinezen Apr 21, 2025
ff26d29
renderer: Resize all texture targets in render stages with new resize…
heinezen Apr 21, 2025
a0f66a8
input: Remove unnecessary resize callback for ID texture.
heinezen Apr 21, 2025
df80670
renderer: Check if all textures of render target have the same size.
heinezen Apr 21, 2025
ce714ee
renderer: Figure out attachment points with switch command.
heinezen Apr 21, 2025
70d5aa3
gamestate: Reserve some game entity IDs for internal use.
heinezen Apr 22, 2025
01f27e8
convert: Change ability with range to use Ranged property.
heinezen May 4, 2025
e4c8b20
convert: Fix pylint complaints.
heinezen May 4, 2025
8918e26
convert: Add new nyan objects for API 0.5.0.
heinezen May 10, 2025
6c99a9f
gamestate: Refactor location of activity gate function definitions.
heinezen May 10, 2025
24da167
gamestate: Allow passing nyan objects in condition/switch functions.
heinezen May 10, 2025
f361a80
convert: Change nyan objects for nyan API 0.5.0.
heinezen May 10, 2025
8c696c5
gamestate: Consolidate NextCommand condition functions into one.
heinezen May 10, 2025
3849106
gamestate: Store current target of command.
heinezen May 11, 2025
7600100
gamestate: Allow checking for the Ranged property in nyan API.
heinezen May 11, 2025
c762aaa
gamestate: Remove obsolete ranged apply effect abilities.
heinezen May 11, 2025
5d079d3
gamestate: Add reverse lookup for ability fqon to ability type.
heinezen May 11, 2025
8d94455
gamestate: Use switch statement for component assignment to new entity.
heinezen May 11, 2025
bda8707
gamestate: Pass state to condition functions.
heinezen May 11, 2025
ca4c189
gamestate; Define initial game entity IDs as constants.
heinezen May 11, 2025
02641d5
gamestate: Add lookup for ability type to component type.
heinezen May 11, 2025
f305e09
gamestate: Add condition for checking if a target is in range of an a…
heinezen May 11, 2025
3d6b0ff
gamestate: Store target of entity when receiving events.
heinezen May 11, 2025
6cd31ee
convert: Add range check before apply effect ability in activity,
heinezen May 11, 2025
6a75d39
gamestate: Add API interface for checking generic API objects.
heinezen May 11, 2025
f572563
gamestate: More reliable method to find API parent of nyan object.
heinezen May 11, 2025
23b0e6b
gamestate: Add method for checking if game entity/player exists.
heinezen May 11, 2025
9ec6236
input: Fix type of target ID send in command.
heinezen May 11, 2025
bb5cc68
gamestate: Make TargetInRange condition accessible for activity system.
heinezen May 11, 2025
88974f2
gamestate: Remove unnecessary parameters from ApplyEffect system.
heinezen May 11, 2025
6480616
convert: Add task nodes to nyan API loader.
heinezen May 11, 2025
a5f42a2
convert: Add clear queue task to default activity.
heinezen May 11, 2025
2c0eefe
curve: Fix breakout condition when clearing queue.
heinezen May 11, 2025
6d1cb27
gamestate: Use clear queue task in activity system.
heinezen May 11, 2025
a5fd975
gamestate: Make apply effect system use command information.
heinezen May 17, 2025
91e9cb6
gamestate: Remove separate queue for command queue targets.
heinezen May 18, 2025
b2a177a
gamestate: Add system for moving to target.
heinezen May 18, 2025
15619e9
gamestate: Private default movement to deestination.
heinezen May 18, 2025
ade21bb
convert: Move to target in default unit activity.
heinezen May 18, 2025
19c11e2
gamestate: Handle MoveToTarget task activity type.
heinezen May 18, 2025
7219ee8
gamestate: Fix wrong log messages.
heinezen May 18, 2025
1514e7c
gamestate: Clear command queue by default when new command is sent fr…
heinezen May 18, 2025
d0684a6
convert: Add activity node for checking if the game entity has an abi…
heinezen May 18, 2025
787b8d1
gamestate: Add condition function for AbilityUsable check.
heinezen May 18, 2025
f830926
gamestate: Turn entity towards target before applying effect.
heinezen May 18, 2025
0630349
doc: Move system descriptions into code docs.
heinezen May 18, 2025
39ea806
doc: Move component descriptions into code docs.
heinezen May 18, 2025
496a644
cfg: Update modpack version of converted games.
heinezen May 18, 2025
4cb8cdb
convert: Fix semantic version comparison.
heinezen May 18, 2025
3ca4c95
Merge branch 'feature/apply_effect' into feature/converter_refactor
heinezen May 27, 2025
456d3d6
convert: Move AoCSubprocessor methods into separate files.
heinezen May 28, 2025
9da6b66
convert: Remove typedefs from docstrings.
heinezen May 28, 2025
3487e2f
convert: Refactor AoCAuxiliarySubprocessor into separate files.
heinezen May 29, 2025
6888c47
convert: Refactor AoCCivSubprocessor into separate files.
heinezen May 29, 2025
eb4bf33
convert: Refactor AoCMediaSubprocessor into separate files.
heinezen May 30, 2025
326cdfd
convert: Refactor AoCModifierSubprocessor into separate files.
heinezen May 30, 2025
c668003
convert: Refactor AoCModpackSubprocessor into separate files.
heinezen May 30, 2025
e344123
convert: Refactor AoCNyanSubprocessor into separate files.
heinezen May 30, 2025
6f54eec
convert: Refactor AoCPregenSubprocessor into separate files.
heinezen May 30, 2025
3abf1ea
convert: Refactor AoCProcessor into separate files.
heinezen May 31, 2025
ba022f3
convert: Refactor AoCTechSubprocessor into separate files.
heinezen May 31, 2025
be46738
convert: Refactor AoCUpgradeAbilitySubprocessor into separate files.
heinezen Jun 1, 2025
125b0ad
convert: Refactor AoCUpgradeAttributeSubprocessor into separate files.
heinezen Jun 8, 2025
d5adbd0
convert: Refactor AoCUpgradeResourceSubprocessor into separate files.
heinezen Jun 8, 2025
f35ab32
convert: Refactor DE1 processor classes into separate files.
heinezen Jun 9, 2025
bfdc957
convert: Move DE2AbilitySubprocessor methods into separate files.
heinezen Jun 9, 2025
6c13249
convert: Refactor DE2CivSubprocessor into separate files.
heinezen Jun 9, 2025
d40a610
convert: Refactor DE2MediaSubprocessor into separate files.
heinezen Jun 9, 2025
153c3f2
convert: Refactor DE2NyanSubprocessor into separate files.
heinezen Jun 9, 2025
724e488
convert: Refactor DE2Processor into separate files.
heinezen Jun 9, 2025
b949c05
convert: Refactor DE2TechSubprocessor into separate files.
heinezen Jun 9, 2025
da889e6
convert: Refactor DE2UpgradeAttributeSubprocessor into separate files.
heinezen Jun 9, 2025
7c88ab5
convert: Refactor DE2UpgradeResourceSubprocessor into separate files.
heinezen Jun 9, 2025
cd13227
convert: Refactor HD processor classes into separate files.
heinezen Jun 9, 2025
6f6c995
convert: Refactor RoRAbilitySubprocessor into separate files.
heinezen Jun 10, 2025
5100eb2
convert: Refactor RoRAuxiliarySubprocessor into separate files.
heinezen Jun 10, 2025
4d6c1e1
convert: Refactor RoRCivSubprocessor into separate files.
heinezen Jun 10, 2025
9f2cf4d
convert: Refactor RoRNyanSubprocessor into separate files.
heinezen Jun 10, 2025
50daca1
convert: Refactor RoRPregenSubprocessor into separate files.
heinezen Jun 10, 2025
821e538
convert: Refactor RoRProcessor into separate files.
heinezen Jun 10, 2025
f9526b4
convert: Refactor RoRTechSubprocessor into separate files.
heinezen Jun 10, 2025
e2846fe
convert: Refactor RoRUpgradeAbilitySubprocessor into separate files.
heinezen Jun 10, 2025
3a7b88c
convert: Refactor RoRUpgradeAttributeSubprocessor into separate files.
heinezen Jun 10, 2025
5ad1e51
convert: Refactor RoRUpgradeResourceSubprocessor into separate files.
heinezen Jun 10, 2025
5c42e41
convert: Fix missing garrison empty condition in SWGB.
heinezen Jun 12, 2025
3b7ba6c
convert: Refactor SWGBCCAbilitySubprocessor into separate files.
heinezen Jun 12, 2025
cd09a11
convert: Refactor SWBGCCAuxiliarySubprocessor into separate files.
heinezen Jun 12, 2025
12e7d80
convert: Refactor SWBGCCCivSubprocessor into separate files.
heinezen Jun 12, 2025
5f3f4a4
convert: Refactor SWGBCCNyanSubprocessor into separate files.
heinezen Jun 12, 2025
f5ddc6a
convert: Refactor SWGBCCPregenSubprocessor into separate files.
heinezen Jun 12, 2025
fa42342
convert: Refactor SWGBCCProcessor into separate files.
heinezen Jun 12, 2025
849030d
convert: Refactor SWGBCCTechSubprocessor into separate files.
heinezen Jun 12, 2025
3e0e6d7
convert: Refactor SWBGCCUpgradeAttributeSubprocessor into separate fi…
heinezen Jun 12, 2025
d03ab18
convert: Refactor SWBGCCUpgradeResourceSubprocessor into separate files.
heinezen Jun 12, 2025
ee4b510
convert: Remove unsupported file xrefs from EnumLookupMember.
heinezen Jun 22, 2025
d0d2f59
convert: Handle unknown enum values in dat file more gracefully.
heinezen Jun 22, 2025
fafb7e6
convert: Add support for newest DE2 version .dat file.
heinezen Jun 22, 2025
62f1d4e
convert: Avoid multiple reads on enum lookup members.
heinezen Jun 22, 2025
96b62cd
convert: Ignore duplicates for container of DE2 attacks.
heinezen Jun 22, 2025
6c26806
convert: Allow conversion of additional task groups.
heinezen Jun 22, 2025
94cd025
convert: Remove unused member from GenieObjectContainer.
heinezen Jun 22, 2025
7e5d53e
convert: Add task groups to unit lines.
heinezen Jul 6, 2025
740354a
convert: Create stack building groups even if only head building is i…
heinezen Jul 7, 2025
757037b
convert: Add names for nyan objects in DE2:TTK.
heinezen Jul 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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