{"id":18084118,"url":"https://github.com/maragedev/yamih","last_synced_at":"2025-08-22T17:10:45.566Z","repository":{"id":258866676,"uuid":"875229051","full_name":"MarageDev/YAMIH","owner":"MarageDev","description":"YAMIH ( Yet Another Multiplayer Input Handler ) is an attempt at creating a more modular approach to Godot's Input system, especially for local multiplayer games.","archived":false,"fork":false,"pushed_at":"2024-10-22T15:35:53.000Z","size":297,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T23:42:25.683Z","etag":null,"topics":["godot","inputs","modular"],"latest_commit_sha":null,"homepage":"","language":"GDScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MarageDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-19T12:36:22.000Z","updated_at":"2024-10-22T15:35:57.000Z","dependencies_parsed_at":"2024-10-22T23:39:38.001Z","dependency_job_id":null,"html_url":"https://github.com/MarageDev/YAMIH","commit_stats":null,"previous_names":["maragedev/godot-modular-inputs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarageDev%2FYAMIH","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarageDev%2FYAMIH/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarageDev%2FYAMIH/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarageDev%2FYAMIH/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarageDev","download_url":"https://codeload.github.com/MarageDev/YAMIH/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415928,"owners_count":20935385,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["godot","inputs","modular"],"created_at":"2024-10-31T15:05:45.968Z","updated_at":"2025-04-05T23:42:29.834Z","avatar_url":"https://github.com/MarageDev.png","language":"GDScript","readme":"\u003ch1 align=\"center\"\u003eYAMIH\u003c/h1\u003e\n\nYAMIH *( Yet Another Multiplayer Input Handler )* is an attempt at creating a more modular approach to Godot's Input system, especially for local multiplayer games. It can handle keyboard inputs, controllers ( and probably also all the other inputs possible in Godot but I couldn't try the other ones ).\n\nIt can support at least 6 players ( tested ), but it can probably support even more players as long as you have enough unique inputs.\n\n![image](https://github.com/user-attachments/assets/f5494e0d-4745-4ec3-8507-7be287239a1f)\n\n\n\n\u003ch2\u003ePresentation\u003c/h2\u003e\n\n\u003ch3\u003eInput\u003c/h3\u003e\n\n```gdscript\nextends Resource\nclass_name C_ModularInput\n\n@export var action_name:String\n@export var input:InputEvent\n```\n- `action_name` is used later in the `InputManager` to add this action ( once formatted ) to the designated `InputMap`.\n- `input` is used to specify which input you want to capture for this action ( key, joypad ... ).\n\u003ch3\u003ePlayerInputHandler\u003c/h3\u003e\n\n```gdscript\nextends Resource\nclass_name C_PlayerInputHandler\n\n@export var PlayerIndex:int = 0\n@export var PlayerName:String = \"Player\"\n@export var Inputs: Array[C_ModularInput]\n```\n- `Inputs` is used to store all the actions possible for this player.\n- `PlayerIndex` must be different for each players.\n\u003e `PlayerName` has no real use besides the demo.\n\n\u003ch3\u003eInputManager\u003c/h3\u003e\n\n```gdscript\nextends Node\nclass_name C_InputManager\n\n@export var Players:Array[C_PlayerInputHandler]\nvar Actions:Array[String]\n\nfunc _ready():\n\tupdate_all_actions()\n\nfunc write_actions_to_input_map(Player:C_PlayerInputHandler,InputMapRef:Object = InputMap):\n\tfor InputRef in Player.Inputs:\n\t\tvar formated_action_name:String = str(InputRef.action_name,\"_\",Player.PlayerIndex)\n\t\tInputMap.add_action(formated_action_name)\n\t\tInputMap.action_add_event(formated_action_name,InputRef.input)\n\t\tActions.append(formated_action_name)\n\nfunc update_all_actions():\n\tfor i:C_PlayerInputHandler in Players:\n\t\twrite_actions_to_input_map(i,InputMap)\n```\n- `Players` stores all the players with their associated actions ( class of `C_PlayerInputHandler`, see above ).\n\n- `write_actions_to_input_map` adds every `Inputs` stored to the designated `InputMapRef` as `[Action Name]_[Player Index]`.\n\n- `update_all_actions` is used if you plan to add/remove another player while playing.\n\n\u003ch2\u003eDemo\u003c/h2\u003e\n\u003ch3\u003ePrinciple\u003c/h3\u003e\n\nIt adds `UI_PlayerCard.tscn` for each registered players in the `InputManager.tscn` node referenced as an export, and display the action, name, player index on the according card. It's mainly here to verify that everything works correctly.\n\n![image](https://github.com/user-attachments/assets/f5494e0d-4745-4ec3-8507-7be287239a1f)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaragedev%2Fyamih","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaragedev%2Fyamih","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaragedev%2Fyamih/lists"}