Announcement

Collapse
No announcement yet.

Why C++ for Unreal 4?

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

    Originally posted by Tarantula View Post
    He meant that new versions of VS are .NET applications and now it is much slower (intellisense...) and uses much more CPU and RAM compared to VS 2008 that was a C++ app.
    That's completely negligible considering the improvements and advancements in hardware over the years. There are also options I believe that you can just turn those things off if they are making your experience less productive. There have been serious advancements to Visual Studios performance more within the past 5 years and all the integration of using a hybrid of managed and unmanaged code for the IDE only greatly improved its feature-set with things like Intellisense, IntelliTrace, built-in perf analysis and managed profiling, etc. In order to support the growing enhancements in other frameworks and languages out there, it was a conscious decision that had to be made on their part to make VS a much more robust toolset.

    Originally posted by Tarantula View Post
    ... The last place you want to be as a programmer (with a future). In the (big) business world it is mostly Java except in the USA where MS used their money to promote C# (paying schools and giving "good" deals to companies). And Java wins any benchmarks I know (by a wide margin).
    I don't agree with this one at all its just wrong. C# is definitely going to be around for at least the next 20-30 years so anyone who invests in it isn't wasting their time by any means. An no, Java isn't more widely used in the "Big" business world as you think. Over the past couple years, I spent time working as a Senior Developer for 20th Century Fox and recently doing more Senior Development for another company creating apps and technology for companies like Microsoft and Disney. I won't name the specifics but they were very big projects for very big companies and guess what.... all C# w/ a pinch of C++ at times and not a lick of Java in sight

    Originally posted by Tarantula View Post
    But for game scripting there are better alternatives (LUA, AngelScript, Python,...). I did my own engine coding in C++, but still added a scripting layer. It's about productivity, use the right tool for each job.

    I'm sure many AAA epic customers still add a scripting layer. You don't do all gameplay logic in the scripting layer, but for certain event based (so not per frame) things it is just more productive to have that layer.

    It is smart of epic to not add a scripting layer, because everyone prefers another scripting language. And with the C++ API many different bindings will be created by the users anyway.
    That's in the Eye of the Beholder. In regards to LUA, AngelScript, Python, C# to many is a much more powerful language and even though you can use it as a scripting language in things like Mono, at its core its a powerful language. It simply depends on the developer. But IMHO, I'm against having real-time scripting as it can limit how far you can push the envelope in what you are doing. Blueprints on the other hand completely negate the need for a scripting language as its not only easier than learning one but gets precompiled so you end up with the best of both worlds of ease-of-use/productivity and bleeding-edge performance.
    Last edited by MC Stryker; 05-02-2014, 05:52 PM.

    Comment


      The lack of a scripting language is a concern for me because I'm developing a strategy game and having a fairly extensive modding system is a must-have in my opinion. That means exposing a programming interface that is friendly to novice programmers. Blueprint is not an option because, if I understand correctly, you need the Unreal Engine SDK to use the Blueprint editor, and I'm not going to make people shell out $19 just to make a mod.

      Of course, I don't necessarily have to expose any direct UE calls in the modding interface anyway, and nothing prevents me from simply embedding (say) the Python interpreter. But I'll admit it'd have been nice to have something I could use out of the box.


      Originally posted by smallB View Post
      The performance of C++ will always beat C# or Java. And yes, you can write **** in any language but **** written in C++ will always be faster than **** written in C#/Java.
      This will probably be entirely irrelevant for 90% of the people here. I have written an entire game in Python, engine and all, that ran at hundreds of FPS on my old computer from 2006, to say nothing of today's computers. I will grant that it was a simple sprite-based game and not some fancy AAA first-person shooter, but I'd wager more people here are making something closer to the former than the latter. The game I'm working on now will have a high budget by indie standards (I'll need to raise at least $100k), but it will most certainly not be AAA. I'll probably be lucky enough if it's even one A.

      Also, remember that 90% of the time will be spent in 10% of the code. If your code is too slow, and if it is due to your choice of language and not your algorithm, you still have the freedom to rewrite that bit in C++ at that time.


      Originally posted by smallB
      I genuinely don't want to hear about python, javascript, java nor c# where games (AAA games) are involved.
      In other words, "La la la la la I'm not listening!"

      You said AAA games can't afford scripting languages. Somebody pointed out a counterexample. Now you're burying your head in the sand in the hopes the threat to your little worldview will go away. This means you have lost the argument.


      Originally posted by vblanco View Post
      I dont think C++ is THAT complicated, after all i learn the basics in a week without prior knowledge.
      C++ is a language of deceptive complexity, and my experience is, the more of it you know, the scarier it is. I have known and used C++ (albeit not constantly) for about 15 years and I would consider myself an intermediate C++ programmer at best, whereas I'd consider myself an advanced Python programmer (possibly even an "expert", but certainly not a "wizard") even though I'm not sure I've used Python more than C++. For example, I still have no idea what the hell C++'s .* and ->* operators are for. I've looked them up before, and I could do it again, but I'd just forget again because I simply have not come across a case where I'd use them. Also, if I look through the code that makes up, say, the Boost library, I might as well be reading Greek. I do have a basic understanding of templates and I use them myself when I find them appropriate, but that stuff still goes way, way beyond my understanding. By contrast, I could probably understand all the code in any well-written Python module.

      I am far from a unique case. I'd wager at least 90% of C++ programmers with at least five years' experience cannot understand the code in Boost.


      Originally posted by Tim Sweeney View Post
      The first three generations of the Unreal Engine included a sandboxed scripting language, UnrealScript, which provided a simple interface for gameplay programming that was shielded from the complexity of the C++ engine.

      The scripting approach is very welcoming to new programmers, but eventually it breaks down and becomes an obstacle to innovation and shipping. We experienced this over time as the Unreal Engine grew until finally, in 2011, we moved to a pure C++ architecture. The causative factors were both pervasive and general:

      - As an engine and its community grows, there is increasing pressure to expose more of the its native C++ features to the scripting environment. What starts out as a sandbox full of toys eventually grows into a desert of complexity and duplication.

      - As the script interface expands, there is a seemingly exponential increase in the cost and complexity of its interoperability or "interop" layer where C++ and script code communicate through a multi-language interface for calling functions and marshaling data. Interop becomes very tricky for advanced data types such as containers where standard scripting-language idioms differ greatly in representation and semantics from their templated C++ counterparts.

      - Developers seeking to take advantage of the engine's native C++ features end up dividing their code unnaturally between the script world and the C++ world, with significant development time lost in this Interop Hell.

      - Developers need to look at program behavior holistically, but quickly find that script debugging tools and C++ debugging tools are separate and incompatible. Seeing where script code had gone wrong is of little value if you can't trace the C++ that code led to it, and vice-versa.

      It is these reasons, ultimately, that led to Epic's move to pure C++. And the benefits are numerous: UE4 is a unified and fully-debuggable code base, freed from Interop Hell and totally open to programmers to study, modify, and extend. There are side-benefits, too, such as increased performance in gameplay code, and ease of integrating other middleware written in C++.

      Building Unreal Engine 4 as a unified C++ codebase has been very freeing, giving engine and gameplay programmers enormous flexibility to write code without unnecessary interop barriers.

      This isn't to say that C++ is the ideal language for simple gameplay code. It is more complex and more dangerous than UnrealScript, C#, and JavaScript. But that is another way of saying that it's more powerful.

      By making peace with complexity and writing code in C++, there is absolutely no limit to what you can accomplish, whether it involves debugging your entire codebase in-context, interfacing to low-level engine systems, modifying them, or talking to the operating system or advanced third-party libraries.
      These are all very good points, of course, but why doesn't the same logic apply to Blueprint? What makes it so different?
      Last edited by furrykef; 05-14-2014, 06:31 PM.

      Comment


        Originally posted by furrykef View Post
        The lack of a scripting language is a concern for me because I'm developing a strategy game and having a fairly extensive modding system is a must-have in my opinion. That means exposing a programming interface that is friendly to novice programmers. Blueprint is not an option because, if I understand correctly, you need the Unreal Engine SDK to use the Blueprint editor, and I'm not going to make people shell out $19 just to make a mod.
        You really should make them pay the $19.

        Tim Sweeney, Mark Rein, and all the folks whose lives are built around the Unreal Engine deserves your love and support.

        Additionally, people should have to pay even MORE to use C++ or any scripting language, but Unreal Engine and Tim Sweeney are giving you and everyone the gift of a Lifetime for $19.


        Consider being grateful for the amazing gift you are being given, and recognizing that $19 is a smaller amount of money than its ever been before (it's not 2006 anymore).

        If people don't want to pay the $19 then they can only use the tools you develop yourself.

        ~~~

        My Own Solution

        I've written my own entire in-game editor to allow people to make maps for my game without having the UE4 Editor. The maps people can make use all my game's assets.

        The scripting system used in my in-game editor is my very own 3d scripting system that I wrote from scratch (seen in video below).

        I also wrote my own graphical AI scripting system so people can customize the AI without having any programming experience.

        To add new assets and code to my game, people would need to get the $19 amazing Gift called UE4.

        It's called being fair to Epic


        Video of In-Game Editor, with 3d scripting, entirely coded by me in C++






        ~~~

        Your Options:

        1. Do the work like me to make your own In-game Editor / scripting system

        2. Or make people pay the $19 for the Lifetime of Work of all the people at Epic.

        3. The most likely scenario for all of us UE4 developers is some combination of 1 and 2.


        The largest set of modding features will only ever be available to people who obtain the UE4 license.

        The Unreal Engine is after all, one big Engine that you modify (Thank You Epic!)

        So pay for the best and enjoy it

        Rama
        Last edited by Rama; 05-14-2014, 07:24 PM.
        100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

        UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

        Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

        Comment


          Do. Or do not. Why all the cry?

          Comment


            Originally posted by Rama View Post
            You really should make them pay the $19.

            Tim Sweeney, Mark Rein, and all the folks whose lives are built around the Unreal Engine deserves your love and support.

            Additionally, people should have to pay even MORE to use C++ or any scripting language, but Unreal Engine and Tim Sweeney are giving you and everyone the gift of a Lifetime for $19.
            You're assuming they would actually pay the $19. Most people would either go, "Oh, I have to pay money? Never mind", or they will pirate it. Nobody wins in either scenario. The way I see it, requiring this would only serve to reduce the number of mods made for my game, and therefore the value of my game. I was talking to MooglyGuy (he works on Minecraft at Mojang) about what language I should use for scripting and mentioned I was strongly considering Dylan for its macro system, but I wasn't sure what value those macros would bring to modders. His response could be summarized as "None." -- using Dylan instead of Lua or Python would severely cut the number of modders because most wouldn't want to learn something new. If using Dylan instead of Python would be chopping down a few trees, then requiring a $19 SDK license would be burning the whole forest down.

            I don't buy the argument that allowing modders some access to the engine would be in some way unfair to Epic. It would still not be a substitute for having the SDK; people would be unable to distribute any mods, even total conversion mods, without requiring a copy of my game, thereby limiting the extent to which they can spread their creations; and people would still not be able to make any money off their mod without buying a license from Epic.

            As for developing one's own tools for modders, it must be nice to have that kind of time and/or money to spend. Unfortunately, I don't. I'm going to be facing a steep uphill climb even without having to spend man-months on modding tools.
            Last edited by furrykef; 05-14-2014, 10:39 PM.

            Comment


              Originally posted by furrykef View Post
              You're assuming they would actually pay the $19. Most people would either go, "Oh, I have to pay money? Never mind", or they will pirate it. Nobody wins in either scenario. The way I see it, requiring this would only serve to reduce the number of mods made for my game, and therefore the value of my game. I was talking to MooglyGuy (he works on Minecraft at Mojang) about what language I should use for scripting and mentioned I was strongly considering Dylan for its macro system, but I wasn't sure what value those macros would bring to modders. His response could be summarized as "None." -- using Dylan instead of Lua or Python would severely cut the number of modders because most wouldn't want to learn something new. If using Dylan instead of Python would be chopping down a few trees, then requiring a $19 SDK license would be burning the whole forest down.

              I don't buy the argument that allowing modders some access to the engine would be in some way unfair to Epic. It would still not be a substitute for having the SDK; people would be unable to distribute any mods, even total conversion mods, without a copy of my game, thereby limiting the extent to which they can spread their creations; and people would still not be able to make any money off their mod without buying a license from Epic.

              As for developing one's own tools for modders, it must be nice to have that kind of time and/or money to spend. Unfortunately, I don't. I'm going to be facing a steep uphill climb even without having to spend man-months on modding tools.
              I agree with this that most people aren't going to pay for the privilege of modding so that's not even worth considering if you're serious about making your game modable, you're gonna want to embed your own tools or scripting system.

              I strongly recommend taking a look at LuaJit. It's jitted lua on the fly, is super fast (almost as fast as compiled C) and has an incredibly easy to use dynamic binding to C/C++, you don't have to write any marshaling on the C++ side to use it. I'll probably use this for my own projects when I cross the same bridge. It would also probably only take a few hours to integrate it as a plugin or a game project, where-as with Mono you're looking at a much larger time investment when you think about actually deploying and bundling the mono runtime. Also, Lua is awesome if you like the dynamic typed languages.
              Last edited by zoid; 05-14-2014, 10:24 PM. Reason: spelling

              Comment


                @Rama, wow, that's pretty impressive! An editor within an editor I'm sure it was a lot of work though.

                But guys, they said that UT4 (definitely) and Fortnite (I think?) will have modding capabilities, so they will probably come up with an in-engine solution before too long.
                Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

                Comment


                  Originally posted by gregdumb View Post
                  @Rama, wow, that's pretty impressive! An editor within an editor I'm sure it was a lot of work though
                  Aww thanks!

                  Hee hee!



                  Rama
                  100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                  UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                  Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                  Comment


                    Also, let me add that you seem to be thinking of the question in the wrong terms. You were thinking that requiring the Unreal Engine SDK to mod the game is worth the $19 because of all the power of the Unreal Engine that gets unlocked. But that is not what a modder sees. A modder sees "$19 to mod this game", and that's it. Are there any games I would pay $19 to mod? There are few games I'd spend $19 on period. (Most of the games I buy are indie, old, or on sale. Often some combination of these.) I don't think there are any games I'd spend even $5 to mod. Even $1 would give me pause, when $0 would mean I could get started right away without committing to anything.

                    If you can't look at your game from a customer's point of view, then I don't understand how you can sell games.

                    Comment


                      Originally posted by furrykef View Post
                      A modder sees "$19 to mod this game", and that's it. Are there any games I would pay $19 to mod? .... I don't think there are any games I'd spend even $5 to mod. Even $1 would give me pause, when $0 would mean I could get started right away without committing to anything.
                      I'm just asking, but you've never bought a tool to mod with? I paid $20 for Milkshape years ago just to make some simple geometry for a game. Blender is more powerful but at the time Milkshape was just plain easier to use. Later I spent thousands on development tools just for a hobby - that ultimately landed me a nice job, I'll admit. My point here is that, while most won't lay out any cash to mod a game there are some people who will, for whatever reason. And most customers aren't buying a game to mod it, most are buying a game to play it. The number of modders is high enough that it should certainly be considered seriously, but one shouldn't assume that a choice like Rama has described was made without looking at it "from a customer's point of view."

                      As far as this raging debate goes, the engine was provided as is. If you want to add a scripting language, go for it. If you don't want to, then don't. Arguing over which language is better is pointless - I use several, each for different reasons. Like speaking, you should use the language that allows you to express yourself most appropriately for your purpose.

                      While we're at it perhaps we should ask "why English for the primary language of these forums?"
                      Last edited by VegasRich; 05-15-2014, 07:14 PM.

                      Comment


                        Originally posted by VegasRich View Post
                        As far as this raging debate goes, the engine was provided as is. If you want to add a scripting language, go for it. If you don't want to, then don't. Arguing over which language is better is pointless - I use several, each for different reasons. Like speaking, you should use the language that allows you to express yourself most appropriately for your purpose.
                        +1 to that, amen.

                        I know I'm a minority, and that it'd sure make my life easier if I could just stay with C#, but I see little point in complaining. Not like I don't have other choices, but I chose to relearn C++ for this, so...yeah. As far as the price of the engine goes...gee, I dunno, I think coming from the perspective of potentially making a game that has a slight chance of becoming my day job, I'd call that reasonable. Never once even thought about it's use for modding, so maybe ought to think on that...except, I dunno, something tells me that with the engine source out there and a great many still learning the system for themselves, it may not be long until somebody develops a modding extension for the marketplace. Would be kinda shocked if this turned out to be an impossible thing to plug into UE4.

                        But anyway, that's probably a topic for another thread. If UE4 ever came out with an update that allowed other languages/scripting, well by that time I'd know C++ in and out. So that's my take on it, much as I'd enjoy not having my brain catch fire every couple days in code here, it's rather beating a dead horse. Best thing we can do is just put the suggestion out there under the suggestion forum, or make a poll. That may speak greater volumes than the mods crawling through posts. (Forum moderation is a bear, I'm a fan of polls personally, no wall-o-texts)

                        Edit: Some might find this thread of interest, just stumbled on it myself: https://forums.unrealengine.com/show...ns-via-plugins
                        Last edited by timconwell; 05-15-2014, 08:20 PM.

                        Comment


                          In regards to plugins/mods... I hope to see the old way of people releasing mods for free and not getting any cash for their work get flushed down the toilet. Instead I want to see publishers (like Epic Games/Valve-TF2), embrace the idea of empowering the modding community to optionally sale their work. If you give your users the option to sale their work then they may have no problem tossing out $19. But if you want them to just mod your games for free- well, of course they probably won't go for it.

                          Looking forward to the new Unreal Tournament with a marketplace. This is a very exciting time for indies.

                          @Rama, you are a machine!

                          edit- And that being said- even though my opinion may differ drastically from some of the rest of you I still hope you can find an arrangement that will work for you. It is interesting, Unity Pro has the same issue. I see this topic popup quite often
                          Last edited by sandboxgod; 05-15-2014, 09:01 PM.
                          Godz for UT '99 / UT 2003

                          Comment


                            Originally posted by sandboxgod View Post
                            @Rama, you are a machine!
                            Hee heeee!





                            Rama
                            100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                            UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                            Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                            Comment


                              I bought UT99, UT2004, and UT3 just to make maps and mod them. Everyone in the community then did. It didn't stop people like myself buying a full priced game back then and $19 won't now.

                              Comment


                                Originally posted by VegasRich View Post
                                As far as this raging debate goes, the engine was provided as is. If you want to add a scripting language, go for it. If you don't want to, then don't. Arguing over which language is better is pointless - I use several, each for different reasons. Like speaking, you should use the language that allows you to express yourself most appropriately for your purpose.
                                Ofcorse, but problem discussed in this debate (which died off anyway) currently engine only provides programming via C++ and blueprint and there people for which C++ is terrifying and they can't used to graphical programming, not to mention Blueprint don't give 100% access to engines APIs. As they don't like C++ they can't implement scripting language themselves and they need to relay on others and they want to do things now. adding fact hat Unity spawned lot of C# programmers in indie community most C# become most demanded language, so it turned in to C++ vs C# debate even thru every one knows there few people working in community to implement it even with editor integration
                                =========
                                My Tutorials:
                                Basic knowledge about Classes and UObject environment and stuff like that

                                Comment

                                Working...
                                X