Hi people, <div>I am a game developer (using C++ and various other languages), I stop by sometimes to see how D and it's community evolves.</div><div>I was reading this interesting (but a bit depressing) thread and I mus just point something for new programmers not knowing a lot about game development:<br>
<br><div class="gmail_quote">On Sat, Aug 4, 2012 at 5:11 AM, Kapps <span dir="ltr"><<a href="mailto:opantm2+spam@gmail.com" target="_blank">opantm2+spam@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
C++ is a terrible language to make a game in.<br></blockquote><div><br></div><div>Wrong. It's the best approximation available of something that gives low and high abstractions and still let us do anything we want if we ask to (I mean, very specific optimizations that should never be in a some generic code). Also, it's the only one letting us code for undefined yet platforms with the less frictions for portability - other than code architecture that have to match with the (console) hardware too.</div>
<div><br></div><div>D could do this too, but apparently it's not there yet. I hope it will. I see some excellent features there.</div><div><br></div><div>Also</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
-Unmaintainable code<br></blockquote><div>This is a team issue, not a programming language issue. I don't have unmaintainable code and as said someone famous around here if you work in a company that have such kind of code "contact headhunters".</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Template bloat everywhere<br></blockquote><div><br></div><div>In game-specific code, it is not very common to use template heavily, so this is wrong.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

-No garbage collection, inevitably causing memory leaks<br></blockquote><div><br></div><div>You apparently know nothing about "modern" C++. This is wrong.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

-Due to no garbage collection, higher overhead passing references around with smart pointers.<br></blockquote><div><br></div><div>One don't imply the other. Different tools, different use. Smart pointers don't replace garbage collection. there is just less a need for it in C++.</div>
<div>In games, in particular, you don't want garbage collection, because there is no way to guarantee performance.<br></div><div>For example, lot of C# based games have uncontrollable hics because of garbage collector.</div>
<div>From what I understand, but i'm not a specialist, it is impossible to avoid this with a garbage collector. I suppose it is one reason why D allow non-managed objects too.</div><div>This kind of problem can kill a game experience. It greatly depends on the game though. </div>
<div>The best thing for a game programmer, is to rely on RAII. C++ have RAII, (as D, from what I understand), so it is very good for games.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

-Difficult to code cross platform for.<br></blockquote><div><br></div><div>Wrong. Also, what is the difference with D on this point? The only thing I could see is that D have a bigger standard library...but it's not clear to me if it is "standard".</div>
<div>Anyway wrong.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Disappointing lack in standard library<br></blockquote><div><br></div><div>That is not a problem for video games. It was a problem when there was no standard container.</div><div>Most of what you want from the standard library for video games are very generic stuffs: containers, sometimes threading, utilies.</div>
<div>Most of C++11 libraries are useful for games, but the most important libraries you use in games are domain-specific.</div><div>For example, graphic rendering (not just OpenGL, I mean, the layer above it, to manage scene graphs or whatever is higher abstractions of graphic rendering),</div>
<div>input acquisition (hard to make generic when your input devices are not "standard"...), audio rendering, etc.</div><div> </div><div>So, wrong.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

-Confusing build system supporting portability issues.<br></blockquote><div><br></div><div>I'm not sure what you mean here. I think you might point to the fact that there is no associated build system to the language.</div>
<div>I think it is a good thing. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Different features supported by different compilers, even in different ways.<br></blockquote><div><br></div><div>Less true today but it might have been true 10 years ago.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

-Features that may result in your engine giving undefined behaviour everywhere.<br></blockquote><div><br></div><div>I don't see the point.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

