这一周开始主要关注character那一块了。
1、解决了自定义RMC的Cube贴图问题,简单好使,上篇中提供思路,作为思考题。
另外在动态的创建Mesh时,使用postload,或者PostActorCreated,当然也可以重写构造函数
virtual void OnConstruction(const FTransform& Transform)override;
2、做成TopDown,视角控制采用魔女之泉的方案:人物处于屏幕中央,必要场景下切换为场景的相机。移除原先的相机pawn,不再提供视角的控制(如拉近,旋转镜头等),将character作为controlled pawn,而不是之前方案中单独的把相机作为pawn,也是采用魔女之泉的方案。这样有一个好处,不用把所有的控制按键输入等逻辑放在Controller中,反而是放在单独的character类上。
仔细分析下魔女之泉的相机控制方案:人物移动时相机会跟着移动,但是在人物旋转的时候相机的朝向始终不变,在springarm的设置中把对应的取消勾选即可
3、11月底前估计会掌握的技能:由于工作上使用C++与Oracle数据库的结合,可以拓展出来的技能,sql语句、使用C++和sqlite联合等。
编译sqlite3,创建空项目,添加sqlite3的源码,选择x64 release版,ctrl+shift+b完成编译
编译后的可执行文件重命名为sqlite3,路径加入环境变量
4、先是用GAS配置character(Done),添加了一个enum来表名当前的装备类型
将Combo的几个动画montage整合成一个,整理受击反应动画,做受击反应(资源里面不多。)Done。
如何在GA_Melee中获取属性值,Done,获取人物属性和装备的状态用来确定播放的动画类型(Done),用section做Combo,section的选取根据骰子幸运值,伤害分段计算仍然是利用碰撞次数来统计,后面可以细分每种装备的基础伤害(TODO)
动画动作要流畅,关于blender到UE4,(10月26号)官方有一个livestream,感觉比uefy上手要简单,不用绑定,直接作动画。缺点就是没法用来做绑定,如何修改人物的mesh? 有一种方式是重定向,重定向的话要求骨架最好是epic的骨架,最好是用uefy做一遍绑定,然后就可以很容易的进行mesh的替换了。
但是要在血条的UI显示上引入damagebuffer(ToDo)
5、attributeset属性增加暴击几率和闪避几率和一个骰子获取的临时幸运值利用"AbilitySystemTestAttributeSet.h"中的思路
// Can the target dodge this completely?
if (DodgeChance > 0.f)
{
if (FMath::FRand() <= DodgeChance)
{
// Dodge!
Data.EvaluatedData.Magnitude = 0.f;
Data.EvaluatedData.Tags.AddTag(FGameplayTag::RequestGameplayTag(FName(TEXT("Dodged"))));
// How dodge is handled will be game dependant. There are a few options I think of:
// -We still apply 0 damage, but tag it as Dodged. The GameplayCue system could pick up on this and play a visual effect. The combat log could pick up in and print it out too.
// -We throw out this GameplayEffect right here, and apply another GameplayEffect for 'Dodge' it wouldn't modify an attribute but could trigger gameplay cues, it could serve as a 'cooldown' for dodge
// if the game wanted rules like 'you can't dodge more than once every .5 seconds', etc.
}
}
if (Data.EvaluatedData.Magnitude > 0.f)
{
// Check the source - does he have Crit?
const UAbilitySystemTestAttributeSet* SourceAttributes = Data.EffectSpec.EffectContext.GetOriginalInstigatorAbilitySystemComponent()->GetSet<UAbilitySystemTestAttributeSet>();
if (SourceAttributes && SourceAttributes->CritChance > 0.f)
{
if (FMath::FRand() <= SourceAttributes->CritChance)
{
// Crit!
Data.EvaluatedData.Magnitude *= SourceAttributes->CritMultiplier;
Data.EvaluatedData.Tags.AddTag(FGameplayTag::RequestGameplayTag(FName(TEXT("Damage.Crit"))));
}
}
// Now apply armor reduction
if (Data.EvaluatedData.Tags.HasTag(FGameplayTag::RequestGameplayTag(FName(TEXT("Damage.Physical")))))
{
// This is a trivial/naive implementation of armor. It assumes the rmorDamageReduction is an actual % to reduce physics damage by.
// Real games would probably use armor rating as an attribute and calculate a % here based on the damage source's level, etc.
Data.EvaluatedData.Magnitude *= (1.f - ArmorDamageReduction);
Data.EvaluatedData.Tags.AddTag(FGameplayTag::RequestGameplayTag(FName(TEXT("Damage.Mitigated.Armor"))));
}
}
6、设计状态,包括 丢骰子、攻击、移动、说话等,完成这之后初步应该就搭建完毕,后面关注的一些内容主要用于丰富素材,包括特效材质、blender到UE4工作流、打斗施法的感觉。