1
\$\begingroup\$

I just saw that you normally use Unreal engines own data structures when you code scripts.

Why is this are those better ? Can you also use the common c++ datastructures ( vector... ) or are you forced to use the UE ones ?

\$\endgroup\$
1
  • 1
    \$\begingroup\$ "Can you use..." have you tried? What results did you observe? \$\endgroup\$
    – DMGregory
    Apr 28 at 16:42

1 Answer 1

2
\$\begingroup\$

You can use other data structures, but there may be tradeoffs.

The most immediate difference is that the API is going to favor their structures. Even if the engine developers haven't tunes data structures for their engine, the API uses them "as is". You can use other structures, but then it's on you to do any conversions (for instance converting some other vector into a format that can be passed into an API rotation function). Even if the compiler optimizes this, there's still a mental complexity cost when you have extra steps to get data from on form to another.

Secondly, their data structures were built with the intent to use them with their framework. General purpose data structures are built for general use. By using their structures, you typically remove the need to question whether or not the structure you're using is implemented in a way that favors your usage.

If you can use other structures, you're potentially adding friction to your development process. Any time, energy & money that you expend replicating work already done by framework amounts to resources that could have been spent working on other the parts of your project. Ultimately only you can decide if that's a good exchange.

\$\endgroup\$
1
  • \$\begingroup\$ Another thing to mention is that standard c++ classes like vector are implemented in OS-specific ways, eg visual c runtime dll on Windows. Unreal can target many platforms, including PC, XBox, Switch... There may not be a standard library implementation on those platforms \$\endgroup\$
    – Jay
    Apr 29 at 1:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .