2D RPG STEAM TITLE (2023)
11:11
Sorry for the title but I can't really take the name of the game because of the NDA I signed with PTW India. While working with them I made some contributions to this game.
//Technical Highlights:
1. REPROGRAMMING OF INPUTS
Imagine a game with hours of gameplay was built doing Input.GetKeyDown(KeyCode.K) everywhere in the code. It's all fun and games until you need to support another input device such as gamepad, which exactly what they asked me to do. First thing I did to replace these Input calls with mine, so the game is not listening to Unity but ME, for inputs. I'm now the middle-man who can listen to all the devices and tell to the game. In fact most game engines handle the input like that, you define input codes which are triggered by devices.
But the story didn't finish here, you have icons all over the UI telling what key does what, and in expected fashion they were just static sprites of keyboard keys. So I created components which would pick the right sprite based on last device and key linked to the specific input code and update them real-time.
But story didn't finish here either, now when you're playing with gamepad, you're no longer using a mouse. Which means the entire UI is waiting for pointer hover and clicks. Solution? I became the middle man again, but this time for Unity. Now I'm lying about these pointer events to unity based on navigational inputs from gamepad.
In the end it was a neat set of components which turned out to be more usable than I thought. I might rewrite them sometime to make a library out of it.
Imagine a game with hours of gameplay was built doing Input.GetKeyDown(KeyCode.K) everywhere in the code. It's all fun and games until you need to support another input device such as gamepad, which exactly what they asked me to do. First thing I did to replace these Input calls with mine, so the game is not listening to Unity but ME, for inputs. I'm now the middle-man who can listen to all the devices and tell to the game. In fact most game engines handle the input like that, you define input codes which are triggered by devices.
But the story didn't finish here, you have icons all over the UI telling what key does what, and in expected fashion they were just static sprites of keyboard keys. So I created components which would pick the right sprite based on last device and key linked to the specific input code and update them real-time.
But story didn't finish here either, now when you're playing with gamepad, you're no longer using a mouse. Which means the entire UI is waiting for pointer hover and clicks. Solution? I became the middle man again, but this time for Unity. Now I'm lying about these pointer events to unity based on navigational inputs from gamepad.
In the end it was a neat set of components which turned out to be more usable than I thought. I might rewrite them sometime to make a library out of it.
2. CHARACTER CUSTOMIZATION
Since it was a 2D game, customisation might sound simple on surface. Break the character down in parts and change sprites to change the features. Yeah, pretty much. But thing is, that character is animated. Using sprite sheets. Using Unity's age old animations. If you ever animated things this way you'd know the depth of problem here. Now every customisation would need sprite sheet for every animation, and we would need to create animation file for each of these sheets. And no way I was doing that much manual work. Solution? I animated numbers, I first renamed the sprites based on the properties and frame number and turned into a library of sprites, then every time that number was changed from animation I would compile the name of target sprite based on customisation properties and frame number of animation and set that sprite. It's hard to elaborate in few words here so you can always write me an email if you need more explanation.
Again, there were more things I did, such as integrating Steam DLCs, adding weapons etc. But these two tasks were special.
Since it was a 2D game, customisation might sound simple on surface. Break the character down in parts and change sprites to change the features. Yeah, pretty much. But thing is, that character is animated. Using sprite sheets. Using Unity's age old animations. If you ever animated things this way you'd know the depth of problem here. Now every customisation would need sprite sheet for every animation, and we would need to create animation file for each of these sheets. And no way I was doing that much manual work. Solution? I animated numbers, I first renamed the sprites based on the properties and frame number and turned into a library of sprites, then every time that number was changed from animation I would compile the name of target sprite based on customisation properties and frame number of animation and set that sprite. It's hard to elaborate in few words here so you can always write me an email if you need more explanation.
Again, there were more things I did, such as integrating Steam DLCs, adding weapons etc. But these two tasks were special.
0 comments