C++ coding or Blueprint approach for my FIRST project?

Hi there.

I’m starting my first indie game for a local game startup challenge and I have about 2 months for a Vertical Slice of my game which means near complete art and game play. I started learning C++ in UE4 about 2 months ago and I don’t know if I can handle every situation really quick in it. Also its a LAN multiplayer game so I don’t know if it’s possible in BP. Can you give me a sight on which part is better efficient in C++ and which parts in BP.

Thanks in advanced.

C++ runs faster so if you are doing loads of math/vector calculations on Tick (every frame) it is better to do it in C++. This is the reason the character movement and AI perception components are done in C++.

Everything else like game-play logic or functions/events that are triggered occasionally can be done anyway you choose. If you like/know C++ better than Blueprints it’s ok to build your whole project in C++.

On the other hand, there is (almost) nothing that can’t be done in blueprints. There is a great Blueprint tutorial on multiplayer in the Unreal documentation. Unfortunately it is down right now so I can’t post the link but just search for “Blueprint Multiplayer”.

I like to work with blueprints so what I would do is separate the “performance critical” blueprints in components. If they starts to clog the CPU I would adjust the Tick interval which will make it run every several frames to lighten the load.

If it doesn’t look acceptable or produces glitches I will then consider writing it in C++ or otherwise optimizing the component.

The key thing is to use the Profiler to see what components take most of the time of the frame. Don’t try to optimize before your gameplay is complete if you are not sure or confident about it. You might end up wasting lots of time optimizing a math problem where the bottleneck could be that objects that don’t need to recalculate the math still do it every frame.

Please note that I do this non-professionally (loose time-frames), alone (no team) and I do prototypes (far less than vertical slice). The tight time frame (2 months) means that you MUST use whatever you (and your team) feel most comfortable with.

I hope this helps.

Nicely put…!

Thanks for the advice dZho, it helps alot. I really like what you said about “performance critical”, I can use that either. and if I can do network stuff in BP so there is no worries for the rest.

C++ as a language is something we should all learn, as it makes us able to do anything we want.

However, trying to learn Unreal’s framework and API at the same time as learning the C++ stuff in Unreal is asking a lot of someone.

I am learning it the Blueprint way first so I can understand how the Engine pieces fit together and how to properly use them, and then later I will probably change to C++ and know which data structures, programming patterns, etc. will work best because I’ve already learned them at a higher abstraction level in BP.

That’s my strategy anyway. I hope it’s a good one.

And you can do almost anything you need to in BP. C++ is more performant for lots of reasons.
I have done all the network stuff I need to in BP.

If there is something you need in BP but only C++ has it, you can use C++ to expose it to BP. I did that to give myself runtime control over whether the game uses splitscreen.

There are finer controls over networking replication in C++ for when you need to get rid of the laggies, but the most impactful things you can do about that are probably possible in BP as well just more tedious to program than in C++ since they have to do with queue of timestamped states and selecting one for rewind/prediction to smooth network movement.

But hey I made a recursive maze generator in BP (and yes the generated maze replicates just fine over the network) so you should be able to do almost anything you need in BP.

Thanks man. It always promising that I can go back to C++ for better results. Actually I want a BP level generator that I want to replicate over network so I’m glad that it’s possible in BP for just now.

Hi @mossi, as the previous poster mentioned, use whichever system you feel you check iterate in more quickly. If you feel like you can reliably write a big section of C++ and spend minimal time fixing bugs. Then native is the way to go. However, every time you have to leave the editor to fix an error is time lost compiling your new source. It may not be a lot, but when you consider the compile time plus the editor startup time it can add up quick.

However, debugging networked code in VS has it’s advantages.

Two months for a multiplayer game of even small scope is a short timetable, especially if you need art and design. I can tell you from experience supporting multiplayer projects that you will want to get very familiar with network roles and ownership. Make sure you know the context of your functions (use the HasAuthority() function or node when you need things to happen on the server.

Also, Play in Editor is very useful, but I have seen instances where developers only test in play in Editor or launch the game server/clients from command line. There is a chance that your networking code may work in either case, but not the other. If your new feature works in PIE you would do well to run it from command line as well to be sure it works correctly between server and client.

Sorry this has gone on so long, but if you plan on packaging the product, do yourself a huge favor and package a build 1.) Before you have any new functionality, and 2.) Every other day or so. There are failure conditions for applications that are handled gracefully within the editor context which will cause a crash in a packaged build.

Out of curiosity, are you planning on using a listen server or a dedicates server?

Hi @ZeroParadigm, thank you for your great response. When I tried C++ I had some crashes for null pointers and other stuff which wastes a lot of time specially for beginners so I think I’ll go with BP mostly. In the other hand I never did multiplayer stuff before so I don’t have any clue of what should I do but I found some good tutorials and then I will come back to your hints.
For the packaging I will keep it in mind. Actually I have a vast background in animation and vfx but I’m new to games so I don’t have enough experience in networking yet. For the servers you mentioned I’m not 100% sure but I think for this stage I’ll go with listen one because I don’t have enough resources for a separate dedicated server.

OMG, I have so many tasks to do all alone. But I can do it.

The advantage of Blueprints is they are faster to iterate changes and test them in editor.
The advantage of C++ is that it can do anything and performs better.

So yes for your FIRST PROJECT i would use BP to decrease the learning curve of understanding how Unreal engine does things.

Thanks. I’m doing it right now.