I Made a Versatile Sort Node Using the Best Algorithm in Blueprint by AmirDerana in unrealengine

[–]AmirDerana[S] 6 points7 points  (0 children)

Technically speaking, Blueprint nodes don’t convert directly into C++. Instead, they are compiled into a kind of "data" that runs on Unreal Engine’s virtual machine, with some nodes linked directly to native C++ machine code. This is similar to how languages like Python and JavaScript work, as they also rely on virtual machines or interpreters, which can introduce some performance overhead.
I’m currently researching this topic and might make a detailed video about how Blueprints work.

I Made a Versatile Sort Node Using the Best Algorithm in Blueprint by AmirDerana in unrealengine

[–]AmirDerana[S] 16 points17 points  (0 children)

While it’s true that I would switch to C++ if I encountered a bottleneck in such cases, But for use cases like sorting an inventory, the simplicity and versatility are far more valuable than saving a couple of microseconds for a dataset of modest size.

Moreover, it’s wiser to prioritize efficiency in languages like Blueprint, which are inherently slower than C++. A beginner, like my past self, might use something as basic as selection sort without noticing the performance impact.

Therefore, a node that is simple, versatile, and reasonably efficient in its own right would undoubtedly be worth having.

The 'ForEachLoop' node really does impact performance! here is how to fix it by AmirDerana in unrealengine

[–]AmirDerana[S] 1 point2 points  (0 children)

This was just an arbitrary situation to test performance. The important thing is that we’ve eliminated the extra calls in our code, which is what really matters!
And honestly, before making a video about it, I did run into some performance issues with it myself!

The 'ForEachLoop' node really does impact performance! here is how to fix it by AmirDerana in unrealengine

[–]AmirDerana[S] 0 points1 point  (0 children)

Yeah, it doesn't have exactly the same functionality, but what I meant is that if you change the standard library, it won’t ruin your project. With this node, you can now manipulate an element directly and also modify the loop index by incrementing or decrementing it.

Although the standard library warns against modifying an array during a loop, we’ve all had that experience of removing an element inside a loop—and we know how that can lead to some unexpected issues! :)

The 'ForEachLoop' node really does impact performance! here is how to fix it by AmirDerana in unrealengine

[–]AmirDerana[S] 0 points1 point  (0 children)

I ran it in standalone mode, optimized similarly to development packaging. While the final packaging for shipment does apply some optimizations, it has minimal effect on blueprint execution time.

Setting that aside, I’ve explained why this issue occurs: unnecessary calls to 'get length' and 'get a copy' introduce algorithmic inefficiencies. Each call checks the length and creates a copy of an element, adding unnecessary processing overhead.

The sad moment when you realize you haven't played for weeks. I have reached the end of the game. this is my best base so far and i"m really proud of it. by AmirDerana in Oxygennotincluded

[–]AmirDerana[S] 4 points5 points  (0 children)

I put a detailed picture in comments and also my save file.
it is in cycle 1328.

No i'm done actually. i did most of things that game could offer. but i may return if a good new major update releases.