Cropout Sample Project - Unreal 5.5.4 - Mega Learning Thread

[INFO DUMP: BP_PLayer]

I’m back after a long while since lots of things happened in the past month and I couldn’t really get back into Cropout Project mentally but, hopefully, that will change from now on.

Previously, I was learning the UI system and in the middle of it I have touched upon the BP_Player due to various input issues I have been encountering. Boy, that Blueprint ishuge, but it allowed me to learn a lot of new things to make getting the hang of the Unreal engine so much easier in relation to the Cropout at least.

Watch this amazing video: https://www.youtube.com/watch?v=bIo97TLsXkY thanks to which the Input Action System is so much more easy to understand.

1. Input Actions

What I understand is the building blocks of the whole Input System are the Input Actions in which you define the dimentionality for each input.

The Cropout Project has 6 Input Actions:

  1. IA_Build_Move (Boolean - mainly to know whether or not you are in the building mode)
  2. IA_DragMove (Axis1D with a Hold trigger - used to allow you moving around the island with a non keyboard input, available only outside of building mode)
  3. IA_Move (Axis2D - used for keyboard movement)
  4. IA_Spin (Axis1D - single way camera rotation using the Q key)
  5. IA_Villager (Boolean - mainly to know whether or not you are holding the villager)
  6. IA_Zoom (Axis1D - two way camera zoom using the Mouse Wheel)

2. Input Mapping Context

So you have created the Input Actions, however, that is not enough. You have to give them context, and that is through the Input Mapping Context.

The project has 4 contexts:

  1. IMC_BaseInput (consists of IA_Move, IA_Spin, IA_Zoom - all the input actions that are not too reliant on any game modes)
  2. IMC_BuildMode (consists of IA_Build_Move - we need to have it separated so we can tweak t he behaviour while placing the Buildable Interactables
  3. IMC_DragMove (consists of IA_DragMove - we need to separate it as the behaviour of moving around the island will be in the way of building and villager behaviour)
  4. IMC_Villager_Mode (consists of IA_Villager - needed mainly to make the Villager Job System its own unique behaviour)

3. Input Modifiers

Once you set up all the behaviours for whatever Input Type you support (as you can see you have not only the PC input but mobile and console as well), you can further tweak how the input behaves through the Input Modifiers.

Most of them are preset, however, two are made in the project, specifically for Touch:

As you can see you can create your own modifiers to make the input even more tailored to your needs. So far, I didn’t make any of the Modifiers for Mouse and Keyboard yet.

4. Input Data Table

Somewhere in between of all that there is also the Input Data Table which you attach to the buttons, however, I didn’t delve into it yet aside for cleaning up the references where some of the BLueprints were using the composite table which didn’t add much to the project.

I know that you can set keyboard presses to specific UI and yet I din’t manage to make the ENter button actually work to properly navigate through the project. Might be something I have broken along the way.

5. Movement Graph


Funilly enough, it didn’t occur to me until I looked into the BP_Player that you can actually have multiple event graphs which makes things more clear. And that’s what the Movement Graph does by keeping all the Input Actions in one place.

As you can see especially with the IA_Villager the input priority for the same button can be easily achieved by removing/adding the mapping context from the Enhanced Input Local Player System. I’m not sure how powerful the system really is, but am planning to spend some time to expand on it as wanted to improve the IA_Spin at the very least, same with the Build Mode.

And, to help you with checking whether things are working correctly or not, consider adding this debug command as a cheat button: https://dev.epicgames.com/community/snippets/EJp/unreal-engine-show-debug-info-for-enhanced-input. It gives out so much useful information you would be surprised.

I guess, that’s it for now. More on the Input and BP_Player later down the line.