文章目录
学习介绍
- 学习目标:有多位b站up翻译了外国ue5大佬Stephen Ulibarri的很多虚幻课程,Stephen Ulibarri自己说过如果想看他的课来学习fps游戏制作,推荐的学习路线为,uec++复习->ue4单人射击游戏->ue5多人射击游戏,所以目标是学完这三门课程
- 相应B站的白嫖视频链接:
uec++复习
(https://www.bilibili.com/video/BV1Dd4y1R7VS/?spm_id_from=333.788.top_right_bar_window_custom_collection.content.click&vd_source=de1f9cbc33f7115533aa33c9d6b5257b)
ue4单人射击游戏
(https://www.bilibili.com/video/BV1RG4y1M7gy/?share_source=copy_web&vd_source=4bae89ebb5106a4b0a5fd299f8769199)
ue5多人射击游戏
(https://www.bilibili.com/video/BV1Zr4y1G79Z/?spm_id_from=333.788.top_right_bar_window_custom_collection.content.click&vd_source=de1f9cbc33f7115533aa33c9d6b5257b) - Stephen Ulibarri的正版虚幻课程地址:
https://www.udemy.com/course/unreal-engine-5-cpp-multiplayer-shooter/#instructor-1
UE5 场景搭建
学习视频地址:https://www.bilibili.com/video/BV1EM411U7PX?p=12&vd_source=de1f9cbc33f7115533aa33c9d6b5257b
对应的视频集数
p1-10
介绍各种界面之类比较简单
p11
- 天空场景搭建
首先需要一个天空大气
其次需要定向光源(这里放置两个)
分别进行重命名,和大气太阳光索引值设置
然后就可以得到两个太阳(ctrl+l控制一个 ,crtl+shift+l控制另外一个)
加入天空光照
开启实时捕获
加入雾
加入体积云
分别设置太阳温度
再继续移动太阳则可以得到不同的天空效果
p12
勾选地形模式
设置好地形大小后,利用地形刷子,创建各种山脉地形
p13-14
去商店下载资源球
新建一个文件夹,放材质
双击材质,进入蓝图界面后,右键单击,新建一个landscape
在图层处,添加,并且重命名
将不同的法线和材质拖入蓝图,并且按名字排好序
将材料拖入地形材质
选择地形->绘制->±>选择权重并且保存
最后进行地形绘画
问题
运行后,提示需要重构地理材质,并且有些地形的材质不会显示
原因:电脑配置不行,所以暂停这段路线学习,学习偏程序方面的射击游戏
UEC++复习
学习视频地址:https://www.bilibili.com/video/BV1Dd4y1R7VS?p=32&vd_source=de1f9cbc33f7115533aa33c9d6b5257b
对应的视频集数
P1-43
学习笔记:
#include<iostream>
#include<string>
using namespace std;
void zh(int& x, int& y);
void a2(int x,int y);
void a2(char x, int y);
enum PlayerStatus {
PS_jump,
PS_run,
};
enum Goods {
G_gun=1,
G_penknife,
};
enum Money {
M_dollar = 7,
M_rmb=1,
};
struct location {
float x;
float y;
float z;
};
struct role {
location map1 = { 1.2,2.3,3.4 };
string name;
int level;
void locationmap1(){
cout << "角色位置:" << map1.x << "," << map1.y << "," << map1.z << ";" << endl;
}
void levleplus(){
level += 1;
}
};
int main() {
int a = 2;
int b = 3;
char c = 'e';
/*----------------------------------------------------------------------------------------------------------------------------------------
结构体的命名以及嵌套结构体,实例化结构体,输出结构体
role yang;
yang.name = "yangxu";
yang.level = 10;
cout << yang.name << endl;
cout << yang.level << endl;
yang.levleplus();
cout <<"角色"<<yang.name << "的等级提升了一级:" << yang.level << endl;
yang.locationmap1();
role xu = { {12.3,15.6,17.8} ,"yixixi",1000};
xu.levleplus();
cout << "角色" << xu.name << "的等级提升了一级:" << xu.level << endl;
xu.locationmap1();
*/
/*----------------------------------------------------------------------------------------------------------------------------------------
枚举的各种声明,以及简单的用法
PlayerStatus s = PS_jump;
cout << s << endl;
Goods z = G_penknife;
cout << z << endl;
Money o = M_rmb;
cout << o << endl;
switch (s)
{
case PS_jump:
cout << "jump" << endl;
case PS_run:
break;
default:
break;
}
*/
/*----------------------------------------------------------------------------------------------------------------------------------------
&&是and的意思就是全真为真
||是or的意思就是一真为真
if (a<b && b>a) {
cout << "fuck" << endl;
}
if (a < b || b < a) {
cout << "?>" << endl;
}
*/
/*----------------------------------------------------------------------------------------------------------------------------------------
if (a == b) {
cout << "fuck" << endl;
}
else
{
cout << "you" << endl;
}
if (a <= b) {
cout << "?" << endl;
}
*/
/*----------------------------------------------------------------------------------------------------------------------------------------
if (a != b) {
cout << "if else if 是中断型语句,只要一个执行剩下的都不会执行,就算有else也是只执行对的那个就停止,当然所有都是错的则就执行else" << endl;
}
else if (a==b) {
cout << "shit" << endl;
}
else if (a==b) {
cout << "????" << endl;
}
else{
}
*/
/*----------------------------------------------------------------------------------------------------------------------------------------
局部变量和全局变量*/
// i=i+3等价域i+=3; i -=3; i/=3; i*=3;
// i%=1; i对1进行取模,就是取余数,将余数赋值给i;
// ++i,是先加1,再返回值, i++是直接返回原值,再加1
/*----------------------------------------------------------------------------------------------------------------------------------------
while (a==b) {
break;
}
do {
continue;
}
while(a==b);
while和do,while,一个是先判断然后循环,一个是先循环然后判断,break和continue都是中断后续执行,不过 break是直接退出循环,continue是不执行循环后的语句,但是仍然在循环里
*/
/*----------------------------------------------------------------------------------------------------------------------------------------
for (int i = 1; i < 5; i++) {
cout << "1" << endl;
}
//执行4次
for (int i = 0; i <= 5; i++) {
cout << "1" << endl;
}
//执行6次
//规律,用判断的i-初始值的i,即为次数,若是判断有等于,则在加一次
*/
/*----------------------------------------------------------------------------------------------------------------------------------------
//引用传递和值传递
内存指向问题
//形参和实参
cout << a << b << endl;
zh(a, b);
cout << a << b << endl;
*/
/*----------------------------------------------------------------------------------------------------------------------------------------
a2(a, b);
a2(c, 2);
函数重载
*/
/*----------------------------------------------------------------------------------------------------------------------------------------
字符串数组命名和使用
char s[4] = { 't','z','u','\0'};
char e[4] = "das";
cout << s << endl << endl;
cout << e << endl << endl;
string fuck = "fuck";
string y = "you";
string u = "and her";
fuck += (y + u);
cout << fuck;
*/
/*----------------------------------------------------------------------------------------------------------------------------------------
const int d = 4;
d = 5;
cout << d << endl;
常量无法修改
*/
/*----------------------------------------------------------------------------------------------------------------------------------------
int t[5];
int r[] = { 2,3,4,5,6 };
char s[] = { 'q','b','z','w','s' };
for (int i = 0; i < 5; i++) {
cout << r[i] << endl;
cout << s[i] << endl;
}
for (int i = 0; i < 5; i++) {
t[i] = i;
cout << t[i] << endl;
}
t[i],最好别和前面的变量重名
*/
}
void zh(int& x, int& y) {
int temp;
temp = x;
x = y;
y = temp;
}
void a2(int x, int y) {
cout << x << y;
}
void a2(char x, int y) {
cout << x << y;
}
p43-63
#include<iostream>
#include<string>
using namespace std;
struct container {
string name;
int x;
int y;
int z;
};
class dog {
public:
int age;
string name;
int healthy;
void show() {
cout << healthy << endl;
cout << age << endl;
cout << name << endl;
}
void bark() {
cout << "wangwang" << endl;
}
dog() {
healthy = 100;
name = "peter";
age = 10;
show();
bark();
}
};
int main() {
/*指针的基本用法,数组指针的特性以及数组的地址
int a = 100;
int * b ;
b = &a;
cout << b << endl;
cout << a << endl;
cout << *b << endl;
数组用法
int number[] = {2,3,4,5,6,7,8};
cout << number << endl;
int * n = number;
cout << *n << endl;
cout << *n + 1 << endl;
结构体用法
container s = { "yangxu",1,2,3 };
container* q = &s;
cout << q->name << endl;
cout << (*q).name << endl;
cout << q->x << endl;
*/
/*结构体和类基本完全相似
dog kangkang;
*/
system("pause");
}
ue4单人射击游戏
学习视频地址:https://www.bilibili.com/video/BV1RG4y1M7gy/?spm_id_from=333.788.top_right_bar_window_custom_collection.content.click
p1-p8
比较简单,不做笔记
p9-p11
主要是讲了基本的变量申明,以及虚幻里的UE_LOG函数,如果通过UE_LOG函数传数据到日志里面查看
①先开启日志
多出来的日志栏
②在AShooterCharacter::BeginPlay()函数里,声明变量,以及用UE_LOG函数打印到日志里
void AShooterCharacter::BeginPlay()
{
Super::BeginPlay();
UE_LOG(LogTemp, Warning, TEXT("wdfing?this!"));
int myint= { 30 };
UE_LOG(LogTemp, Warning, TEXT("myint:%d"),myint);
float myfloat{ 3.1415926f };
UE_LOG(LogTemp, Warning, TEXT("myfloat:%f"), myfloat);
float mydouble { 5.45677 };
UE_LOG(LogTemp, Warning, TEXT("mydouble:%1f"), mydouble);
char mychar{ 's' };
UE_LOG(LogTemp, Warning, TEXT("mychar:%c"), mychar);
wchar_t widechar{ L'j' };
UE_LOG(LogTemp, Warning, TEXT("widechar:%1c"), widechar);
bool myBool{ true };
UE_LOG(LogTemp, Warning, TEXT("myBool:%d"), myBool);
UE_LOG(LogTemp, Warning, TEXT("myBool:%d,mychar:%c,mydouble:%1f"), myBool, mychar, mydouble);
FString mystring{ TEXT("My String!!!!") };
UE_LOG(LogTemp, Warning, TEXT("mystring:%s"), *mystring);
//这里的GetName()是获取角色名称
UE_LOG(LogTemp, Warning, TEXT("name of instance:%s"), *GetName());
}
③点击运行进行日志查看
成功打印
ue5多人射击游戏
学习视频地址:https://www.bilibili.com/video/BV1Zr4y1G79Z/?spm_id_from=333.788.top_right_bar_window_custom_collection.content.click&vd_source=de1f9cbc33f7115533aa33c9d6b5257b
暂未开始