2) The moment I stepped into Video Game development with Unity, I was immediately hired. It didn’t happen due to my skills but actually due to the college I belong to, i.e. a college of National Importance.
3) This is the only work I can do without killing myself or others.
4) If I don’t like what I am working for, I don’t want to do it.
5) Payment with YouTube is slowly declining and soon it will be over.
6) I can’t work on something I don’t love.
Ground Rules:
1) Take help.
2) Stick to the schedule.
3) Focus on becoming a game developer. Let other things be as they are. No need to be jack of all trades.
Thoughts
Youtube 3 hour game course vs. Udemy proper 30 hour course:
This approach is so much better than following a generic youtube tutorial of making a game
That was so rushed, even if it was three hours, it felt so rushed, I had to stop continously. I took I think 9-12 to go through the 3 hours course and the main reason was that the user wasn't interested in teaching the course but was more interseteing in selling his course on some other platform instead of making quiality tutorial, maybe just covering the basics which might not have made anything useful, he chose to complicate things and make course that was terrible for anyone starting out with Unity and people were so confused with that approach
This is so so much better
Also, due to these little challenges I am having fun and not staying frustrated
[a]Useless Tutorial followed. Complete waste of time.
[b]Useless tutorial followed. Complete waste of time.
Why I didn't want to get back:
Due to the way earlier playlists were combined, I thought that I have been working on this particular udemy course for 9 or close to 10 days. Also my head had been clouded with the terrible youtube courses. And I had only managed to do about 15% of the course.
15% of the course in 10 days of 3 hour each? That sounds insane and I know that that percentage shouldn't have affected my judgement but it did and I broke the Ground Rules #3: Focus on game development and I went to something I clearly didn't care about: Android Development.
However while cleaning all the playlists up yesterday I realized that I have barely done 1.5 days of work and I already completed 15% of the course and I realized that I am speeding through this course AND I am actually doing stuff even before it is even said in the course and also going out of my way to add stupid shit that will make these games a lot more fun. Like importing an animation from Blender into the course.
Godot
Projects
Princess Dragon Slayer
TODO:
v1.0: Export the bare minimum project on server.
v1.1: Added total 69 coins and a whole hidden area under the map.
v1.2: TODO:
Fix the missing textures from the map.
Make the game run in normal size and not maximized which gives people an unfair advantage.
Note: This course just made me make a godot game without actually knowing or learning anything about it. I tried changing or adding functionality in the game and I couldn't. Initially I thought I would be able to but these courses are in themselves not sufficient enough and hence, I will be moving to other proper courses (possible paid ones on Udemy) instead of going with youtube courses.
UI
Scenes is like classes. You make changes at one place and everywhere else the changes reflect at once thereby reducing the effort took of going everywhere and changing them.
Colliders rarely need to be precise. It’s a good rule of thumb to make them a bit smaller.
Q- Select Mode, W- Move mode
Z-index is applicable in 2D also and works as you expected.
Area object: When we don’t want to collide with the object.
Godot has many inbuilt features for 2D games.
Signals: Trigger code based on what happens in game.
Mask: Defines what layer to check the collision on. It doesn’t have to be the same layer as the draw layer.
delta = 1/20s
Remember to attach node script to object if called later
% access or accessing a node by only it’s name can only be done by another scene if they are in the same hierarchy
Shortcuts
F8 - Stop Emulation
Ctrl+A - Add New Node inside current?
F - Center on screen
Unreal
Notes:
One way or another you have to learn blueprints since it’s baked into Unreal so even if you did learn C++ properly, you still would have to learn Blueprint.
Compile button recompiles things in Blueprint if you have made any changes, however so does.
When searching for a node, if you can’t find it, remember to disable “Context sensitive”.
Actors are anything that can be placed in our world.
Cast: If the event is based on an actor.
Whenever you create a widget, the first thing you need to add is a canvas panel.
Canvas panel was added by default in Unreal Engine 4 but after that it has to be done manually.
Layer/ordering is just opposite in unreal with something like photoshop.
Whenever there is a repeating logic, you add them into an event or function.
Deleting the middle parent doesn’t delete the child even if they are exclusive.
Break in blueprints gives you all information from the event/actor extracted.
Unreal’s default behavior is to set to “Static” so if you want to move the object change the behavior under mobility.
Note: The above was by @UnrealSensei on Youtube and other than wasting a lot of time, it didn't really teach me anything. I would have much appreciated if it taught me atleast one thing properly instead of cramming everything in three hour video. This course was the reason to stop doing such courses altogether.
Now from the proper unity course
General Notes
Settings→ Engine Scalability Settings →Graphics settings for your viewport.
C++ > Blueprints:
C++ is industry standard. That’s a huge deal.
C++ has access to all areas.
Good for bigger projects
Most unreal libraries are written in c++ and you can add your own functionality in C++.
Export Project as Zip is better than sharing the whole project folder due to extra unnecessary build stuff.
Keep new maps in new folders to stop it from being overwritten.
Think of blueprints as electrical wiring.
References are just addresses. We’ll learn more about it later.
Execution nodes will run if they are needed by some other node also and not just even based.
You can directly add math equations in blueprints
Add Impulse has an option to ignore mass and just work with velocity with a boolean.
We usually prefix BP_ to Blueprint class for easy readability.
Data types are represented by pins of different color in Unreal.
Default Pawn -> The pawn the player is represented by. It’s added by Unreal for default.
By default in Unreal, the pawn doesn’t rotate with the rotation of the camera.
Migrate on project files to be able to use it in another project.
Geometry brushes: Don’t use the scale property if you want them to look good.
? Is 100 units one meter in unity by default?
Project Settings → Maps and Modes → Select the default map on startup here.
Select block of blueprints and right click and select collapse to function to convert part of blueprint into function.
A good measure of code quality = WTFs / minute
Good naming of functions/variables will be helped by other people.
You can change unreal version of a project by finding the root .uproject file and then right clicking and convert.
You can make one mesh a child of another for them to behave in union and its position becomes relative to the parent.
By default many objects can come with simplified collisions for the sake of lower computation.
Dragging from one flow to another will not always reliably work as some data requires conversion, so if you set and print an integer, you can’t just drag from the SET and find print as the conversion is missing.
Stick to recommended other software versions as asked by Unreal.+
We spawn the player when the game is started instead of being spawned in directly.
Also for playtesting we need to right click and select: Play from here.
Use Unlit view if the level is too dark to work with.
Use 4-split view and Middle Mouse button to measure stuff in units.
Double click items in outliner to open up them in all views at once.
Use grid snap here to actually align things as per the world instead of using Alt+D.
Alt and drag instead of duplicating.
Lumen lightning is new and has a lot of issues:
We can't use pixel depth offset while using the lumen lighting system in Unreal 5.
Use Movable with directional light/sun when using lumen
Some materials are one side meshes only. In which case you have to block them with another one side bigger mesh on the outside to make sure there is no light bleed.
Reducing attenuation radius of light sources reduces the computational load.
Line Trace needs to be very precise and that's why we use geometry trace or sphere trace or circle trace or shape trace. It's actually a sweep.
How you see a circle vs point info when debugging android touch.
In the beginning was the UWorld. You can load a level into UWorld.
UWorld is a top level object.
A level can be a single persistent level or a list of streaming levels.
These are important
We don't load a very large level into a world due to performance reasons and we load small part of the levels at a time.
These are called optional list of streaming levels.
FCollision shape can be sphere, capsule box or line.
Default unit is centimeters in Unity.
Object B
Object A
Ignore
Overlap
Block
Ignore
Ignore
Ignore
Ignore
Overlap
Ignore
Overlap
Overlap
Block
Ignore
Overlap
Block
If you want objects to block each other both should agree on block. Otherwise, the least blocking interaction prevails.
Components in Unreal have their tick components switched off by default for performance reasons.
PrimaryComponentTick.bCanEverTick = true;
Be careful when adding constructor because it is called even in editor, even when you're not playing the game.
C++ in Unreal:
We need third party editor to edit the code unlike Blueprints which was tightly integrated into Unreal.
Here that is Visual Studio Code. This is simply the source code editor.
We need a compiler that will convert our C++ source code into a binary for Unreal to read from.
Here that is Visual Studio. NOT TO BE CONFUSED WITH VISUAL STUDIO CODE. Mac users go with XCode.
These compilers have their own source code editing capabilities however we will still stick to Visual Studio Code.
No spaces in class file name.
It's required to refresh the Visual Studio Code Project in Unreal for it to show up in Visual Studio Code.
A prefix means an Actor.
Integer declaration:
int32 MyInt = 99;
Live Coding...
Adding the following just before a line of code makes it available in Unreal Editor and allows it to be edited:
UPROPERTY(EditAnywhere)
I am going to assume there are much much more such important things.
Struts: Vector Declaration:
FVector MyVector = FVector(1, 2, 3);
While using a third party editor, it can take a long time to update and/or wrongly show errors while editing.
If a gamemode is set to C++ you can't use blueprint classes maybe. So make a new gamemode in blueprints if you want to use blueprints.
Store the same variable as a pointer instead of copying the whole variable.
C++ :
YourActor = &MyActor;
Pointer Access Types:
It's a pointer if used after a type.
AActor* Owner = GetOwner();
Dereferencing operator * before the pointer
FString Name = (*Owner).GetActorNameOrLabel();
Or it can also be written with the arrow operator:
Take all the specific Unreal Syntax and use them to generate more C++ code.
↓ Standard C++ Compilation Process:
↓Preprocessor
# lines only.
↓Compiler
Converts the code into executable binary.
↓Linker
Takes all of that together and outputs an executable.
A scene component is an actor component. It just adds a bit more functionality on top.
If you see any parameters that are references but aren't marked as const then you can generally assume that someone marked that as an out parameter.
Or if you see a value declared with no value and instantly passed into a function, it's most likely an out parameter.
Or if they are named with out.
It can be a weird quirk of C++ and can be hard to spot.
FQuat::Identity→ No rotation.
Trace channel is located in Config→DefaultEngine.ini
Xbox controller only works with Unreal Engine NOT PS.
From UE5.1 onwards the standard input system has been depreciated and replaced with enhanced input system..
Anything that you put in the header file will automatically be in the cpp file.
the .generated.h file should always be the last #include in a header
For performance sake, components that are simulating physics will go to sleep when they have been still for a certain amount of time.
As a general concept we try to fit in a whole function in a window.
b is a prefix we often use when we have to show that it has a boolean type.
Functions:
VInterpConstantTo
Move from one location to a target location with a constant speed.
FAB.com
How to remove added assets to your account?
Glossary:
Event graph→ The canvas for our blueprint
Node → Premade functionality
Event→ When node
Pin - Sockets we can connect up
Input Pin - On the left - When to run the code
Output Pin - On the right - What to do after
Connection → Wires between pins.
Object → Collection of data and functionality.
Actors → Objects that can go in a level.
Components → Objects that can go on an actor.
Reference → Where to find an object.
Data pin → The input or output of data for a node. (What)
Execution Pins → When to run this node
Spawning → Creating an object while playing
Transform → Location, rotation and scale.
Return → Output of a node.
Struct → An object that is usually small and we don’t use references and just pass them around and copy them around in memory
Data types → “Shape” of the data.
BSP: Binary Space Partitioning or Geometry brushes.
Side-effect: When a function has observable effect after it has been run which sounds like every function except there are functions which don’t have side-effects which are called pure functions. etc… Print Function, Add Impulse, etc…
Pure Function: A function with no side-effects and only return values. E.g. Get Ammo, Get Actor Forward Vector, Multiply, Minus…
Pure functions are the functions which won’t have an execution pin.
Only convert functions to pure when you’re sure a function has no side-effects.
Object Oriented Programming -> Functions live with the data they manipulate
Member function: A function on a class, that always called on a particular instance of a class.
Self: A node available in member functions, always points to the current instance.
Source Code: Human Readable code (like C++)
Binary Executable: Machine readable code
Compiler: Translates from Human to machine readable code.
Source Code Editor: Makes writing code fun
Game Loop:
Process Input.
Update game state.
Render the display
Frame: A single picture in a video.
Frame Rate: How many frames a second(FPS)
Tick: Called every frame.
Scope:
How long does the variable live?
Variable is valid between the {} braces.
Pseudocode: A plain language description of the steps in an algorithm.
Comments: Code that is ignored by the compiler.
Expression: Fragment of code that produces a value.
Statement: An action to be performed.
Using DeltaTime in unreal, it can tell us how long each frame took to execute.
When we multiply something by DeltaTime, it makes our game "frame rate independent."
Scope Resolution Operator Looks inside the class in the same way a operator allows us to look into an instance of a class.
> is called what?
Game Mode - An Actor that controls the "rules". e.g. Who should spawn here.
Inheritance: A child class automatically has all the functionality of the parent. The child "is a" parent.
Composition: Class A has an instance of Class B but it can choose use it's functionality but it doesn't have to. Class A "has a" Class B.
Ctrl+Space after a variable name to get it's functions (Or maybe it's just for classes).
Pointers vs. References:
Both are stored in memory.
References can only be set up once. Pointer however can be reassigned.
Repointing variables can lead to problems where those variables can disappear.
Pointers can be null but References must be initialized.
Trying to do something with a null pointer can crash your engine so using references is safer.
Syntax for accessing Contents:
Pointer: *ActorPtr
References: ActorRef
No special syntax.
Syntax for accessing Address:
Pointers: *ActorPtr
References: &ActorRef
Changing the address:
Pointers: ActorPtr = &Actor
References: Not allowed
Changing the value stored at that address:
Pointers: *ActorPtr = Actor
References: ActorRef = Actor
The & and * Symbols in Context:
Context
When Using
When Declaring
Code Examples
CopyOfActor = *ActorPtr;
ActorAddress = &Actor;
UActor* ActorPtr;
UActor &ActorRef;
Symbol
*
&
*
&
Syntax
*ActorPtr
&Actor
&ActorRef
UActor*
UActor&
Meaning
Contents at ActorPtr
Address of Actor or Actor Ref
Pointer to UActor
Reference to UActor
These can also have other meaning like bitwise AND.
Out Parameter: A parameter for passing things out not passing in.
Template function: A function with <parameters> that get evaluated when you compile.
TArray<Type> : When we don't know the size of the array.
<Angle Brackets> are compile time parameters.
Shortcuts:
Alt + Select Object → Duplicate and drag
Double Click object in Outliner to go to it.
Ctrl+Shift+S → Save all files
Click an object and then move into the blueprint and right click which will create a reference for that object in the blueprint.
Alt+Click: Remove Connection
F8 → Eject yourself while playing the game to test other stuff
Ctrl+Space: Content Browser
Old Bug: Right click on the map you want to open and that will move the preparing shaders to the right bottom position and then you can normally double click on it.
Ctrl+Drag variable to Get. Alt+Drag variable to Set.
Select block of blueprints and right click and select collapse to function to convert part of blueprint into function.
Right click an object and click go here to go directly to that location.
`` : Brings up the log
Ctrl+Alt+F11 : Brings up the live coding
use mouse scroll to move fast and slow in the project
QWER: Select, Move, Rotate, Scale
G: Game view mode
H: Hide
Ctrl+H: Unhide
F: Focus on object
Ctrl+Space: Content Drawer
Ctrl+B: Browse to Asset located within my content drawer
Ctrl+D: Duplicate
Alt+D: Drag out a new duplicate
Shift+Select: To select object
Shift+F1: Get mouse cursor back.
Ctrl+E: Open up assets editor
Ctrl+Shift+S: Save All
Alt+P: Play the game
Ctrl+L: Rotate the level’s sun
Alt+S: Simulate the game without going into play mode.
Live coding can lose data or forget new data on new launch. To fix it, build the task from Visual Studio/Visual Studio code when Unreal Editor is actually closed.
It might be easier to just disable live coding altogether which will change the usage of the button below to actually recompile.
New constructor doesn't always gets shown properly when just using live coding so you need to close and rebuild.