# Magic Nodes

**URL:** <https://forums.unrealengine.com/t/magic-nodes/121220>\
**Category:** UE Marketplace\
**Tags:** unreal-engine, fab\
**Created:** [January 16, 2019, 11:07pm UTC](https://forums.unrealengine.com/t/magic-nodes/121220 "2019-01-16T23:07:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![BrUnO\_XaVIeR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno_xavier/32/1110230_2.png) [@BrUnO\_XaVIeR](https://forums.unrealengine.com/u/BrUnO_XaVIeR)\
**Post date:** [January 16, 2019, 11:07pm UTC](https://forums.unrealengine.com/t/magic-nodes/121220/1 "2019-01-16T23:07:14Z")

</div>

![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/3/2633d5a26f626ba4cfc0f5fa3bd1e7f08ea742b1.png)

Mega Grant Recipient 2020!  
[HR][/HR]  
Hello!  
I have been using this for a while now and, even though I didn’t have the time to put together extensive learning resources, I believe it’s ready to be shared with you guys 🙂

I’ve put together a system which I call “Magic Nodes” (lol) where we can write some C++ functions in-place on any Blueprint Graph and that node will “morph” to match the input and output parameters of the function you wrote within the node itself. Some people might be confused of why we would need this, but instead of trying to advocate the tool I’d rather let your own experience speak for itself; there’s numerous tasks where dragging wires on Blueprint Editor slows down productivity and this tool could be useful to address that, sometimes it’s simply faster to type a few lines of code instead of dealing with wire spaghetti!

With this I also hope, with time, Blueprint developers have a first contact with C++ code and slowly become comfortable moving to Visual Studio workflow later on, if wanted 🙂

So, what is this… A few super simple simple examples:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/7/6/2767247e0c7a13a03e9456ae3ecd194b4e9fad7b.png) ](https://i.imgur.com/TaRsVrL.png)

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/5/d/e5d712a9cfe79c7f8c2836dd63221372b5a9b3e2.png) ](https://i.imgur.com/rP9CsUi.png)

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/f/f/4ff5f77aded926f8425839261aea0f19a4f15ca9.png) ](https://i.imgur.com/95tQwSX.png)

We can type some code, compile (hot-reload), and the node will “morph” its pins to accommodate and execute the function we wrote inside of it.  
This can be very handy for developers missing something in-between Blueprints and pure C++ code…  
Also it’s very useful to actually “read” right there what exactly that one node is doing.

While coding our functions in this node, we can have some basic auto-complete functionality as well.  
However keep in mind that I have no previous experience with any of this, turns out making an auto-complete feature is a beast of a complex task and I’ve implemented only the very basics!  
For example, in this screenshot the node detected I am trying to invoke a function from a ACharacter class, so while I was typing it will show me functions and properties members of ACharacter class:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/d/8/3d8a2f0988d3a66d9795f8c76d722209b87f5367.png) ](https://i.imgur.com/nUDkus5.png)

[HR][/HR]Now released:

**MARKETPLACE** ]([Magic Node in Code Plugins - UE Marketplace](https://www.unrealengine.com/marketplace/magic-node))  
**GITHUB** ]([GitHub - BrUnOXaVIeRLeiTE/Unreal-Magic-Nodes: Custom Kismet Node System that enables C++ code to be written on Blueprint Graphs](https://github.com/BrUnOXaVIeRLeiTE/Unreal-Magic-Nodes)) [HR][/HR]

---

<div class="post-metadata">

**Author:** ![BrUnO\_XaVIeR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno_xavier/32/1110230_2.png) [@BrUnO\_XaVIeR](https://forums.unrealengine.com/u/BrUnO_XaVIeR)\
**Post date:** [January 16, 2019, 11:08pm UTC](https://forums.unrealengine.com/t/magic-nodes/121220/3 "2019-01-16T23:08:39Z")

</div>

Reserved for FAQs…

---

<div class="post-metadata">

**Author:** ![Ispheria](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ispheria](https://forums.unrealengine.com/u/Ispheria)\
**Post date:** [January 16, 2019, 11:43pm UTC](https://forums.unrealengine.com/t/magic-nodes/121220/4 "2019-01-16T23:43:46Z")

</div>

If it’s free why not just open source it and let us download it on github while waiting for epic’s approval? It looks very interesting btw

---

<div class="post-metadata">

**Author:** ![BrUnO\_XaVIeR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno_xavier/32/1110230_2.png) [@BrUnO\_XaVIeR](https://forums.unrealengine.com/u/BrUnO_XaVIeR)\
**Post date:** [January 16, 2019, 11:55pm UTC](https://forums.unrealengine.com/t/magic-nodes/121220/5 "2019-01-16T23:55:14Z")

</div>

> [@Ispheria](#):
>
> If it’s free why not just open source it and let us download it on github while waiting for epic’s approval? It looks very interesting btw

The source is fully open.  
However, not everybody know how to setup plugins from outside Marketplace.

GitHub source I will release later, for now I’m busy coding things not related to any of this (work stuff).

---

<div class="post-metadata">

**Author:** ![leehwanchoi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@leehwanchoi](https://forums.unrealengine.com/u/leehwanchoi)\
**Post date:** [January 17, 2019, 1:22am UTC](https://forums.unrealengine.com/t/magic-nodes/121220/6 "2019-01-17T01:22:13Z")

</div>

amazing tool!

---

<div class="post-metadata">

**Author:** ![Basement\_Bob](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Basement\_Bob](https://forums.unrealengine.com/u/Basement_Bob)\
**Post date:** [January 18, 2019, 3:55am UTC](https://forums.unrealengine.com/t/magic-nodes/121220/7 "2019-01-18T03:55:01Z")

</div>

Yes,this will definitely help in moving over to C++, allow learning and replacing incrementally without fear of destroying existing projects.

Just curious, any added bonuses like performance in packaged builds using these nodes over blueprint nodes? or nativization issues or benefits, regardless this is brilliant, cheers.

---

<div class="post-metadata">

**Author:** ![BrUnO\_XaVIeR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno_xavier/32/1110230_2.png) [@BrUnO\_XaVIeR](https://forums.unrealengine.com/u/BrUnO_XaVIeR)\
**Post date:** [January 18, 2019, 5:08am UTC](https://forums.unrealengine.com/t/magic-nodes/121220/8 "2019-01-18T05:08:19Z")

</div>

> [@Basement\_Bob](#):
>
> Just curious, any added bonuses like performance in packaged builds using these nodes over blueprint nodes? or nativization issues or benefits, regardless this is brilliant, cheers.

Hot-reload times are much faster than when you change a whole character class in C++ for example.

This plugin only work on C++ projects, because it generates C++ classes for your nodes.  
It self-nativize by default.

The cost of calling one node is the same of calling a C++ function. You can have multiple functions in your node code, they will be all native C++ functions (no VM cost).

There’s only 1 VM cost per node, just like any functions created in pure C++.  
You can create and call hundreds of internal functions within your node code and call them, the VM cost ia still going to be just one.

If you call Blueprint Function on the other hand, the VM cost is the function \* nodes it contains, each one is a VM cost…

So in this system’s case, your runtime cost is just the same as if you were coding everything from pure C++ in Visual Studio. 1 VM cost per node executed 🙂

In fact this plugin generates its own C++ code from the nodes you create, you don’t even need to nativize anything, it’s native code by default!  
The generated C++ classes are stored inside your project’s Source/MagicNodes folder (automatically).

Those generated native classes are what is executed in your packaged game, the nodes are just “hosts”.

---

<div class="post-metadata">

**Author:** ![Basement\_Bob](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Basement\_Bob](https://forums.unrealengine.com/u/Basement_Bob)\
**Post date:** [January 18, 2019, 12:00pm UTC](https://forums.unrealengine.com/t/magic-nodes/121220/9 "2019-01-18T12:00:58Z")

</div>

Fantastic,  
hopefully someone at epic sees the value of this and moves a bit of that dev-grant money your way for your ongoing support of the community.

---

<div class="post-metadata">

**Author:** ![Raildex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Raildex](https://forums.unrealengine.com/u/Raildex)\
**Post date:** [January 18, 2019, 7:21pm UTC](https://forums.unrealengine.com/t/magic-nodes/121220/10 "2019-01-18T19:21:04Z")

</div>

Even Visual Studio with VAX doesnt have a List of inherited functions 😉  
I’ll take a look at this.

---

<div class="post-metadata">

**Author:** ![Dannington](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dannington](https://forums.unrealengine.com/u/Dannington)\
**Post date:** [January 21, 2019, 12:23am UTC](https://forums.unrealengine.com/t/magic-nodes/121220/11 "2019-01-21T00:23:01Z")

</div>

This looks terrific! I’ll be weening myself over to c++ using this - great work as usual Bruno.

---

<div class="post-metadata">

**Author:** ![HiIAmMoot](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HiIAmMoot](https://forums.unrealengine.com/u/HiIAmMoot)\
**Post date:** [January 21, 2019, 11:49am UTC](https://forums.unrealengine.com/t/magic-nodes/121220/12 "2019-01-21T11:49:22Z")

</div>

Would it be possible to maybe to something similar to existing BP nodes/C++ code in your project source folder? View, edit & recompile?

---

<div class="post-metadata">

**Author:** ![BrUnO\_XaVIeR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno_xavier/32/1110230_2.png) [@BrUnO\_XaVIeR](https://forums.unrealengine.com/u/BrUnO_XaVIeR)\
**Post date:** [January 21, 2019, 5:09pm UTC](https://forums.unrealengine.com/t/magic-nodes/121220/13 "2019-01-21T17:09:16Z")

</div>

> [@Dannington](#):
>
> This looks terrific! I’ll be weening myself over to c++ using this - great work as usual Bruno.

Thanks!

> [@Mootjuh](#):
>
> Would it be possible to maybe to something similar to existing BP nodes/C++ code in your project source folder? View, edit & recompile?

lol no, the whole blueprint system would need a rework for that.

---

<div class="post-metadata">

**Author:** ![Yggdrasil](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Yggdrasil](https://forums.unrealengine.com/u/Yggdrasil)\
**Post date:** [January 22, 2019, 4:04pm UTC](https://forums.unrealengine.com/t/magic-nodes/121220/14 "2019-01-22T16:04:16Z")

</div>

This looks to be really cool. I would imagine your plugin would be accepted.

---

<div class="post-metadata">

**Author:** ![NilsonLima](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NilsonLima](https://forums.unrealengine.com/u/NilsonLima)\
**Post date:** [January 22, 2019, 4:32pm UTC](https://forums.unrealengine.com/t/magic-nodes/121220/15 "2019-01-22T16:32:05Z")

</div>

I would be more than happy to help Bruno at repository level to maintain the code, thou I might not have time to add functionality to it besides just maintain new engine releases

Fantastic job as always [USER=“434”]BrUnO XaVIeR[/USER] !

PS: apply this to Unreal Dev Grants if not already!!

---

<div class="post-metadata">

**Author:** ![BrUnO\_XaVIeR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno_xavier/32/1110230_2.png) [@BrUnO\_XaVIeR](https://forums.unrealengine.com/u/BrUnO_XaVIeR)\
**Post date:** [January 24, 2019, 7:14pm UTC](https://forums.unrealengine.com/t/magic-nodes/121220/17 "2019-01-24T19:14:47Z")

</div>

Everything should be set now for Marketplace release.  
Later on I will setup a GitHub public repo as well, but before that, I want to collect feedback from both users without coding experience and C++ veterans.

For now, I’ve written a little bit about the ins and outs of this system and how it is meant to work for you, here:

> **[Unreal “Magic Nodes” (Programming)](https://brunoxavierleite.com/2019/01/16/unreal-magic-nodes-programming/)**
>
>   What: I’ve put together a system which I call “Magic Nodes” where we can write some C++ functions in-place on any Blueprint Graph and that node will “morph” to match…

---

<div class="post-metadata">

**Author:** ![HiIAmMoot](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HiIAmMoot](https://forums.unrealengine.com/u/HiIAmMoot)\
**Post date:** [January 25, 2019, 7:23am UTC](https://forums.unrealengine.com/t/magic-nodes/121220/18 "2019-01-25T07:23:56Z")

</div>

Does it make separate files for each function? Or are all magic nodes put inside one big function library?

---

<div class="post-metadata">

**Author:** ![BrUnO\_XaVIeR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno_xavier/32/1110230_2.png) [@BrUnO\_XaVIeR](https://forums.unrealengine.com/u/BrUnO_XaVIeR)\
**Post date:** [January 25, 2019, 8:38am UTC](https://forums.unrealengine.com/t/magic-nodes/121220/19 "2019-01-25T08:38:20Z")

</div>

> [@Mootjuh](#):
>
> Does it make separate files for each function? Or are all magic nodes put inside one big function library?

The first iteration I was compiling them to a library.  
But then I noticed that hot-reloading time was increasing the more nodes I create.

Now what I do is create source files for each node class, hot reload became way faster and will remain the same time always, when I recompile just one node.

Now instead of packing them within a library, I pack their source files inside the Source/MagicNodes/ folder. You will be able to see each generated class within Content Browser’s C++ directory.

The good thing is, if desired, you can remove all Magic Nodes from your Blueprints later and destroy the “Script” asset once the C++ class is generated and compiled. Then you include and use the C++ code directly. So the nodes in this case would be just a testing environment before moving your algorithms to full C++ in Visual Studio environment…  
I’ve been doing that. Once a node works the way I want, and I know I will never change it again, I delete the node asset and call the native functions directly from my Character.cpp.  
Only nodes that are really self-contained I leave them running as is, when the functionality doesn’t fit any of my native classes.

Oh I think I forgot to mention in the blog post to include “MagicNodeRuntime” module to Build.cs file for that, to make those sources usable by native project classes, otherwise project classes might cause error when calling magic node functions directly.

---

<div class="post-metadata">

**Author:** ![Naikrovek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Naikrovek](https://forums.unrealengine.com/u/Naikrovek)\
**Post date:** [January 27, 2019, 1:59am UTC](https://forums.unrealengine.com/t/magic-nodes/121220/20 "2019-01-27T01:59:49Z")

</div>

This is brilliant. Please update this thread when it arrives on GitHub (or other site like it).

---

<div class="post-metadata">

**Author:** ![Ben\_Cykyria](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ben_cykyria/32/700751_2.png) [@Ben\_Cykyria](https://forums.unrealengine.com/u/Ben_Cykyria)\
**Post date:** [January 28, 2019, 9:23am UTC](https://forums.unrealengine.com/t/magic-nodes/121220/21 "2019-01-28T09:23:57Z")

</div>

Subscribed, bookmarked, noted and thousand thanks for this plugin!

---

<div class="post-metadata">

**Author:** ![BrUnO\_XaVIeR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno_xavier/32/1110230_2.png) [@BrUnO\_XaVIeR](https://forums.unrealengine.com/u/BrUnO_XaVIeR)\
**Post date:** [January 29, 2019, 2:36am UTC](https://forums.unrealengine.com/t/magic-nodes/121220/22 "2019-01-29T02:36:10Z")

</div>

This plugin is now released 🙂

**MARKETPLACE** ]([Magic Node in Code Plugins - UE Marketplace](https://www.unrealengine.com/marketplace/magic-node))  
**GITHUB** ]([GitHub - BrUnOXaVIeRLeiTE/Unreal-Magic-Nodes: Custom Kismet Node System that enables C++ code to be wr](https://github.com/BrUnOXaVIeRLeiTE/Unreal-Magic-Nodes))

[Next page](https://forums.unrealengine.com/t/magic-nodes/121220.md?page=2)
