Closed scottanderson closed 1 year ago
In an experimental branch, I have been able to read a v3 (UE5) file from the Railroads Online beta after handling changes listed above. The experiment breaks compatibility with GVASv2 (UE4) save files because of a quick and dirty replacement of f32 with f64 in the existing FloatProperty and struct types. These types will need to be upgraded to support what UE5 calls large world coordinates. More information here: https://docs.unrealengine.com/5.0/en-US/large-world-coordinates-project-conversion-guidelines-in-unreal-engine-5/
This probably will be done by replacing the cursor with a GvasTrait + GvasReader, and the first trait will implement getters for asset specific data so it can be queried when reading, I'm open to other suggestions too.
I see two options for supporting LWC:
FloatProperty
, and the three StructRPoprety
subtypes Vector
, Rotator
, and Quat
) can be converted to an enum with f32 and f64 variants. The ::read()
function will need to have knowledge of whether LWC is enabled - that might be possible to do with monomorphization/traits. Alternatively, LWC can be passed as a bool argument."FloatProperty"
to separate concrete types FloatPropertyF
or FloatPropertyD
. Apply similar logic to the three StructProperty subtypes, with the strings "Vector"
mapping to structs VectorF
and VectorD
, and so on. The Property::new
and StructProperty::read
functions will still need to know if LWC is enabled.I am leaning toward the second option for having a simpler architecure and copying what UE5 actually does; but I could be convinced otherwise.
On closer inspection, it appears that I was mistaken about FloatProperty
storing doubles. Only the struct sub-types are impacted by LWC.
Known issues
Vector
,Rotator
, andQuat
use double-precision floats ("large world coordinates")TextProperty
has new flag values