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

Any plans to update this project? #38

Open
davidbaez opened this issue Mar 6, 2022 · 10 comments
Open

Any plans to update this project? #38

davidbaez opened this issue Mar 6, 2022 · 10 comments

Comments

@davidbaez
Copy link

Hi there!

First off, love the project, and thank you for your contributions to the dev community!

Just wondering if there were any plans to update this project or if it is officially closed?

@robreuss
Copy link
Owner

robreuss commented Mar 6, 2022 via email

@davidbaez
Copy link
Author

The project doesn't compile on the latest version of Xcode. I have a project dependent on the framework that needs to be updated. The VGC functionality works really well on it, so I think I'll just look into forking it and fixing the current issue. I'll push over a PR if I can figure it out!

Thanks for sharing your new project, and Apples virtual controller framework! I'll definitely look into those options if for some reason I'm unable to get this working.

Best wishes!

@robreuss
Copy link
Owner

robreuss commented Mar 6, 2022 via email

@trulyronak
Copy link

One consideration in terms of putting energy into it is that Apple now offers it’s own virtual game controller integrated into the GCController framework:

Hi Rob, first off wanted to say thanks so much for creating this project + still replying!

I was curious if you had any examples of this - I clicked on the link you provided and it seems like it's really just a framework / it's meant to be for real controllers?

I wasn't able to find any example code for how to set up an iOS app that could be used to control the tvOS game.

Essentially what I'm trying to do is this:

  • the tvOS app shows the gameplay
  • users would connect using their iOS devices to control their players

@robreuss
Copy link
Owner

Hey Ronak. There's a class listed on that page, GCVirtualController, which is what you use if you want a virtual controller. Direct link

I've not tried using it but presumably it does not have the ability to send controller data over the network, which VGC does provide - rather, it's designed to use the device as a controller for a game playing on that same device.

If you decide VGC is what you need I'm happy to get it compiling well on current generation iOS and Swift.

@robreuss
Copy link
Owner

Note, while Apple's GCController doesn't have network-based functionality built in, I think it would be very straightforward to save the virtual game controller input on the controller device as a "snapshot", serialize it to send over the network, and then load that snapshot into the GCController object on tvOS. If you're comfortable handling the networking (should be pretty easy these days given improvements in frameworks) that might be the preferred way to go, to avoid a dependency on a third-party framework.

@trulyronak
Copy link

trulyronak commented Nov 12, 2022

Gotcha, thanks for the help!

I actually went ahead and tested out the Elemental Controller iOS Client with the macOs code but hooked it up for tvOS to test that instead since VGC is pretty old now, but sadly it seems tvOS is having some networking issues (it works with an iOS simulator and a device installed tvOS app but not with a device installed iOS app).

I think it would be very straightforward to save the virtual game controller input on the controller device as a "snapshot", serialize it to send over the network, and then load that snapshot into the GCController object on tvOS. If you're comfortable handling the networking

As far as I can tell, there's no official way to connect an iOS client with tvOS (to send data over) - I fear I'm misunderstanding what you're saying here, would you be able to clarify?

@robreuss
Copy link
Owner

When you tested EC and encountered the problem with a real world connection with device tvOS and device iOS what did you see? Any error messages or just failing to connect? You'll need to deal with local network privacy by seeing an Info.plist key as described here:

https://nilcoalescing.com/blog/GettingReadyForNewiOS14LocalNetworkPrivacyRestrictions/

As far as I can tell, there's no official way to connect an iOS client with tvOS (to send data over) - I fear I'm misunderstanding what you're saying here, would you be able to clarify?

The sample code here might provide what you need to implement a protocol for sending the serialized snapshot:
(https://developer.apple.com/documentation/network/building_a_custom_peer-to-peer_protocol)

That being said, it would be easier with EC (and still easier with VGC given that's designed around game controller data elements).

I swear I had read about an Apple framework that made all of this easy. I'll look more but happy to help you make one of my frameworks work for you!

@robreuss
Copy link
Owner

If there is no Apple solution for using an iOS device as controller with a tvOS game maybe I'll update VGC for latest Swift. I had assumed it was no longer needed because Apple with providing a turn-key solution.

@robreuss
Copy link
Owner

And now that I think about using the snapshot feature in GCController to serialize game controller state and send it over the network wouldn't be nearly performant enough for most game settings. VGC sends individual values for each element very efficiently. It would be nice to have a module for EC that implements the game controller interfaces from VGC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants