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

Unreal plugin WatchGameServer implementation #2064

Merged
merged 2 commits into from
Apr 30, 2021

Conversation

highlyunavailable
Copy link
Contributor

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking
/kind bug
/kind cleanup
/kind documentation

/kind feature

/kind hotfix

What this PR does / Why we need it:

This PR adds the WatchGameServer functionality to the Unreal plugin. It allows Unreal-based games to react immediately to Agones state changes instead of polling.

Also corrects some docs around the WatchGameServer websocket endpoint.

Which issue(s) this PR fixes:
N/A

Special notes for your reviewer:

Build log from Unreal for CI purposes.

Build log:

CONSOLE: Use build tool: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe
9:36:39 PM Building C:\repos\agones\PluginTest\Intermediate\ProjectFiles\PluginTest.vcxproj
0>"C:\Program Files\Epic Games\UE_4.25\Engine\Build\BatchFiles\Build.bat" PluginTestEditor Win64 Development -Project="C:\repos\agones\PluginTest\PluginTest.uproject" -WaitMutex -FromMsBuild
0>Using 'git status' to determine working set for adaptive non-unity build (C:\repos\agones).
0>Creating makefile for PluginTestEditor (no existing makefile)
0>Parsing headers for PluginTestEditor
0>  Running UnrealHeaderTool "C:\repos\agones\PluginTest\PluginTest.uproject" "C:\repos\agones\PluginTest\Intermediate\Build\Win64\PluginTestEditor\Development\PluginTestEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -abslog="C:\Users\_\AppData\Local\UnrealBuildTool\Log_UHT.txt" -installed
0>Reflection code generated for PluginTestEditor in 4.2109695 seconds
0>Building PluginTestEditor...
0>Using Visual Studio 2019 14.28.29333 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).
0>Building 14 actions with 8 processes...
0>  [1/14] Default.rc2
0>  [2/14] Default.rc2
0>  [3/14] SharedPCH.Engine.ShadowErrors.cpp
0>  [4/14] PluginTest.cpp
0>  [5/14] PluginTest.init.gen.cpp
0>  [6/14] PluginTestGameModeBase.cpp
0>  [7/14] PluginTestGameModeBase.gen.cpp
0>  [8/14] UE4Editor-PluginTest.lib
0>     Creating library C:\repos\agones\PluginTest\Intermediate\Build\Win64\UE4Editor\Development\PluginTest\UE4Editor-PluginTest.lib and object C:\repos\agones\PluginTest\Intermediate\Build\Win64\UE4Editor\Development\PluginTest\UE4Editor-PluginTest.exp
0>  [9/14] UE4Editor-PluginTest.dll
0>     Creating library C:\repos\agones\PluginTest\Intermediate\Build\Win64\UE4Editor\Development\PluginTest\UE4Editor-PluginTest.suppressed.lib and object C:\repos\agones\PluginTest\Intermediate\Build\Win64\UE4Editor\Development\PluginTest\UE4Editor-PluginTest.suppressed.exp
0>  [10/14] Module.Agones.gen.cpp
0>  [11/14] Module.Agones.cpp
0>  [12/14] UE4Editor-Agones.lib
0>     Creating library C:\repos\agones\PluginTest\Plugins\Agones\Intermediate\Build\Win64\UE4Editor\Development\Agones\UE4Editor-Agones.lib and object C:\repos\agones\PluginTest\Plugins\Agones\Intermediate\Build\Win64\UE4Editor\Development\Agones\UE4Editor-Agones.exp
0>  [13/14] UE4Editor-Agones.dll
0>     Creating library C:\repos\agones\PluginTest\Plugins\Agones\Intermediate\Build\Win64\UE4Editor\Development\Agones\UE4Editor-Agones.suppressed.lib and object C:\repos\agones\PluginTest\Plugins\Agones\Intermediate\Build\Win64\UE4Editor\Development\Agones\UE4Editor-Agones.suppressed.exp
0>  [14/14] PluginTestEditor.target
0>Total time in Parallel executor: 21.38 seconds
0>Total execution time: 27.25 seconds
Build succeeded at 9:37:07 PM

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: b1c71a75-68a9-4c4c-955c-03e1e7878907

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/2064/head:pr_2064 && git checkout pr_2064
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.14.0-6ad9b6a

@roberthbailey
Copy link
Member

@domgreen

Copy link
Contributor

@domgreen domgreen left a comment

Choose a reason for hiding this comment

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

Overall looks great really like thjat its being done with websockets 👍 this has been something on my backlog to look at for a while (but the long polling approach) so this is fantastic.

Main comments are around splitting the keep alive of the socket connection and the Health method feel that these are two seperate conecrns so should be dealt with seperartly.

I would also suggest turning the WatchGameServer to pass in a delegate that is called when the gs is updated. This can then tidy up the above and also only set up the ws if peopel explicitly want to watch for state changes.

OOI - which versions of unreal have you tested this with? It compiles on 4.25.4 👍

