Ascension dev schedule ๐ก๏ธ
๐ Wednesdays: a tease. Roadmap peeks and what we're building right now.
๐ฎ Saturdays: update day. New build and/or devlog on itch.
Follow along and tell me what you want to see next!
https://t.co/aAkZtnjhSX
Ascension 0.1.5 is up on itch. A small update, and your 0.1.4 saves carry over. Still in development, so if you play, tell me what you notice.
https://t.co/aAkZtnjhSX
#gamedev#LitRPG
Part 2 of my free beginner SDL3 GPU tutorial is up: drawing text.
The idea is simple: a glyph is a textured quad, the same kind of quad as Part 1. You bake the letters into one atlas, upload it once, and draw a string as a row of those quads.
What it covers:
- Packing an atlas with stb_truetype and Atkinson Hyperlegible
- Turning pixel positions into the GPU's coordinate system, including the y flip
- Drawing each glyph as 6 vertices (two triangles, no index buffer)
- A hand-drawn 8ร8 hex bitmap font, the way I learned it on graph paper
- Press T to toggle between the smooth TTF atlas and the chunky hex font
The finished program shows two lines: a title, and a live FPS line that switches from TTF to HEX when you press T.
CI-tested on Windows, macOS and Linux. MIT licensed.
Write-up: https://t.co/MpGgTvF89w
Code: https://t.co/cqEsGKmb5N
Planned for Ascension: class evolutions from how you play. A Fighter who keeps healing might be offered a Paladin-like path. Plus villagers who only hear rumors of your titles. What would your style evolve into? #LitRPG
Emerald now has a component registry: register a type and its fields once, and that same list drives JSON worlds and prefabs, plus inspector widgets when you don't draw your own. Mark a field Transient and it stays out of prefabs but still lands in snapshots.
#gamedev#indiedev #cpp
They notice whatever reached them, not just the good ones. A few can actually see the title you're wearing. Most villagers only hear rumors. For now that's in how they greet you, not whether they'll deal with you. There isn't a truly bad title in yet, though the one you earn by walking away from fights already gets a drier hello.
Ascension 0.1.4 is out on itch. You can now wear the titles the System gives you (class rarity sets your slots), and the villagers notice. Plus a danger meter that pauses on the road. Still in development, feedback welcome.
https://t.co/aAkZtnjhSX
#gamedev#LitRPG
PCSS looks amazing in 3D, but I don't think it belongs in a pixel-art 2D game. A simple blob under the sprite โ offset, squashed, tinted โ is probably enough. Blocking light with walls is a different problem, and can wait. Just thinking out loud; nothing in the engine yet.
Yesterday's puzzle: the bug is at exactly 45 degrees.
When dy == dx, the slope is 0x10000. That value needs 17 bits, but I stuffed it into a uint16_t, which truncates it to 0. After that, every step adds nothing to y, and the "line" comes out perfectly flat.
A 17th bit is what it takes to hold 0x10000. I lost an afternoon to this in 2009. AI finds it in seconds now, which is fine, but I still think it's worth learning by hand.
The fix is how Doom steps in 16.16 fixed point. Keep the fraction and the integer in one int32_t, and the pixel row is just the top 16 bits:
// Doom-style 16.16 fixed point, x-major
void DrawLine(uint8_t* fb, int pitch, int x0, int y0, int x1, int y1, uint8_t color)
{
int32_t step = ((y1 - y0) << 16) / (x1 - x0);
int32_t y = (y0 << 16) | 0x8000;
for (int x = x0; x <= x1; ++x, y += step)
fb[(y >> 16) * pitch + x] = color;
}
Same idea as the old version, but step is a full 32-bit value, so 0x10000 fits and 45-degree lines actually draw. If you're starting out, steal this one, not the puzzle.
Around 2009, two years into C++, I wrote a line drawer that beat Bresenham on my machine. One loop, no ifs. Full disclaimer: I was really into bit manipulation back then.
// lines where 0 <= dy <= dx
void DrawLine(uint8_t* fb, int pitch, int x0, int y0, int x1, int y1, uint8_t color)
{
int dx = x1 - x0;
uint16_t slope = (uint16_t)(((uint32_t)(y1 - y0) << 16) / dx);
uint16_t frac = 0x8000;
int y = y0;
for (int x = x0; x <= x1; ++x)
{
fb[y * pitch + x] = color;
uint32_t sum = (uint32_t)frac + slope;
y += sum >> 16;
frac = (uint16_t)sum;
}
}
There is a bug. Can you find it?
Credit where it's due: I originally picked this pattern up from reading id Tech 4 (Doom 3).
In id Tech 3 (C), John Carmack passed global structs of function pointers (refexport_t) across DLL boundaries. When id moved to C++ for Doom 3, they kept that exact architecture, just translated to abstract base classes and global pointers (soundSystem, renderSystem, fileSystem) backed by static Local instances in the .cpp.
No Instance() linkage headaches across game DLLs, zero header bloat, and 100% explicit Init() / Shutdown() order. Still one of the cleanest real-world C++ patterns ever shipped.
My old C++ singleton trick, cleaned up. No Instance(), no lazy init, no locks.
Put abstract interfaces in one header, plus a global pointer for each:
// Interfaces.h
struct IAudio {
virtual ~IAudio() = default;
virtual void Init() = 0;
virtual void Play(SoundId id) = 0;
virtual void Shutdown() = 0;
};
extern IAudio* g_Audio;
The real class lives in a .cpp, out of sight:
// Audio.cpp
namespace {
class Audio final : public IAudio {
void Init() override { /* open device */ }
void Play(SoundId id) override { /* ... */ }
void Shutdown() override { /* close */ }
};
Audio s_Audio;
}
IAudio* g_Audio = &s_Audio;
Why I like it:
- Callers only see the interface. The implementation and its headers stay in one .cpp.
- Pointing g_Audio at a stub swaps it for tests or a null device.
- The pointer is constant-initialized, so there are no static init order surprises.
- Keep constructors trivial and call Init()/Shutdown() explicitly from main, so startup order is yours.
I wrote a free beginner tutorial for SDL3's GPU API: from an empty window to a spinning textured quad in one ~370-line C++20 file. The same code runs on Vulkan, D3D12 and Metal.
What it covers:
- Creating the GPU device and loading shaders (HLSL written once, compiled to SPIR-V, DXIL and MSL with SDL_shadercross)
- The register rules that trip everyone up: vertex uniforms at b0/space1, fragment texture + sampler at t0/s0 in space2
- Uploads: CPU to transfer buffer to copy pass to GPU, and why cycle=true matters for buffers you rewrite every frame
- The frame loop, including why a NULL swapchain texture just means the window is minimized
Tip for new programmers: let AI handle the CMake setup and spend your time on the code. But ask it to make sure the build is current, meaning the latest stable SDL3 and up-to-date CMake steps, because AI often suggests outdated versions.
Next up, slowly: classic Asteroids on the same setup. Part 2 is drawing text, because a glyph is just a textured quad, with an old-school sidebar on hand-drawing a bitmap font on graph paper in hex, the way I learned it.
CI-tested on Windows, macOS and Linux. MIT licensed:
https://t.co/cqEsGKlDgf
Emerald engine dev note: SDL3 stays inside the engine.
Public headers used to #include <SDL3/SDL_pixels.h> and expose SDL_Window*, SDL_Event, and SDL_FColor. Now: NativeWindow*, Event, and Color. SDL3 is a private link, so games build with no SDL include path.
#cpp#gamedev
In the works for Ascension: titles you wear. Class rarity sets your slots (1 for Common, up to 4 for Legendary), and villagers notice. Wear Wolf Cull and Pell, Bram and Calder have something to say. What title would you grind for?
#gamedev
Emerald, the C++/SDL3 engine behind Ascension, now builds and passes tests on macOS with Metal. Every change runs through CI on Windows, Linux and Mac, and the Mac job renders 30 frames to prove it. One engine, the same game code on all three.
#gamedev#indiedev#cpp
@0xGEMLAB That's a good instinct. Pausing the meter on the road instead of clearing it would keep the risk honest without the first step back into the wild feeling like a surprise. I'll keep that in mind.
Ascension 0.1.3 is out on itch. Step off the road and the wild fights back: a danger meter fills as you walk, and tracks and howls warn you before something finds you. The road stays safe. Still in development, feedback welcome.
https://t.co/aAkZtnjhSX
#gamedev#LitRPG
16bit Forge 0.1.3 is out. Maximizing the setup window no longer knocks the game off screen, input movies survive a crash, plus a lag counter, a timing check suite, and interrupt and DMA/HDMA timing fixes. 0.1.2 movies may not replay the same.
https://t.co/o3F4KU7jZW
The shutdown, before and after:
before:
worker.request_stop(); // jthread joins itself
after:
{ std::lock_guard l(m_Mutex); m_Stop = true; }
m_WorkAvailable.notify_all();
for (auto& w : m_Workers) w.join();
Full diff: https://t.co/SNZQUPs3Ox
Emerald engine dev note: Apple's libc++ still has no std::jthread, so the thread pool now uses std::thread plus an atomic stop flag. Set the flag under the lock, notify_all, join. Same behavior, and Emerald now builds and passes tests on macOS in CI. #cpp#gamedev