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

move Netspeak Unreal SDK into Agones Unreal SDK #1739

Merged
merged 7 commits into from
Aug 7, 2020
Merged

move Netspeak Unreal SDK into Agones Unreal SDK #1739

merged 7 commits into from
Aug 7, 2020

Conversation

domgreen
Copy link
Contributor

@domgreen domgreen commented Aug 5, 2020

What type of PR is this?

/kind breaking

What this PR does / Why we need it:

This PR updates the Unreal SDK to the one at https://github.com/netspeakgames/UnrealAgonesSDK

  • has support for C++ and Blueprints
  • more typical of a Unreal Plugin
  • has more coverage of API (see README.md)
    • missing watch
  • has Alpha APIs for PlayerConnect etc.
  • has some more documentation of how to get up and running with Unreal

Which issue(s) this PR fixes:
Closes #1683

Special notes for your reviewer:
👋 hi, thanks for the great project.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 1e4ca539-e5b7-46ff-9963-80de5a4be5b9

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

@domgreen
Copy link
Contributor Author

domgreen commented Aug 5, 2020

ERROR
ERROR: build step 27 "gcr.io/cloud-builders/gsutil" failed: step exited with non-zero status: 1
Step #23 - "sdk-conformance": includes/sdk.mk:145: recipe for target 'run-sdk-conformance-no-build' failed
Step #23 - "sdk-conformance": includes/sdk.mk:88: recipe for target 'run-sdk-command' failed
Step #23 - "sdk-conformance": make[2]: *** [run-sdk-conformance-no-build] Terminated
Step #23 - "sdk-conformance": make[2]: *** [run-sdk-command] Terminated
Step #23 - "sdk-conformance": make[1]: *** [run-sdk-conformance-test] Terminated
Step #23 - "sdk-conformance": make[1]: *** [run-sdk-conformance-test] Terminated
Step #23 - "sdk-conformance": includes/sdk.mk:152: recipe for target 'run-sdk-conformance-test' failed
Step #23 - "sdk-conformance": includes/sdk.mk:152: recipe for target 'run-sdk-conformance-test' failed
Step #23 - "sdk-conformance": make: *** [run-sdk-conformance-test-rest] Terminated
Step #23 - "sdk-conformance": make: *** [run-sdk-conformance-test-rust] Terminated
Step #23 - "sdk-conformance": includes/sdk.mk:174: recipe for target 'run-sdk-conformance-test-rest' failed
Step #23 - "sdk-conformance": includes/sdk.mk:168: recipe for target 'run-sdk-conformance-test-rust' failed

Seems like failing conformance tests.

Copy link
Member

@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.

Thanks for sending this through, excited to see this moving forward.

// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using UnrealBuildTool;
Copy link
Member

Choose a reason for hiding this comment

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

All files will need to have the Google LLC Apache licence at the top please, before we can accept them.

@@ -0,0 +1,361 @@
#pragma once
Copy link
Member

Choose a reason for hiding this comment

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

Apache licence please

// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright Epic Games, Inc. All Rights Reserved.
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately I don't think we can't accept this with the current copyright 😞 not sure if that is going to be an issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was due to taking the short cut of generating via UE4 can rewrite exactly the same by hand.


## Developer Information
## Getting Started
Copy link
Member

Choose a reason for hiding this comment

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

These user docs should really live in: https://agones.dev/site/docs/guides/client-sdks/unreal/

There is a guide on how to document upcoming features so that they can be hidden until the next release here:
https://agones.dev/site/docs/contribute/#documentation-for-upcoming-features

@markmandel
Copy link
Member

If someone from @drichardson @dotcom @WVerlaek @robbieheywood (or other Unreal users) can give this a review, that would also be awesome, just to make sure there are no concerns or issues 👍

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 97fe111c-aea0-4a4d-8af4-7addb50ebe3b

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/1739/head:pr_1739 && git checkout pr_1739
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.8.0-87d68f3

@dotcom
Copy link
Contributor

dotcom commented Aug 6, 2020

I tried this SDK (with UE version=4.24.3-0+++Release-4.24 source build) and it was very easy to use. niceee.

By the way, about WatchGameserver,
this seems to me that in Unreal, we need to use a FSocket because of getting the stream's progress.

Fortunately, IHttpRequest has a Delegate called FHttpRequestProgressDelegate, which allows us to monitor whether or not the Stream has made progress. Of course, what the above is doing is simply calling CheckProgressDelegate(); every time with Tick() to see if there is a change in the Bytes received.
However, this seems to cause a memory leak in theory. This is because it doesn't discard any information about past Gameserver changes. (you can look FCurlHttpRequest::ReceiveResponseBodyCallback)

