Cropout Sample Project - Unreal 5.5.4 - Mega Learning Thread

Hello,
I hope this is the right place to start a Cropout Sample Project specific mega thread for solving issues / learning new things / implementing new features using the aforementioned project whether development or automation oriented with Unreal 5. If not, please direct me to a better place as I would love to start a ‘mega thread’ somewhere for all things Cropout project centric.

I’m new with Unreal and as I go through the ‘Ask a Dev’ Tutorial videos I decided to slowly implement the knowledge I have towards the Cropout project as it felt simpler than the shooter one. I have stumbled upon some snags due to my lack of proper terminology /knowledge so was hoping somę of you could speed up my syruggles. :smiley:

  1. Can someone help me in understanding how I can access the values inside the blueprint nodes likę in the Screenshot as I am scratching my head trying to figurę out where exactly the array is stored and how to edit that. Or, any documentation will do as well. I like reading.

  2. As part of the automation testing I wanted to understand how the save/load system works + deleting sales before tests (slowly getting there). This is mainly due to the issue I am having where a new villager is being spawned on most of the game starts (the default is 3 but the more I restart I can reach 20+ villagers and have tough time to debug that)

More questions to come, I guess, but for now I will be grateful for petting some light shed on those probably straightforward problems I want to learn operate around. Blueprints is so visually helpful but still, it takes time to get the hang of all the things. :smiley:

I have figured out that in the Play mode, you can mouse over the nodes to see the values inside instead of a cropped text, so at least I know the array has 3 resource types (obviously). No idea how to edit that still, though. I guess it’s something super stupidly easy, as usual…

On a side note, I have exported the BP_Spawner file as .T3D via Asset Actions, no luck there either. Back to digging. :smiley:

Indeed, it was obviously in plan sight. Focused too much on BluePrints side of things while completely overlooking the in-level hierarchy. Oh well, one problem solved, so can play with that. :smiley:

I’m getting closer to figuring out the save/load system and fixing the extra Villager problem I am experiencing on Game Continue (still not event sure whether that’s by design or not), but anyways.

It seems that the moment I choose any villager and drag them to an interactable object to switch their job, Spawn villager or a call to increase the villager count is being triggered somewhere, which then the Save data pick up, resulting in the game state having 1 extra villager spawned if you Quit and Continue.

If I don’t drag to target any of the Villagers, the Quit and Continue keep the number the same.
If I Restart, the number of the villagers is set back to 3 as the Save data is cleared in that flow (the +1 Villager issue might stem from BP_GM or BP_GI, but debugging is difficult as don’t have enough experience yet how to navigate around, but soon :D).

I’m finally getting the hang of understanding debugging with breakpoint’s help. This helped me find out that for some reason the Set Array Elem inside the BP_GI is the problem as oftentimes it returns number of villagers as +2 per step instead of +1, ending with more Villagers that it should be set(?).

Weirdly, the Villager Count in BP_GM breaks and returns 0 while that happens, so no idea why is that, so far. Back to more digging… :smiley:

For whoever will be working with the Cropout project in the future (if that’s not changed by then) I have found out the cause of the extra Villagers being spawned, short explanation:

  • ‘Event Update All Villagers’ is meant to update Villagers logic
  • For some reason the ‘Get All Actors Of Class’ looks for the Pawn type
  • BP_Player is of the Pawn Type too (game start limits the number of Villagers to 3 so despite the count being 4 with Player included, only 3 Villagers are spawned)
  • Changing Actor Class inside the ‘Get All Actors Of Class’ to BP_Villager fixes the issue

And with that, I can return to Automation Tests for the Cropout project with a clear mind now. :smiley:

[INFO DUMP: QA Automation: Functional Tests]

I did some investigating around the automated functional tests in Unreal 5.x and here are my initial findings (which might change as I learn the systems and rules around those more), which I feel are worth sharing:

  1. Most likely due to performance/time considerations (couldn’t find a good source for that other than the very old posts in this forum - when I find the post again, I will post a link here) the ‘Take Automation Screenshot’ blueprints can take only a single screenshot per started test run, whether the test run consists of only one individual test or multiple tests.

