robreuss / VirtualGameController

Software-based game controllers for iOS, tvOS, OS X and watchOS in Swift 4.2.
MIT License
462 stars 44 forks source link

Any plans to update this project? #38

Open davidbaez opened 2 years ago

davidbaez commented 2 years ago

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 commented 2 years ago

Thanks for the kind words. I haven’t tried to compile it in a while, or done any maintenance. Did you come up against significant errors?

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: https://developer.apple.com/documentation/gamecontroller/gccontroller

I’m not sure my project offers too much over and above that integrated capability, and I’m also not sure what additional functionality would add the kind of value that would make it worth the effort.

I did take the underlying architecture of VGC and produced a more generalized framework called ElementalController: https://github.com/robreuss/ElementalController

The ElementalController framework is central to projects I’m working on right now so I’ll be focusing on making it more production-ready!

On Mar 5, 2022, at 11:54 PM, davidbaez @.***> wrote:

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?

— Reply to this email directly, view it on GitHub https://github.com/robreuss/VirtualGameController/issues/38, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEPXCRNO5B4MPDD2ASOJ53U6Q3APANCNFSM5QATV6WQ. You are receiving this because you are subscribed to this thread.

davidbaez commented 2 years ago

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 commented 2 years ago

Nice to know you’ve put VGC to use! If I can help it get it compiling let me know.

On Mar 6, 2022, at 9:24 AM, davidbaez @.***> wrote:

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!

— Reply to this email directly, view it on GitHub https://github.com/robreuss/VirtualGameController/issues/38#issuecomment-1059972017, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEPXCV6S36BCGNLUSULAK3U6S5ZDANCNFSM5QATV6WQ. You are receiving this because you commented.

trulyronak commented 1 year ago

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:

robreuss commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.plistkey 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 commented 1 year ago

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 commented 1 year ago

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.