Another week another devlog! This week has so far been a bit rough for myself as I have been struggling with the subject at hand, Inverse Kinematics(IK)!
This and last week I have been getting into IK which stands for Inverse Kinematics. IK in this case refers to the calculating of skeleton joint parameters(location, rotation) needed for placing a joint in the right place depending on the skeletons surroundings(for example a hand and arm). That said, the mathematics behind IK can get very confusing. Luckily, using Unreal Engine, we dont really have to care about what is going on inside the engine however, some difficulties remained. The IK built in to unreal engine is very simple, which is very good thing for most use cases as the threshold for who can use it becomes lower, in my case however this lead me down a rabbit hole.
--- Author: SImon "Vito" Gustavsson ---
Using IK in unreal is as said very simple as you only really have to give the location where you want the joint to target and which other joints should also follow. In this case it would be where I would want the hand to target a ladder step and all the joints leading to it from the shoulder, which is simple enough. This is where the problem arose: there was no interpolation between the positions, so whenever I wanted the hand to switch to the next rung, it just teleported there.
Video titled "Before"
So this lead to me having to come up with a solution for the interpolation and I of course googled the problem, but I couldnt really find a solution online so my brain was going to have to work a bit harder. After some consideration I came up with that what I wanted to do was go from the old location to the new location, and I knew there existed blend nodes for general animations, so my first test came out to try to blend between old locations that had been used and interpolate between the new location. Here I used a node called blend node by bool which in hindsight was the most foolish idea I have ever had, however this function had a blend time which made it enticing for me to try out. This solution I did not like as there were many variables that needed blending and the animation code became too big and unreadable.
However, it also had a grand flaw: while the blending worked brilliantly, it would always lag behind. This is because when using Blend Node by Bool it interpolates between the position given at the start of the blend. During this time, the solver does not update the target position, causing it to lag behind by however long the blend time is. This made me also understand why unreal does not have a built-in blend for IK. This lead me to try out all different kinds of blending between animations and I found one I really liked that was about what I was imagining, just a simple interpolation with an alpha variable that seemed to work fine. This is also where I found out you could save previous poses from you character(which I should have realized earlier) so I did not have to use so many variables for using the damned bool node which also fixed my problem with blend times.
Video titled "After"
All said and done I still do not like looking at how small the solution became in the end, it makes me feel stupid for making such a complex solution to begin with. Nonetheless I still have some minor tweaks to figure out, like right now it jitters a bit too much while climbing and also some IK for going against walls and for the legs. but now I am going to take a little break from doing this and test out some new smart objects for NPCs in unreal(maybe a topic for another devlog :P)
That is it for this week, hope yall are doing well! Au Revoir!
[ 2023-02-01 10:59:31 CET ] [ Original post ]
🕹️ Partial Controller Support
🎮 Full Controller Support
a Restless wanderer
The City of Machines wanders restless through the barren wastes. Here, everything is machines; even the inhabitants. Ever onward, the City chases Optimum: the last, fleeting oasis of time left in the world.However, A New Threat Looms On the Horizon.
a Mechanical Puzzle Adventure
Mechanical Sunset is a mechanical puzzle adventure. In the game, the player will get the chance to explore The Wandering City of Machines; a place its robotic inhabitants have made home. This is a bizarre place where the warm, inviting lights of a cabin mingles with heavy machinery, cascades of sparks, and forests of wire and pipe.On their way through the metal jungle, the player will have to learn to operate the aging machinery; buttons, levers, gauges and lights guide you as you awaken the slumbering leviathan.
Features
- Navigate through the bizarre and unfamiliar world of the Walking City of Machines, where
mechanical meets countryside comfort. - Encounter obstacles that must be overcome by learning to operate large and unfamiliar machinery.
- Learn to interpret what the machines are telling you by reading indicator lights and gauges;
connected to accurately physics-simulated components. - Manipulate the world around you using old, analogue control panels. Satisfying buttons and
chunky levers are your means to get the old machines running again.- Careful: the inattentive player may end up breaking the machinery and have to rely on
alternative solutions to get what/where they want.
- Careful: the inattentive player may end up breaking the machinery and have to rely on
- Talk to the interesting robotic lifeforms around the City.
- Discover their Wishes, Dreams, and Ideals.
- Help them With their Tasks – Or Don’t.
- Ask them for help with puzzles that you can’t crack on your own.
- Discover the truth behind the temporal apocalypse.
- Time is freezing, and it is up to the player to figure out why, and how to stop it.
This is a game for people who like pressing buttons.
[ 6132 ]
[ 2625 ]