Description
Are you working on a project where a player can move? Then this asset pack is for you! No, really. These macros not only fix an inherent “flaw” in movement inputs, but they also allow you to implement custom directional movement curves that perfectly replicate and work on both controller and keyboard. The keyboard versions allow for partial-pressure inputs. There is a very good chance these are the most efficient and effective movement solutions in their class.
Limitations: After much use, and driven by my honest nature, I have found a limitation with this approach to governing movement speed. Since the speed modification is driven by a formula attached to the enhanced input event, it doesn’t directly alter the movement physics, only what the movement physics receives. So the gradient changes in speed are instant, meaning things like acceleration don’t have an affect on the outer gradient changes. If you hold W to go forward, then tap E to go forward right, that speed change will be instant (for the cosine macro). There is no way to correct for this without significantly compromising efficiency.
Regarding UE 4 & Earlier: Movement seems to have changed DRASTICALLY with the introduction of UE 5 and Enhanced Input. I tried for a while to get these equations working within UE 4, with some success, but learned something interesting in doing so. So, picture the x and y input amount values as a shape on a graph. In UE 5, intuitively, it seems like a nice square. This asset turns the square into a circle or egg. In UE 5, that base graph shape is NOT the same shape. It proved to be insanely tricky pulling off the same shenanigans (and they were shenanigans) that worked for the 5 version within 4. I have some working in 4, but not all. So if you need anything for 4, ask first and if it’s one of the solutions I have I shall happily provide it.
Future of this product: I am absolutely fascinated by human motion and I have a background in astrophysics. I will likely make this asset part of a larger adaptive motion system. No ETA on that, but it’s the long-term intent.
VIDEO DEMO/INSTRUCTIONS: YouTube Video
Discord: [dephoro] Discord
Website: [dephoro] Help Center
This product contains an elegant fix for the movement input system, while also allowing you to implement any custom directional movement curve of your choosing. Here’s what you get with this pack (DSM stands for Directional Speed Modifier, abbreviated for ease of use):
1x “DSM – Keyboard – Circularization” Macro
1x “DSM – Controller – Circularization” Macro
1x “DSM – Keyboard – Cosine” Macro
1x “DSM – Controller – Cosine” Macro
1x “True Speed Calculation – Cosine” Macro
Here is what each product does:
“Directional Speed Modifier – Circularization” Macro
THIS ONE IS A MUST-HAVE AND NO THAT’S NOT A SALES GIMMICK. It fixes an inherent “flaw” in the movement input system WITHOUT affecting anything beyond that fix. The rest of your in-place and already-built movement systems SHOULD be completely unaffected. What this input does is perfectly circularize all combinations of X+Y movement inputs. At all input angles. And it is impressively light-weight and should fully replicate in multiplayer games because of how the problem was addressed.
“Directional Speed Modifier – Cosine” Macro
This macro, instead of circularizing inputs to where a character has a steady speed in all directions, modifies directional movement along a (custom) cosine wave. When you move forward you move at full speed. When you move left or right you are moving at about 90% speed. When you move backwards, you are moving at about 70% speed. And the in-between values are a smooth gradient between those named values. This specific macro is what we, personally, use to somewhat mimic human directional movement; however, the point of our including it was so you can have a framework to make your own custom movement curves! Maybe your players control animals, or monsters, or anything… this should allow you to tailor a directional movement curve to each.
“True Speed Calculation – Cosine” Macro
The True Speed calculation is used to reverse the effects of a specific modifier function, in this case the “Cosine” modifier macro above, for tracking purposes. Suppose you have a “scroll to increase speed” system. You will likely want to reference the character’s speed as if they weren’t slowed down so you can ensure they don’t scroll-tick themselves above or below a certain threshold. With this, you can always use the player’s actual, unaffected speed as a baseline. Either store it to a variable or use it as a macro!
All of our macros are contained within the “BML_P_MovementInputCC” Blueprint Macro Library file, contained within the “MovementInputCC” folder. The macro comes with Pawn set as its parent class by default. Considering all of the functions are math-based, feel free to change this parent class to Player Controller or Character as you see fit. To use these macros in a pawn or character or player controller blueprint, simply search for the name of the macro you want to use in your right-click search pop-up. All of our macros are delightfully lightweight, mathematically-based, and there is more commenting than code to ensure you fully understand what is going on AND how to edit them to suit your own, individualized needs.
This is the type of asset you can use in nearly every one of your projects!
Speed runners: Sorry in advance and we have nothing but respect for your craft.
Technical Details
Number of Blueprints: 1 (Macros are contained within a Blueprint Macro Library)
Input: Keyboard & Controller
Network Replicated: Yes, Should Be. Tested In-Engine.
Supported Development Platforms:
Windows: Yes
Documentation: Comments in Macro // YouTube // Website // Discord
Important/Additional Notes:
For help creating your own custom directional movement speed formula, feel free to join the discord and send us a message!
Supported Engine Versions
5.1 – 5.3