craftablescience / ChiraEngine

A customizable MIT-licensed game engine.
https://craftablescience.info/ChiraEngine/
MIT License
33 stars 6 forks source link

Replacement input system #49

Open ashifolfi opened 1 year ago

ashifolfi commented 1 year ago

Component to Improve

Core Engine

Describe Your Suggestion

The current input system is not very flexible and kinda sucks to work with. We should replace it with something else.

Here's a list of possible replacements I've found to handle inputs:

ashifolfi commented 1 year ago

feel free to add any other suggestions here this is just what I found from searching

craftablescience commented 1 year ago

I would rather rewrite what we have tbh It would be best to make input mappings that aren't defined in code, but defined by the user I think, none of the two linked would allow that without writing a wrapper anyway Handling input cannot be too hard compared to other engine tasks

craftablescience commented 1 year ago

We're going to use SDL once #39 is in, but we still need our own system on top of it to keep everything pretty looking

It would be great if we could just copy how Godot does it but mix it up a bit, where keys, buttons, joysticks, etc map to a single named action specified in a config and you can register/deregister hooks into that named action (or check if that action is being fired in the update function, which is also more like Godot and is probably more scripting-language friendly but might be slower depending how it's implemented)