Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable Activities #1609

Merged
merged 44 commits into from
Jan 12, 2024
Merged

Conversation

heinezen
Copy link
Member

@heinezen heinezen commented Dec 7, 2023

Makes the activity system configurable with nyan.

  • Converter: Configure activities as abilities for game entities
    • Load new nyan data API objects (see nyan data API v0.4.1 #1608)
    • Assign default activity to game entity definitions in modpack
    • Export new engine modpack version
  • Activity system
    • Define condition/event function per branch for XorGate/XorEventGate
    • Add built-in condition functions
    • Add built-in event primer functions
  • Entity creation
    • Get data from activity objects from nyan API
    • Create activity from nyan definition
    • Cache created activities

@heinezen heinezen added nice new thing ☺ A new feature that was not there before lang: python Done in Python code area: assets Involved with assets (images, sounds, ...) area: nyan Involves our data description language/database labels Dec 7, 2023
@heinezen heinezen marked this pull request as draft December 7, 2023 22:41
@heinezen heinezen force-pushed the feature/activity_configure branch 6 times, most recently from a8ffed9 to 6a46710 Compare December 24, 2023 01:55
@heinezen heinezen force-pushed the feature/activity_configure branch from 6a46710 to cf0fda6 Compare December 24, 2023 12:36
@heinezen heinezen marked this pull request as ready for review December 24, 2023 21:15
@heinezen heinezen added the area: simulation Involved in the game mechanics and simulation label Dec 24, 2023
@heinezen heinezen force-pushed the feature/activity_configure branch from bc962b1 to 7549a9e Compare December 24, 2023 21:55
@heinezen heinezen added the lang: c++ Done in C++ code label Dec 25, 2023
Copy link
Member

@TheJJ TheJJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

progress!

libopenage/gamestate/activity/event/command_in_queue.cpp Outdated Show resolved Hide resolved
libopenage/gamestate/activity/event/command_in_queue.cpp Outdated Show resolved Hide resolved
libopenage/curve/queue.h Outdated Show resolved Hide resolved
libopenage/curve/queue.h Outdated Show resolved Hide resolved
return {db_view->get_object(next->get_name())};
}
// 1+ next nodes
case activity::node_t::XOR_GATE: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be part of the xorgate node implementation instead of this central place? might be a suitable application of a std variant and stdvisit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to integrate nyan too deep into the gamestate. That's why these helper classes exist as a kind of layer between nyan and openage. I think this also makes it easier to maintain the API when we change it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but isn't the xorgate node class the abstraction layer? so instead of having specific snippets here, having them more local to the specific code using it seems more local.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this would make more sense though. The function here is only used to traverse the activity graph defined in the modpack, so it doesn't have much to do with activities at runtime. It's only use is to create the runtime activity from the nyan definition. XorGate and the other nodes have their own internal next function for traversing the runtime graph.

libopenage/gamestate/api/activity.cpp Outdated Show resolved Hide resolved
openage/convert/tool/api_export.py Outdated Show resolved Hide resolved
@heinezen heinezen force-pushed the feature/activity_configure branch from 7549a9e to 0e7178f Compare December 25, 2023 18:12
@heinezen heinezen requested a review from TheJJ December 25, 2023 18:41
@heinezen heinezen force-pushed the feature/activity_configure branch from 73d51f8 to ec381df Compare January 2, 2024 18:48
@TheJJ TheJJ merged commit c4ccd41 into SFTtech:master Jan 12, 2024
13 checks passed
@heinezen heinezen mentioned this pull request Jan 14, 2024
@heinezen heinezen deleted the feature/activity_configure branch February 23, 2024 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: assets Involved with assets (images, sounds, ...) area: nyan Involves our data description language/database area: simulation Involved in the game mechanics and simulation lang: c++ Done in C++ code lang: python Done in Python code nice new thing ☺ A new feature that was not there before
Projects
Status: ✅ Done
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants