[Semi OT] Language for Game Development talk

Xavier Bigand via Digitalmars-d digitalmars-d at puremagic.com
Sat Oct 11 03:34:04 PDT 2014


Le 02/10/2014 08:22, Manu via Digitalmars-d a écrit :
> On 2 October 2014 00:16, bearophile via Digitalmars-d
> <digitalmars-d at puremagic.com> wrote:
>> Max Klyga:
>>
>>> https://www.youtube.com/watch?v=TH9VCN6UkyQ
>>
>>
>> A third talk (from another person) about related matters:
>> https://www.youtube.com/watch?v=rX0ItVEVjHc
>>
>> He doesn't use RTTI, exceptions, multiple inheritance, STL, templates, and
>> lot of other C++ stuff. On the other hand he writes data-oriented code
>> manually, the compiler and language give him only very limited help, and the
>> code he writes looks twiddly and bug-prone. So why aren't they designing a
>> language without most of the C++ stuff they don't use, but with features
>> that help them write the data-oriented code they need?
>
> Most gamedev's aren't quite as staunch as Mike Acton. The principle is
> there, ingrained in every gamedev, but that doesn't mean we all love
> flat C (although lots of us do!).
>
> I've never used RTTI, I've never used exceptions, certainly never use
> multiple inheritance, I rarely use templates (in C++)... but I'm still
> attracted to D!?
> I often find this strange... but not really. In D, I still don't use
> RTTI, I still don't use exceptions, I tend to box use of templates
> into their own worlds, so I would never use them pervasively (like
> phobos).
> You'll notice at one point that he talked about using offline text
> processing tools to do codegen... this is basically because C's
> preprocessor sucks, and C++ templates suck. D templates have proven to
> eliminate a lot of those offline tools for me. The code is kept in the
> same place, and built using the same tool.
> I suspect even Acton would appreciate features like CTFE.
> You'll also notice he made repeated reference to build environment
> complexity and build times.
> D also offers potential compiler advantages, purity, immutable, etc,
> which give the optimiser information which it can use to improve
> codegen which is awkward in C/C++.
>

For the application I am working on the 3D developer wrote everything in 
c++ style, but he made a lot of mistakes that killing performances.
We are far away cache miss issues (or polymorphism,...), and more in 
instancing ones. Last week I removed allocation and deallocation of 
meshes made in the sort for transparent models. new and delete aren't 
the main problem, it was the code in constructors and destructors that 
made heavy use of vectors.
Things like vector.erase(vector.find("boo"));

One my PC (a gamer one) I just win 20FPS from 10 to 30. For a scene of 
700 objects (< 50 000 triangles). YEP this is really bad for my i7 and 
my 670GTX. I have a lot of work to do, normally on my PC for a such 
scene I can expect much more than 200 FPS.

This is just one of our performances issues, and for me it's not due to 
only C++ OOP. It's about experience. I had never worked on games or 
applications need a level of optimization impose me SOA design but 
reusing chunk of memories and avoiding unnecessary computations are 
always things I carry on.

For those are interested to see more about the application :
https://groups.google.com/forum/#!forum/home-design-3d-beta

This is also the one that inspired me and my friend for DQuick.


More information about the Digitalmars-d mailing list