Announcement

Collapse
No announcement yet.

Why C++ for Unreal 4?

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

    Originally posted by smallB View Post
    If you know C++ well you don't have problems with reading nor reasoning what code does. But if you don't then you don't.
    Even if you know C++ very well, reasoning about C++ isn't easy. Consider this simple statement:
    a = b + c;
    In order to know what that does, you need to know:
    -the types of a, b and c
    -how + is defined for b and c
    -how = is defined for the result of + and a

    C++ is a wonderful language. It is also a wonderful collection of guns aimed squarely at the user's feet.

    C# maybe has its uses but not in gaming industry where performance is at premium.
    Anything you can do (in C#) I can do better (in C++). And at least 200% faster. At least.
    It's this kind of blanket assessment that I am allergic too. No, C# isn't useless in the gaming industry, or in creating game engines; It's a perfectly valid tool to implement the bits of your game in that aren't your main physics or render loops. In gameplay programming, the extra nanoseconds you get from doing it in C++ just aren't that important.

    Also, be wary of using hyperbole. No, you can't do "anything" 200% faster. That's ********, and you know it. You can do some things dramatically faster, yes. Others, you can do a little bit faster. The areas where you can profitably use C#/.NET in an engine fall squarely in that latter category, and the minuscule performance gains aren't necessarily worth it if it means that the person implementing the stuff has to keep all the little caveats and pitfalls of C++ in mind while implementing.

    Comment


      Originally posted by The_E View Post
      In order to know what that does, you need to know:
      -the types of a, b and c
      -how + is defined for b and c
      -how = is defined for the result of + and a
      Actually it's just:
      1. Learning the api - no matter what language you use
      2. If the code is well written then it should be obvious what + does, and names should point you to the type at once. If you are a good c++ coder, and you use good c++ code, your example isn't an issue.

      Comment


        Originally posted by Cube2222 View Post
        Actually it's just:
        1. Learning the api - no matter what language you use
        2. If the code is well written then it should be obvious what + does, and names should point you to the type at once. If you are a good c++ coder, and you use good c++ code, your example isn't an issue.
        I completely agree! But good code, especially good code in game projects, is the exception, not the norm; 6 years of working on an old game engine has taught me that much.

        Comment


          Originally posted by The_E View Post
          No, you can't do "anything" 200% faster. That's ********, and you know it.
          No, it is not a ********. It is proven time over time over time that C# is at least two times slower than C++ and that is best case scenario. Worst case scenario is close to 10 times which gives:
          a) Best case scenario 200% slower so when you say "Others, you can do a little bit faster" is at best you can be 200% slower using C# and that is best what you can get and there is simply no way that you will do better.
          b) Worst case scenario 1000% slower

          Why on a God's earth I would want that if I can use C++? Why?
          C++ gives you:
          a) Portability
          b) Performance
          c) Level of abstraction IDENTICAL to C# so those dudes who claim that they cannot write high enough code in C++ are simply weak programmers, that's all.

          C# on the other hand takes everything above from you and is NOWHERE as expressive as C++.
          In view of that why would I want to use it? Now you tell me.

          Comment


            I think it is amusing how some are bashing C#, considering how languages just like it (and Java) were invented for the very reason to illeviate the headaches of C++. Producitivity is worth more than performance - even Tim Sweeney himself has said so.

            Not that performance is a huge problem anymore, considering how technology compiling byte code to machine code equally fast as C++ is maturing and making its way into the pipeline of development tools.

            Comment


              Originally posted by DancingPeasant View Post

              ... technology compiling byte code to machine code equally fast as C++ is maturing and making its way into the pipeline of development tools.
              Any chance to actually support this with some reliable data? Because I know for a fact and I've provided link to research done by Google, that Java is at best 370% slower than C++ and at worse 1260%. Why would I want that?
              Also C# nor Java for that matter DO NOT INCREASE productivity and that has been proven too.
              So please provide some data to support your opinion.
              Originally posted by DancingPeasant View Post
              Producitivity is worth more than performance - even Tim Sweeney himself has said so.
              Tend to disagree with him on that one. There is little point in producing whole lot of software which performs poorly.
              Another point I'd like to make is that QUALITY should be the ultimate factor and C++ gives you better quality of virtually everything:
              1. Expressiveness
              2. Performance
              3. Gaming experience due to the performance etc.
              Last edited by smallB; 08-26-2014, 05:42 AM.

              Comment


                The only hard part about using C++ is manual memory managment. Explicit memory managment is where most people get WTF sign and give up.

                And for that matter UE4 solves this problem. As long as you are using UPROPERTY() or TWeakObjectPtr, you don't need to understand what memory is, really.

                The only harder part is when you are going to extend engine, editor or write UI using Slate. As there even using smart pointers you still have to think a bit about managing memory.
                https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

                Comment


                  Originally posted by smallB View Post
                  Any chance to actually support this with some reliable data? Because I know for a fact and I've provided link to research done by Google, that Java is at best 370% slower than C++ and at worse 1260%. Why would I want that?
                  And UnrealScript was how many times slower? 10? Why would you want that? Productivity.

                  Unity demoed some of the upcoming technology in Unity5 called IL2CPP:

                  https://www.youtube.com/watch?v=5RZBxGexCuk#1h12m39s

                  Also some JIT paper I found (not same as above, which is AOT):
                  https://www.itu.dk/people/sestoft/pa...erformance.pdf

                  Originally posted by smallB View Post
                  Also C# nor Java for that matter DO NOT INCREASE productivity and that has been proven too.
                  So please provide some data to support your opinion.
                  Ok, we might just as well stop discussing here if you truly believe this. C++ development by its very nature is more prone to bugs because of free memory access. Some bugs are ridiculously hard to near impossible to debug and find if the memory is being corrupted by write violations.

                  Comment


                    Originally posted by DancingPeasant View Post
                    And UnrealScript was how many times slower? 10? Why would you want that? Productivity.
                    Not productivity but for people who otherwise wouldn't have chance to create anything because they simply are unable to program uscript was invented so they can pretend that they can do some programming.

                    Comment


                      @DancingPeasant
                      Every time I work with software written in managed code it seems sluggish. Visual Studio is best example of this. Virtually unusable for a large code base like UE4.

                      Comment


                        Originally posted by smallB View Post
                        Not productivity but for people who otherwise wouldn't have chance to create anything because they simply are unable to program uscript was invented so they can pretend that they can do some programming.
                        Thanks for confirming your ignorance. No further discussion required.

                        Comment


                          Originally posted by smallB View Post
                          @DancingPeasant
                          Every time I work with software written in managed code it seems sluggish. Visual Studio is best example of this. Virtually unusable for a large code base like UE4.
                          Well, do you know of an alternative IDE that can do the things VS does as well as VS does that is faster for exceptionally large projects like UE4?

                          Comment


                            Originally posted by The_E View Post
                            Well, do you know of an alternative IDE that can do the things VS does as well as VS does that is faster for exceptionally large projects like UE4?
                            Qt is much better than VS virtually in everything. Written in C++ of course that's why its performance is superb.

                            Comment


                              Originally posted by smallB View Post
                              Qt is much better than VS virtually in everything. Written in C++ of course that's why its performance is superb.
                              Qt is an IDE? Awesome! Where can I get it?

                              That was a joke.

                              "These tools are better than that thing built with other tools" is a strange statement. I'm not disagreeing with the sentiment that VS would have better performance if it had been built with Qt instead of the .NET Framework. I'm objecting to the weird statement used to express this sentiment.

                              Honestly, this thread has gone on way too long. The choice was made, the deed is done, if you really want a scripting language then add it and move on.

                              Comment


                                Originally posted by smallB View Post
                                Any chance to actually support this with some reliable data? Because I know for a fact and I've provided link to research done by Google, that Java is at best 370% slower than C++ and at worse 1260%. Why would I want that?
                                Also C# nor Java for that matter DO NOT INCREASE productivity and that has been proven too.
                                So please provide some data to support your opinion.


                                Tend to disagree with him on that one. There is little point in producing whole lot of software which performs poorly.
                                Another point I'd like to make is that QUALITY should be the ultimate factor and C++ gives you better quality of virtually everything:
                                1. Expressiveness
                                2. Performance
                                3. Gaming experience due to the performance etc.
                                Don't really want to be the guy to defend Java, but in most cases code performance in business applications (and that's what Java is primarlirly used for) is irrelevant. Bottle necks are mostly databases or network traffic. These numbers just don't hold up in the real world where code mostly just queries databases.

                                Of course nobody is going to write a AAA game engine in Java.

                                Comment

                                Working...
                                X