edited April 2022 in ORK Support
I am trying to get ORK3 to support local multiplayer (not Online MultiPlayer) with [New Input System].

The NewInputSystem can easily absorb almost any input, not only PS4/Xbox, but Switch, Touch, Steam controllers, etc.
This makes multi-platform support very easy.

Depending on the number of controllers, this is a real-time battle controlled by one to four players.

How can I make the ControlMap of a member in the second PlayerGroup work while the first player remains IsPlayerControlled?

http://makinom.com/guide/documentation/features/input-keys/#13-toc-title
I would like to use this guide to achieve local multiplayer using InputID.

However, after quite a bit of trying, I converted the playerIndex (0-3) in [New Input System] in Custom Script to InputID (0-3) and told ORK to enter the InputKey for each player, but the second Player's ControlMap does not work.

http://makinom.com/guide/extensions/scripts/unity-input-action-input-key/
I tried this Makinom plugin and it worked fine for solo, but it did not recognize the InputID and considered the two controllers as the same input.
So, I used CustomScript to indicate the InputKey.

In [New Input System], when you press a button on the second controller in the PlayerInputManager Component, a JoinAction is performed.
So PlayerInputManager instantiates Prefab and assigns PlayerInput's playerIndex.
I want to use this because from a usability standpoint, it would be easier for a second friend to Join. (For example, a friend can instantly Join by simply pressing and holding the button on the second controller for 3 seconds.)
https://docs.unity3d.com/Packages/com.unity.inputsystem@1.3/manual/Components.html

So, set the combatant's Prefab to InstantiatePrefab in PlayerInputManager.
AutoMachineComponent is pre-attached to the Prefab.
Set StartType to Start=0 and run Player Join Group Node and Add Combatant Node from Machine at the same time as Instantiate.

From a custom script
var pickInput = Maki.InputKeys.Get(attackID);
pickInput.SetAxis(playerIndex,1f);
yield return null;
pickInput.SetAxis(playerIndex,0f);

Do I need anything else, I tried ShortCutAbility instead of Ability with the same result.
To begin with, the player2 combatant’s control map does not work.

