Feedback for Section: "Obstacle Assault"

Lectures include:

  1. Section Intro - Obstacle Assault - We overview the prototype for the game and our plan of action for creating it.

  2. Project Setup - We start by downloading the asset packs we need and starting a project from one of these. We create our own map and bring in a different player character.

  3. Customizing The Character - We create our own child character class and tweak the inputs to match our project.

  4. Compilers and Editors - We see why we need a compiler and source code editor and how they fit into the process of making games.

  5. PC - Installing Visual Studio - We show you how to install our compiler for PC: Visual Studio Community and which version and features are required.

  6. Mac - Installing XCode - We show you how to install our compiler for Mac: XCode.

  7. Installing VSCode - We install the final piece of the puzzle, our source code editor, VSCode. Then install plugins that will help us with C++ development in Unreal.

  8. Compiling a C++ Project - We add a C++ file to our project and learn to compile the editor.

  9. UPROPERTY Variables - We learn how to add variables to a C++ class and how to make these visible in the editor. We then see how to compile our class using Live Coding.

  10. C++ Files & BeginPlay - We see how to use the Cpp files to implement our code. We encounter the BeginPlay function and use it to add up variables.

  11. Using Structs In C++ - We learn to create FVector variables and how to construct a Struct as well as access it’s component parts using the dot operator.

  12. Calling Functions in C++ - We see what function calls look like in C++ and learn that their inputs are called Arguments. We learn how to SetActorLocation with both a variable and a constructor.

  13. Tick - We learn about the Game Loop and how Tick allows us to update things every frame. We use this knowledge to make our moving platform move!

  14. Local Variables - We introduce the concept of a local variable and understand the concept of scope.

  15. Pseudo Code - We learn about Pseudo code and comments and use this to write a description of how we want our code to work.

  16. Function Return Values - We learn the difference between a statement and expression in C++. And we see how function calls can return values for us to use.

  17. Velocity & DeltaTime - We update our current location from a vector and we look at how we can make this frame rate independent using DeltaTime.

  18. Scope Resolution Operator - We see how to use the :: operator to access functions within a class. We use this to calculate and visualise the distance moved by the platform.

  19. If Statements - We make the platform return along it’s path by using an If-Statement and comparison operators.

  20. Using Member Functions - We use the member functions of FVector to GetSafeNormal() and calculate the direction of movement.

  21. Blueprint Child Classes - We make a Blueprint Child Class to get some configuration in Blueprint as well as C++.

  22. Forcing Character Collisions - We work around an issue with the character by forcing it to update it’s position each frame. We then build out our obstacle course with pushing platforms.

  23. GameMode - We see how to setup our own Game Mode as the project default and how this can allow us to use the “Play from here” menu item.

  24. Writing To The Output Log - We see how to use the UE_LOG function for write text and float variables to the output log. We use this to print our overshoot distance.

  25. FString - We see how to put strings into C++ variables and then how to print these out in a log message. We use this to print the name of the actor doing the logging.

  26. Member Functions - We see how we can refactor into functions to keep our code small and legible.

  27. Return Statements - We learn how to make our own functions return values so that we can make our code even more legible.

  28. Const Member Functions - We see how to use the const keyword to make const member functions that cannot modify members of the class. We also see how that change can require us to make other functions const.

  29. FRotator - We learn how to get and set the rotation of an actor using the FRotator type. We use this to create a new rotating platform Blueprint.

  30. Level Design & Polish - We sketch out a level design on paper using the elements that we can change. We then go ahead and implement this in the editor.

  31. Obstacle Assault: Wrap-Up - We overview the learning takeaways from the section and see how we could take our project further.

Jump in and leave feedback.

Not sure if I did something wrong or if I have an issue with UE5, but every time I load the project all of the Actors from the BPs based on the C++ class lose the values set for the variables that are defined in the class. So I have to set PlatformVelocity, MoveDistance, and RotationVelocity for every instance of an actor each time. When the project is loaded the details pannel does not have the Upropery data, I have to recompile for them to show back up and then they are at default values. Any idea what is going on?

1 Like

So this seems to be a bug in livecoding at the moment. The fix for me. If you find that your values have been reset:

  1. Immediately close the editor
  2. Recompile in VSCode (or Visual Studio)
  3. Reload the editor

The values should come back without having to re-enter them.

2 Likes

I really like the direction of this new course so far! Something that may improve it for the course takers is also weaving in proper folder organization. Instead of putting the main level in the Content folder, maybe put it in a folder path like Content / _Game / Maps or Content / ObstacleAssault / Maps. Loving this course! Keep up the awesome work!!