@google-oss-robot
Copy link

@domgreen: changing LGTM is restricted to collaborators

In response to this:

Overall looks great really like thjat its being done with websockets 👍 this has been something on my backlog to look at for a while (but the long polling approach) so this is fantastic.

Main comments are around splitting the keep alive of the socket connection and the Health method feel that these are two seperate conecrns so should be dealt with seperartly.

I would also suggest turning the WatchGameServer to pass in a delegate that is called when the gs is updated. This can then tidy up the above and also only set up the ws if peopel explicitly want to watch for state changes.

OOI - which versions of unreal have you tested this with? It compiles on 4.25.4 👍

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@domgreen
Copy link
Contributor

Noticed in the build script your on 4.25 as well:

0>"C:\Program Files\Epic Games\UE_4.25\Engine\Build\BatchFiles\Build.bat" PluginTestEditor Win64 Development -Project="C:\repos\agones\PluginTest\PluginTest.uproject" -WaitMutex -FromMsBuild

We should look at getting a test on this at 4.26 at least that it compiles.

@highlyunavailable
Copy link
Contributor Author

highlyunavailable commented Apr 19, 2021

Thanks for the comments! I'll look into making some of the changes you suggested. BTW re 4.26: this exact code is used in a live game on 4.26 so it definitely compiles there too, but I'll see if I can scrounge up some drive space to do a test build of it on 4.26 binary.

@roberthbailey roberthbailey added the feature-freeze-do-not-merge Only eligible to be merged once we are out of feature freeze (next full release) label Apr 20, 2021
@highlyunavailable highlyunavailable force-pushed the unreal-plugin branch 3 times, most recently from 99286bd to e3fe572 Compare April 25, 2021 18:28
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 132749aa-ae87-4be7-89c6-5c099cb799dd

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/2064/head:pr_2064 && git checkout pr_2064
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.14.0-99286bd

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 0ac550ec-57fd-4480-850f-e58f0f780d30

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

1 similar comment
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 0ac550ec-57fd-4480-850f-e58f0f780d30

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

@highlyunavailable
Copy link
Contributor Author

@domgreen Changes made as requested, plus a few more! Let me know if that meets with your approval. I originally used a multicast delegate so I could bind/unbind from watching, but if we're copying the method of the Go SDK, you can only bind and never unbind from watching. It doesn't matter though, since in practice I bind a watcher once and then never touch it again.

Also, here's a build log from a fresh 4.26 project to confirm that it builds there:

CONSOLE: Use build tool: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe
12:03:18 PM Building C:\repos\agones\PluginTest\Intermediate\ProjectFiles\plugintest.vcxproj
0>"C:\Program Files\Epic Games\UE_4.26\Engine\Build\BatchFiles\Build.bat" plugintestEditor Win64 Development -Project="C:\repos\agones\PluginTest\plugintest.uproject" -WaitMutex -FromMsBuild
0>Using 'git status' to determine working set for adaptive non-unity build (C:\repos\agones).
0>Creating makefile for plugintestEditor (no existing makefile)
0>Parsing headers for plugintestEditor
0>  Running UnrealHeaderTool "C:\repos\agones\plugintest\plugintest.uproject" "C:\repos\agones\plugintest\Intermediate\Build\Win64\plugintestEditor\Development\plugintestEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -abslog="C:\Users\_\AppData\Local\UnrealBuildTool\Log_UHT.txt" -installed
0>Reflection code generated for plugintestEditor in 3.8953068 seconds
0>Building plugintestEditor...
0>Using Visual Studio 2019 14.28.29333 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).
0>Building 6 actions with 8 processes...
0>  [1/6] Default.rc2
0>  [2/6] Module.Agones.gen.cpp
0>  [3/6] Module.Agones.cpp
0>  [4/6] UE4Editor-Agones.lib
0>     Creating library C:\repos\agones\plugintest\Plugins\Agones\Intermediate\Build\Win64\UE4Editor\Development\Agones\UE4Editor-Agones.lib and object C:\repos\agones\plugintest\Plugins\Agones\Intermediate\Build\Win64\UE4Editor\Development\Agones\UE4Editor-Agones.exp
0>  [5/6] UE4Editor-Agones.dll
0>     Creating library C:\repos\agones\plugintest\Plugins\Agones\Intermediate\Build\Win64\UE4Editor\Development\Agones\UE4Editor-Agones.suppressed.lib and object C:\repos\agones\plugintest\Plugins\Agones\Intermediate\Build\Win64\UE4Editor\Development\Agones\UE4Editor-Agones.suppressed.exp
0>  [6/6] plugintestEditor.target
0>Total time in Parallel executor: 3.57 seconds
0>Total execution time: 10.14 seconds
Build succeeded at 12:03:29 PM

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 7376d97d-8841-4558-9711-16369bf5afd1

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/2064/head:pr_2064 && git checkout pr_2064
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.14.0-e3fe572

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 2612a7b9-ad3a-467b-8aa3-5e7433fc0fa6

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/2064/head:pr_2064 && git checkout pr_2064
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.14.0-cf973be

