July 31, 2015
On Thursday, 30 July 2015 at 21:27:09 UTC, deadalnix wrote:
> On Thursday, 30 July 2015 at 15:10:59 UTC, Brandon Ragland wrote:
>> It's a dog because Java is a dog. But that's not because of the GC.
>>
>> It's not really that bad either, I can open up Minecraft at any time and have it sit in the background quietly using ~800Mb ram and virtually no cpu time.
>>
>> Either your kid has tons of mods in their Minecraft or your computer is a bit dated.
>
> Now compare that kind of resources consumption with any game based on Quake III engine. While you are at it, compare the graphisms. Still not convinced ? Measure latencies, which are critical for most games.

Again,

People see minecraft as "terrible graphics, pixellated" but each block represents 16 triangles, and there could be thousands of blocks on screen. You're easily looking at 200,000 triangles on "far" render mode.

Then you have folks who use 512x512 mapped images per block, so now you have a HUGE textel density.

People need to get their facts straight. I don't like Minecraft, but by no means in Minecraft some amateur game from 1990s running terribly on a computer.

That game is every bit as CPU intensive as a modern game, though it looks like trash at first.

Granted, it's by far not written well, but even for poorly written code, it performs better than I could have ever expected.
July 31, 2015
On Thursday, 30 July 2015 at 21:27:09 UTC, deadalnix wrote:
> On Thursday, 30 July 2015 at 15:10:59 UTC, Brandon Ragland wrote:
>> It's a dog because Java is a dog. But that's not because of the GC.
>>
>> It's not really that bad either, I can open up Minecraft at any time and have it sit in the background quietly using ~800Mb ram and virtually no cpu time.
>>
>> Either your kid has tons of mods in their Minecraft or your computer is a bit dated.
>
> Now compare that kind of resources consumption with any game based on Quake III engine. While you are at it, compare the graphisms. Still not convinced ? Measure latencies, which are critical for most games.

People always compare things to Minecraft when discussing if garbage collection is feasible in a game. Which is annoying, because I'm sure Minecraft's allocations would make most people sad. It's not a fair comparison.

Some quotes:
"Minecraft 1.8 has so many performance problems that I just don't know where to start with. Maybe the biggest and the ugliest problem is the memory allocation. Currently the game allocates (and throws away immediately) 50 MB/sec when standing still and up to 200 MB/sec when moving. That is just crazy."

But that was just a one off thing for 1.8 I believe, the normal is much better:
"How did that work in previous releases? The previous Minecraft releases were much less memory hungry. The original Notch code (pre 1.3) was allocating about 10-20 MB/sec which was much more easy to control and optimize."

10-20 MB of garbage every second. That's just ridiculous to think of in a language like D. And that was long ago, it's probably worse now. Luckily D has things like ranges and other ways of improving this.

Source: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1272953-1-8-7-optifine-hd-d6-fps-boost-hd-textures-aa-af?page=2111#c43757
August 01, 2015
On Friday, 31 July 2015 at 21:40:51 UTC, Kapps wrote:
> On Thursday, 30 July 2015 at 21:27:09 UTC, deadalnix wrote:
>> On Thursday, 30 July 2015 at 15:10:59 UTC, Brandon Ragland wrote:
>>> It's a dog because Java is a dog. But that's not because of the GC.
>>>
>>> It's not really that bad either, I can open up Minecraft at any time and have it sit in the background quietly using ~800Mb ram and virtually no cpu time.
>>>
>>> Either your kid has tons of mods in their Minecraft or your computer is a bit dated.
>>
>> Now compare that kind of resources consumption with any game based on Quake III engine. While you are at it, compare the graphisms. Still not convinced ? Measure latencies, which are critical for most games.
>
> People always compare things to Minecraft when discussing if garbage collection is feasible in a game. Which is annoying, because I'm sure Minecraft's allocations would make most people sad. It's not a fair comparison.
>
> Some quotes:
> "Minecraft 1.8 has so many performance problems that I just don't know where to start with. Maybe the biggest and the ugliest problem is the memory allocation. Currently the game allocates (and throws away immediately) 50 MB/sec when standing still and up to 200 MB/sec when moving. That is just crazy."
>
> But that was just a one off thing for 1.8 I believe, the normal is much better:
> "How did that work in previous releases? The previous Minecraft releases were much less memory hungry. The original Notch code (pre 1.3) was allocating about 10-20 MB/sec which was much more easy to control and optimize."
>
> 10-20 MB of garbage every second. That's just ridiculous to think of in a language like D. And that was long ago, it's probably worse now. Luckily D has things like ranges and other ways of improving this.
>
> Source: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1272953-1-8-7-optifine-hd-d6-fps-boost-hd-textures-aa-af?page=2111#c43757