Note for UPROPERTY Variables video: I would start introducing the UE naming conventions from Unreal Engine documentation such as…

If an In or Out parameter is also a boolean, put the “b” before the In/Out prefix, such as bOutResult .

Functions that return a value should describe the return value. The name should make clear what value the function will return. This is particularly important for boolean functions.

Calling Functions in C++ - I have been learning C++ and Unreal for months now and this slide just made so many things click. Can confirm, visuals like this are extremely helpful, to at least some :slight_smile: :

1 Like

Hi,

I got an error when I tried to create new c++ class.

"A fatal error occurred. The required library hostfxr.dll could not be found.
If this is a self-contained application, that library should exist in [E:\Epicspiele\UE_5.0\Engine\Binaries\DotNET\UnrealBuildTool].
If this is a framework-dependent application, install the runtime in the global location [C:\Program Files\dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x64\InstallLocation].
The .NET Core runtime can be found at:

I installed “.net desktop development” to get it to run. Maybe you could add that to Section 5.
Installing .net Core 3.1 didn’t work. Nor placing the binaries into the buildtool folder of UE 5. I tried to install single components (.net core) but this didn’t work either. Only thing was the .net desktop development workload that finally worked.

2 Likes

I also had this problem, but installing .NET Core 3.1 from the link in the error log was enough to fix it for me. Although, I also deleted the entire project and started a fresh one after doing so.
Curiously, I did choose to install the .NET for desktop workload when installing VS 2022, and that wasn’t enough.
Agree that this should be addressed in the course, as it’s billed as a “beginner” course and for many beginners it will likely mean the end of their ability to follow along But maybe it’s due to a recent update of something, and Sam just hasn’t had time to update the course material?

I am having the same issue today, error when trying to add the class from Unreal, and it is now saying I have to recompile the ObsticleCourse module…which I have no idea how to do. I assume the totor, under an already working enviroment, had some dependencies already installed, but I have now installed .NET 3.1, the reccomended one, and the full Deskotp .NET C++ enviroment through the Azure installer tool.

Now when I restart Unreal 5.0 I get told the ObsticleCourse must be rebuilt, but if fails. These tutorials were great until now, but this step is very very lacking…I will need to go back to square one and hope fo rthe best.

I got it to work, however now when I open the C++ class in VS2022 the menu is totally dfiffernt, I do not have a Terminal option, nor do I have any option listed after that. Has anyone else had that problem?

EDIT: everytime I restart Unreal now the project fails as it says it is for another version. When a new project is started with the asset pack, it says it needs to be upgraded and this is perhaps the problem? I’m now stuck, I cannot go any further in this tutorial. :frowning:

EDIT 2: following some step by step testing, it is the stylised character pack that is causing the issue…project saves and reopens no problem until you add that, do nothing else, close and reopen and you get an error you cannot get out of.

Also, in the VS Studio setup you missed that you also need to install the UE connector.

Still can’t get this tutorial to work at all though.

SOLUTION: unbeliveable…but I had Unreal installed on a drive that was not my main C (system) drive. I have moved it to the C drive with a new install, and suddely everything seems to be fine.

Ran into my first issue in the course as well.

When I create my MovingPlatform actor, I get this message.

No option for “Open Visual Studio Code” either as well as lacking the workspace file in my project folder. I reinstalled both Visual Studio and VSCode again to make sure I’ve followed all the steps properly and still running into the same issue.

EDIT: Managed to fix this. Not sure which steps were relevant to this, but here’s what I did anyway.

  1. I opened the level blueprint and clicked compile.
  2. Afterwards adding new actor would actually open VSCode although with some errors, namely that I’m missing “Microsoft.NETCore.App Version 3.1.0” and “.NET Framework SDK at 4.6.0 or higher” so I installed those.
  3. That didn’t seem to help, but when I launched my PC the next day (Apparently it requires a restart) it launched VSCode upon creating new Actor, but the console was empty.
  4. I went to the ObstacleAssault project folder, right clicked the ObstacleAssault.uproject file and then “Generate Visual Studio project files”.
  5. VSCode opened up so I closed it, opened UE5, created t he MovingPlatform Actor again and everything seems in order now.
1 Like

Writing to the output log - doesn’t work either. I have the snippets, but typing ulog does not bring anything up, I have to type the full command. Also, the tilda key oddly doesn’t seem to do anything, and if I open the log with the mouse it’s totally blank.

When using FString in the next step, the final part force closes UE5 every time.

EDIT: Ah, never mind - I used the %s for the float by mistake. interesting fact, if you use %s then pass a float, compilation works fine but UE just force closes on running.