As a temporary workaround (thanks to this post: How to take a screenshot including UI only using Blueprint? - #26 by Danthomo87) I have created a custom Macro using the ‘Execute Console Command’ node (when making tests work in a macro first, you will thank me later, as automation is lots of repeated code).

This way I have a first step towards recording the game visuals per test step, even if those screenshots are not high quality ones (not sure if those can be used as ground truths for Screen Comparisons - something I will look into later).

Reference images below. Since it’s a macro, you need to make it variable agnostic - what I mean by that is that all the variables should be provider from the outside of the macro as once the macro is edited, it will edit itself globally (think editing ‘for loop’ that would affect whole project instead of single blueprint).

In simple terms:

  • Create a macro
  • Add the macro to the Blueprint
  • Hook up and set variables needed by the macro


  1. Annoyingly, though to a degree it makes sense, any red type error message which gets triggered during the test run (regardless if set by you or in the project itself) will result in that particular Functional Test result being marked as ‘Fail’ even when the test itself succeeds (reference example below).

I am yet to find any command or option in the Unreal engine that would suppress those errors just for the Functional Tests so that the test can remain as Success despite the potentially unrelated issues.

Not really a workaround but a way to make a less invasive warnings at least for your own control that I have figured out is by simply using the ‘Log Message’ node instead, should you want to raise awareness while not impacting the test status.

  1. Sadly, there is no way of ordering tests you are starting via the Session Frontend. Presets might be the workaround (or some C++ way), however, I have not given it a proper look yet, but soon.

  1. Functional Tests have no way to emulate inputs on their own, at least I couldn’t find any answers on how to do that. The only way to go I have managed to find and simple enough to understand and replicate is by creating your own events side by side with the ones called in the UI widgets. Then you can call them in your Functional Test blueprint.

This does not subsistute UI testing, it’s just a means to move through UI without user input (i.e., for comparison screenshot gathering), until proper input can be emulated. Clicking through UI is still advised to be the manuał job for QA. :slight_smile:

  1. Functional Tests need to be attached to a level for them to be started. This poses a problem since when you switch levels the test itself is not persistent, resulting in it being marked as ‘Aborted’ and failing. I am yet to find a way to make it as a persistent presence (something in the likes of DoNotDestroy in Unity).

That is all for now. More to come as I learn via the Cropout Sample Project. :smiley:

[INFO DUMP: Island Generator Blueprint]

I couldn’t make the Functional Tests work with the current project set up (levels being opened and everything being destroyed afterwards), so those are still being aborted on level change. Not a big deal at the moment as my Functional UI Tests within a single scene are almost done (that topic next time).

Decided to detour towards understanding the Cropout project better one blueprint at a time before I attempt at making the world a streaming one (Main Menu being persistent while Village becomes a sub level). Below are the results for the Island Generator:

1. Preparing the Dynamic Mesh

Few things to note:

  • Original Blueprint moves the Island on each creation alongside the Z place, thus, keeping the Actor at the Origin point will save us from potential headaches later (should we play this game for a long time)
  • I have added in the later sections the Array for Cone Sizes which is closely tied to Spawn Marker (this will be useful for spawning objects within bounds of the cones which I am rewriting slowly) - we need to clear the said Array otherwise it will store the values each time you start the blueprint which we don’t want

2. Spawning the Cylinders

Main Point:

  • Expose as many variables as it makes sense - it will speed up your iteration process and reduce the chance of you scratching your head on why something is not working to find out it was because you have forgotten about some obscure Magic Number you set ages ago
  • Reroute Nodes are your Friends :smiley:

3. Forming the Island

Main Point:

  • Again, exposing the variables makes understanding the code so much easier. Especially when trying to figure out the Mesh Plant Cut or the importance of the Z Dimenation in the Blueprint
  • Other than that, cool learning experience in regards to transforming cylinders - worth digging deeper

4. Clean Up

Few things to note:

  • Releasing All Compute Meshes is used here as an anti-memory leak since we use the Geometry Script (if I understand the documentation related to those nodes correctly)
  • Moving slightly the Island is means for faster (?) iteration (again, just an assumption as it’s quite convenient to see changes on each variable change, although quite slow on my machine)
  • My brain didn’t initially click but Col is obviously Colour and not column (oh, my Excel part of the brain :smiley: )

[INFO DUMP: Island Generator / Spawner]

As I was figuring out the Island Generator related Blueprints I have noticed that in some cases (most likely due to me messing up with a few things) the Interactables were being spawned on the water and that made me think on why and how to potentially fix it (or improve it).

Below are the results of my trials with many errors. :smiley:

1. Addition to the BP_IslandGen


I decided to go for the simplest approach my brain could put first on paper and then somehow into Blueprints, and that was to spawn the Interactables within a specific radius range (see math: calculus - How to calculate cone radius for given height - Mathematics Stack Exchange).

Things to note:

  • Obviously, island is made out of combined cylinders turned into cones for the slope effect (once all the geometry magic happens), so referring to the Radius already in the BP would be the solution, right? Yes, but not exactly. Despite Radius used and having the Nav Volume Bounds already in the original set up, the Villagers and Interactables behaved as if that didn’t matter (the Area seemed correct when pressing P which shows you the navigable space)
  • Silly for me, and it took me a while, the Radius was the base side of the cone which resulted in the spawning/walking area being way bigger) - additionally, the Z point of the Bottom Plane Cut influenced that as well, as watever was under the water added to the whole problem even after I have swapped out the ‘Get Random Location in the Navigable Radius’ for ‘Get Random Reachable Point In Radius’ which didn’t make any difference (I am keeping it for future iteration of the Villager logic as I have read the Reachable Point is used for smarter AI navigation, if I understand it all correctly)
  • Then the Math Spirit hit me and I found a way to calculate the radius I needed (see the calculus link above) - still, in some cases the things appeared above water. To avoid those situations I have implemented a check to measure the Vector Distance from the Center Point of the Place Cut Radius (BP below for reference) and with a Buffer for the Sand Edges it worked out quite nicely

