Day 116: Today I worked at my usual rate. It was productive, but not incredible. I continued the work on the input system so I don’t have much to say apart from that. Oh and also tonight I don’t have anything to do, like sending cv or making a portfolio. It feels great.
Daily interesting stuff: Weirdly though I only have one link for you today.
Article about getting a copyright lawsuit even as a small time indie. It’s well written and raises some good points. Just because the name of his small game was a bit close to another, they asked him to change everything. It bumps me down that because of stuff like that you can’t use some words while naming your games. Like seriously no beeing able to use “Tribe”? That’s fucked up…
Tasks done:
Implemented a custom axis Input system. It’s mainly used to be able to rebind the move keys. It was a bit hard to do, since it wasn’t planned at all. The custom input system I have only binds one key to an action. And with axis it needs to take either a real Unity axis or two keys. So I had to implement a solution that would fit nicely in the system I wrote. I end up treating it differently as the buttons and it has its own specificities.
Implemented a dynamic input device switching. It’s a clever way to say that know when you press a key on the keyboard it switches to keyboard inputs. And when you press a button on the gamepad, it switches to that aswell. This took a bit of time to make. In the end the code is rather simple, but it took a lot of trial and error. First I created a SniffInput method. I had this functionality before, but it was starting to become duplicated code. So Now it’s in one place only. It returns the key actually pressed. It works with most of the gamepad buttons too. So back to the switching thingy. It first checks to see if there’s any axis used, then it checks if there’s any key down. If there’s a key down, it calls the sniff method. If not it does nothing. Then it analyse the input to see if it belongs to the gamepad or the keyboard. And then if it detects a change in the device used, it switches to that device. It does so by applying saved key bindings. And since gamepad and keyboard keybindings are saved separately from the start, it works well.
Almost implemented the rebinding UI. I say almost because I have a small bug with it. I could’ve fixed it today, but I wanted to have something fresh in my mind to start tomorrow. So this tasks took me around two hours today. It’s less than I expected. It’s mostly because to test all the previous work, I had to have some kind of fake rebinding. So most of the “press a key to assign it” was already done. I then created a pane, and texts elements to show what to press. Animating everything took the most time. I used the code-based animation components I created a while ago. It’s really cool because it enables me to schedule things nicely thanks to coroutines. I can for exemple wait for an animation to be finished before doing anything else. So for tomorrow, and to finish the Input system, I need to correct the bug I have (weird stuff). And I also need to actually use the new system in-game. For now I still rely on the regular Unity Input system (I didn’t want to break anything).
0 comments