February 27

On Wednesday, 26 February 2025 at 16:21:20 UTC, Michael Lee wrote:

>

On Monday, 24 February 2025 at 10:51:09 UTC, Lewis wrote:

>

I don't strictly use betterC, but I do avoid GC usage in all frame-to-frame gameplay code. I allow myself GC usage for debug code, editor tools, and major state changes where a hitch is okay (eg. startup, loading a save game).

The bulk of my frame-to-frame allocations are handled by an object pooling system that reuses elements and grows if needed. I also have a per-thread linear allocator that resets after each frame, useful for scratch allocations that don't need to outlive a frame. I made some minor changes to druntime so that in any given scope I can switch into "scrapheap mode" as I call it, at which point all GC allocations get redirected to my linear allocator until the scope exits. This lets me use phobos, druntime, and other libraries even if they would allocate to the GC in a problematic way. As long as the allocation doesn't need to outlive the frame, I can use the library unmodified by just switching into scrapheap mode.

This sounds ideal to me. How much of phobos did you mod? What kind of lift was it? Does it take much maintenance? Does using phobos feel seamless or is there some reluctance/superstition about using it in complex scenarios e.g. threads.

I'm an indie game dev, and am moving to D from C++. Congrats on the release! The game looks fantastic. A crowning achievement for a solo dev.

I didn't make all that many changes, and I don't think any of them were strictly mandatory to ship a game. They broadly fall into a few catagories:

  • Support for "scrapheap mode" (temporarily rerouting GC allocations to a linear frame allocator)
  • Support for DLL-based hotswapping. This required piping a few calls in the DLL's druntime/phobos over to the EXE's druntime (eg. using a GC proxy, thread management). Also, a couple small changes to stuff like the GC initialization in the DLL so the proxy gets set up correctly. This was completely worth it, DLL hotswapping is a gamechanger, just a massive improvement to iteration time. My changes are a tad hacky, but the release build of the game skips the DLL and links everything statically, so any bugs from this hackiness are debug-only.
  • Reducing build times. I use string formatting absolutely everywhere, so in debug I use the old C-style string formatting implementation, since it's non-templated and compiles very slightly faster (which for 10 calls is pointless, but 1000 calls it adds up).
  • Added a couple minor features to the phobos thread pool implementation
  • Added some missing bits of the windows API
  • Modified std.experimental.logger to better suit my exact needs (and use no templates, again I log everywhere and want to keep build times fast)

I use phobos all over the place without any issues.

February 27

On Thursday, 27 February 2025 at 09:24:59 UTC, Lewis wrote:

>

[...]

The fact that I just referred to it as "std.experimental.logger" probably dates me, huh :P

February 27

On Thursday, 27 February 2025 at 09:28:36 UTC, Lewis wrote:

>

On Thursday, 27 February 2025 at 09:24:59 UTC, Lewis wrote:

>

[...]

The fact that I just referred to it as "std.experimental.logger" probably dates me, huh :P

wait, what? It is no longer experimental? O_o

February 27

On Thursday, 27 February 2025 at 12:19:20 UTC, evilrat wrote:

>

On Thursday, 27 February 2025 at 09:28:36 UTC, Lewis wrote:

>

On Thursday, 27 February 2025 at 09:24:59 UTC, Lewis wrote:

>

[...]

The fact that I just referred to it as "std.experimental.logger" probably dates me, huh :P

wait, what? It is no longer experimental? O_o

Answering my own question, yep, since summer 2022 - https://github.com/dlang/phobos/commit/e113440df1112f9f2e6cc1dfe6ef3b5d2b7979f0

February 27

On Monday, 24 February 2025 at 03:08:11 UTC, Lewis wrote:

>

Hello! I'm Lewis, a solo developer from Vancouver. I've been working on The Art of Reflection for ~4 years. It's basically Superliminal meets Viewfinder with mirrors, with a bit of Portal and The Witness thrown in for good measure.

I built the game and engine from scratch in D, using D3D11, PhysX, FMOD, and a few other libraries. Happy to answer any questions about the process, but in short I'm super happy with my decision to use D. I honestly can't really imagine going back to C++ at this point.

You can play the demo right now if you want to give it a spin. Feedback is always welcome and appreciated.

Thanks so much for your support!

-Lewis

This game looks really awesome! I hadn't really played any games for a decade or so and then recently played the Portal games, which I thought were fun, but I was disappointed when I ran out of levels to play. I must admit too that I was pretty annoyed by the backstory and thought it got in the way and likely consumed a lot of resources they could have used to make more levels.

I look forward to playing The Art of Reflection. I see someone mentioned it runs on Steam Deck, does that mean I can get it running on Linux as well with Proton? Great to see such cool software written in D. I just ported a software synthesizer I've been working on for several years from C to D and did a similar dance with respect to non-GC threads for critical low-latency processing, so I also find your solution to this to be quite interesting.

