Skip to content

[Unreal] Refactor agones component to subsystem#4033

Merged
markmandel merged 18 commits intoagones-dev:mainfrom
GloryOfNight:refactor-to-subsystem
Nov 12, 2025
Merged

[Unreal] Refactor agones component to subsystem#4033
markmandel merged 18 commits intoagones-dev:mainfrom
GloryOfNight:refactor-to-subsystem

Conversation

@GloryOfNight
Copy link
Copy Markdown
Contributor

@GloryOfNight GloryOfNight commented Nov 11, 2024

What type of PR is this?

/kind breaking

What this PR does / Why we need it:

  • Refactor agones from using ActorComponent to GameInstanceSubsystem:

    • Subsystem seems to be more suitable for agones in general. Documentation on topic
    • Subsystem will persist across all worlds.
    • Subsystem easier to integrate, since it does not require being part of some actor which it should be attached to. You can see updated documentation to understand how much easier it to use.
    • Subsystem would be created only for server builds, saving on resources.
    • Subsystem could be easily obtained using Get() function from any UObject context
  • Removed final keyword, to allow basing of Subsystem and overriding it's behavior.

  • Added bDisableAutoHealthPing variable to disable auto call to HealthPing() during Initialization

  • Added blueprint readwrite flag support for HealthRateSeconds, bDisableAutoHealthPing, bDisableAutoConnect to improve blueprint support slightly.

  • Space&Tabs mix change to just Tabs

Special notes for your reviewer:

That is something we used internally for some time already and I think people can benefit from that change.
This change would break code that was previously dependent on AgonesComponent.

build.log

@github-actions github-actions bot added kind/breaking Breaking change size/M labels Nov 11, 2024
@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: 3ab0bc2c-9618-471a-af73-0f58076bc7d9

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/4033/head:pr_4033 && git checkout pr_4033
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.45.0-dev-0d0c4d4

@GloryOfNight GloryOfNight marked this pull request as ready for review November 11, 2024 15:19
@agones-bot
Copy link
Copy Markdown
Collaborator

Build Failed 😭

Build Id: 25d7e15e-cdf9-4b3c-a2b3-6d160f0177d3

Status: FAILURE

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@GloryOfNight GloryOfNight marked this pull request as draft November 12, 2024 12:03
@gongmax
Copy link
Copy Markdown
Collaborator

gongmax commented Nov 13, 2024

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: f3e2be54-b83b-4fda-ae32-fdb1375a3cc7

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/4033/head:pr_4033 && git checkout pr_4033
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.45.0-dev-b87eaef

@GloryOfNight GloryOfNight marked this pull request as ready for review December 14, 2024 22:49
@igooch
Copy link
Copy Markdown
Collaborator

igooch commented Jan 29, 2025

@KAllan357 as an Unreal contributor, could you please review? This PR in particular is marked as breaking.

@igooch
Copy link
Copy Markdown
Collaborator

igooch commented Jan 31, 2025

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Failed 😭

Build Id: c1fe56e2-bbf7-4971-a783-6e629d40a987

Status: FAILURE

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@igooch
Copy link
Copy Markdown
Collaborator

igooch commented Mar 10, 2025

@KiaArmani @DevChagrins @oniku2929 as recent Unreal contributors, could you please take a look at this PR?

@DevChagrins
Copy link
Copy Markdown
Contributor

@KiaArmani @DevChagrins @oniku2929 as recent Unreal contributors, could you please take a look at this PR?

Without pulling the code and building locally, the code looks good to me.

# Conflicts:
#	sdks/unreal/Agones/Source/Agones/Private/AgonesSubsystem.cpp
@markmandel markmandel requested a review from Copilot November 10, 2025 15:21
@markmandel
Copy link
Copy Markdown
Collaborator

/gcbrun

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the Agones Unreal SDK from an ActorComponent-based architecture to a GameInstanceSubsystem-based architecture. The changes improve lifecycle management, reduce dependencies, and provide better integration with Unreal Engine's subsystem framework.

  • Migrates from UAgonesComponent to UAgonesSubsystem using Unreal's subsystem architecture
  • Introduces a custom FTimerManager to handle timer operations independently of World
  • Adds new configuration options for disabling auto-connect and auto-health ping features

Reviewed Changes

Copilot reviewed 5 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdks/unreal/Agones/Source/Agones/Public/AgonesSubsystem.h Renamed and refactored header to use GameInstanceSubsystem base class, added subsystem lifecycle methods
sdks/unreal/Agones/Source/Agones/Private/AgonesSubsystem.cpp Renamed and refactored implementation to use subsystem lifecycle and custom timer management
sdks/unreal/Agones/Agones.Build.cs Removed unnecessary Slate dependencies
sdks/unreal/Agones/Agones.uplugin Changed plugin loading phase from PreLoadingScreen to Default
site/static/images/unreal_bp_usage.png Added new image asset for documentation
Comments suppressed due to low confidence (4)

