July 30, 2015
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.

It's mostly because, in Java, every one of those tiny immutable `(x,y,z)` tuples and vectors have to be allocated on the heap.

D is nice because you can allocate such small things on the stack, but it also doesn't have a massively optimized collector either.

> Either your kid has tons of mods in their Minecraft or your computer is a bit dated.

Tons of mods is the only way I can (or more accurately, can't) play MC anymore.
July 30, 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?
>
> 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?

There's a small incomplete list of game dev libraries here:
https://github.com/zhaopuming/awesome-d#awesome-d
July 30, 2015
On Thursday, 30 July 2015 at 15:23:18 UTC, Minas Mina 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.
>
> Not really.
> http://www.minecraftforum.net/forums/support/server-support/server-administration/1916245-garbage-collection-issues-help-with-java
>
> Look it up in google.

First: That doesn't reflect the majority of users, and is an isolated case.

Second: That doesn't prove anything about GC in general. Perhaps they were using an out-dated Java version, or one of their plugins was hogging things up.

Garbage collection is a non-issue even in most video games. Minecraft is an *extreme* case because minecraft has tons and tons of user variables to take into account, such as the thousands of blocks users place, and all the entities that wouldn't be an issue in say, an FPS or MMO RPG game.

If anything, Minecraft is an example of how well GC can work, even when the program itself is seriously abusing the heap and dynamic memory allocation.
July 30, 2015
On Thursday, 30 July 2015 at 14:12:32 UTC, Minas Mina 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.
>
> I was thinking of using D for my game server (which is in C++ at the moment)... is the gc going to be such an issue? I know of @nogc but I also do know that some stuff needs gc, e.g strings and exceptions.
>
> From the things I read on this forum, it seems work is being done to make exceptions not use the gc. How is that moving along;

The good thing with D is that you can avoid the GC for the most part. So If you think that make sense for your project, go for it. It can work and I even think this is a good choice.

But the GC in its current form is not very good, so avoid it.
July 30, 2015
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.
July 30, 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.

Heh, what about the original Quake or Unreal? Both ran quite well on a Pentium 100 with 16MB of RAM. Not sure if memory is serving me right, but I suspect the amount of visible triangles per scene in Quake 1 can be comparable to that of Minecraft's, except it was released almost 20 years ago... I think I was able to run it on my 486 with 8MB of RAM, though it was more of a slideshow than a game, even with minimum viewport size, but still!
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.

The OP is talking about indie games not AAA blockbusters.

In general D is great for writing indie games, you just need to be aware that the GC is not the best and use @nogc where possible. It's not difficult and probably less overhead than writing the same code in C++.

As for the Java GC, well Minefcraft does very well and has millions of happy blockheads playing it.

bye,
lobo
July 31, 2015
Everyone always references Minecraft, but that's not the only Java game out there. There are quite a few on Steam. You'll never even know they're Java if you don't follow their development, as they ship with a bundled JRE. The Java games that perform poorly or hog resources are always held up as an example of why Java is a dog or why GC for games is a problem, but then the ones that perform well don't even become part of the conversation.

Experienced Java game developers know how to code to the GC and tune their apps to maximize performance. There's quite a lot of knowledge tucked away in the posts at java-gaming.org, where they've shared their experience and their games. The GC itself is not a deal breaker, nor is the Java language. People prove it every day.

The same can be true of D. When enough D experience has been accumulated and shared, people will be writing games that take the GC into account. There's no reason to avoid it completely. It can be made to work for you. Even today, games in C and C++ focus on minimizing allocations, using the stack as much as possible and setting aside as much heap memory up front as they can. Given that collections in D only run during allocations, there's no reason why that same strategy won't work in D. It's all about strategy and profiling, finding what hurts performance and learning how to avoid it.
July 31, 2015
Using C code from D is actually a fairly straightforward to do, all you need to do is write a D version of the function signature you want to call and tell D to mangle it as a C function eg extern(C) { int SDL_Init(uint flags); } now you just need to tell the linker to link in libsdl and you are ready to go.

I have personally found Derelict adds too much complexity and breaks too often for my liking.

If you want to play with a cross platform game engine with D bindings you could look at https://github.com/TurkeyMan/fuji


On Fri, Jul 31, 2015 at 11:53 AM, Mike Parker via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> Everyone always references Minecraft, but that's not the only Java game out there. There are quite a few on Steam. You'll never even know they're Java if you don't follow their development, as they ship with a bundled JRE. The Java games that perform poorly or hog resources are always held up as an example of why Java is a dog or why GC for games is a problem, but then the ones that perform well don't even become part of the conversation.
>
> Experienced Java game developers know how to code to the GC and tune their apps to maximize performance. There's quite a lot of knowledge tucked away in the posts at java-gaming.org, where they've shared their experience and their games. The GC itself is not a deal breaker, nor is the Java language. People prove it every day.
>
> The same can be true of D. When enough D experience has been accumulated and shared, people will be writing games that take the GC into account. There's no reason to avoid it completely. It can be made to work for you. Even today, games in C and C++ focus on minimizing allocations, using the stack as much as possible and setting aside as much heap memory up front as they can. Given that collections in D only run during allocations, there's no reason why that same strategy won't work in D. It's all about strategy and profiling, finding what hurts performance and learning how to avoid it.
July 31, 2015
On Thursday, 30 July 2015 at 22:39:38 UTC, Márcio Martins 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.
>
> Heh, what about the original Quake or Unreal? Both ran quite well on a Pentium 100 with 16MB of RAM. Not sure if memory is serving me right, but I suspect the amount of visible triangles per scene in Quake 1 can be comparable to that of Minecraft's, except it was released almost 20 years ago... I think I was able to run it on my 486 with 8MB of RAM, though it was more of a slideshow than a game, even with minimum viewport size, but still!

Are you kidding me? Visible triangles in Quake 1 was sub 2,000.

Visible triangles in a "far" render mode on Minecraft tops over 200,000.

Please don't make such a statement without looking. Each minecraft block is 16 triangles. Multiply that by however many blocks you have, and you'll see that number sky-rockets.