The outcome with some follow up things to do (in case I forget or others want to take a bite at it):

  • More even randomisation of the Interactables (as you can see, some areas are more empty than others)
  • Elements spawning only within the sand area (sea sheels or crabs would feel nice :slight_smile:)

With that figured out and done now, all I need to do next is to rewrite the SpawnAssets function to do the same to see all the Stone and Trees and Bushes working together on a single map and fix new problem from that, which will happening for sure. :smiley:

[INFO DUMP: Island Generator / Spawner > Continued]

I did finally rewrite the SpawnAssets function, and as I was doing so, I came to realise that I could just make a macro out of it (at least whatever code gets repeated to make it less time consuming if I end up adding something new). Here is how it ended up looking. :slight_smile:

P.s. I’ve noticed that some of my images ended up being blurry in previous posts (can’t edit anymore) so will try to cut things into more manageable pieces making in a better quality.

1. The Macro


I think the most important things to note here would be:

  • Making a local variable requires 2 parts: Local and Assign nodes (for more specialised types I have used Local Wildcard, not sure whether that’s the way to go or not but all seems to work exactly the same as before)
  • Since macro’s insides are a bit naming dry you really need to make sure the flow and important bits are well documents (even better than I did it :smiley: ), ideally with comments and meaningful name in the Input/Output nodes

2. The updated Functions (SpawnInst)

3. The updated Functions (SpawnAssets)

Haven’t exposed all the variables yet for both of the functions as still need to check what does what and whether it’s even worth it. Anyways, since that’s done, I can check the Event Graph of the BP_Spawner itself. :smiley:

Oh, and here is the island with everything put together, while I detour to another problem to figure out: Why villlagers walk on water?

[INFO DUMP: BP_Spawner / BP_Interactables / Navigation Mesh]

I was away whole week and didn’t have access to my laptop, by anyways, came back more fresh to continue to share new findings and new problems. :slight_smile:

1. BP_Interactable

Every interactable object (Tree, Stone, Brush) inherits from BP_Interactable blueprint which in its Construction Script has a logic that applies the Collision Box based on the Mesh’s dimentions. I had to recreate it to understand it as one single comment wasn’t enough so below are all the pieces of it that I commented as best as I could to grasp the gist of it all in case I look at them later (individual sections for better resolution below). Some parts don’t make much sense to me still, but anyhoo.

As I was rewriting the logic I wanted to use the ‘Get Component Bounds’ as I thought that will be more useful (it helped in avoiding the unit conversion step), but, in the end had to shelve it for nów as ended up having various issues related to the objects being scaled up or down, making the collision areas crazy in size. So, the ‘Get Local Bounds’ stayed, even though the logic is not as precise as I wanted it to be. Not an issue at the moment thanks to the points below.

2. SpawnElementWithinIslandBounds Macro (see previous post)

