Announcement

Collapse
No announcement yet.

Disadvantages of C++ Project type?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Disadvantages of C++ Project type?

    I made a game using Kismet and another using Playmaker, so naturally my next one will be made using Blueprints.
    However during the development of those two games I was sometimes forced to use programming since the visual scripting couldn't do something (properly).
    So as a safety measure I would like to start my next game with a C++ Project instead of a content only Blueprint project to have C++ as a backup option.

    I never tried a C++ project, but still want to be able to make an informed decision about this, so what disadvantages will I have switching to the C++ project type?

    What I found so far is that the setup is more complicated since it needs visual studio, but that's ok since there is a free express version.
    Another one I found is that it's not possible to compile C++ projects for iOS without a Mac.
    So basicaly I want to know if there are more C++ project type disadvantages, so that I don't choose the wrong type.


    PS: This is not supposed to be a discussion of whether working with C++ or Blueprints is better, there are plenty of those aready. ^^

    #2
    You might be a lot less productive since you're sitting there in visual studio constantly trying to compile code. Finding compiler errors is a bit harder than regular C++ since Unreal has it's own crazyness on top of C++.

    I myself am an avid C++ coder and am doing a lot of things in C++ so I have no regrets. I typically code up all the base stuff in C++ and only tweak a few things in Blueprint, like make a base weapon class. Then create blueprint weapons and tweak meshes, damage, etc.

    Comment


      #3
      dont bother with vs express its terribly slow
      there is now a free community edition

      cant thing of any disadvantages, blueprint as you know is limited but can be expanded using c++.
      the engine source is available written in c++ so you can even change things at their core.
      the only thing that might throw you is
      Unreal has it's own crazyness on top of C++
      tegleg.co.uk - indie electronic music label
      Android + HTML5 WIP Physics Game
      PC Games - Android Apps

      Comment


        #4
        There's really no disadvantage to a C++ project type if you know C++ and have a compiler/IDE installed already. One of the really nice things about the C++ templates is that they include a blueprint subclass of the C++ classes created from the template, so you have the flexibility to use C++ or Blueprint, whichever is more appropriate to the situation and/or your tastes. If you work in blueprints in a C++ template, you'll basically compile your project code once and then it'll be just like a blueprint project.

        You don't actually have to launch from Xcode or VS with a C++ project, either. You can launch them directly from the UE4 launcher if you're not planning on making C++ code changes.

        Comment


          #5
          You will need to update your C++ as the API changes with updates. That's the only reason I can see why it would be better if your not planning on writing C++ to use a BP only project, you'll save yourself that step.

          My main project in UE4, the cat game in my sig was a BP Project, which I then added C++ to.

          Comment


            #6
            I like to work in a double project environment. Where you have a c++ plugin containing all the games base class functionality and then have a blueprints only project that uses said plugin. This way you have the best of both worlds. you could have a blueprint only project that uses c++

            Don't get the express version get the community version. it's much much better. http://www.visualstudio.com/en-us/ne...munity-vs.aspx
            Last edited by SaxonRah; 12-05-2014, 09:58 PM.
            Youtube
            Machine Learning C++ Plugin
            Lindenmayer System C++ Plugin

            Comment


              #7
              Another thing to be wary of with C++ stuff though is code changes through engine upgrades. Usually stuff is deprecated rather than outright removed/changed, but sometimes you end up with build errors after an engine update. This isn't really a concern with content-only projects. Of course, you can go back into the source and fix those issues and it will build fine. It's just something to be aware of if you have a ton of code.

              My workflow is mostly in blueprints. I create C++ nodes when I need them for things the current nodes can't do. At the end of the project when it's ready to wrap, I tend to convert everything over to C++ just because I want to get as much speed as possible (and code is kind of like porn for me). I don't write in code first because compile times aren't good enough yet to allow for that kind of alchemy. BP for prototyping and getting your ducks in a row, C++ for what blueprints can't do and for shipping.
              iTween For UE4
              Procedural pathed animation for actors, components & UMG - $0
              Runtime DataTable
              DataTables dynamically loaded from text or Google Sheets while your game is running!
              easyCSV
              Fast, cheap, and accurate CSV parsing at runtime!

              Comment


                #8
                Aside from from the fact that you have to compile from time to time, it's hard to me to think of, of any particular disadvantages.

                I personally work mainly in C++ (when making actual game ;p). Sometimes I tend to quickly sketch some ideas in blueprint (especially for UI stuff with UMG) or some quick tests with traces.

                But usually I tend to setup underlaying logic in C++, and then expose it in reasonable manner to editor. Just note on this. If you expect to expose more complicated functionality than property editing (and even then), you will NEED to extend editor, with various things, like custom BP nodes (nodes, not functions), details customizations, property customization, maybe even roll out custom editor for something particularly complex.

                But it's worth time ten fold. Once you have nice tools, you can quickly iterate over game mechanics without touching code and recompiling anything.
                https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

                Comment


                  #9
                  Originally posted by Jared Therriault View Post
                  Another thing to be wary of with C++ stuff though is code changes through engine upgrades. Usually stuff is deprecated rather than outright removed/changed, but sometimes you end up with build errors after an engine update.
                  Does this only apply to my own C++ code additions? Or is it also a problem if I never end up changing C++ code and stick with blueprints all the way? (I'll start from an empty C++ project, no templates!)

                  Thanks everyone for all the advice!

                  Comment


                    #10
                    Originally posted by XilenceX View Post
                    Does this only apply to my own C++ code additions? Or is it also a problem if I never end up changing C++ code and stick with blueprints all the way? (I'll start from an empty C++ project, no templates!)

                    Thanks everyone for all the advice!
                    It applies to all code projects, but the likelihood of something low-level enough breaking so that it borks empty code projects is very slim. You should never experience any deprecation problems if you don't add any more code to an empty code project but it's possible. And even then, why would you start with a code project if you don't add any code?
                    iTween For UE4
                    Procedural pathed animation for actors, components & UMG - $0
                    Runtime DataTable
                    DataTables dynamically loaded from text or Google Sheets while your game is running!
                    easyCSV
                    Fast, cheap, and accurate CSV parsing at runtime!

                    Comment


                      #11
                      On this topic, as a beginner, the thing that is confusing me is:
                      What is the actual difference between a C++ project and a blueprint project?

                      If I start with a blueprint project, I am taken directly to the editor and can create blueprints. But I can also use "Add code to project" to write C++ code.
                      If I start with a C++ project, I get a Visual Studio project. As soon as I build it, I am right back in the editor and can create blueprints, etc.

                      The only meaningful difference I've encountered, so far, is that the C++ project has the extra step of having to actually build the editor before running it. My guess is that I really only need a C++ project if I plan to be modifying the engine/editor code?
                      Level 17 The Ladon Device

                      Comment


                        #12
                        Originally posted by Pat-Level17 View Post
                        The only meaningful difference I've encountered, so far, is that the C++ project has the extra step of having to actually build the editor before running it. My guess is that I really only need a C++ project if I plan to be modifying the engine/editor code?
                        C++ projects let you program character classes, items, everything. You can then create blueprints which extend Actor c++ classes very easily in the editor. Running the VS project opens the project in the editor and loads the c++ code.

                        Blueprint-only projects are opened in the editor without any custom code, and you use Blueprints to access all of the functions. (To me, coding game logic is much easier, more flexible/maintenance free, and less cluttered in c++)

                        From my own experience I've been able to just copy .uasset files (models, blueprints) over to different projects (c++ code would not be "active"), and in future I'll create a new c++ project and copy things over. But the limitation is that this doesn't seem to work for things like vehicles, so I might have to recreate these things manually.

                        In earlier versions with c++ projects the editor had sometimes broken my .uproject file and I couldn't generate the code again, so now I make backups as much as possible.
                        Last edited by xXxFishAndChipsxXx; 12-15-2014, 04:34 PM.

                        Comment


                          #13
                          Originally posted by xXxFishAndChipsxXx View Post
                          C++ projects let you program character classes, items, everything.
                          ...
                          Blueprint-only projects are opened in the editor without any custom code, and you use Blueprints to access all of the functions.
                          Ok, thanks, but then what does "Add code to project" do in a blueprint project?
                          Level 17 The Ladon Device

                          Comment


                            #14
                            Originally posted by Pat-Level17 View Post
                            Ok, thanks, but then what does "Add code to project" do in a blueprint project?
                            Nothing, in my experience. I mean, it will actually add code and you can write C++, but that code won't impact your game.

                            I'm not sure if this is intended, but adding code to a content-only project does not make it a code project. Code placed in its source folder does not add or change game functionality and hot compile is not available. The only way I've found to change this is to start a new code-based project and copy over the content folder from the content-only project, then set your preferences up again.

                            One reason I think this may be intentional is because code-based projects won't build for iOS from Windows, so it may be a way of just locking out code-creep so that those projects will cook. Why I think it might NOT be intentional is that it didn't used to be this way - I've added code to content projects before and added functionality, but that was versions ago. Now it doesn't work like that. Also, no developer has explicitly stated that this is the intention as far as I know.
                            iTween For UE4
                            Procedural pathed animation for actors, components & UMG - $0
                            Runtime DataTable
                            DataTables dynamically loaded from text or Google Sheets while your game is running!
                            easyCSV
                            Fast, cheap, and accurate CSV parsing at runtime!

                            Comment


                              #15
                              Ah, thanks, Jared. That makes a lot more sense now. Is it common to build code "outside" the project? For example, maybe to make a DLL? I'm asking just because the whole build process is pretty painfully long when building the whole project/engine/editor/whatever. This might be because I'm using Visual Studio Express and not "Community," which I've seen recommended here in the forum.
                              Level 17 The Ladon Device

                              Comment

                              Working...
                              X