[OT] Previously: DMD - Windows -> C# in gamedev

Peter Alexander peter.alexander.au at gmail.com
Sun Jan 8 13:42:50 PST 2012


On 8/01/12 8:55 PM, Nick Sabalausky wrote:
> "Peter Alexander"<peter.alexander.au at gmail.com>  wrote in message
> news:jebvvg$2orl$1 at digitalmars.com...
>> On 8/01/12 4:11 AM, Walter Bright wrote:
>>> On 1/7/2012 4:12 PM, Peter Alexander wrote:
>>>> The main advantage of Lua for game code (in my opinion) is runtime
>>>> reloading,
>>>> and the ability to avoid recompiles just to test some new game logic.
>>>> That's not
>>>> so easy with C++.
>>>
>>> D is far faster at compiling than C++.
>>
>> True, but:
>>
>> - It's not orders of magnitude faster. You still have to wait for a
>> re-compile of large projects.
>>
>> - Linking takes just as much time as compiling.
>>
>
> They should both be more than fast enough in D if you're just compiling
> gameplay scripts. Especially on typical game-dev machines, which are
> above-average spec anyway.

Here's a quote for you:

http://www.gamasutra.com/view/news/39368/InDepth_Incremental_Linking_And_The_Search_For_The_Holy_Grail.php

"As an example, for me within our current code at Bungie, a single file 
change in the code I usually work on can cost as much as 10mins in 
linking (many targets). If I opt to build a single target (say the 
runtime), then this is reduced to ~2 mins. This is without any linker 
optimization such as Link Time Code Generation which is known to heavily 
increase Link time."

The rest of the article is about trying to get incremental linking 
working. At the end he says:

"Once you have resolved all the issues that can stop incremental linking 
from working, you are a short step from the Holy Grail. Something I 
personally have never had working before but will be actively fighting 
for in the near future."

So Bungie can't get incremental linking working. Good luck for the rest 
of us.


>> - Can't account for the time it takes to boot your application back up
>> after compiling and get back into the state you were in when you wanted to
>> make the change.
>>
>
> So compile the scripts to a dynamic lib instead of a static one. Shoot, id
> was already doing that back with Quake 1 or 2, weren't they?

On PC, yes. It's not so simple on consoles.


>> - Also, DMD is slow at optimising.
>> http://d.puremagic.com/issues/show_bug.cgi?id=7157
>
> Yea, like Walter said, just don't use that in the middle of an
> "edit-comple-test-edit" loop.

You often have to. The norm in the games industry is to always run with 
optimisations on unless you are debugging. The game simply runs too slow 
without them.



More information about the Digitalmars-d mailing list