I was trying to make use of the Interactable collision logic as I desperatly wanted for the Interactables to be moved around until they no longer collided, but that attempt failed (I added the logic directly into the Interactable itself). Instead, I decided to improve things one step at a time and upgraded my macro to support rerolling the Vectors if in some odd cases the object is supposed to be spawned off the island. So far no Infinite Loops, although that addition feels sketchy to me still. :smiley:

Things to note:

  • Let the Spawner do the spawning (and maybe even the collision checks once I get better at that) so the Interactables can just appear and wobble. :smiley:

3. Navigation Mesh

While I was fighting to make sure the Interactables move sideways rather than get destroyed, I stumbled upon another problem which I yet to have a proper fix, this time related to Meshes (see below).

This was why I gave up on collision checks improvement for now, but will give it another go, knowing that positioning side of things is ok now. Once I tidy up the whole interactables Blueprint. :slight_smile:

For some odd reason the NavMeshEdgePadding is not updating as you start the game (I guess as I edited things that part broke somewhere), so all the Interactables end up being spawned in the darkened areas, which also explained why the Villagers would walk on the water. Looked perfect in the editor when you press P, but would immediately be different as you play.

Not sure where yet (might be that IslandGen Blueprint is in need of investigation as potential culprit) but the Mesh is stored somewhere in-editor and it doesn’t want to update properly as the new island is loaded. I will find it as I grow, eventually. :smiley:

To fix this, which is not really an ideal fix but will do for now since it all game me a big headache to figure out, is:

  • Go to Project Settings > Navigation Mesh > Runtime, set Force Rebuild On Road to True and Runtime Generation to Dynamic
  • Set Agent Radius to 0 (in my case at least it extended to just around the edge with the Sand Area)

That approach comes with new things to decide and design and potentially fix:

  • Since the Mesh is dynamically generated on each island creation you have to wait for each type of Interactables to be spawned which will take time (see those red squares that will move from the center outwards each spawn step), making the island empty with only Town Hall and 3 Villagers being present as things slowly build up - I might consider setting up a loading screen, although in the grand scheme I wanted to merge MainMenu and Village into one scene to stream everything and jump between Islands (still on my to do to list to make the Automation Tests work as much as possible).
  • The order of loading up is weird, Stone > Tree > Foliage > Brush even though Foliage should be spawned last, but then again, doesn’t matter much (nice to have to fix only as it doesn’t break the game, and makes it more likely for the Grass to not overlap with resources)

Results below after fixing:

And of course, villlagers no longer walk on the water, which means that I need to implement bridge logic, as the island generator likes to throw multiple Islands at me here and there, if the Random Speed aligns. :smiley:

[INFO DUMP: BP_Interactables]

Now that I got the Mesh being Dynamic and things related to it are working well enough for the time being, I have continued my journey in understanding the insides of the BP_Interactable Blueprint (and slowly diving deeper into the Resource Nodes), since I already figured out most of the Construction Script and the way it handles the Collision Boxes (see previous posts).

Still, it needed one tweak to make it more useful for me.

1. Construction Script: Overlap Check Threshold

As you will see later in the Event Graph each Interactable has a logic that checks whether no overlap occurs between the Actors. To make a small distinction I have decided to store separately the longest dimension of the base of the Collision Box (even though that will always be the square). Mainly in order to use it to iterate through the optimal distance for each Actor combination so that when they have to touch, they will do so in a pleasantly looking way. :smiley:

2. Event Graph

As per the original project set up the main functions of the Interactable Blueprint are: a). check for overlaps, b). perform ground blend, and c). wobble :smiley:

Things of note for the part above:

  • Not sure why we have to use Delay Until Next Tick node but my suspicion is that we need to wait to give the Island Generation extra time, most likely am wrong about that, it just makes understanding it easier, even if it comes from a misunderstanding.
  • Similarly, I understand almost nothing in relation to the TransformToTexture Macro I have created variables which I am storing in the BP_Spawner as it is responsible for the spawning of all Interactables and game them long and somewhat meaningful name to tweak the Ground Blend with more confidence and to make the learning proces less tedious. :slight_smile:

Why PlacementMode tag is used, I do not know yet as I still need to check other Blueprints, which will eventually happen. All I added here was an extra tag check for the Town Hall (Collection Point) as I have noticed that despite the overlap check with Destroy Autor the Interactables spawned on top of it regardless, which is not happening now (ground blend still being triggered even when the Autor got destroyed is another story to solve, though).

