Coder Social home page Coder Social logo

Comments (16)

stefanoditore avatar stefanoditore commented on June 19, 2024

also, there is a way to forse the player join with the keyboard and mouse processor profile ?

from sk.libretro.

Skurdt avatar Skurdt commented on June 19, 2024

The first input device you use will be player 1, any other devices used afterwards will add more players.

You can add quest controller bindings (or any other device supported by unity) to the Input System Asset (LibretroInputActions.inputactions). The current configuration includes mouse/keyboard and gamepad.

The device gets registered only after the game launched, so you can technically start the game with a mouse using the menu, and use the quest controller to play the game afterwards.

For a more advanced input configuration (like multiple devices for a single player), you will have to implement your own logic and replace the existing one for player joining.

from sk.libretro.

stefanoditore avatar stefanoditore commented on June 19, 2024

Thank you very much for your response. I will try to modify the scripts as you suggested tomorrow. However, the strange thing is that every time I press a button or joystick on the Quest controller, a new player is added. Instead of associating the Quest controller with the library, is it possible to make Libretro ignore input from Quest controllers?

from sk.libretro.

Skurdt avatar Skurdt commented on June 19, 2024

Does it add player 2 or a player for every single button? this seems really strange.

If your quest is mapped using a tool to press keys on the keyboard this is not a library issue I think. It will obviously see 2 devices.

You could go into InputProcessor.cs and prevent the script to add more players besides player 1 (ie. stop adding stuff in the Dictionary if there is anything in there).
Or use manual joining on the PlayerInput component to add players manually.

from sk.libretro.

stefanoditore avatar stefanoditore commented on June 19, 2024

it add players every time i touch any button om the quest controller. I don't know why. how i can use manual joining on the PlayerInput component to add players manually? i am using the project from the link in the github. Can you explain me this step? thanks

from sk.libretro.

stefanoditore avatar stefanoditore commented on June 19, 2024

ok, i have edited the inputprocessor.cs script and now i just have player1 and, as you say, the devices get registered only after the game launched, so i lounch the game with keyboard and mouse and it registred only them. But everytime i need to loynch the game and after activate the quest2 and his controller. there is a way to force the library to start with mouse and keyboard also if there are otbers devices connected? and just the last question, there are differences between the "usage example" project linked in the page and the library of this github? thankyou for your support.

from sk.libretro.

Skurdt avatar Skurdt commented on June 19, 2024

When you start a game it doesn't register any device, it also doesn't matter what is connected. It only adds a player when you press something after a core has launched (you can see in the console when a new player joins).
If you only want mouse and keyboard, just press any key after a core has started.

If the goal is to use VR, it would be much easier to setup your scene as a proper VR project and start games using quest controllers and normal VR interactions. And also setup the libretro input asset to have the proper quest button bindings (as opposed to use a keyboard mapper).

The sample project contains the scene with the menu and basic mouse interaction to start the library with a specific core and rom.
It has this repository as a dependency (in Packages/manifest.json).
Cloning the sample repo will pull this automatically (adding the dependency to your own project will do the same).
To modify anything in this without unity complaining, you have to clone this repo as a subfolder in Packages.

from sk.libretro.

stefanoditore avatar stefanoditore commented on June 19, 2024

thankyou.
this is a fantastic library

from sk.libretro.

stefanoditore avatar stefanoditore commented on June 19, 2024

Hi, sorry to bother you again. I followed your advice and recreated the project from scratch (without using the example one from the link). I set the join behavior to a specific input action and limited the number of players to 1. In the previous project, I hadn't modified the input action asset, but I had imported a wrapper library that simulated physical button input so I could play with the Oculus Quest controllers. Now I have recreated the project and I would like to avoid using this workaround. So I have modified the libretro actions asset by adding bindings for the Quest controllers. However, I ran into some problems. Adding the Quest controller buttons to the actions (and exporting the class with the same name and namespace) makes the controller inputs (for now I have only tried the thumbsticks) work if I instantiate the class (e.g. GamepadUp.performed, start or complete is detected and I can associate any method with it) but it is not detected by the game. I don't know if I need to modify the inputplayerprocessor or inputpricessor scripts by adding something to make the event detectable. Even though, since these are input actions, once triggered by any physical input or should they still be detected by the emulator (even if in fact they don't happen), or am I wrong? Can you give me some suggestions or examples? Thank you very much for your availability.

from sk.libretro.

Skurdt avatar Skurdt commented on June 19, 2024

The library's input script don't need modifications at all to get other input devices working (at least common ones, even the quest 2 touch controllers). You only need to add the bindings on the input asset.

I added a vr scene example on the LibretroUnityFE repo (https://github.com/Skurdt/LibretroUnityFE). Only analog, a, b, start, select are bound. I didn't have to limit to 1 player to get it working but don't use any keyboard, mouse or gamepad to prevent adding players.

My guess is that your vr scene is not setup correctly. (Mine is very basic but it does allow to start the game using the menu and the touch controllers).

from sk.libretro.

stefanoditore avatar stefanoditore commented on June 19, 2024

hello, thankyou for your work. I have tried your vr project but the analog of quest controller not work (the buttons yes), i cannont understand why.

from sk.libretro.

Skurdt avatar Skurdt commented on June 19, 2024

if it's for a different core than the one I used (mame2003plus), then you would have to add bindings for the d-pad

from sk.libretro.

stefanoditore avatar stefanoditore commented on June 19, 2024

ok, i try and now the controllers work. I have only a problem when i change game. I have set the gamesdirectiry with "application.datapath" and it seems that all work, but when i change game rom, the new rom is loaded and work, but i have a lot of problem from the burst compiler. The right way to change rom is to call the function Stopcontent() and after the startcontent(core, directory, romname)? I have also tryed to stopallcoroutines, to deinizialize, to deactivate the libretroinstance component, to destroy it or the gameobject, but however i have errors. There is something that i have to do to change rom in runtime?

from sk.libretro.

Skurdt avatar Skurdt commented on June 19, 2024

If the controller problem is solved, I'd rather you close this issue and open new ones for other unrelated issues.
It would also help to describe the use case (what core/rom), as well as what kind of error (with console logs, or anything else that could help).

from sk.libretro.

stefanoditore avatar stefanoditore commented on June 19, 2024

ok. thankyou

from sk.libretro.

stefanoditore avatar stefanoditore commented on June 19, 2024

problem solved

from sk.libretro.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.