I made a game and engine in D that's a cross between Superliminal and Viewfinder, and you can play the demo now
Michael Lee
leecommamichael at gmail.com
Wed Feb 26 16:21:20 UTC 2025
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.
More information about the Digitalmars-d-announce
mailing list