mixer / interactive-unity-plugin

Unity Plugin for Mixer Interactivity
MIT License
59 stars 23 forks source link

Clarification - per-player data/text/feedbackc #114

Closed djarcas closed 4 years ago

djarcas commented 5 years ago

Apologies if this is the wrong place to ask - the mixer documentation is friendly and all, but doesn't seem to delve into much detail, and looking over the Unity implementation hasn't seemed to help.

How do I do per-participant stuff? I can see that I could place each participant into a unique group, and then send that group to a given Scene. That's fine, but let's say the participant chose a Mage, and then got damaged - I'd like to be able to show, for that participant only. "Mage - Health 32/50" (or whatever)

I can't see anything at all in the API that lets me do per-participant data at all - however:

https://mixer.com/deathsdoorgame

Absolutely has per-participant stuff.

If this is the wrong place to ask, please give me a link and send me on my way :)

payzer commented 5 years ago

If you're doing a customer control, you can skip groups and scenes altogether and just manage what each participant sees on the browser side.

payzer commented 5 years ago

Using broadcast message, you can target a single participant with a message.

payzer commented 5 years ago

The broadcastEvent message, I mean. Does that help?

djarcas commented 5 years ago

If you're doing a customer control, you can skip groups and scenes altogether and just manage what each participant sees on the browser side.

Ouch. So sidestepping the absolutely lovely build stuff on mixer.com and doing it all manually? :(

payzer commented 5 years ago

That would be my recommendation. Death's Door and many of the others use custom controls.

rasterknight commented 5 years ago

Hi djarcas, digging on the same stuff. For now my strategy is using scenes and groups to store meta data that every participant in that scene / group needs. And use broadcast events to Target participant or groups for fire and forget data.

Now thinking about it I might even skip the whole scene/group thing and maybe use only world (with worldUpdate) for global data.

Also what are you using to edit the participants views? (On my side I'm using Htlm/js in CDK).

Nick

djarcas commented 5 years ago

@rasterknight I've been using https://mixer.com/lab/interactive, which is quite frankly glorious, and I'm actually rather sad if I won't be able to use it.

I guess I can prototype it there, download the JSON, and then upload that from within Unity? A shame. If it was possible to simply say Button.SetText("Text",Participant.ID") to modify what was displayed to each person, that would have been perfect.

payzer commented 5 years ago

Unfortunately there isn't a way to modify a control for just one participant. The built in controls get modified for all participants.

djarcas commented 5 years ago

Ok. I take it there's no tutorial on building a scene in code and transmitting it to the client? I'll be writing a lot of code, and using SendJsonString to send it up to the Mixer server?

payzer commented 5 years ago

Rather than building a scene in code, I'd recommend building a custom control: https://dev.mixer.com/guides/mixplay/customcontrols/gettingstartedwithhtml

payzer commented 5 years ago

The built in controls from interactive studio are just custom controls under the covers.

djarcas commented 5 years ago

I wish Unity were even 1/10th as responsive and helpful as you! Thank you.

payzer commented 5 years ago

No worries! We are always happy to help. And if you get further along, let us know what you're up to by sending an email to mixerdevinfo@microsoft.com. Perhaps we can feature your work on a show or help get the word out.

rasterknight commented 5 years ago

With the custom controls tool/ide you are in an in-between the lab and wiring everything yourself where you have thus good control of the whole thing.

Still working on getting all the details but that's what I use to build my prototypes.

rasterknight commented 5 years ago

Curious @payzer what would you recommend for the meta/persistent/game session data ? world ? a single scene ?

I was thinking: world meta + participant meta + broadcasts for fire and forget

Thanks

AechDub commented 5 years ago

Use world if you want persistent to all participants, especially if you want that data available when they join.

AechDub commented 5 years ago

Your list above is a great idea to approach this.

rasterknight commented 5 years ago

Thanks @AechDub One more thing: with HTML/JS/CDK , when a participant joins can the JS fetch/access the world meta or does the server needs to send a world update to this new participant ?

PS: saw that the latest dev mixer show shared about broadcastEvent.. kewl... I think it will help devs.

djarcas commented 5 years ago

Are there any plans on the roadmap to add in 2-way communication for the existing controls? I very much feel like I've got a few weeks of re-inventing the wheel ahead of me, by implementing all this myself!

payzer commented 5 years ago

What kind of two way communication are you thinking of?

djarcas commented 5 years ago

Enabling/Disabling a control, changing the control's text, potentially setting the colour. Basic stuff.

I'm making headway into the CDK stuff, but I imagine a lot of other devs would also like to show different and unique controls per player. Or I'm an unusual case, in which case I shall plod on learning HTML and JavaScript. I only know C variants these days...

payzer commented 5 years ago

Ah I see. Yes, per participant controls is something we've gotten a lot of feedback about. But it's not something we're looking at in the short term unfortunately.