A good reason to use FSocket is to be able to discard the past data. (Of course, assuming we use libcurl, It would be nice if we could add a method to FCurlHttpRequest to clean the buffer. But I can't think of how to do it well.)

That's just my opinion. Please point out to me if I'm wrong.

@markmandel
Copy link
Member

@dotcom thanks for taking it for a spin!!

Copy link
Contributor

@WVerlaek WVerlaek left a comment

Choose a reason for hiding this comment

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

Nice work @domgreen, got a few comments but overall looking good

{
GENERATED_BODY()

UPROPERTY()
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this also be UPROPERTY(BlueprintReadOnly)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, just did a check and I only set it in C++ it is passed in as a argument in the func call, will check the rest of the file as well.

}

// TODO(dom) - look at JSON encoding in UE4.
Json = Json.Replace(TEXT("playerId"), TEXT("playerID"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Any way this can be done differently?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This frustrated me for days ... I would love to know if there is a way to fix this, seems that JSON encoding isnt great in UE4. Do you have any suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

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

Feel your pain.. Not sure either, does renaming the PlayerId field of FAgonesPlayer to PlayerID do anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope, I did try that ... could have just been holding it wrong but have had a few ppl look at it internally and nothing obvious came up. If you could see if the i8e team knows a work around that would be fantastic.

}

// TODO(dom) - look at JSON encoding in UE4.
Json = Json.Replace(TEXT("playerId"), TEXT("playerID"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

* See - https://agones.dev/ for more information.
*/
UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class AGONES_API UAgonesComponent final : public UActorComponent
Copy link
Contributor

Choose a reason for hiding this comment

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

Previously Agones plugin settings could be configured in a config file (by having UCLASS(config = Game, defaultconfig) as class properties), is that still possible or do these settings need to be set at runtime now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is possible to do as mentioned we could add the UCLASS config section ... would require some more thinking of where we would want the config for the plugin to live. Can add it onto my back log to investigate.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that would be good, also to ease the migration from the old plugin to this one. It also makes sense for things like auto connect and health checks to live in a config file as they are picked up immediately once the Agones plugin is created, you'd have to be careful changing these values at runtime at the right time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

have added port, rate of health check and disableConnect to the config ... this is also added to the docs

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, can you add defaultconfig as well (from #1352)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mind blown, didnt even know this existed 😂

Copy link
Member

Choose a reason for hiding this comment

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

mind blown, didnt even know this existed

✨✨✨ THE POWER OF OPEN SOURCE AT WORK ✨✨✨

TSharedRef<IHttpRequest> UAgonesComponent::BuildAgonesRequest(const FString Path, const FHttpVerb Verb, const FString Content)
{
FHttpModule* Http = &FHttpModule::Get();
TSharedRef<IHttpRequest> Request = Http->CreateRequest();
Copy link
Contributor

Choose a reason for hiding this comment

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

Any particular reason automatic request retries have been removed? That's probably fine if you have autoConnect turned on but in the case you have it disabled and the game itself calls Ready at some point it would be helpful if that request will retry until e.g. the agones sidecar is ready

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do have helper functions that do this on startup that can be used to poll the endpoint till the sidecar is healthy, it will then call ready and return the game-server as part of a delegate that you can do with what you need.

Main reasons for not using the auto request retries was I've not seen it heavily used in other plugins and now that we have the fail call back its much easier to allow the game play programmers to deal with the inability to make the call themselves via delegates, there may be edge cases where they would prefer a failed call to do something else rather than keep retrying.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah right instead of calling Ready you'd then use Connect to poll until ready, I think that works. Might be worth adding a small section to the docs calling this out as part of migrating from the old plugin to this one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is more inline with what I have seen in the other Agones plugins from what I remember. Will add a section to the docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahhh, it's already in the docs :D saying that there are additional utility methods that have been added to the plugin that can be used for both health and connect 🥇

@domgreen
Copy link
Contributor Author

domgreen commented Aug 7, 2020

Nice work @domgreen, got a few comments but overall looking good

Thanks for the review @WVerlaek will make some changes and push back ... miss you 😸

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 9ae8b0ef-b7bf-47ed-a671-7fbb1a4d1168

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/1739/head:pr_1739 && git checkout pr_1739
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.8.0-d4562b8

@domgreen
Copy link
Contributor Author

domgreen commented Aug 7, 2020

@WVerlaek its not letting me re-request review from you but if you have time that would be lovely. 🅿G💣

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 3cc09f34-7138-4840-98e6-04fee69d5944

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/1739/head:pr_1739 && git checkout pr_1739
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.8.0-aac2629

@WVerlaek
Copy link
Contributor

WVerlaek commented Aug 7, 2020

Small nit to add defaultconfig as well but other than that LGTM!

Copy link
Member

@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.

One small thing on the docs, but otherwise, also looks good to me.

Looks like we'll be able to squeeze this in before RC next Tuesday, which is awesome!

@@ -18,7 +18,7 @@ Check the [Client SDK Documentation]({{< relref "_index.md" >}}) for more detail

Download the source from the [Releases Page](https://github.com/googleforgames/agones/releases)
or {{< ghlink href="sdks/unreal" >}}directly from GitHub{{< /ghlink >}}.

{{% feature expiryVersion="1.8.0" %}}
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

site/content/en/docs/Guides/Client SDKs/unreal.md Outdated Show resolved Hide resolved
site/content/en/docs/Guides/Client SDKs/unreal.md Outdated Show resolved Hide resolved
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 07240103-f8ad-46ca-a04f-7094200568be

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/1739/head:pr_1739 && git checkout pr_1739
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.8.0-d1239ba

@markmandel
Copy link
Member

@WVerlaek if you could please confirm you got the defaultconfig thingo you were looking for, I am very happy to approve and merge this PR! 😀

@WVerlaek
Copy link
Contributor

WVerlaek commented Aug 7, 2020

Yup thanks for adding, LGTM

Copy link
Member

@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.

🤸🤸🤸🤸🤸

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: domgreen, 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

@markmandel markmandel added area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc kind/breaking Breaking change kind/feature New features for Agones labels Aug 7, 2020
@markmandel markmandel added this to the 1.8.0 milestone Aug 7, 2020
@markmandel markmandel merged commit 8e215d3 into googleforgames:master Aug 7, 2020
@domgreen domgreen deleted the netspeak_sdk branch August 8, 2020 08:15
ilkercelikyilmaz pushed a commit to ilkercelikyilmaz/agones that referenced this pull request Oct 23, 2020
* moving Netspeak Agones SDK into main repo SDK

Co-authored-by: Mark Mandel <markmandel@google.com>
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/breaking Breaking change kind/feature New features for Agones lgtm size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Discussion] Assimilate netspeakgames/UnrealAgonesSDK
7 participants