# Serialization deserialization

**URL:** <https://forums.unrealengine.com/t/serialization-deserialization/1753742>\
**Category:** Verse\
**Tags:** unreal-engine, question\
**Created:** [March 15, 2024, 11:01am UTC](https://forums.unrealengine.com/t/serialization-deserialization/1753742 "2024-03-15T11:01:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![celebro011](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@celebro011](https://forums.unrealengine.com/u/celebro011)\
**Post date:** [March 15, 2024, 11:01am UTC](https://forums.unrealengine.com/t/serialization-deserialization/1753742/1 "2024-03-15T11:01:02Z")

</div>

Hi  
I want to build in game a car from parts (engine, suspension, body - these are separate parts). The car has a physical simulation such as joints, rigidbody. I build the car in workshop, then i load it to game.

How can I serelize/deserelize a car from construction mode to game mode if the parts are separate blueprints?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [March 15, 2024, 11:28am UTC](https://forums.unrealengine.com/t/serialization-deserialization/1753742/2 "2024-03-15T11:28:14Z")

</div>

I would make a data table holding soft references to classes of the parts.  
Then have a nested struct that would hold the information.

So it would have  
Engine : =\> datatable row identifier for engine model  
Suspension : =\> datatable row identifier for suspension model  
etc

Inside of the parts of the blueprints make sure they have a reference to their data table counterpart , then just go through the car and get the datatable information for each included part and set it in the main cars struct which can be later saved for instance as a json file in a savegame.

To load pull out the json string describing the car, parse it into a struct and run a script that will spawn components based on the saved data table row descriptor.

---

<div class="post-metadata">

**Author:** ![celebro011](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@celebro011](https://forums.unrealengine.com/u/celebro011)\
**Post date:** [March 15, 2024, 2:55pm UTC](https://forums.unrealengine.com/t/serialization-deserialization/1753742/3 "2024-03-15T14:55:33Z")

</div>

> [@3dRaven](#):
>
> table holding soft references to classes of the parts

“table holding soft references to classes of the parts” can you tell me more details, please?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [March 15, 2024, 3:17pm UTC](https://forums.unrealengine.com/t/serialization-deserialization/1753742/4 "2024-03-15T15:17:20Z")

</div>

Use soft references to classes to not load the class into memory before it is needed. Datatables are simplified database like structures in unreal. A car catalog part would be defined as a class that inherits if i remember correctly from datatablerow

Example

USTRUCT(Blueprintable)  
struct FCarPartStruct : public FTableRowBase  
{  
// add part properties  
}  
This can be done in bp too just use a struct that inherits from TableRowBase

Then when creating a datatable choose your struct as the row / entry definition

The tsoftclassptr is the c++ version of a soft reference. In blueprints it’s the pink variant of a class. You will need to async load the soft class before you can spawn its full instance.

---

<div class="post-metadata">

**Author:** ![celebro011](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@celebro011](https://forums.unrealengine.com/u/celebro011)\
**Post date:** [March 15, 2024, 4:06pm UTC](https://forums.unrealengine.com/t/serialization-deserialization/1753742/5 "2024-03-15T16:06:29Z")

</div>

Thanks for your answer

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [April 14, 2024, 4:06pm UTC](https://forums.unrealengine.com/t/serialization-deserialization/1753742/6 "2024-04-14T16:06:42Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