When placing the rotating platform, you might want to make people aware that there is one with no collission mesh; if you choose the wrong one your character does not interact with the rotating platform.

Everything was going perfectly until I tried creating the ‘Moving Platform’ C++ class and now chaos reigns.

Part 1: I create the class then receive the following error message: “successfully added class ‘MovingPlatform’, however you must recompile the ‘Obstacle Assault’ module before it will appear in the Content browser. Failed to generate project files”. VS Code doesn’t open. Sam’s suggestions not there. I close Obstacle Assault. Cannot reopen the project. Read forums, go to Visual Studio Installer → Modify → Individual Components → and select .NET Framework 4.8 SDK, NET Framework 4.8 Targeting Pack, .NET Core 3.1 Runtime (LTS).
After this, I am able to reopen Obstacle Assault.

But Unfortunately:
Part 2: I open Obstacle Assault. ‘Moving Platform’ is in C++ Classes. I open it and VS Code is empty:

I create another C++ Class, VS Code opens but is empty again, I get a “live Coding Failure” message, and another message like this which ends in a red “Build Failed”.

![BuildFailed|690x398](upload://mRYJpP2DsYb1lDLmk48NnwEkjvE.png

The new C++ Classes aren’t appearing in the Editor, but I can see the C++ Source Files in the Source folder on my computer for Obstacle assault.

I also tried installing the .NETCore runtime at the link shared by PhillipR above but to no avail.

I’m at a loss, please help!!! I would really like to continue this course, and also be able to create C++ scripts!

@Hannerizm The second image you tried to share which I presume contained the build log (with the build error) didn’t upload correctly. Can you try uploading it again or copy-pasting the log text?

I’m not sure what’s going on with the VS Code workspace but you could try deleting it and regenerating it from the ObstacleAssault.uproject file.

I’m actually using VS 2019 Pro and recommend that people struggling with VS Code use either VS 2019 or VS 2022 Community Edition (both are free). VS Pro editions are pretty much the industry standard and are virtually identical to the community editions.

Hi! I’m about halfway through Obstacle Assault and am thoroughly enjoying myself so far, but something has been annoying me since the introduction of C++. I’m using a reasonably powerful Mac, running Xcode 13 as suggested by the Unreal documentation, but every time I compile from the editor, it takes roughly 60 seconds to complete. I see from the video that @sampattuzzi is able to compile virtually instantly, which I thought should be the case since the code is so simple. I’m wondering if anybody else has a similar issue on Mac, or whether the video is actually edited to skip the waiting time.

Hey.

I have a very powerful PC, running off of a Samsung 980EVO M2 SSD, and it can still take 10-11 seconds. Fairly certain a lot of these video’s skip stages…for example, opening projects and loading up both also take a lot longer for me.

1 Like

Did you use the TOOLS menu in UE to create the Visual Basic files and try again?

Hi Steve thanks for your response :).
I switched to VS 2022 and Moving Platform opened successfully with the populated template. However I couldn’t create the variable MyInt (from the next video), kept getting a Live Coding build failed error. Any new C++ classes wouldn’t appear in the Content Drawer either so I started a new ObstacleAssaultv2 project.

Now everything seems to be working fine in the v2 project with VS 2022. No idea why VS Code won’t work or why my ObstacleAssault v1 is broken but time to move forward for now.

Hi Aaron, are you referring to 4:24 of the video where Sam points to the Tools menu? The option he selected didn’t appear.

@Hannerizm Glad you were able to get it working with VS 2022! And yeah, sometimes the best thing to do is just start over from scratch, especially if you aren’t very deep into the project yet.

Interestingly, the engine source code itself actually recommends VS 2019 (or newer) for development on Windows, and VS Code for development on Linux. Obviously VS Code can be used on Windows as well, but again I personally recommend using VS 2019 or 2022 if you’re on Windows because that’s what we use in the industry and also what Epic uses themselves for development. It just makes the dev cycle run smoother imo. =]

Also - the option under the Tools menu depends on what you have set in Editor Preferences > General > Source Code > Source Code Editor, as well as what’s available on your system.

1 Like

Hi, just a weird question, I’m not sure if it makes any difference, since things seem to be working so far, but ive been noticing that Visual Studio Code doesn’t seem to recognise some of my code in the same way it does in the video, i.e. I don’t get the same colour highlights… any idea why? and does it make a difference?
this is mine
image

this is from the video

you can see that FVector is different, and it also happens in the header, its been like this from the start really… I’m more curious than anything to why that is…

Privacy & Terms