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

Updates to C# v3, Intiface-Engine & other Misc Questions #14

Closed
Zendrex opened this issue Jan 21, 2023 · 8 comments
Closed

Updates to C# v3, Intiface-Engine & other Misc Questions #14

Zendrex opened this issue Jan 21, 2023 · 8 comments

Comments

@Zendrex
Copy link

Zendrex commented Jan 21, 2023

Seeing how Intiface CLI is now deprecated in favor of Intiface Engine as well as the reemerging of the C# v3 implementation, is there any sort of time frame that we could be looking at to see the Unity package updated?

When I was attempting at adding the current version of the Unity package into an ongoing project, I quickly learned how out-dated it was, especially with lacking support for much more recent devices (Lovense Gravity for example).

While reading over the README for Buttplug C#, I noticed that within the "What Happened" section it states there is no longer support or plans for an integrated server, so is this package going to require Intiface Centeral going forward?

@qdot
Copy link
Member

qdot commented Jan 21, 2023

Short version: I'm trying but have kinda split myself up too thinly so everything is running super slow.

Long version that I'll probably add to the README today:

Yeah, Buttplug Unity needs an overhaul and simplification. Having shipped the plugin with no real documentation and a reliance on shipping an executable with the system, a lot of game developers are now off track for how I imagined Buttplug support should work. That's admittedly my fault for just kinda shoving things together and throwing this out into the world without much guidance.

Ideally, developers should just be able to use a package that looks exactly like the nuget package (though I'll still need to package it for unity I guess), and expect that their users will be running Intiface Central, as that means the game developer won't need to worry about Buttplug updates in the future unless they want to add new features to their game.

Honestly, I'm tempted to just require players of games using the Buttplug Unity plugin to have Intiface Central running, similar to what bHaptics does for their vests. I could still ship a copy of the engine executable with the Unity Plugin, but that should only be used in cases where Intiface Central can't be found (because I do realize devs would like to ship games as complete units without having to say "oh and go download extra thing"), and Intiface Central should be checked for first before bringing up an engine process. That said, I'm afraid that devs won't quite get that and we'll be right back in the same situation we're in now.

@qdot
Copy link
Member

qdot commented Jan 21, 2023

Also, I've started a new Games section in the Buttplug Dev Guide that will hopefully provide more guidance when it's done. https://docs.buttplug.io/docs/dev-guide/cookbook/games/intro

@Zendrex
Copy link
Author

Zendrex commented Jan 21, 2023

Short version: I'm trying but have kinda split myself up too thinly so everything is running super slow.

I've actually taken the liberty to start ripping out the guts of both the Unity package and integrate C# v3 and Engine to get myself a bare-bones system working (for 2020+, ignoring the IL2CPP workarounds).

Since the lack of documentation for literally any of the libraries (including C# v3) it is very much trial and error (especially in regards to Device Attributes being inconsistent and far from developer friendly). I come from a Js/Ts background so I was a bit frustrated seeing such weak helper functions/variables, especially for the ButtplugClientDevice class.

Additionally I can't seem for the life of me to understand the device linear function. I could just be low on sleep and overseeing something, however the struggle is real when implementing it. Test device being The Handy.

Anywho, if I feel confident in my overhaul of the Unity Package, I'll push a PR, however it's far from ready and still requires some updates to the C# library anyways to assist in development.

@qdot
Copy link
Member

qdot commented Jan 21, 2023

There's C# v3 examples in the dev guide: https://buttplug-developer-guide.docs.buttplug.io/docs/dev-guide/writing-buttplug-applications/intro

The IL2CPP workaround should no longer be needed when moving to C# v3 as the Rust bindings have been eliminated.

I'm working on reducing the unity plugin on my side now, we'll see if that pans out.

The device linear function takes a position and a timing to move to that position. That said, getting that worked out to deal with real time interaction is pretty difficult right now. That's one of the future articles I have planned for the dev guide.

@Zendrex
Copy link
Author

Zendrex commented Jan 21, 2023

There's C# v3 examples in the dev guide: https://buttplug-developer-guide.docs.buttplug.io/docs/dev-guide/writing-buttplug-applications/intro

I meant developer api docs (along the lines of what Discord.JS doc's provide)
Ref: https://discord.js.org/#/docs/discord.js/main/general/welcome

The IL2CPP workaround should no longer be needed when moving to C# v3 as the Rust bindings have been eliminated.

Figured, thus why I ripped it out.

I'm working on reducing the unity plugin on my side now, we'll see if that pans out.

I went along the rout of keeping the core helper logic, just cleaning up the code a bit and utilizing engine + updated arguments.

The device linear function takes a position and a timing to move to that position. That said, getting that worked out to deal with real time interaction is pretty difficult right now. That's one of the future articles I have planned for the dev guide.

If you have a moment, would love a rough example of this so I can test my updated implementations of the package.

One game that I saw which does it well is Lustbound (referenced in buttplug-awesome).

@qdot
Copy link
Member

qdot commented Jan 21, 2023

Yeah, updated API docs are coming at some point. C# v3 is, right now, about 3 weeks old, and was adapted from a codebase that hadn't seen work in 2+ years, so I need to sweep back through and update comments and stuff. Since all of this is a one dev project and the breadth has gotten pretty wild at this point, I'm not sure on schedule tho.

For linear movement, the main issue is timing. I don't actually have a good example of this right now (part of the article writing task is "actually research what can be done here"). I know some games just use animation playback where the position timing is already known, in which case it's just a loop of send command -> wait amount of time until next command.

That said, if you're curious about Lustbound's impl, the dev is on our discord (https://discord.buttplug.io), might be able to ask them.

@qdot
Copy link
Member

qdot commented Jan 22, 2023

Ok, my updates, which is basically "Remove everything and just put the C# DLLs in", is now in the v3 branch on this repo.

I'm in talks with some other unity devs about shipping the engine executable possibly as a separate package, but the plan for this repo is to keep that out and just ship pure C# DLLs. That will drastically reduce my support load here, which means this might get better updates and docs. Someday.

@qdot
Copy link
Member

qdot commented May 18, 2024

v3 shipped last year, but broken. It's now shipped again and hopefully working now. Gonna close this out, please let me know if you ahve any issues. (And maybe those API docs will happen soon)

@qdot qdot closed this as completed May 18, 2024
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

2 participants