Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement saving and loading the Input Map from within the Project Settings #423

Open
golddotasksquestions opened this issue Jan 30, 2020 · 20 comments · May be fixed by godotengine/godot#84902

Comments

@golddotasksquestions
Copy link

golddotasksquestions commented Jan 30, 2020

Describe the project you are working on:
I constantly create small minimal projects if I want to try a specific feature/mechanic first before implementing it into my main project, if I discover a bug and need to report it, if I want to help someone out in the community channels. Sometimes one or two a day.

Describe the problem or limitation you are having in your project:
Everytime I create a new project, I have to set all custom Input map actions again. Any single action usually has 3 to 4 Inputs. In 95% these are the same every time - joypad, keyboard, mouse. It feels like a massive chore and waste of time. I'd much rather rename or delete what I don't need than create everything.
It would also make it easy to share Input Maps.

Related: godotengine/godot#29358

Describe how this feature / enhancement will help you overcome this problem or limitation:
If I could click "load", select a config file or whatever and be done with it, instead of doing the same process over and over again, I would be a much more zen person.

Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
Load-save-inputmap

Describe implementation detail for your proposal (in code), if possible:
Clicking on "Save" would open a prompt asking to select a place and a name to save the simple text config file. (res:// by default)
Clicking on "Load" would open a prompt to browse to the place to select the Input Map config file. (res:// by default)
When starting a new project, I imagine all I'd have to do is to copy the InputMap config file I saved in my previous project into res:// of my new one and load it, or even simpler have a common place outside of res:// and just load it from there.

If this enhancement will not be used often, can it be worked around with a few lines of script?:
It would be used a lot by anyone creating small test projects, teachers, people testing things in the engine ...

Is there a reason why this should be core and not an add-on in the asset library?:
I think this should be build into the engine as it would speed up workflow quite a lot for people who create a lot of projects.

@Calinou
Copy link
Member

Calinou commented Jan 31, 2020

Wouldn't it make more sense to allow saving and loading input map files from anywhere on the filesystem, not just res://?

@golddotasksquestions
Copy link
Author

golddotasksquestions commented Jan 31, 2020

Wouldn't it make more sense to allow saving and loading input map files from anywhere on the filesystem, not just res://?

Yes absolutely, that's what I meant with "select a place".
res:// just being the default.

@FeatherAntennae
Copy link

I'm adding a menu and an option to restore default here godotengine/godot#31815

It could help to put the option to import / export in there.

@KoBeWi
Copy link
Member

KoBeWi commented Jan 31, 2020

InputMap is stored in your project, so you just need a "template" project.godot with InputMap configured and just copy it when you want to create a new project.

@FeatherAntennae
Copy link

@KoBeWi A lot of things are stored this way, importing and exporting the InputMap would allow to import and export only the InputMap. I can see this be useful.

@golddotasksquestions
Copy link
Author

@KoBeWi That's a good tip if you'd want to copy more than just the Input map. Thx!

@Calinou Calinou changed the title Save and load Input Map from within the Project Settings. Implementing saving and loading the Input Map from within the Project Settings Nov 6, 2020
@Calinou Calinou changed the title Implementing saving and loading the Input Map from within the Project Settings Implement saving and loading the Input Map from within the Project Settings Nov 6, 2020
@haennes
Copy link

haennes commented Apr 23, 2021

I think this should be implemented.
It would make changeable InputMaps much easier.
The methods for saving and loading the InputMap should be exposed to the API
(used for loading and saving InputMaps created / changed by the user (the one playing the game))

@YuriSizov

This comment has been minimized.

@TheOrioli
Copy link

The way Unity handles this is with an InputActionAsset .

The added benefit is you can ship the game with multiple control schemes and switch them out on the fly through an options menu if you don't want to provide full control customization.

@KoBeWi
Copy link
Member

KoBeWi commented Dec 25, 2021

I created an asset that can save your remap to a file and allows for easy editing of controls:
https://github.com/KoBeWi/Godot-Input-Remap
It's designed for easy controls customization in games.

@Pinkyyyy
Copy link

Was just googling trying to figure out if importing an input map exists, and it seems like it doesn't still, any plans for this in the future?

@Calinou
Copy link
Member

Calinou commented Jan 25, 2023

Was just googling trying to figure out if importing an input map exists, and it seems like it doesn't still, any plans for this in the future?

4.0 is in feature freeze, and there is no ETA for features being implemented. Also, there still isn't a clear consensus on whether this should be editor-only functionality, or something that can also be used in exported projects.

Another question we haven't decided upon yet is whether the saving/loading process should affect built-in actions such as ui_accept.

@Pinkyyyy
Copy link

4.0 is in feature freeze, and there is no ETA for features being implemented. Also, there still isn't a clear consensus onwhether this should be editor-only functionality, or something that can also be used in exported projects.

Hopefully it's there for 4.1, seems like a really useful thing to have.

Another question we haven't decided upon yet is whether the saving/loading process should affect built-in actions such as ui_accept.

Personally since 4.0 seems to hide built-in actions they shouldn't be affected by an imported input map.

I guess a way to do this without having to import an input map or rather have to create one from scratch every time you make a FPS game for example is by just using template projects.

@Shadowblitz16
Copy link

Shadowblitz16 commented Jun 20, 2023

Was just googling trying to figure out if importing an input map exists, and it seems like it doesn't still, any plans for this in the future?

4.0 is in feature freeze, and there is no ETA for features being implemented. Also, there still isn't a clear consensus on whether this should be editor-only functionality, or something that can also be used in exported projects.

Another question we haven't decided upon yet is whether the saving/loading process should affect built-in actions such as ui_accept.

It should NOT be editor only.

I honestly think ui actions should be bindable to input map resources.
Just have a default one in the editor settings and a button to reset it to default just in case we mess it up.

It would be nice to treat separate ui with separate actions and if the multi ui focus gets implemented it would be extra useful

@Catastrphic
Copy link

a nice way to implement it is to have an option to include built in actions and to be able to do this from a script.

@EladKarni
Copy link

I'm not sure if this is still an active proposal, but I ended up making a plugin for this. I'm hoping it'll help with the proposal so we can have this feature added to the main engine 😄

https://github.com/EladKarni/InputMapperPresetLoader

Should I make a new proposal since this one is from 2020 or should I do something else to try and promote this feature?

@Zireael07
Copy link

Do NOT make a new proposal. Does not matter how old the proposal is, if it's still open it's still considered.

@golddotasksquestions
Copy link
Author

Instead of another proposal for the same thing, you can submit a Pull Request which would solve this issue @EladKarni

@ZycaR
Copy link

ZycaR commented Nov 14, 2023

@golddotasksquestions - I'm new here and I accidentally created similar proposal. (should be closed now) Can you please revisit my proposal if it is aligned with your needs?
BTW: working on the solution into curent code v4.2

@ZycaR
Copy link

ZycaR commented Nov 22, 2023

Pull request is kind of ready to review. Is it possible to give feedback if it is ok, or there is additional work?

The code change adds 'three dot' menu with import/export:
284427615-b2963c78-5d76-410b-9d22-c34529ffb066

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.