Page 1 of 1

Unity Input System

Posted: Sat Dec 05, 2020 2:57 am
by Alth
I thought I would have a go at swapping the old input system for the new one. I kind of like how it works. Maybe might try to implement it to the entire project. I noticed that the way the game was handling input on UI and in most of the system seems to be (at least in some parts) just checking for keycodes. This new system is very event driven and has things built in like modifier keys for hotkeys. Also you're able to have separate control schemes for different situations and the whole configuration and event bindings should probably help with modding it seems since you could just replace scripts and input assets.

I don't know how you guys want to handle input but currently I have created a player controller for a separate project that I am working on. Personally I find it easier to have all the inputs and their connected functions in a single, easy to read place. Please leave any feedback on this. :)

Re: Unity Input System

Posted: Sat Dec 05, 2020 3:55 am
by Interkarma
Hi. :) Just to set expectations, I have no plans on revising input system in Daggerfall Unity. Unless you're only doing this for your own enjoyment in a forked project, please don't spend more time on this than you feel comfortable with.

Daggerfall Unity is entering beta in a few weeks. From this point there will be no further major changes or overhauls accepted to the code. Only bug fixes and small incremental enhancements to mod & localization support.

Re: Unity Input System

Posted: Sat Dec 05, 2020 7:22 am
by Alth
Noted, I'll probably just keep it as a fork if I don't get anywhere with it in time. The reason that I started it was to roll my own control system for an idea I have for the game.

Re: Unity Input System

Posted: Sat Dec 05, 2020 8:49 am
by Interkarma
Sounds good. Be sure to share progress later when ready, I'm interested in seeing what you do with it. :)

Re: Unity Input System

Posted: Sat Dec 05, 2020 11:18 pm
by jefetienne
Alth wrote: Sat Dec 05, 2020 2:57 am I thought I would have a go at swapping the old input system for the new one.
Hey, I worked really hard on that system! :lol:

Understandable though, DFU was in Unity 2018 earlier this year when I started overhauling it for controller support, and when I read later that 2019 had a new input system that included controller support, I said to myself "uh, did I just do all of this for nothing?" But then I thought that it was good to create something that the programmer has total control over versus a proprietary engine's. Plus, the logic of I wrote can always apply to other game engines or ones built from scratch.
Alth wrote: Sat Dec 05, 2020 2:57 am This new system is very event driven and has things built in like modifier keys for hotkeys.
If you take a look at InputManager.PollInput(), you can add a spot for proper events to be executed. I also have modifiers done (though limited to just two buttons) that can be of any combination.

Good luck on your fork! I'd love to see how it's done down the line.

Re: Unity Input System

Posted: Sun Dec 06, 2020 9:08 am
by Alth
jefetienne wrote: Sat Dec 05, 2020 11:18 pm
Alth wrote: Sat Dec 05, 2020 2:57 am I thought I would have a go at swapping the old input system for the new one.
Hey, I worked really hard on that system! :lol:

Understandable though, DFU was in Unity 2018 earlier this year when I started overhauling it for controller support, and when I read later that 2019 had a new input system that included controller support, I said to myself "uh, did I just do all of this for nothing?" But then I thought that it was good to create something that the programmer has total control over versus a proprietary engine's. Plus, the logic of I wrote can always apply to other game engines or ones built from scratch.
Alth wrote: Sat Dec 05, 2020 2:57 am This new system is very event driven and has things built in like modifier keys for hotkeys.
If you take a look at InputManager.PollInput(), you can add a spot for proper events to be executed. I also have modifiers done (though limited to just two buttons) that can be of any combination.

Good luck on your fork! I'd love to see how it's done down the line.
You did a nice job with what you had to work with. Besides that I have been using some of the work you did to help me get things like saving and loading player binds.

I think I'm starting to see how it's going to work barring any misunderstandings on my part.

I am planning to have the input manager parent class perhaps with all the references to integral parts of the game that the player will need to interact with through input that the daggerfall input manager will derive from. Then if people want to have completely custom input and functionality by creating their own input manager that derives from that parent class. Or they can add new binds on top of the daggerfall one.

I'm sure there are things I am missing in terms of how modding works in this regard so if anyone wants to chime in on whether I'm trying to take the system way beyond its limitations or just any advice would be greatly appreciated.

Either way I'm really enjoying working on this haha.

Re: Unity Input System

Posted: Mon Dec 07, 2020 9:22 am
by Alth
Working on adding all the hotkeys so people can rebind to their hearts content. :D
Made some changes to UI but nothing drastic.

Re: Unity Input System

Posted: Sun Dec 13, 2020 10:03 am
by Alth
Change of plans, I found myself changing too much of the engine that I'm probably just going to keep it as a fork. I couldn't get the UI system to work with the way I wanted to do input so I'm also just going to redo the UI system to using the Unity one. One benefit of that is that it's integrated with the input system.

Custom wip main menu :D

Image

Re: Unity Input System

Posted: Sun Dec 13, 2020 4:37 pm
by jefetienne
Alth wrote: Sun Dec 13, 2020 10:03 am Change of plans, I found myself changing too much of the engine that I'm probably just going to keep it as a fork. I couldn't get the UI system to work with the way I wanted to do input so I'm also just going to redo the UI system to using the Unity one. One benefit of that is that it's integrated with the input system.
Wow, that looks great so far :D are you using/modifying the DaggerfallUI class or is your UI work completely separate so far?

Re: Unity Input System

Posted: Sun Dec 13, 2020 8:36 pm
by Alth
jefetienne wrote: Sun Dec 13, 2020 4:37 pm Wow, that looks great so far :D are you using/modifying the DaggerfallUI class or is your UI work completely separate so far?
Thanks! I like the Daggerfall title so I thought it would look great as the menu title. The black background kinda sets the right kind of mood for "VENGEANCE!" ;)

The Unity system is super simple to implement. You set it up as gameobjects, attach a script for a particular interface and hook up functions in the inspector. So I can design the interface in the scene and save it to a prefab. I'm just using the old interfaces to find the functions that are called for certain buttons and other things like that.