Skurdt / LibretroUnityFE

Example scenes on how to use the SK.Libretro package/library.
MIT License
17 stars 7 forks source link

NETPLAY #18

Open jeffabner opened 2 years ago

jeffabner commented 2 years ago

I would like to develop a netplay, I can already use a WebRTC framework, via websocket or http, I'm thinking of doing it later either via netcode or mirror networking or photon engine, but that's the least, but first I need to see how to link the control and multipap manually and then in any of the options link the controller number for each play, first I would like to do offline and then see the options via savestation or screen capture or camera mirroring, and can even do the same with nintendo 64, psp, ps2 or even nintendo wii, something you don't have in retroarch.

image image image

image

Skurdt commented 2 years ago

This currently supports multiple players but locally only by using 2 devices.

To process input differently, you basically have to reimplement the PlayerInputProcessor class and probably not use the PlayerInput component.

The PlayerInputProcessor processes all the input events from unity and the input system. Note that in this class, you have the gamepad buttons contained in a single uint used as a bitset. Sending that variable over the network will provide all the buttons at once. For analog controls and others, you need more data.

The InputProcessor provides input data to the libretro wrapper/core and only contains "get" methods (implements the IInputProcessor interface from the wrapper). It's implemented as a Dictionary<int, PlayerInputProcessor> where the int is the port number.

jeffabner commented 2 years ago

thanks for your attention, I will start doing it in parts, I would like to make two buttons, player 1 and player 2, when I clicked, for example, on player 2, I could move only control 2, and when I clicked on player 1, I would control only the player 1, with this example, I could replicate on the network, I'll be seeing how to implement this for the week, I'll make a multiplayer with joystick for those who play through the browser on the cell phone or builds of android and ios, where whoever is on the cell phone, will be able to play against pc and those who have a brother or friend on the same pc play together against another person, server and network issues are the least of it. any help or example is welcome and I'll report my progress here. another thing, i can run nintendo 64 games in editor after changing an option "mupen64plus-rdp-plugin;RDP Plugin;angrylion;gliden64|angrylion|parallel;" for angrylion that runs as directx11 at more than 700 fps if not limited