The point is that because Minecraft does such a shoddy job at any kind of memory allocation, optimization, or conservation, the GC has a lot more to handle, and is abused quite regularly due to Mojang's lack of any real world coding experience it seems.

The point of the comparison is this:

If Minecraft, which is terrible, can do it with a GC, then why can't a *well* made D game work even better.

I'm not defending Minecraft in any way shape or form, I'm actually defending the JVM GC.

Minecraft is terribly designed and mad,e and uses excessive amounts of resources partially just based on it's design. A whole bunch of "blocks" yes "blocks" represent 12 outer triangles and on diagonal triangle through the center. The stairs, etc. that the game has represents even more tris.

So if you have:

* A game which regularly renderings in excess of 200,000 trs per frame
* A game with terrible optimizations (if any....)
* A game based on Java with a GC

And it can still pull 30FPS on my cruddy 8 year old Gateway, than a GC is NOT the reason to NOT use the D language.

If anything, you should take the lessons from Minecraft and do it *better* in D and you'll have much much better resource allocation, usage, and far less GC abuse.

-Peace
August 02, 2015
On 2/08/2015 11:15 a.m., Brandon Ragland wrote:
> On Friday, 31 July 2015 at 21:40:51 UTC, Kapps wrote:
>> On Thursday, 30 July 2015 at 21:27:09 UTC, deadalnix wrote:
>>> On Thursday, 30 July 2015 at 15:10:59 UTC, Brandon Ragland wrote:
>>>> It's a dog because Java is a dog. But that's not because of the GC.
>>>>
>>>> It's not really that bad either, I can open up Minecraft at any time
>>>> and have it sit in the background quietly using ~800Mb ram and
>>>> virtually no cpu time.
>>>>
>>>> Either your kid has tons of mods in their Minecraft or your computer
>>>> is a bit dated.
>>>
>>> Now compare that kind of resources consumption with any game based on
>>> Quake III engine. While you are at it, compare the graphisms. Still
>>> not convinced ? Measure latencies, which are critical for most games.
>>
>> People always compare things to Minecraft when discussing if garbage
>> collection is feasible in a game. Which is annoying, because I'm sure
>> Minecraft's allocations would make most people sad. It's not a fair
>> comparison.
>>
>> Some quotes:
>> "Minecraft 1.8 has so many performance problems that I just don't know
>> where to start with. Maybe the biggest and the ugliest problem is the
>> memory allocation. Currently the game allocates (and throws away
>> immediately) 50 MB/sec when standing still and up to 200 MB/sec when
>> moving. That is just crazy."
>>
>> But that was just a one off thing for 1.8 I believe, the normal is
>> much better:
>> "How did that work in previous releases? The previous Minecraft
>> releases were much less memory hungry. The original Notch code (pre
>> 1.3) was allocating about 10-20 MB/sec which was much more easy to
>> control and optimize."
>>
>> 10-20 MB of garbage every second. That's just ridiculous to think of
>> in a language like D. And that was long ago, it's probably worse now.
>> Luckily D has things like ranges and other ways of improving this.
>>
>> Source:
>> http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1272953-1-8-7-optifine-hd-d6-fps-boost-hd-textures-aa-af?page=2111#c43757
>>
>
> The point is that because Minecraft does such a shoddy job at any kind
> of memory allocation, optimization, or conservation, the GC has a lot
> more to handle, and is abused quite regularly due to Mojang's lack of
> any real world coding experience it seems.
>
> The point of the comparison is this:
>
> If Minecraft, which is terrible, can do it with a GC, then why can't a
> *well* made D game work even better.
>
> I'm not defending Minecraft in any way shape or form, I'm actually
> defending the JVM GC.
>
> Minecraft is terribly designed and mad,e and uses excessive amounts of
> resources partially just based on it's design. A whole bunch of "blocks"
> yes "blocks" represent 12 outer triangles and on diagonal triangle
> through the center. The stairs, etc. that the game has represents even
> more tris.

Notch has said previously, if he had known Minecraft was going to become a hit like it was, he would have made it in C++. It was never made to be performant unfortunately.

> So if you have:
>
> * A game which regularly renderings in excess of 200,000 trs per frame
> * A game with terrible optimizations (if any....)

In the last few releases Mojang has been rewriting large portions of Minecraft for the purpose of performance optimization. E.g. thread friendly.
It's broken mods ridiculously every single release.

> * A game based on Java with a GC
>
> And it can still pull 30FPS on my cruddy 8 year old Gateway, than a GC
> is NOT the reason to NOT use the D language.
>
> If anything, you should take the lessons from Minecraft and do it
> *better* in D and you'll have much much better resource allocation,
> usage, and far less GC abuse.
>
> -Peace

