Announcement

Collapse
No announcement yet.

Why C++ for Unreal 4?

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

    Originally posted by NegInfinity View Post
    As for level of abstraction, C++ is as high level as C# if not higher level.
    Oh you. ╭(◔ ◡ ◔)/

    Comment


      Originally posted by smallB View Post
      @Sharpfish
      I am totally with you.
      C++ is the language to go for if you are interested in:
      a) performance
      b) flexibility
      c) power
      d) finesse
      e) beauty - yes! it is beautiful language which so much possibilities that no other (current) language can compare or even come close to.

      And may I just say that gaming industry is the industry where every "tick" matters and C++ is simply unbeatable where it comes to performance.
      If someone asks me why do I prefer C++ over anything else I simply reply:
      If I have a choice between ferrari and ford fiesta and the likes why on earth would I choose anything but ferrari?
      And just to post short disclaimer:
      I'm not a language zealot, fanatic or kid who thinks only the toy he has is best. I am not looking to start any kind of "language war". On the contrary. I programmed in many languages apart from C++: C#, Java, Javascript, AS2, AS3, you name it, and after using all those languages for some time and being able to compare them with C++ my conclusion is this:
      No modern language compares favorably to C++, in any respect really. C++ is the most powerful, the most flexible modern language, and now after getting updates and hard work from ISO commitee and new C++14 update on horizon and another major update foreseen for 2017 this is simply the language every professional game programmer should go for.

      dude, what have you been smoking? i gotta correct you here when you say: 'No modern language compares favorably to C++, in any respect really.'

      a notable early attempt was D, which compares favorably. but what compares even more favorably is Rust and how it improves on C++ by correcting the major flaws of C++, basically a badly mutated functional superset of C. Rust finally comes in to clean the house of all that garbage.

      don't believe me, read this: https://www.rust-lang.org and this: https://www.quora.com/What-do-C-C++-...-think-of-Rust

      and listen to what Rich Hickey (the creator of Clojure) has to say about C++: no time to find the youtube vid for you but here is a page where some of it is briefly summarized and why OOP sucks: http://www.flyingmachinestudios.com/...-hickeys-brain. rich is a guy who spent years using C/C++, Java, etc... so not some idiot off the street who doesn't know what he's talking about.


      and when you say: 'beauty - yes! it is beautiful language which so much possibilities that no other (current) language can compare or even come close to.'

      again i need to stop you right there and draw your attention back in time to John McCarthy and his creation of Lisp in the late 1950s (among many other things that fundamentally influenced the development of computer science and languages to this day): you speak of beauty--compare the elegance of Lisp and its modern-day incarnation as Clojure (http://clojure.org) to what IMHO is the sheer ugliness of C/C++ code.

      but beauty is in the eye of the beholder, of course. ;-) nonetheless, i write this in the hope that anyone reading this might see the time has come to move on to better and more elegant tools: Rust and Clojure.

      we would have been living in a much better compute world IMHO had coded been developed in Rust and Clojure instead of C/C++ and Java/C#.

      obviously, i don't want to start requoting 1,000s of pages you can easily find on the web and start a flame war about languages, but need to mention that there are plenty of other worthy efforts in addition to the 2 i mention: ML, OCaml, Haskell, Scala, ADA, Smalltalk, etc....

      as an aside, it sure would be nice to be able to use Python and/or Clojurescript in addition to Lua as a scripting language for UE. we live in a polyglot world--let's not restrict UE when so much more is achievable.

      Comment


        before we lose our senses, i urge the community here to read this:

        'Today's OOP languages - Ruby, Java, Python, etc. - are fundamentally flawed. They introduce accidental complexity by building on an inaccurate model of reality. Where they have explicit definitions for the following concepts, the definitions are wrong:

        Value
        State
        Identity
        Time
        Behavior'

        source: http://www.flyingmachinestudios.com/...hickeys-brain/

        Comment


          Just wanted to throw my hat into this conversation from a particular viewpoint: I'm a long time Unity user who's about to start exploring Unreal. I'm quite comfortable in C# and while I know some basics of C and C++ (I've taken a total of two university courses that cover these languages) I have a long way to go.

          So-
          Despite some hyperbolic opinions and occasionally over the top arguments, this thread has proven to be quite useful and I've enjoyed reading it. I learned quite a few things about C++ and C# that I was not previously aware of. People arguing over things is generally a good way to learn about those things if it is a civil argument, both sides want to prove their side is correct. This leads to them explaining what's good about their side and bad about the other. In a more succinct sense, this thread has gathered a lot of useful points about C++ and C# for me to go over.

          So thanks for arguing this out and discussing it. I'm gonna go read some links and start learning about smart pointers and unique pointers and the various tutorials that have been posted.

          Comment


            I am a professional C# developer and a long, long, long time hard core C++ guy. The last metrics I have read is that C# is comparable to Java (not javascript) in terms of speed and performance, on average bytecode languages tend to run about 10x slower than C++. This is sort of the price you pay for using a managed language. However that does not mean that Everything C# does is that slow, remember the key word is "average". Sometimes that metric may be closer to 1:5 or 1:2 and even 1:1, and also remember we are dealing with a handful of milliseconds so an operation that takes 5 milliseconds in C++ will take 5, or 10 to 50 milliseconds in C#. However even my Javascript now a days runs ridiculously fast, executing several operations at the rate of 1 millisecond and it's not even a bytecode compiled language, it's an interpreted language. So is C# viable as a game engine core, yes if your game is computationally light or medium (which is a bit subjective because what is Heavy today will be light in the future). Is C# viable as a scripting language when your engine is built on C++, absolutely. Is C# great for engine tools heck yeah. The same goes for a lot of other languages such as Javascript which has been becoming an increasingly popular choice.

            With all this noted I would also like to point out that Unreal Blueprints are Bytecode and have an execution time comparable to C# and Java. There have been quite a few games developed using just blueprints. Of course they have the a C++ core to back them up, but still it is something to note. And as a second note the Blueprints in the future maybe compiled to C++ code (if I heard that correctly).
            Last edited by ArcainOne; 06-03-2016, 01:16 PM.

            Comment


              Well, this came back from the dead...

              Comment


                Originally posted by ArcainOne View Post
                And as a second note the Blueprints in the future maybe compiled to C++ code (if I heard that correctly).
                For me, Blueprints' greatest offense isn't even the performance; it's how long and tedious it is to work with them compared to a scripting language, how limited in functionality they are, and how impractical they are to try to maintain and understand quickly. Also, one of the biggest reasons why I want a scripting language is to make editor tools, and it is often impossible to do that in blueprints

                I wish Epic just made a scripting language instead. One that is officially-supported, so that people wouldn't be afraid that the support for it could drop at any time.

                Ideally, I would still write most of my game systems in c++, but sometimes you just wanna make a quick script for editor tools or things that aren't very performance-critical. Scripts would be incredibly useful for that.
                Last edited by Philippe St-Amand; 06-03-2016, 03:03 PM.

                Comment


                  No, BP is the best thing!!!! Once you get into it, it's easier to pick up than scripting (especially for artists / designers).

                  Btw, this is the best C++ vs C# thread ever https://forums.unrealengine.com/show...oes-Epic-Games !!!

                  Comment


                    Originally posted by motorsep View Post
                    No, BP is the best thing!!!! Once you get into it, it's easier to pick up than scripting (especially for artists / designers).
                    No doubt BP seems like the best thing ever for artists, but for a programmer, blueprints are an immense downgrade compared to a proper scripting language.

                    There are plenty of things you cannot do in blueprints (or cannot do quickly and efficiently)
                    Last edited by Philippe St-Amand; 06-03-2016, 03:12 PM.

                    Comment


                      Originally posted by Philippe St-Amand View Post
                      No doubt BP seems like the best thing ever for artists, but for a programmer, blueprints are an immense downgrade compared to a proper scripting language
                      I doubt that - look at Epic's programmers. They use C++ in conjunction with BP to achieve their goal. If BP was that bad, Epic wouldn't even bother with it. However, BP is not a downgrade. Just different concept (visual vs text). You can do everything straight in C++ anyway.

                      Comment


                        Originally posted by motorsep View Post
                        I doubt that - look at Epic's programmers. They use C++ in conjunction with BP to achieve their goal. If BP was that bad, Epic wouldn't even bother with it. However, BP is not a downgrade. Just different concept (visual vs text). You can do everything straight in C++ anyway.
                        Epic uses BP because it's good way for programmers to make a bridge to artists and designers. It's also their main "marketing strategy" to appeal to the mostly-unexperienced masses (and I don't mean that in a derogative way). But it's not that great for programmers themselves, compared to scripting.

                        c++ works, but it's not always ideal. When you just want to make an editor tool (which is impossible in BP), or a quick script, you don't want to have to die of old age three times while waiting for intellisense to kick in, and for misidentified errors to disappear
                        Last edited by Philippe St-Amand; 06-03-2016, 03:41 PM.

                        Comment


                          BP was created as an artist tool, always helps to remember that.

                          I too find it pretty slow to work with at times compared to C++ but, I don't find C++ very slow to work with at all - and a scripting language is highly unlikely to speed up my workflow personally. If it's worth doing, it's probably worth doing right (/ the most MLG way possible)

                          Comment


                            You can doubt and speculate all you want. Because Blueprints can be backedup with an actual C++ code base you can build your entire game with blueprints, it's fast enough for most games and even AAA games can leverage them. Like or dislike of them is not a quantitative metric.

                            Since there are games built entirely out of Blueprints any argument about it being functionally limited is false, at least in terms of game systems. Where blueprints are limited is editor extension and plugin development as you must use C++ for that. My suggested workflow (and this is leveraged a lot other places) is your core is built in C++. Then your game play specifics are built in blueprints. For instance you should not build every item in your game in C++, just your base item, the rest are blueprints. You can also quickly prototype complicated behavior in Blueprints, then refactor it in C++. These are not new workflows, these are tried and tested patterns used for many many years in the software industry.

                            Can Blueprints become a cluttered jumble of lines and squiggles... Yes but programmers also have a similar problem "Spaghetti code" and it's not just a problem with "GoTo" statements. Interfaces and S.O.L.I.D. Principals and Design Patterns can also make Spaghetti code, but if used wisely they are powerful tools for re usability and maintainability. We have developed best practices over the years to reduce spaghetti code and the same needs to be true for Blueprints. Loving or Hating Blueprints is pretty much a personal opinion. I personally feel they have their place and need to be used responsibly and be well documented just like any set of code you write. Just as you can tell the rookie programmer by the mess of code he or she writes, so too can you tell the rookie UE4 user by the jumple of Blueprint Nodes and connectors he or she jumbles together.

                            But ultimately I am wrong, because the decision to use just blueprints or just C++ or the combination of both is a personal decision on your part as the developer of your game. If you hate Blueprints, don't use them. If you do not know C++, that does not mean your game will not be awesome or responsive. Wish you had a different scripting solution, there are a few of those out there including a Javascript scripting engine for UE4.

                            Finally I will apologize for lending my aid to the resurrection of this thread, I spotted it at the top of the list, and did not see there where 15 pages of postings to it before plotting down my thoughts on the original question. Live you learn.
                            Last edited by ArcainOne; 06-03-2016, 03:46 PM.

                            Comment


                              Originally posted by ArcainOne View Post
                              Since there are games built entirely out of Blueprints any argument about it being functionally limited is false
                              Would you say the fact that you can build a skyscraper with your bare hands nullifies all arguments that having tools and heavy machinery would be better?

                              Also, I didn't mention this before, but another gigantic problem of blueprints is that they take the spotlight waaaaay too often. Good luck trying to find good UE4 c++ tutorials. Every tutorial is always in blueprints, even for things that should never be made in blueprints in a serious game
                              Last edited by Philippe St-Amand; 06-03-2016, 03:47 PM.

                              Comment


                                Originally posted by Philippe St-Amand View Post
                                Would you say the fact that you can build a skyscraper with your bare hands nullifies all arguments that having tools and heavy machinery would be better?

                                Also, I didn't mention this before, but another gigantic problem of blueprints is that they take the spotlight waaaaay too often. Good luck trying to find good UE4 c++ tutorials. Every tutorial is always in blueprints, even for things that should never be made in blueprints in a serious game
                                I'm pretty sure that's a straw-man fallacy, since building a skyscraper has nothing to do with scripting languages. You may not be able to build a sky scraper with your bare hands... ever, you also can't build a pyramid or a tower of babble as all some form to toolage was used for those as well. But you can build a game with blueprints. Further more you are aruging for the sake of arguing since you did not debunk my statement.

                                Every tutorial is in blueprints, okay, so write them in C++. It's not that hard, and it's a workflow that is encouraged, hence Prototype in Blueprint, refactor in C++. Do you need to know how to program in C++, yes. Do you need to know how to program UE4 C++ (basic UCLASS, UPROPERY, etc) yes. Don't like them, don't use them. Obviously they are not for you, you are a programmer, go program. But do not tell people who are intrested in them that they are not good.

                                Comment

                                Working...
                                X