How can I use Makinom2 + ORK3 with separate Input IDs to trigger Ability on each Combatant in the same ControlMap?
Post edited by joeee19 on
  • While Makinom supports local multiplayer via using input IDs (can also be used to e.g. switch between control styles), ORK 3 is currently not fully supporting that.

    I've plans to add more support for that (e.g. being able to assign input IDs to combatants), but it'll probably not be in the next update (my Covid infection somewhat derailed my schedule :D).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited April 2022
    OK.
    I really hate Covid. I'm sorry you had a hard time. ・・・・ Please take care of your body first and foremost.

    I also read the source code of ORK and Makinom and added ORK.Game and Maki.Game to the Debug watch and gradually I understand what is going on.
    For now, the current version of ORK does not use the control map, and development is progressing with the following custom input scripts for each player.

    I'm very excited to hear that it will be officially supported in a later version!
    Local multiplayer is a must for my game, so I will force it to be supported by CustomInputScript, which will be very useful when we support online players in our ORK games in the future.
    There is also UnityGamingService, and UnrealEngine's OnlineService is also available in Unity (at no server cost!). You can use it.

    async private void NewInputSystemPickActionFire()
    {
    if (interact.AvailableCount > 0 )
    {
    Debug.Log("interact");
    Maki.Game.Player.SetPlayer(gameObject,false,false,false,false);
    interact.Interact();
    return;
    }
    if (!shortcuts[0].CanUse(combatant, false, false)) {
    Debug.Log("Cant use");
    return;
    }
    List<Combatant> targetList = new List<Combatant>() { combatant };
    Combatant target = combatant.SelectedTargets.GetAbilityTarget(combatant,shortcuts[0] as AbilityShortcut);
    if (target != null)
    {
    targetList.Clear();
    targetList.Add(target);
    }
    shortcuts[0].Use(combatant,targetList,true);
    Debug.Log("Fired!! inputID=" + inputID + " isPlayerCont:" + combatant.IsPlayerControlled() +
    " Comb Name:" + combatant.GetName()+" shortCut:"+shortcuts[0].GetName()+" taget:"+targetList.FirstOrDefault().GetName());
    }


    What we would like to see happen is the following
    1: Allow Override InputID to be used in each Combatant instance of ControlMap like Makinom's InputID.
    2: Interactions should also support InputID.
    3: There was a problem when the Combatant prefab was instantiated from the UnityInputSystem instead of from the CombatantSpawnNode.
     When I made my GameObject the Combatant of Player2 in AddCombatantNode, the Combatant Init Schematics is no longer called.
     So, I set up Init Schematics in AutoMachine instead. This seems to be a bug in AddCombatant.
     
    That is all.
    Post edited by joeee19 on
  • Regarding #3 - the Add Combatant node has options for using the init schematic (and other things) or not. Should actually be enabled by default. Other than that, all combatants are created via the same functionality, so if the option is enabled the init schematics will be used.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited January 2023
    Any news about ORK 3 getting better support for local multiplayer?
    (and not necessarily for New Input System)

    I managed to spawn two player combatants in my game (using Game Kit Controller and some ORK nodes), but only the current "Makinom/ORK Player" is able to do interactions in my scene (e.g.: Talking with an NPC).

    The second player can't interact with the NPC, the interaction HUD window doesn't appear when that second player character is near the NPC. The first player can interact normally with the NPC.
    Post edited by andymiira on
  • ORK 3.11 made a first step in that direction by adding support for input IDs per combatant. The Change Combatant Input ID node in schematics can be used to set an input ID for a combatant to e.g. use separate controls per combatant in menus, control maps, etc.

    However, the rest is still single-player and there's only one combatant controlled by player controls, etc.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks for the info!

    Would it be too much work to allow more than one Makinom Player/ORK Player in the systems? To achieve true multiplayer support.
    I don't know how much of the internal Makinom/ORK systems would need to be refactored around that.
  • A big +1 to this. It would be amazing to have this capacity in ork.
  • Theoretically, it could be already done, but I haven't tried it yet.

    Via a Control Component node in a schematic (e.g. the same with the Change Combatant Input ID node to set the combatant's input ID) you can register player or camera control components with the system to be blocked on control blocks.
    The control components already need to be on your players (e.g. the prefabs), though.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited February 2023
    Thanks for the tips. :)

    But my issue is not so much with the players' input (which from what I understood, I guess can be worked around by using the Control Component and Change Combatant Input ID nodes).

    My multiplayer issue is more about (for example) the interaction HUD not appearing/interaction event not working for the second player I've spawned (the issue I mentioned in some posts above).
    And if InteractionController is being affected by this issue, then other systems may possibly be affected too. (I haven't tested Makinom/ORK enough to confirm that)

    Also, in my game's case, the two players are being controlled simultaneously (split-screen, action RPG).
    Their movement/camera controllers are actually using Game Kit Controller, but I was trying to also trigger interactions using Makinom's InteractionController.

    I'm not sure if the Change Combatant Input ID and Control Component nodes will help with the stuff I've mentioned. But if those nodes can actually help solve this, then great! :D
    Post edited by andymiira on
  • edited February 2023
    No, the node doesn't help with that :)
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Can you think of any way that the second player can have the HUD and interactions work within the current systems? Otherwise if it could be spiked that would be awesome since having MP support even at a rudimentary level or just those particular aspects, would really open up a lot of exciting possibilities :)
  • No, needs to be implemented within the system, so that's currently not possible.
    Will look into having interactions from multiple players.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Hi Gil there have been some multiplayer requests and queries on the discord threads and some other points of discussion with Ork recently. Some users are even trying to figure out workarounds at the moment within schematics. Since its been a a month since this thread was active I thought id check in. How have you had a chance to look into it?

    https://cdn.discordapp.com/attachments/1009249032008380416/1083531320573050911/image.png
  • Currently you can just give combatants their individual Input ID to use different input for them.

    E.g. input key Accept has 2 input IDs added:
    - input ID 0 > uses joystick 0 button 1
    - input ID 1 > uses joystick 1 button 1

    Using the Change Combatant Input ID node in a schematic and setting the 2nd player group member's input ID to 1 will now have that combatant's menu inputs use joystick 1 instead of joystick 0 for the accept key.
    Do the same for the rest of the input keys to have full control, e.g. horizontal/vertical menu input, cancel, control map keys, etc.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.