August 02, 2015
On Thursday, 30 July 2015 at 14:44:30 UTC, CraigDillabaugh wrote:
> On Thursday, 30 July 2015 at 14:18:21 UTC, Brandon Ragland wrote:
>> On Thursday, 30 July 2015 at 13:44:41 UTC, deadalnix wrote:
>>> On Thursday, 30 July 2015 at 13:43:35 UTC, karabuta wrote:
>>>> D is really cool and makes a good candidate for developing a game. Are there any guys out there using D for indie games?
>>>>
>>>> For some time I have been seeing some cool game engine being developed in the DUB repo. What more is happening? I don't see derelictSDl and derelictSFML activities much. Whatup?
>>>
>>> GC's up.
>>
>> Minecraft, written in java which has a GC does perfectly fine.
>>
>> A GC is not a reason a game cannot be developed.
>>
>> Look at how many browser-based games there are, which use a GC somewhere from the interpreted Flash or JS.
>
> Minecraft is a dog though ... I always have to kill my kids ongoing game
> if I ever want to do any real work on the same machine.

This is because of java

most allocations in D are on the stack, not the heap. Java has no concept of stack allocations outside of basic types.

Furthermore, more often than not allocations in D on the heap contain no pointers/references at all(>60% of all allocated memory in nearly every D program I tested that wasn't optimized to not use the GC contained no pointers/references.) and AFAIK the current GC makes no use of this fact.
August 02, 2015
On Friday, 31 July 2015 at 21:40:51 UTC, Kapps wrote:
> On Thursday, 30 July 2015 at 21:27:09 UTC, deadalnix wrote:
>> [...]
>
> People always compare things to Minecraft when discussing if garbage collection is feasible in a game. Which is annoying, because I'm sure Minecraft's allocations would make most people sad. It's not a fair comparison.
>
> [...]

This is because of java's lack of stack allocation AFAIK. Lots of small objects that are created and quickly thrown away(like you'd see in a game) creates intense GC pressure.
August 02, 2015
On Sunday, 2 August 2015 at 05:03:34 UTC, rsw0x wrote:
> Furthermore, more often than not allocations in D on the heap contain no pointers/references at all (>60% of all allocated memory in nearly every D program I tested that wasn't optimized to not use the GC contained no pointers/references.) and AFAIK the current GC makes no use of this fact.

Of course it does: memory allocated for data without pointers is not scanned (see core.memory.BlkAttr.NO_SCAN). It has been this way for ages.
August 02, 2015
On Sunday, 2 August 2015 at 06:25:34 UTC, thedeemon wrote:
> On Sunday, 2 August 2015 at 05:03:34 UTC, rsw0x wrote:
>> Furthermore, more often than not allocations in D on the heap contain no pointers/references at all (>60% of all allocated memory in nearly every D program I tested that wasn't optimized to not use the GC contained no pointers/references.) and AFAIK the current GC makes no use of this fact.
>
> Of course it does: memory allocated for data without pointers is not scanned (see core.memory.BlkAttr.NO_SCAN). It has been this way for ages.

Partially correct.

If you compare the amount of memory allocated by the GC that is marked NO_SCAN compared to passing precise type information with the allocation many, many allocations that are without pointers/references are not marked NO_SCAN.
August 02, 2015
On Thursday, 30 July 2015 at 13:43:35 UTC, karabuta wrote:
> D is really cool and makes a good candidate for developing a game. Are there any guys out there using D for indie games?

I hack away at little games in D whenever I can find some free time.
My previous project was a strategy game:
https://github.com/rcorre/terra-arcana

I've abandoned it for now to move on to a less complex project that I can hopefully finish, but it did get to a playable state.

As far as the GC stuff, I haven't run into issues like I used to with C#+XNA, but I also haven't been pushing the limits on allocations (my last two projects were turn-based-strategy).

For now, D just seems to make me more productive than any other language I've tried. I'm hoping that if I do run into memory issues, std.allocator may be able to help.
August 02, 2015
On Friday, 31 July 2015 at 03:29:59 UTC, Brandon Ragland wrote:
> People see minecraft as "terrible graphics, pixellated" but each block represents 16 triangles

I really hope they don't render a block with 16 triangles.

> and there could be thousands of blocks on screen. You're easily looking at 200,000 triangles on "far" render mode.

Look up triangles/sec on modern video cards, you'll be surprised.

> Then you have folks who use 512x512 mapped images per block, so now you have a HUGE textel density.
>
> People need to get their facts straight. I don't like Minecraft, but by no means in Minecraft some amateur game from 1990s running terribly on a computer.

Compared to real games, it is.