3. Ground Blend

As you can see above, ground blend is just (wow, I sound as if I know something :smiley: ) the material draw on top of the already generated island. Unfortunately, it is hard for me to understand this part even though I have tried (especially the macro below), as that requires Materials and Shaders knowledge which I do not have yet. All will be learned in due time, as always. I didn’t tweak it much as ideally would like to rewrite it to draw an otuline around the mesh’s base (way out of my league at the moment), so make it more visually clear before moving on to different Blueprints.



Things to note:

  • Render Target is used as a brush base and is set to 1024x1024
  • To make the whole thing more understandable I have expanded the macro to use variables stored in the BP_Spawner so I can iterate faster (didn’t help much, still black magic)

4. Wobble Effect

This one is honestly the coolest part in the Interactable as it taught me how to animate using values on the Material, and I will definitely experiment with it in the future. If I understand it enough, you compare the locations of the Villager and the Resources Node to be mined, create a normalised Victor to be easily digested by the Material Parameters and tweak them thanks to the Animation Graph. And then you have a resource node wobbling in the direction the Villager is facing. :smiley:

Ending notes

And that’s about it in relation to the Interactable Blueprint. As I improve I want to upgrade it with the following:

  • Ability to tell the BP_Spawner to keep on reallocating the Interactables, until it is not overlapping with anything - and to spawn the Resource Nodes at a more optimal distance
  • Make the Ground Blend nicer as current effect is a bit jarring and doesn’t work well with the grass and available Assets (ideally outline of the base mesh) - also, prevent it from spawning if the Autor gets destroyed or spawns at the edges

[INFO DUMP: BP_Interactable / BP_Spawner]

Wow, shortly after I have made the last post, so many things broke and I have spent a lot of time to figure out what has happened and when. That’s what you get when you are too excited to learn things and implement them while you forget to mąkę it a habit to test the whole game. Afterwards, it’s difficult to find the cause, even with the GIT version control system set up (Blueprints are sadly just files so you have to fix things based on your memory, which is not always good). :smiley:

1. Improvements to the BP_Spawner

When I have been tweaking the MainMenu Level I have noticed that in some cases not all Resource Node Types will spawn, and even if they do, the Foliage would be still missing. After quite a bit of thinking what ended up to be the issue was that I have introduced the Get Random Reachable Point in Radius nodes. Because of them, if things spawn at the Centre, no point in radius can be reached altogether and everything will appeal at 0, 0 location.

I could have reverted the logic but then I thought to myself: why not to fix it instead in a way where that part cannot be changed - and so I did.

As the first part of this multiple-step process (more in sections 2 to 3) I had to create an array of distances measured from the Origin Point of the Spawn Marker (which we create with each cone that forms the island) to the Spawn Point of the Interactable to be placed within the said come. As a side note, get into the habit of clearing the array, otherwise old entries will be stored, making it unreliable, and forcing you to scratch your head in wonder, like I did. :smiley:

Minor digression:
I decided to implement the Delay between spawning the Resource Node Types since Island gets dynamically checked with each group spawn. This way at least the Resource Nodes are more likely to not get spawned at the same time - far from ideal, as it all takes time still.

Improvement in the making:

  • To implement a macro that would grab the number of Resource Nodes of a given type that survived being destroyed and feed that Information into the Delay so that the moment the last Interactable of its type spawns (with animation time included), the next spawn type jumps in.

2. BP_Interactable’s Event Graph Tidy Up

Once the BP_Spawner’s changes have been finally done, it was time for the BP_Interactable side of things. And when I looked at it (you can see its state in the previous posts), it was a mess and needed tiding up. Results for the lift up below:

I was heavily relying on the BP_Spawner to preparae information for me, so I have put all the logic into the Collapsed Graph. That area was constantly growing, and including now the Distance From Origin Array, which I have implemented recently, morę things were likely to come, making it obvious to visually separate things.

2.5. Object Name To Index Macro