Copy link
Contributor

@domgreen domgreen left a comment

Choose a reason for hiding this comment

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

Looks fantastic! Great stuff, happy for this to go in (and I'll start using it soon 👍 )

Have 2 small nits but not a blocker.

@google-oss-robot
Copy link

@domgreen: changing LGTM is restricted to collaborators

In response to this:

Looks fantastic! Great stuff, happy for this to go in (and I'll start using it soon 👍 )

Have 2 small nits but not a blocker.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: bfc8a10f-c4aa-4a4f-b463-07bd86173e49

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/2064/head:pr_2064 && git checkout pr_2064
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.14.0-75779ca

@highlyunavailable
Copy link
Contributor Author

/assign @pooneh-m

@markmandel
Copy link
Member

The only question I have is - should this also update https://agones.dev/site/docs/guides/client-sdks/unreal/#sdk-functionality ?

(Probably with appropriate https://agones.dev/site/docs/contribute/#at-the-page-level wrappers)

@domgreen
Copy link
Contributor

I can update my branch to show it's implemted then merge straight after?

@domgreen
Copy link
Contributor

Or cherry pick commits over update the cross to a tick and merge all together 😉

@highlyunavailable
Copy link
Contributor Author

highlyunavailable commented Apr 27, 2021

Actually, should I remove this part too?

{{< alert title="Note" color="info" >}}
The Unreal SDK is functional, but not yet feature complete.
[Pull requests](https://github.com/googleforgames/agones/pulls) to finish the functionality are appreciated.
{{< /alert >}}

Or flag it as {{% feature expiryVersion="1.15.0" %}} maybe? Because I think this means the Unreal SDK is feature complete.

Also, how do I flag a table row as versioned?

@markmandel
Copy link
Member

That's a good catch, I missed that.

Ah yes - wrap it in a {{% feature expiryVersion="1.15.0" %}}.

A single table row tends to be a pain :/ easy way - copy the entire table into one expiring feature shortcode, and then a second feature publishing shortcode for the new table.

make site-server will give you a local preview if you want to check it before it hits here.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 972f164f-cd3d-4f7b-b99b-bb86a3d2dd00

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/2064/head:pr_2064 && git checkout pr_2064
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.14.0-0a370be

@highlyunavailable highlyunavailable force-pushed the unreal-plugin branch 2 times, most recently from 210c98f to bda08b9 Compare April 27, 2021 19:17
@highlyunavailable
Copy link
Contributor Author

Alright, all updated. We should be good to go @markmandel ! @domgreen : I actually set the entire table to expire after 1.15 is released since the client would be feature-complete at that point and there wouldn't be a need to have a table of features that are implemented.

Also if you need a table generator in the future, I highly recommend the one I linked - I use it extensively, even for stuff like making fixed width data tables to paste into code blocks in chats.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 681396a9-c1cd-424b-8b2d-52e897ef53ab

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/2064/head:pr_2064 && git checkout pr_2064
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.14.0-210c98f

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 72886643-aeea-4872-b5ab-a542155961d6

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/2064/head:pr_2064 && git checkout pr_2064
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.14.0-bda08b9

@domgreen
Copy link
Contributor

@highlyunavailable I think we might want to keep the table in, I'm currently going through documenting the other SDKs to show what they have implemented. Keeping this consistent even if full of ticks might be a good things.

@markmandel WDYT?

Code all looks good thought 🎉 🥳

@highlyunavailable
Copy link
Contributor Author

highlyunavailable commented Apr 27, 2021

Ahhh if that's the plan then I shall re-add and let you tweak as necessary. Table has been re-added

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 37d5a1e0-2516-4dff-8d80-80d31d0dc7bd

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/2064/head:pr_2064 && git checkout pr_2064
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.14.0-566ea32

@roberthbailey roberthbailey removed the feature-freeze-do-not-merge Only eligible to be merged once we are out of feature freeze (next full release) label Apr 28, 2021
@markmandel
Copy link
Member

LGTM! @domgreen any issues on your end?

@domgreen
Copy link
Contributor

@markmandel all good 👍

Exciting to be feature complete.

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: domgreen, highlyunavailable, markmandel

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-robot
Copy link

New changes are detected. LGTM label has been removed.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: aa864128-a466-4a81-a536-85d45b1fd640

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/2064/head:pr_2064 && git checkout pr_2064
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.15.0-b6d538b

@markmandel markmandel merged commit 7ff9f2c into googleforgames:main Apr 30, 2021
@markmandel markmandel added area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc kind/feature New features for Agones labels Apr 30, 2021
@markmandel markmandel added this to the 1.15.0 milestone Apr 30, 2021
@highlyunavailable highlyunavailable deleted the unreal-plugin branch April 30, 2021 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc cla: yes kind/feature New features for Agones size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants