Intro:
Programming 2 will be C++ programming in Unreal Engine.
WEEK1 - 1/25/2024
Is the intro of the c++ basics. It was suppose to been done on Tue but the teacher wasn't there so I am doing today.
I'll be following a PDF that my other gave to us to follow bring us up to date on c++. Because I am a bit somewhat familiar with c++ from last semester I'll mostly read through most of it and only document stuff that I didn't know. I did some small run of c++ again during new year and might show you what I have done if it shows up on PDF.
Low level are Faster & High level are slower
Low level has assembly library and manage memory.


By using cmd prmt or Powershell you get access terminal allowing compile and execute program. I already attempted during the New year, compile and execute. I even used Vim to use the cmd as a code editor to write code nd save and compile using g++ filename.cpp and then write ./a.exe to run it or make output g++ filename.cpp -0 output_filename and then run ./____ ( using custom output name)
Input.output
INPUT = byte flow from inpute device.
Output = byte flow from memory to the out put device.
In C++ << , Input & output, >>
Header and system Header files: For Header files -
#include is the importer for c++ header files and functions. Whereas <___> is the c++ libraries that store functions for our program. and compiler comes with system header files. You can specific with your files In the header "___/___"
There 3 types of data type: Primitive , User defined type & derived data type.
For Global var it can be declared and accessed every where. Whereas Local var can only be accessed within that function
&& = both - Returns if all oprends is trye
|| = or -Returns if either is true
WEEK2 - 1/30/2024
The C++ workbook we used last week was for us to quickly brush up on what we were supposed to know in SEM 1. I'll continue to do so.
This lesson was for us to see how C++ intro how look in Unreal for us to have a small taste.**I have tried C++ Unreal for my project for a bit
In this unit, everything we learn in the BP unit will need to be taught in C++ with more units ( Which is this one). The class made Door openings in a blueprint and C++ code. The way my classmate made the BP is a little different from how I did it, but it has been a while since. I used Vector they used float. When it comes to c++the way they set it up is different I use C++ class and create BP file from it whereas they created it all in visual studio.





1/31/2023 to ??? - MINI- HMWK
For this mini homework, I set up for myself. I wanted to attempt to recreate the blueprint code that I did as homework from this week and last week, but this time c++. This attempt wasn't easy roughly 5 hours-ish to get one to work. Some of that time waste was due to fact I tried create something without on code without adding on bP (*because I learned that the more you set up in BP the less you need to code) it didn't work and I wasted some time. So I went straight to doing the actual work. First thing was adding var in bp through code it wasn't it was like I was in a wild goose chase but I was able to do it ; even able to convert var as well.
Here the example show case:
Int(cpp vers:
<--Images
I will add more later on this week.


WEEK 3 (Prequel(Week2)) - 2/6/2024
In today's session on week 3, we reviewed what was supposed to go over last week. Class is storing reusable cod.
Struct is user-defined datatype, that combined different type var into one container.This will save memory. Struct are public but class or private. When made a struct , you choose name and put in your int main, you donb't have your struct and just say point__. You don't have* because it is instance.


Union, is similiar to struct, but differently memory location is different place whereas the struct is different.


ENUMS, are created to make program easily readable, it like array, what make different to a struct is that uses comma like array.


Classes, Public and Private access modifiers in C++ Example I made.
HWK1 - Where, why and how - (Feb)2/7/2024
Union/Struct -
Where: I will find it in adventure game
Why: Because this can be used for Inventory.
How: By creating the item and giving values on how many of that item is available
ENUM
Where: Multiple choice question game
Why: By typing or selecting an option progress the game.
How: stack options in an enum array and question will ask and you use if statement and cin .




WK 4 - (FEB) 2/13/2024
Today we went over the pointer, which stores the address of var as a value in a pointer. Into detail storing value. It similar to an array reference.
Here is an example I did in class
3) Sizeof, its compile operator calculates the variable, data type, and classes.