February 27

On Thursday, 27 February 2025 at 09:24:59 UTC, Lewis wrote:

>
  • Support for DLL-based hotswapping. This required piping a few calls in the DLL's druntime/phobos over to the EXE's druntime (eg. using a GC proxy, thread management). Also, a couple small changes to stuff like the GC initialization in the DLL so the proxy gets set up correctly. This was completely worth it, DLL hotswapping is a gamechanger, just a massive improvement to iteration time. My changes are a tad hacky, but the release build of the game skips the DLL and links everything statically, so any bugs from this hackiness are debug-only.

Obligatory link to talks Manu and myself did on this topic:

https://www.youtube.com/watch?v=Jf7dvOWjLpU

https://www.youtube.com/watch?v=7YjLW7anNfc

https://www.youtube.com/watch?v=nro3txFndbM

https://www.youtube.com/watch?v=Aj9_Mb6wQV0

And yeah, being able to switch between release optimised binaries and debug binaries at runtime is one of the key advantages over something like Live++. Ultimately, treating code as data and making it just another asset in your engine's pipeline is 100% the way to go.

March 01

On Thursday, 27 February 2025 at 18:36:58 UTC, Element Green wrote:

>

On Monday, 24 February 2025 at 03:08:11 UTC, Lewis wrote:

>

Hello! I'm Lewis, a solo developer from Vancouver. I've been working on The Art of Reflection for ~4 years. It's basically Superliminal meets Viewfinder with mirrors, with a bit of Portal and The Witness thrown in for good measure.

I built the game and engine from scratch in D, using D3D11, PhysX, FMOD, and a few other libraries. Happy to answer any questions about the process, but in short I'm super happy with my decision to use D. I honestly can't really imagine going back to C++ at this point.

You can play the demo right now if you want to give it a spin. Feedback is always welcome and appreciated.

Thanks so much for your support!

-Lewis

This game looks really awesome! I hadn't really played any games for a decade or so and then recently played the Portal games, which I thought were fun, but I was disappointed when I ran out of levels to play. I must admit too that I was pretty annoyed by the backstory and thought it got in the way and likely consumed a lot of resources they could have used to make more levels.

I look forward to playing The Art of Reflection. I see someone mentioned it runs on Steam Deck, does that mean I can get it running on Linux as well with Proton? Great to see such cool software written in D. I just ported a software synthesizer I've been working on for several years from C to D and did a similar dance with respect to non-GC threads for critical low-latency processing, so I also find your solution to this to be quite interesting.

The game should run fairly well in Proton. That said, at the time of writing, some Proton players are seeing a bug where the wall paint flickers quite obnoxiously. I'm actively working on a fix, but if you start playing and encounter this bug too I'd probably advise holding off just until I can get a bugfix out for that issue. It looks pretty annoying to try and play with.

March 06

On Saturday, 1 March 2025 at 09:04:47 UTC, Lewis wrote:

>

The game should run fairly well in Proton. That said, at the time of writing, some Proton players are seeing a bug where the wall paint flickers quite obnoxiously. I'm actively working on a fix, but if you start playing and encounter this bug too I'd probably advise holding off just until I can get a bugfix out for that issue. It looks pretty annoying to try and play with.

Thanks for the info. I'll take your advice and wait until then. Looking forward to it!

5 days ago

On Thursday, 6 March 2025 at 15:35:19 UTC, Element Green wrote:

>

On Saturday, 1 March 2025 at 09:04:47 UTC, Lewis wrote:

>

The game should run fairly well in Proton. That said, at the time of writing, some Proton players are seeing a bug where the wall paint flickers quite obnoxiously. I'm actively working on a fix, but if you start playing and encounter this bug too I'd probably advise holding off just until I can get a bugfix out for that issue. It looks pretty annoying to try and play with.

Thanks for the info. I'll take your advice and wait until then. Looking forward to it!

For anyone coming to this later, the Proton flickering bug should be fixed now :)

4 days ago

On Thursday, 27 March 2025 at 06:27:19 UTC, Lewis wrote:

>

On Thursday, 6 March 2025 at 15:35:19 UTC, Element Green wrote:

>

On Saturday, 1 March 2025 at 09:04:47 UTC, Lewis wrote:

>

The game should run fairly well in Proton. That said, at the time of writing, some Proton players are seeing a bug where the wall paint flickers quite obnoxiously. I'm actively working on a fix, but if you start playing and encounter this bug too I'd probably advise holding off just until I can get a bugfix out for that issue. It looks pretty annoying to try and play with.

Thanks for the info. I'll take your advice and wait until then. Looking forward to it!

For anyone coming to this later, the Proton flickering bug should be fixed now :)

That's interesting! How did you fix it?

1 2
Next ›   Last »