How to create Data Asset?

#1
I'm new from Unreal ,intereted in the tech of CE.
I am creating ACT RPG game.
When I have finished some class, such as Weapon class or Combo System, there must be many kinds of weapon with different data,mesh,name.etc.
In UE4 ,I can create data asset and get data when game start, it is very convenient. But I do not know how to do this in CEV.
First, I want to inherit from CAssetType and CAssetEditor,But I find out CE can't reflect containers(Vector,Map,Array) or Custom Class as a Property of a Class to Sandbox, So this way is hard to realize.
Then, I think I can write/read some xml or json file. It is Ok to our Programmer, but it is not convenient to designers.
I want to ask is there a better method?
Thanks.

Re: How to create Data Asset?

#3
check class CMaterialType. some qt program need.
Thank you!
And I have a thought about this. But still have some problems.
I have a complex data class tree. There is many classes,For example:
Item -- Entity Item --Weapon
--armor
--shield ......
--Skill Item --Combo Attack Item
--Magic Skill Item
--Static Skill Item...
Motion Item --Attack Motion
--Guard Motion
--Magic Motion
--Dodge Motion....

If I inherit from CAssetEditor, Because the reflection of CEV is too simple (can not reflect Map<a,b> or Vector<a> and custom classes as a property), I need to write one Editor and Asset Type for each class instead of Inheriting from a base class and a Common editor filled with reflect proerty.
What do you think?

Re: How to create Data Asset?

#4
class is composed of below type : basic type like float , vec3,string
resource type : material , mesh ,animation,audio ,


first you have to learn to Serialize and reflect each type above.

cryengine has support

Schematyc::EntityClass
Vec3
Schematyc::PositiveFloat
Schematyc::Range<0, 100000>
Schematyc::SurfaceTypeName
float
CryTransform::CClampedAngle<0, 90>
Schematyc::UnitLength<Vec3>

and

MaterialFileName,GeomCacheFileName and other resource type construct from path.
check
https://github.com/CRYTEK/CRYENGINE/blo ... rceTypes.h

Serialize and reflect class , you have to provide
two methord to Serialize and reflect class member.

static void ReflectType(Schematyc::CTypeDesc<Type>& desc)
void Serialize(Serialization::IArchive& archive)

example example struct SBuoyancyParameters struct STriggerSerializeHelper

there are CryReflection and CrySerialization

https://github.com/CRYTEK/CRYENGINE/tre ... /CryCommon

complex container(vector ,map and queue,set) is not support ,but has some trick

vector<int> myIntVara;
void Serialize(Serialization::IArchive& archive)
{
vector<int> vec;
int num;
int temp=0;
if(archive.isRead()){
archive(num, "count","vec count");
for(int i=0;i<num; i++){
archive(i, "i","vec count");
vec.add vec;
}
myIntVara=vec;
else {
num= myIntVara.size();
for(int i=0;i<num; i++){
archive(myIntVara, "i","vec count");
}
}
}

Re: How to create Data Asset?

#6
there is txt asset editor plugin
https://github.com/CRYTEK/CRYENGINE/tre ... mplePlugin
type reflect

https://github.com/CRYTEK/CRYENGINE/blo ... TypeDesc.h

i found reflect CArray.

https://github.com/CRYTEK/CRYENGINE/blo ... n.inl#L167

and CArrayWidget is the UI.
https://github.com/CRYTEK/CRYENGINE/blo ... s.cpp#L733

and use case
https://github.com/CRYTEK/CRYENGINE/blo ... nent.h#L21

https://github.com/CRYTEK/CRYENGINE/blo ... nt.cpp#L81

Re: How to create Data Asset?

#7
Awesome! You are so great! Thank you so so so much!
Sorry for reply you so late, I will learn it as my best!

Re: How to create Data Asset?

#8
Hey! Are you chinese? I thought I saw your video on Bilibili !

Who is online

Users browsing this forum: No registered users and 2 guests