Not really tidting up but worth mentioning it here before the next big section. It occured to me that the Interactables are being destroyed at many stages so finding their distance from origin inside the array (to feed it on later) felt a bit problematic, but it turned out simpler than I thought, thanks to the ClockworkOcean’s post (What's the best way to remove letters and special characters from a string? - #3 by andbc), as I knew how I wanted to approach it, just needed to find the right pieces to built it from. And, as it proved to be a useful function, I have elevated it into the Macro, allowing me to use it freely in the current project and later ones if need be (I preferuje putting those in a separate Macro Library father than inside the Blueprint).

3. BP_Interactable’s Overlap Checks

Now came the time to fix all the spaghetti flow inside the Validation Part of the BP_Interactable, and as a result it is less of a mess, I hope. We will see when I look back at it in a month or so. :smiley:

After moving and improving things around, the checks that I needed so far ended up to be as follows:

  1. Interactable is not in the PlacementMode (is not a building/crop type, so we don’t destroy the said Interactables when we place things fon the Island by hand)
  2. Interactable is not overlapping with another Interactable, with Error Margin allowed (this still needs imrrovement as the extents of the Interactables vary so is not too optimal yet)

  1. Interactable is not colliding with the Town Hall (special case, as that’s the only building spawned before anything else)
  2. Interactable is not too close to the Origin Point (what we compare is our allowance against the Distance From Origin we have stored via the BP_Spawner - also, triple check the order of the pins for things like that as you might be thinking that all is in order but the things should be inverted, which took me a long time to figure out)

  1. Interactable is not spawned at the Centre Point (a.k.a does not match the Spawn Marker location - another not super obvious one as the BP_Spanwer uses Stepped Position Node, so you have to keep it in mind when doing positional checks on the Island)

Thanks to the above points the Interactables are able to remove themselves from the island when they end up where they shouldn’t be. Not ideal, as preferably I would like to, again, move them out of the way and put them somewhere else, which is something for later, fingers crossed not too late. :smiley:

4. Navigation System

We did all the tiding up and added all the checks in the BP_Interactable and now we can proudly see how the Interatables spawn on the Island, right? Nope. Well, things did spawn but not in the way expected. :smiley:

That was because of the Navigation System (Edit > Project Settings > Navigation System). Oh boy, that took me not only by surprise but also, since I had no idea what was happening, age to figure out and fix. Lucky for me I knew of the P button that shows your Nav Mesh and ultimately this post put a lot of light on how to resolve the issue: Why is the RecastNavMesh object not created for the Nav-Agent?

Basically, at one point in the project I have broken the Navigation System which resulted in the Interactables returning an incorrectly sized navigation blocker area, which prevented the Foliage to spawn due to lack of space. I still don’t exactly know how things are set up, especially for Villagers, but all I understand is that green is for Interactables, Orange is for AI. Also, AI doesn’t like extra tags on the Resource Nodes (job will fail to load), so I need to inventigate that as well.

Anyways, the most important values for the project as of now are:

  • Agent Radius (offset limitting the edges of the Navigation System)
  • Agent Weight (to make sure the Navigation System is on top of the Island).

5. BP_Interactable - Placement Mode

Crops and Buildings are their own types, though they inherit from the BP_Interactable, so the Placement Mode is being used only by them to prevent the removal and redundant grond blend from happening. It also grabs a list of meshes so then later its easier to trigger the building stages the game uses.

6. BP_Interactable - Building Progression Level

Not the best description by me as what this part of the blueprint does is to keep the time to finish placement of either the Crop or the Structure so that if we leave the game, the progress can be stored and all the right meshes are loaded based on their progression level (thus the Mesh list).

I think it could be improved but I’m not near enough the Crops and Building Blueprints yet, but, as always, it will happen eventually.

[INFO DUMP: M_MasterButton / M_MasterFont]

I needed some break from the Interactables and that turned out to be a really good thing as I got completely consumed by learning about UI (and tiding all the UI elements - a lot of it). In the Cropout Project there is a lot for me to understand, digest and fix around UI before sharing my findings here as it takes me quite a long time lately, so for now (to keep the thread alive), I will focus only on the starting point for me when I jumped into UI: the Materials part of things, as those, next to Style UI Objects, are base elements of the UI, at least to me.

When it comes to the Cropout Project the Master Button Material is the one solely used for the UI Styles (to which I have added one small bit). Then, when I got more confidence into how Materials behave and are constructed, I have created the Master Font Materiał (with the help of these posts: UMG: How to make widget with rounded borders / https://www.reddit.com/r/unrealengine/comments/kw7qot/why_arent_you_using_font_materials_yet_i_just/).

1. M_MasterButton

It was difficult for me to understand initially the Button Materiał as, sadly (similar to some parts of the Project which I have to still go through), it was quite a bit of a tangled mess with no comments to really grasp it. Because of that I had tidied the graphs up as best as I could (results above, individual parts below for easier reading :smiley: ) and tweaked each and every value until it started making sense. I have put as many comments as I thought were useful for other people to have a better understanding, though I don’t grasp it fully yet, so some of the comments might be stupid talk :smiley:. The only part I have added to the Master Materiał functionality wise was the Texture Sample at the very end as I needed the buttons to have some noise on them, espeically after I did the Master Font Materiał. The style which you will see later doesn’t really match the game but I kept it until I learn to make better things as a confidence boost, as it was such a cool experience to figure out the nodes one by one until it kind of looked decent.


What I found cool about the Master Materiał is that having multiple instances is super easy so you can quickly iterate and separate the same materiał base into variants, making each UI element more polished, if things don’t work by default. All is needed is to right click on the Master Materiał and choose the ‘Create Material Instance,’ and after that tweak however you want. :slight_smile:

2. M_MasterFont

Initially I just wanted to try out a gradient material consisting of 3 colours and that evolved into a textured gradient, with an ability to have rounded edges as well.

Main notes here:

  • Gradient 1/2 Power - the bigger the value, the more squashed to the side the colour will be so worth keeping it rather small
  • With the Param Switch I had to double the variable input for True and False as I couldn’t find a way to avoid the compilation error as the engine complained about missing B pin input
  • To enable Opacity in the Output Node I had to set the Blend Mode to Translucent

3. Outcome and next Focus

Hopefully soon I can share more about the UI itself as I am past the half way through tidting things up, doing small fixes and improvements and understanding it as a whole, while I keep it all logged in the form of git version control so I don’t forget what to share later.

(post deleted by author)

[INFO DUMP: UI_MainMenu]

Trying again, after a failed post. :sweat_smile:

It’s been almost two weeks without writing anything, eh. Life got me busy but now at least I can go back to the usual and continue this little learning blog of mine - I’ve not given up yet, just had to have some refresher elsewhere as it’s been almost constant staring at Blueprints. Now to recall things. :smiley:

1. UI_MainMenu

Before the break, after doing two full passes of going through each and every UI Blueprints in the project I felt that I finally began to somewhat get it, so let’s start with the first one - UI_MainMenu.

Disclaimer. For this one and any other UI I will just talk from the desktop experience as I can’t really develop and troubleshoot for Console and Mobile platforms. As much as it would be just ta good learning experience for me, it’s too much of a hassle at the moment, and I want to push through the whole project to redo some bigger things like Save Game system and Input problems, which I 100% broke when changing things alongside the way, just am too scared to get into as there’s surprisingly so many pieces to move around..

Unreal UI was a bit of a slow and tedious experience to get used to especially since some things are in Designer and some are in the Graph and clicking between was quite distracting so I lost my plot a few times but at least now it’s all getting better. Part of a learning curve was remembering to mark UI elements as variables if you ever wanted to call functions on the related components from the Blueprint side.

Anyways, in the Main Menu we check for the Saved Game and depending on whether there was a game already, the Continue Button is either visible or not. And alongside that, we set up the button focus (which you can overrride). Quite simple, unlike setting up the click events.

As a side note, I’ve marked QA events in yellow to clearly define which are used by me for the fake clicks to support the automation tests and the longer I think about it, after I have paused getting to understand that part of the engine, I’m mentally preparing to get into AltTester instead (AltTester® SDK will soon become available for Unreal Engine games), but I digress again.


So, what are the takeaways?

  1. I’ve lost lots of time trying to find where the OnClicked events are set up and it was all at the very bottom of the Designer Side of things. Would expect something more in my face. Because of the above, I still don’t get fully how the Confirm and Back buttons are hooked up even though I can see the Event Dispatchers sending calls to the events bound in the UI_MainMenu. Not to mention the InputTable being it’s own separate object that you need to remember about… Not being too confident in myself at the moment when it comes to fixing input issues. Even after watching some videos, it just doesn’t stick. And that was my first interaction with the system. Almost threw a towel. :smiley:
  2. When it comes to the way most of the UI is set up you have to push a widget (ok, get that) to the top of the Stack to then override it later (seems fine). Then you destroy it and create it again as those widgets are not re-usable. Sometimes you grab other element and build things like a pyramid, more or less logical. Past that, black magic. I did fix the buttons once, but after barely 2 weeks I can’t find what I want. I guess I need to break the buttons again, for practice.
  3. One small good thing I have learned is how to disable the blue outline on the buttons (set the RenderFocusRule to Never in the DefaultEngine.ini). O the other hand, I still can’t make the Enter button work as click to Confirm/Back. :face_with_tongue:

Mostly making mistakes or getting frustrated, but, with every failure I improve with something.

2. Hierarchy of UI Elements

This topic is another thing I feel like I’m just not having the right mindset as I wanted a simple Z hierarchy to add a background to a border. Sadly, as you can see above I had to make another set up and position it exactly behind to achieve a background for a semi transparent effect (duplicated titles are for the animation related Z-order). If need be, I can re-use it the next time I want something similar, until I find a better way, surely. Is it ugly, yeah? But at least it gets me somewhere.

3. Animations

That one was quite rewarding, though it took me a while to notice where the Animation tab was exactly (bottom in the Designer area). But then again, things were not as intuitive.

I have deleted the variables from the animation that I didn’t need and after that I have spent lots of time toget them back. All it needed was to click on the track and then right click on the time line to re-enable what have been removed. Simple, not so obvious. Required deep search of the forum.

As a result of fiddling with the time line, I have found out also that if you click in the UI hierarchy (in this case on Title_8) and then right click on one of the elements in the animation, you can copy over the Animation keys, making re-doing things so much easier. Not always recognizes the clicks but if it works, it saves some time.

Overall, much more difficult experience lately but then again what do I know about Unreal? Not much yet. But I’ll push through it regardless.

More to come soon, wanted to write more but I think the forum has a limit of 10 pictures only so, maybe it’s for the better. :smiley:

[INFO DUMP: UI_Button / UI_Prompts / CUI_Styles]

Here we go again, while I still remember what I was doing in the project so it’s easier for me to remind myself in case of another break and if whoever is patient enough to read all of that gets any value from my trials and errors, even better.

1. UI_Button


Nothing too complicated here as to my surprise there is no OnClicked logic on the UI Button as to my understanding the Button is meant to just exist and be pushed/added to bigger UI chunks, so the only thing we do is hook up the text, prepare the height box so things don’t get squeezed and add the Input Action (this one is my nightmare as things look obvious but feel otherwise - then again, more reason to practice and get out of my comfort zone).

Surprisingly, there was no logic for a focused state either (keyboard). I had to make one (or I just didn’t tick the right box, smarter people will know). Sadly, I couldn’t figure out yet how to not have duplicated overlays when you quickly swap from mouse to keyboard while mouse is still hovering, but thing are good enough, so moving on.

Part of the solution was to create new Styles after finding out how to swap them out. I don’t think that’s the right solution but here we are.

2. CUI_Style

Every UI element that needs to be fancy requires some type of Style, however, as it is similar with Materials, unless you make a copy (instance) of it, all the values will be the same, so I have made a lot of new ones just so that the things could be more distinct (like smaller font for sections inside the Pause Menu or some readability improvements as my font is not that good and more padding was needed here and there).

The other thing I had to do was to name the Style as per the Parent class because I duplicated an incorrect Style Type many times and was scratching my head why it doesn’t work, as I kept forgetting it’s not a global style object.

In regards to the above, it took me fair bit of tweaking to put ito my head that margins are lines for the 9-slice.

The Materials that I already were using from the project itself were behaving, though I had to keep in mind that I have to make sure that the Border is drawn as the Box, otherwise it will end up like a squashed circle, so keep that in mind when you attach the Materials and change the margins. Also, the Image Size seems to matter as that can result in your boarder having different, not always smooth, corners. Again, because of how the Material is set up, not the Style.

3. UI_Prompt


I wish I understood the Event Dispatchers better because if I were to create things from scratch, I still wouldn’t be able to.

I do get that you have to:

  1. Create the Disaptchers in the UI you want to push to the stack
  2. Bind the Events in other UI that will use the UI_Prompt to the Confirm / Back dispatch message
  3. Add the logic to OnClicked for the other UI
  4. Add the dispatch calls to the OnClicked events

I feel I’m missing something still, though. What I remember I had to do last time the buttons broke was to bind the Confirm/Back somewhere in the Designer? but I can’t find it at the moment, or it was just my imagination. The names were important.

We will see in the future. Not the most intuitive system, though my lack of experience doesn’t really help.