sdks/unreal/Agones/Source/Agones/Public/AgonesSubsystem.h:121

  • Corrected spelling of 'Retrive' to 'Retrieve'.
    sdks/unreal/Agones/Source/Agones/Public/AgonesSubsystem.h:140
  • Corrected spelling of 'HealhPing' to 'HealthPing'.
    sdks/unreal/Agones/Source/Agones/Public/AgonesSubsystem.h:163
  • Corrected spelling of 'initilization' to 'initialization'.
    sdks/unreal/Agones/Source/Agones/Public/AgonesSubsystem.h:111
  • The documentation still refers to this as 'Unreal Component' but it's now a subsystem. This should be updated to 'Unreal Subsystem' for accuracy.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@markmandel
Copy link
Copy Markdown
Collaborator

Swinging about around on this - CoPilot did find some spelling errors that we should fix please:

  • Corrected spelling of 'Retrive' to 'Retrieve'.
    sdks/unreal/Agones/Source/Agones/Public/AgonesSubsystem.h:140
  • Corrected spelling of 'HealhPing' to 'HealthPing'.
    sdks/unreal/Agones/Source/Agones/Public/AgonesSubsystem.h:163
  • Corrected spelling of 'initilization' to 'initialization'.
    sdks/unreal/Agones/Source/Agones/Public/AgonesSubsystem.h:111
  • The documentation still refers to this as 'Unreal Component' but it's now a subsystem. This should be updated to 'Unreal Subsystem' for accuracy.

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: 23824d24-3a84-4ee8-83ab-a093855cc5bd

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/4033/head:pr_4033 && git checkout pr_4033
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.54.0-dev-5983142

@markmandel markmandel requested a review from Copilot November 10, 2025 19:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 5 out of 10 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (3)

sdks/unreal/Agones/Source/Agones/Public/AgonesSubsystem.h:121

  • The comment contains a typo: "Retrive" should be "Retrieve".
    sdks/unreal/Agones/Source/Agones/Private/AgonesSubsystem.cpp:110
  • [nitpick] Consider adding a null check for GameInstance before dereferencing. While GetSubsystem may handle null internally, being explicit about the null case improves code clarity and prevents potential crashes if the implementation changes.
    sdks/unreal/Agones/Source/Agones/Private/AgonesSubsystem.cpp:116
  • [nitpick] UE_SERVER is a compile-time preprocessor definition. Using it in a runtime function like ShouldCreateSubsystem means the subsystem will either always be created or never created depending on the build configuration. This is correct for the intended behavior (server-only subsystem), but the documentation comment should clarify that this only affects compilation, not runtime server detection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Collaborator

@markmandel markmandel left a comment

Choose a reason for hiding this comment

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

/gcbrun

Seems legit to me. other than spelling errors.

Any objection to merging @igooch , @lacroixthomas ?

@markmandel
Copy link
Copy Markdown
Collaborator

/gcbrun

Co-authored-by: Mark Mandel <mark@compoundtheory.com>
@keith-miller
Copy link
Copy Markdown
Contributor

lgtm and a welcome change!

@markmandel
Copy link
Copy Markdown
Collaborator

Part of me wants to merge this on the 24th, because then it's been a full year 🤦🏻‍♂️ (not really, let's get this in soon)

mumbles something about really needing some approvers with Unreal knowledge

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: bdf91344-485b-47ed-9615-1cbb291475d7

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/4033/head:pr_4033 && git checkout pr_4033
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.54.0-dev-a9d003f

@markmandel
Copy link
Copy Markdown
Collaborator

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: 67aa95be-fe38-4053-86e1-5303e1698a29

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/4033/head:pr_4033 && git checkout pr_4033
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.54.0-dev-e981303

Copy link
Copy Markdown
Collaborator

@markmandel markmandel left a comment

Choose a reason for hiding this comment

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

Le'ts get this merged. Finally!

@markmandel markmandel merged commit a3b5712 into agones-dev:main Nov 12, 2025
4 checks passed
@GloryOfNight GloryOfNight deleted the refactor-to-subsystem branch November 12, 2025 08:46
mnthe pushed a commit to mnthe/agones that referenced this pull request Mar 23, 2026
* refactor agones component to subsystem
* - add blueprint read&write exposure
* - remove unused module dependecies
* - changed loading phase to default
* removed depency on FTSTickerObjectBase
* move tick bind from constructor to init
* Update sdks/unreal/Agones/Source/Agones/Public/AgonesSubsystem.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants