Happy to hear that! Feel free to post a link ![]()
Yes and no. The great benefit of C++ is of course speed. For a lot of stuff that much speed is unneeded and blueprints work just fine, but AI is one of those things that can get really resource heavy depending on what you want to do. So if you are designing the kind of AI that will be doing a very large number of calculations in a very short time C++ will let you do more.
If all you want C++ for is your AI, then all you need to expose to C++ is whatever your AI will be using. You likely want access to the grid arrays such as GridLocations, GridEdges etc. as well as pathfinding, LoS etc. But you probably don’t need access to how you are animating your units, for instance.
Your C++ code will not be able to access variables you have declared in blueprints (without a lot of awkward workarounds), so you would want to create C++ versions of the classes you want to access in C++ and reparent their respective blueprint classes to these new classes. Then you would define any variables you need to access in the C++ version of the class and replace any references to the old blueprint variables with the new C++ variables.
I have already converted many of the resource heavy blueprints such as these to C++. I can share them with you if you are interested. Be aware that implementing it will take some work, though.
- Alternatively, if I didn’t need to convert my whole project to C++, from what I understand, I can add C++ elements to the blueprint project, and I just wanted to make sure that was also correct.
Thanks, and hope you’re well
[/QUOTE]
Indeed you can. It is absolutely possible to combine C++ and blueprints in a UE4 project. Epic does this for all their internal projects and blueprints were designed with this in mind.