-Many features are not implemented yet, let alone widespread.<br></blockquote><div><br></div><div>You mean in C++11? Yeah, it have been only 1 year since the standardisation. Also, D is apparently in the same case without having any standardisation process.</div>
<div>Building a language and making it real is no easy task.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Threading is not part of the language, when games now-a-days tend to be heavily multithreaded for maximum performance.<br></blockquote><div><br></div><div>In C++11 it is. Boost provide it. In fact there is tons of libraries for it.</div>
<div>However I agree that a standardized task scheduler interface would be great.</div><div>But the point is: multithreded maximum performance is not really interesting in most games.</div><div>For example I am planning several projects right now. On 6 projects, only  1 would benefit from multithreading.</div>
<div>Rendering libraries are already using multithreading so the game code is not always necessary to use it.<br>On some consoles it is necesary to use it, because of the architecture of the console, but then the console provider provides the console-specific library. </div>
<div>It's better if you use a standardized library though, but it's here now.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
C# is a terrible language to make a game in.<br></blockquote><div><br></div><div>No, it is good for a lot of kinds of games. I'm playing Fez these days, it is very good and would have been hard to make by only 2 people (1programmer) with C++, without really high knowledge of C++.</div>
<div>It have sometimes slowdowns ans hiccups, but the game itself don't suffer from that because it's not a high speed action game.</div><div>Not all games require full power of the machine.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
-Can be difficult to interop with C/C++ libraries.<br></blockquote><div><br></div><div>You rarely work directly with C/C++ libraries in C#, evne in games. Most C# gaming libraries abstract, hide their native parts in a way that makes you not bother about that.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Code can be decompiled easily and stolen, even obfuscated.<br></blockquote><div><br></div><div>Since when it is not possible in other languages? There are tons of native code applications cloned on Apple Store.</div><div>
 </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Bugs can be easily found and exploited due to IL code.<br></blockquote><div><br></div><div>Not on a gaming console. Anyway, that's not a real problem for a game. Most developers will say that if you want to aleterate your game experience, you're on your own.</div>
<div>If it is about multiplayer hacks, then whatever the language, it is the organization of your game communication that makes or breaks the possibility.</div><div>Language have nothing to do with this in games.</div><div>
I cannot say for other domains.</div><div><br></div><div>Also, consider that tons of developers use Javascript in games. Think about it. </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

-Does not compile to native code, so your game will have performance issues.<br></blockquote><div><br></div><div>Not all games require high performance. In games "there is no rule". Use what works. Tons of excellent C# games have been made.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Overhead when calling native code.</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Your game may not easily run on every platform.<br></blockquote><div><br></div><div>Obviously, that's why you should have preferred C++ if it was your goal. </div><div>Game developers are smart, they make decisions based on goals only.</div>
<div>They use C# for tools though. It's highly efficient to just build some nice tools in short time.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

-Different compilers (all two of them) support different parts of the language.<br></blockquote><div><br></div><div>I don't know, if I wanted to use different compilers for C# i would have used another language, like C++.</div>
<div>No point. </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Forces your userbase to install yet a second product for .NET runtime and/or Mono.</blockquote></div><br></div><div>Only if you are not up to date in Windows Xp, or you use Linux.<br><br>That said, then you might better bet on C++. </div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">I am currently developing a MMORPG, client part is in c++ and<br>
</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">server in c#, i want to know if D language is "ok" for the client<br></span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">side ?</span></blockquote>
<div> </div><div>First you need to consider two properties of your game:</div><div> 1. does it's code have to be maintained in years?</div><div> 2. do you have time/budget to deal with issues that might occure from D not-yet-finished developpement?<br>
<br>A game that have to be maintained for years have better to stick with a stable version of it's tools.</div><div>If you have time to deal with changing the tools or fixing problems related to them, then why not experiment?</div>
<div>The problem is that it have a cost. In classic game industry, the costs are too high so there is no point in changing the tools when it can only add instability (from a end-user point of view, not from a programmer point of  view). </div>
<div>However, the indie scene is full of people in position to "just try". Not everybody however.</div><div>For example, I cannot bet on D right now even if I really think it would be nice in theory, because I cannot afford to deal with problems coming from it's implementation (maybe for future games though).</div>
<div>However, once stability is complete (on both compiler and standard library), at least with a fixed version I could use it IF there would be at least graphic and audio rendering engines available. If not I would have to do extra work I don't really have the time to deal with so it would be required for me (I said the same in another thread).<br>
<br></div><div>Anyway, I wish D gets to the point I can finally use it in real context. C++ is good enough for me right now though.</div><div><br></div><div>A game developer.</div><div><br></div><div>Joel Lamotte - Klaim</div>