Week 5 * continuing pointer for lesson.
Quick run-through:
CPU; HDD is stack Memory, Heap allocates memory in application dynamically, A var has two values "Lvalue & Rvalue" = Lvalue are memory address of that var; whereas Rvalue = data stored in the variable.
Now I was given task to explain what the code does, decompile:( The image of the close example is on the side)
Nick is Function As well as Erik, We declare a pointer type on MyClass(PMC)(in the curley bracket we place number and Nick which is equal pmc ( name of MyClass)).So print the Nick and number value with a memory address thanks to the pointer., We duplicated the value of pmc and modified it to be pmc2, so we can Erika so we can print Erika.
Search syntax of the smart pointer how it is use
3 types of Pointer = Unique, Smart and Weak.
The pointer and array , if you place custom var ,"array_pointer" it will print out all 1 because the it only 1 value.
Exercise:
Q1 & 2:
<------On the 4th image on your left.
Tue/02/27/2024
Today, I will be following this C++ that will be helping game programming. The prof gave it to one of my classmates, who gave it to me. This from prof, from uni in the netherlands.
C++ Fast Track for Games Programming Part 1: Getting Started
The solutuion I found online that some one posted
#include “stdio.h”
#include “stdio.h”
void main()
{
int I = 0;// This is the first value that get printed
do
{
printf(“hello world\n”);
getchar(); // This enter a new line
I++; // this will help increase the value , in this context
}
while(I < 10); // This 0 – 10, and will print the amount number before 9
}
The I++ increase the value meaning the text the that we want to print.
Do is self explanatory,
The int I = 0 , the 0 represent the first value, while(I < 10) ,this mean from 0 to 10( First to tenth value) 0 is less than 10 , this declare that each Text(Hello world)
up to 10 times
While looking at people response , your response to them, took me to w3 school(which I'm familiar with) and there's version of this which short and simple:
{
int I = 0;// This is the first value that get printed
do
{
printf(“hello world\n”);
getchar(); // This enter a new line
I++; // this will help increase the value , in this context
}
while(I < 10); // This 0 – 10, and will print the amount number before 9
}
The I++ increase the value meaning the text the that we want to print.
Do is self explanatory,
The int I = 0 , the 0 represent the first value, while(I < 10) ,this mean from 0 to 10( First to tenth value) 0 is less than 10 , this declare that each Text(Hello world)
up to 10 times
While looking at people response , your response to them, took me to w3 school(which I'm familiar with) and there's version of this which short and simple:
for (int i = 0; i < 10; i++) {
std::cout << "Coding is awesome!" << "\n";
}
std::cout << "Coding is awesome!" << "\n";
}
(But started on Tues lates night) Weds/02/28/2024 to Thurs/02/29/2024
C++ Fast Track for Games Programming Part 2: The Template
Experiement
1. The screen->Clear(__); = The lower the number the darker it is , the higher the number the brighter it is. In this case Blue
2.It changes the text "Hello World" colors, in this instance, From Red to green to Blue
3. This changes the position of text, from center to right
4.Yes
5.Did it
6 Two differences: I see the command prompt doesn't spam and loop, this goes to the console window, and something happened behind the turret
1. The screen->Clear(__); = The lower the number the darker it is , the higher the number the brighter it is. In this case Blue
2.It changes the text "Hello World" colors, in this instance, From Red to green to Blue
3. This changes the position of text, from center to right
4.Yes
5.Did it
6 Two differences: I see the command prompt doesn't spam and loop, this goes to the console window, and something happened behind the turret
This is my attempt at the assignment:
It took me a while for me to figure out I was suppose to do it, more how to attempt it. I Iknew I had to create the 8x8 grid, which I did. But what I didn't realize at first was that I was supposed to create a word "code" using lines. At first I though I did it right but apparently I didn't but now it works all of a sudden. X1 andY1 is rotation and X2 and Y2 is for length , one of the things I learned I could be wrong and it is a coincidence.
// -----------------------------------------------------------
// Main application tick function
// -----------------------------------------------------------
void Game::Tick(float deltaTime)
{
//Letter C REd
screen->Line(60, 80, 300, 80, 0xff0000);
screen->Line(60, 80, 60, 400, 0xff0000);
screen->Line(60, 400, 300, 400, 0xff0000);
//Letter O Green
screen->Line(120, 157, 240, 157, 0x00ff00);
screen->Line(120, 157, 120, 350, 0x00ff00);
screen->Line(120, 350, 240, 350, 0x00ff00);
screen->Line(240, 157, 240, 350, 0x00ff00);
//LETTER D Blue
screen->Line(240, 157, 240, 350, 0x0000ff);
screen->Line(240, 157, 301, 157, 0x0000ff);
screen->Line(302, 157, 360, 237, 0x0000ff);
screen->Line(360, 237, 360, 350, 0x0000ff);
screen->Line(242, 350, 360, 350, 0x0000ff);
//Letter E Yellow
screen->Line(360, 160, 360, 400, 0xFFFF00);
screen->Line(360, 160, 480, 160, 0xFFFF00);
screen->Line(360, 270, 480, 270, 0xFFFF00);
screen->Line(360, 400, 480, 400, 0xFFFF00);
screen->Line(120, 157, 240, 157, 0x00ff00);
screen->Line(120, 157, 120, 350, 0x00ff00);
screen->Line(120, 350, 240, 350, 0x00ff00);
screen->Line(240, 157, 240, 350, 0x00ff00);
//LETTER D Blue
screen->Line(240, 157, 240, 350, 0x0000ff);
screen->Line(240, 157, 301, 157, 0x0000ff);
screen->Line(302, 157, 360, 237, 0x0000ff);
screen->Line(360, 237, 360, 350, 0x0000ff);
screen->Line(242, 350, 360, 350, 0x0000ff);
//Letter E Yellow
screen->Line(360, 160, 360, 400, 0xFFFF00);
screen->Line(360, 160, 480, 160, 0xFFFF00);
screen->Line(360, 270, 480, 270, 0xFFFF00);
screen->Line(360, 400, 480, 400, 0xFFFF00);
}







WEEk 6 - (MAR)03/05/2024
Today we went over Abstraction Polymorphism
Abstraction class is are class that has a particular focus and it has different variable/properties and methods that are related to each other come to together for the relevant task .
.
The abstraction layer is when a class is separated into two different entities.
Exculpation. You secure the class code and decide what they can see and modify.



This task is to create a separate header and CPP for each I made previous



WEEK 7 - (MAR)3/12/2024
Today and onwards around 4 to 6 weeks, I will be making a tank game. I can make it simple but put my own spin on it to make it special and exciting. Today We took apart free default model from online and separate each part of the tank into three different part, TankTurret, TankBarrel & TankChasis.I had to use 3ds max this timeto perform the action, I have used before in the past, but been using Maya quite recently. Once we tinkered with it we had to access unreal make new project, making it blank and c++ , because with this project it will be mixed with c++ and blueprint.
I had to put together each tank parts together on unreal. By Creating socket in static mesh, like SM_Barrel socket will attach to the SM_turret & SM_Tuuret attach to the SM_Chasis.
Then place them in the BP_Pawn that we created , attach the cameras, ,set camera input in project settings and put input cmmd in BP.