You are browsing as a guest. Sign up (or log in) to start making projects!

torkel

@torkel

Joined June 1st, 2026

  • 112Devlogs
  • 2Projects
  • 2Ships
  • 33Votes
a so called "programmer"

banner credit @lix
Open comments for this post

3h 53m 18s logged

sllight hub overhaul

redid the project hub screen and added recent projects tracking, since up to now opening anything meant going through a file dialog every single time…

changes

  • recent projects get tracked in a PROJECTHIST file (next to the editor executable) …dead simple format, one filepath per line, each pointing at a project’s .json. capped at 5 entries, oldest just get removed off the list.
  • hub screen is basically remade two docked panels now instead of one. left panel is the same buttons as before (new project, open project, etc), right panel is the new recent-projects list, up to 5 entries since that’s all the history file holds.

also

  • removed some unused dead code i found…

QoL type stuff i guess :D

2
0
102
Open comments for this post

3h 56m 30s logged

too many post proc fx?

followup to the post processing / shader experiments…

changes

shader includes

shaders can #include "rand.glsl" etc and it resolves properly. it checks the project VFS first, then falls back to the engine’s own shader helper directory if it isn’t found there.

engine shader helpers also get packaged into exported games under engine/shaders/, so includes keep working at runtime.

added a few helper include files:

  • rand.glsl / auto_rand.glsl - seeded hash-based random, with auto_rand reseeding per frame from u_Time
  • color.glsl - HSV conversion, lift/gamma/gain, contrast, saturation, and three-way color wheels
  • commons.glsl - engine-provided uniform declarations so you don’t have to redeclareu_Resolution, etc. in every shader for engine-provided uniforms

the helpers use #ifndef / #define guards, so auto_rand.glsl can include rand.glsl without causing double declarations if the effect shader or another include declare the same uniforms or includes.

more built-in effects

added a few more built-in post processing effects:

  • ColorGrading - exposure, contrast + pivot, saturation, lift/gamma/gain, and shadow/midtone/highlight color wheels using color.glsl
  • FilmGrain - chunky per-cell grain with u_GrainSize controlling the cell size
  • Vingette - yes i know its mispelled.

uniforms with Wheel in the name now get the wheel-style color picker instead of the regular color picker, since a normal RGB slider

cleaned up effect registration

used to have two separate lists, one for raw shader registration and one for the default effect chain. this meant adding an effect involved touching two different structs in two different places.

merged those into one PPRegistration list with an inDefaultChain flag

shader debug name

added an actual m_DebugName field and made error messages / the material inspector fall back to it when there isn’t a real file path.

docs

wrote up some post-processing editor docs ….. i hate writing docs..

also

  • .shader is now a valid extension for importing custom effect shaders, alongside .frag / .glsl
  • trimmed down the miniaudio CMake config by disabling its examples, tests, and tools, along with Vorbis/Opus/FLAC support since i’m not using any of that….
0
0
31
Open comments for this post

3h 1m 2s logged

shader preprocessing

been working on a small shader preprocessor thing while also finishing up the final bits of post-processing

right now the preprocessor is pretty simple, mostly just adding support for:

  • #include
  • #pragma once

I haven’t actually needed it yet, I just kinda had the urge to make it… so now I have a shader preprocessor …?

its pretty extendable and all though so usefull to have ig :)

0
0
72
Open comments for this post

6h 57m 51s logged

more post processing!!!!

this took way longer than i thought it would but uh whateveer. i think i still gotta fix some small things but its working pretty alright :D

editor ui

  • added a proper ui for post processing :)
  • threw in an import button and stuff so you can load in fragment shaders as post proc fx
  • you can edit the uniforms directly in the ui now

stuff

  • glsl uniform parser: wrote a very simple basic glsl uniforms parser. this is what makes the ui editing possible, but it also helps a ton with serialization so i don’t have to hardcode everything

  • serialization: implemented saving and loading for post processing effects and also made post processing effects bound per-scene instead of being a global engine thing

yay post processing funny effects shaders aaaaaaaah

0
0
43
Open comments for this post

6h 14m 35s logged

experimenting with post processing

working on a lil post-processing pipeline
still very wip but im mostly just playing around with various shaders and stuff

changes

the pipeline

PostProcessor is a simple “ping-pong” chain: scene renders to an off-screen FrameBuffer,
then each enabled effect runs full-screen-triangle shaders bouncing between two ping-pong buffers, in whatever order they were added

I’m working on a system via variants to get uniforms to be easily serializable and such, it seems to be working but I havent actually wired it into anything just yet.

editor and runtime

a lil bigger change than expected.
i implemented a unified fbo for both editor/runtime rather than the weird jank i was doing before

  • editor: scene renders into m_SceneFrameBuffer, post effects run, then it gets sent into the ImGui viewport image like before
  • runtime: same scene framebuffer, same post effects, then PresentToScreen goes to the default framebuffer instead

just some general cleanup for that ig

crt shader

i wrote a lil silly CRT looking shader to test it out as shown below, it’s cool but kind of useless, but very fun to play with!!!

0
0
125
Open comments for this post

4h 56m 9s logged

custom meshes

im trynna make it so you can draw your own custom 2d meshes in the editor

its still a lil buggy but it’s mostly working, serializes and all that :)

very fun…

0
0
46
Open comments for this post

2h 7m 49s logged

ui editing gizmos!!!1

you can finally drag UI elements around in the editor
(instead of typing position/scale values into the inspector)

changes

ui gizmo

added a proper UI gizmo with resize handles and dragging support and that

  • corners resize both axes, edges resize one axis
  • dragging the body moves the element
  • resizing from the top/left keeps the opposite edge anchored
  • added a small drag deadzone so clicking doesn’t accidentally create an undo step
  • UI transforms now go through TransformUIElementCommand, so they’re undo/redo -able

also renamed the existing entity gizmo code and naming gets confusing otherwise…

coordinate stuff

the gizmo needed mouse coordinates relative to the viewport rather than the whole window, so added some better viewport coordinate handling for that… maybe a lil late

ui editing mode

buttons won’t randomly enter their hover/pressed states just because your mouse is sitting over them now in the editor beccause its a lil annoying when editing

small optimization

also fixed UIText and UIButton recalculating their text layout every frame when nothing changes

feels nice :)

0
0
51
Open comments for this post

2h 31m 48s logged

hardening + performance stuff

so this is kinda the continuation of the last log(s) where i was going through some old code
kinda boooring but its important

performance

mainly been trying to get rid of unnecessary allocations and full scans stuff

  • optimized ECS entity/component lookups and removal
  • reworked hierarchy propagation to avoid unnecessary registry scans
  • reduced allocations in scripting and UI command buffers
  • cached script wrappers so they can be reused instead of constantly recreated
  • improved UI lookups with a proper name index
  • made particle/lightmap updates only rebuild when actually needed
  • cached project browser directory scans
  • capped the editor console and added clipping for large logs

also did a bunch of smaller optimizations around scripting task scheduling and resource loading things

thread safety

went through a lot of the cross-thread stuff as well

  • made ResourceManager access properly synchronized
  • experimenting with the audio locking
  • guarded FreeType access
  • made window size and pending scene state thread-safe
  • fixed some render thread / GL context handling

basically trying to make all the multithreading stuff a little less “it seems to work” type stuff

though alot of this probably wasnt actually causing any issues YET, it would be very hard to debug in the future if I didn’t try to fix it now so yeahh

correctness

  • fixed several out-of-bounds issues in VFS/package parsing
  • made VFS path resolution properly stay inside the VFS root (oops…)
  • fixed hierarchy reparenting allowing cycles
  • fixed a few dangling references in hierarchy code
  • fixed some component pool and packaged asset lifetime issues
  • undo history now clears when loading a scene
  • cleaned up a few map editor edge cases
  • fixed text centering
  • fixed the triangle mesh
  • made engine context non copyable

also updated the demo template while I was at it (since a recent movementcomponent update it wasnt behaving properly due to the addition of a new field)

there are other small things i probably didn’t mention here too but it’s mostly all a collection of a bunch of small things

im still testing this though and looking into a few other small things…..

0
0
46
Open comments for this post

7h 50m 36s logged

code cleanup & optimization

currently going through a bunch of older code and fixing / optimizing things.

prolly way too much to actually write about,
and most of it is just boring small changes, bug fixes, and a lil cleanup

big pr i guess soon idk

0
0
23
Open comments for this post

3h 26m 32s logged

mostly windows fixes

changes

  • SetLightmap took a raw Lightmap* and just held onto it for the frame swapped it for a small value type the renderer copies out immediately instead… this sometimes caused crashes but seemingly only on windows?.. just my luck..
  • LightingSystem had the same issue, was writing back into ECS memory through a raw pointer from a GL init task. now creates the framebuffer/vao up front and just calls Invalidate() on them
  • SubmitPersistent was also holding a raw pointer into caller-owned memory, now copies into the staging buffer like everything else does
  • RenderBatch used to just silently not draw anything if a batch went over MAX_INSTANCES. now it chunks into multiple draw calls instead of dropping the whole thing
  • InvalidateGLCache wasn’t resetting the dynamic instance buffers, only the VAO cache, so they could point at dead GL objects after a context loss

actual windows fixes

  • opening files tries to open via already existing file associationg, otherwise falls back to the “open with” dialog if there’s no default handler
  • also the paths get normalized to backslashes now
  • asset import for scripts and so just does a file copy now instead of going through the old import path
0
0
34
Open comments for this post

4h 16m 33s logged

persistent entities… again

kinda scrapped most of the first attempt at persistent entities and decided to redo it
instead of setting persistence in the editor, I went with something closer to Unity’s DontDestroyOnLoad, where scripts explicitly mark entities as persistent. makes more sense and is a lot less weird around scene changes.

(i.e this.SetPersistent(true); )

changes

scripting

added:

  • entity.SetPersistent(true)
  • entity.IsPersistent()

persistence

persistent entities are tagged before the scene unloads, serialized normally, then re-injected and reparented when the new scene loads.

the persistence tag itself isn’t serialized, so it won’t accidentally end up saved into the scene

dedup

added some basic deduplication so persistent entities don’t get duplicated if the new scene already contains an entity with the same name.

its name based for now… not very great, but good enough

0
0
32
Open comments for this post

6h 44m 36s logged

persistent Entities

been working on persistent entities via a tag.. the same idea as Unity’s DontDestroyOnLoad, except you mark entities as persistent in the editor instead of doing it through scripts (scripts can do it too though).

everything keeps breaking or half-working
help.

0
0
76
Open comments for this post

2h 30m 56s logged

more docs… and some bug fixes

some small bugs that have been annoying me for a while finally got fixed… and I wrote more docs than I probably needed to…? or maybe too litte.. who knows

changes

entity selection actually clears now

fixed an issue where clicking empty space in the viewport wouldn’t reliably clear the current selection.

the pick-result handling was structured wrong, so the “nothing was selected” case basically never got handled properly.
also explicitly clear the entity ID framebuffer attachment every frame so it doesn’t leave stale IDs around from previous frames.
i knew this was broken, and figured the fix would be pretty simple for a while.. but i just kinda forgot to fix it.. oops….

fixed parent transforms during scene loading

fixed a bug with parented entities getting their transforms messed up when loading a scene.

the issue was that scene loading was using the same Reparent() logic as interactive editor reparenting. that function intentionally recalculates the local transform to preserve world position,
which is what you don’t want when loading a transform that’s already been serialized correctly… was eepy when writing that i guess

added Registry::SetParentDirect() for scene loading, which just sets up the parent/child relationship without touching the transforms.

interactive reparenting still uses the old behaviour, so dragging entities around in the hierarchy still preserves their world position

misc

  • cleaned out some old commented-out code

docs, docs, docs

also wrote proper editor documentation section covering things like:

  • editor concepts
  • usage
  • scenes
  • prefabs
  • components
    and some even have screenshots.. yes i know.. fancy

the help button in the editor links to some of these pages now.

i guess “figure it out yourself” wasn’t really an acceptable documentation strategy anymore….
i mean i had some docs.. but they weren’t that good for editor-usage and more technical stuff.. so yep..

also made the README headers slightly more obvious because people were still asking where the download link was ….

0
0
57
Open comments for this post

2h 42m 41s logged

scrips can change things on the map yippie

changes

scripting

scripts can now modify maps through EngineLib

added:

  • Map_SetHexWalkable
  • Map_SetTileType

yes, i made sure changes to walkability properly update the map’s pathfinding data instead of leaving it with stale information…

sanitizers

added sanitizer builds….

got ASan + UBSan working through CMake, along with presets for testing… it has helped already :)

timers

SetTimeout:

if a script created a timer and then the scene changed before it fired, the callback could still run against the old scene state.
timers now use generations, so changing/reloading a scene invalidates any timers belonging to the previous scene.

editor

fixed another map editor bug where discarding unsaved changes didn’t actually discard them… it would clear the dirty state but leave the edited map in memory…
i knew about this bug and fix for a while, but i kept on forgetting about it… but its finally done -.-

also added an Edit button to script entries in the project browser so scripts can be opened directly (launches default app it detects for the file via ur os)

0
0
56
Open comments for this post

1h 5m 18s logged

mostly ui stuff (and fighting windows wide chars)

yay pretty ui

editor ui theming ui blah blah idk what to call it

  • kinda cleaned up some stuff into proper members so the ui state doesn’t get all weird and persistent when you close the theme window
  • discarding changes: actually works now. closing the window used to revert colors but keep your staged font changes, which was dumb (didnt really cause issues since changes werent applied anyways unless you saved beforehand but still.)
  • font role indicators: added a little visual thingamabob where the font list now shows a star next to whatever font is actively set as the body font (also font name is now rendered in its proper font)
  • path tooltips: added a hover tooltip on the font list items that shows the full file path of the font
  • also some placeholder stuff in the code for searching the customization menu i might be implementing soon

windows compat

  • std::filesystem::path everything: went through and switched out the raw std::string usage for font paths inside FontConfig, replacing them with std::filesystem::path. this was purely because my windows ci build was failing. i was passing raw char strings around and doing weird string conversions, which completely blows up on windows because it expects wide chars for paths and i didnt consider that when i was being lazy and doing silly conversions and stuff because i just wanted to pass ez pz to a c library.
  • freetype & serialization cleanup: updated all the internal freetype helper functions (GetFontName, etc.) and the json theme serializer to play nice with the new paths instead of passing raw char pointers

kinda mostly just making it a lil more prettier

0
0
39
Open comments for this post

9h 4m 13s logged

fighting with fonts

font-management rabbit hole in the theme editor… still wip

changes

font management in the theme editor

the theme editor now has a proper Fonts section

  • import .ttf / .otf fonts directly from the editor
  • assign fonts to roles like Body, Bold, Monospace, Icons, etc.
  • merge fonts together so icon fonts can be stacked on top of regular fonts
  • rename, delete, and change the size of fonts
  • fontsets are now saved as part of the theme, so imported fonts persist across restarts

the role system isn’t fully wired up yet currently Body is used as the default editor font and Monospace is used for the console.

im still working on the whole font management system here and its very unfinished and kinda untested.. very WIP!!!

hot-reloading

the annoying part was getting font changes to work while the renderer is running on another thread.

rebuilding the ImGui font atlas in the middle of a frame was… not ideal, and eventually resulted in an assertion.

now font changes mark the atlas as dirty, and the editor waits for the render thread to finish before rebuilding the atlas at a safe point.

not the prettiest solution, but it seems to be working.. kind of

dpi & freetype

also experimented with DPI handling for fonts and wrapped FreeType into a single shared instance instead of creating separate instances everywhere.

still figuring out exactly how I want the DPI/font sizing stuff to behave, but it’s getting there.

bug fixes

while doing all of this I also ended up fixing a few unrelated things:

  • fixed an old GUI rendering bug where text could stop rendering or become garbled because of a pointer race
  • thanks to @staneko for helping test/report that one since I couldn’t reproduce it properly on my system
  • fixed a weird compilation issue related to namespace escaping
  • bumped the vendored ImGui version for some dynamic font-related fixes
  • a few other small UI changes and cleanup

still working on this, and the font management side definitely isn’t finished yet…

most of this time was just spent trying to get it to half-work so.. yep..

0
0
51
Open comments for this post

3h 38m 49s logged

…the default imgui theme

first off, huge thanks for all the incredibly kind reviews on my last ship !!!

most of this work was also inspired by someone pointing out that i was still using the default imgui theme.
fairs… so i spent some time making the editor actually customizable and messing around with having some kinda-nice defaults :)

editor ui & theming

  • live theme editor: built a proper window to tweak colors, spacing, padding, rounding, etc. in real-time.
  • semantic palettes: added a semantic color system so you can build out a theme from a small set of base colors, rather than manually adjusting every single internal imgui color enum (though you can still override individual colors if you need to).
  • serialization: themes dump straight out to a theme.json sitting right next to the editor executable.
  • undo/redo: the theme adjustments go through the undo/redo system!
  • help menu: put in a placeholder help menu. turns out literally nobody likes reading docs, so i guess i gotta start explaining how to use the engine from inside the engine… not implemented yet though

editor groundwork

did a bit of backend cleanup as well.

  • added an EditorContext for editor-specific state, separate from the runtime EngineContext (currently just used for theme stuff)

  • started working on editor font support with a FontSet for things like Body, Bold, Monospace, and Icons, not implemented though

the font stuff is mostly groundwork for now, but the theming system is actually working and makes the editor feel nice :D

0
0
76
Open comments for this post

2h 48m 53s logged

scripts can schedule stuff for later

Added SetTimeout to the scripting API

changes

SetTimeout

SetTimeout(fn, ms) calls fn() after ms milliseconds. simple to call from obsl

  • timers live in a plain std::vector<Timer> in a new Platform::Time namespace, polled once a frame from Scene::Update no threads, no async bs or whatever :)
  • the callback itself is a SmallTask, which falls back to a heap allocation if the closure is too big to fit inline fine for this since timeouts aren’t really a hot path
  • timeout callback fires from an arbitrary point in Update, so it gets its own ScriptCommandBuffer set up on the worker just for the duration of the call, then flushed right after
  • also gc.add_root/remove_root the function around the callback so it doesn’t get collected while it’s sitting in the timer list waiting to fire

Documented it in the api reference alongside the other Time functions

also

  • tiny UI tweak in the tile editor: it now warns “no tile types defined, no map will be visible!” instead of just “no tile types defined” was seeing people get confused about why a new map looked empty after trying to paint

  • also small updates to docs in general and stuff but nothing super interesting

0
0
31
Ship

timer

a dead-simple CLI timer

why

i was tired of googling for timers all the time. for a while i’d had this thought sitting in the back of my head: why not just have a timer command in my terminal instead?
i looked around for something like this first, but couldn’t find anything in the form i actually wanted, so i built it myself.

it solves a simple problem: i needed a, terminal-native way to track time without breaking my workflow or needing a browser open in the background eating my ram.

what it is

a dead-simple timer. no fancy UI, no flags to memorize. one argument, intuitive syntax (imo):

timer 5m

that’s it.
no messing around with weird bash loops or sleep one-liners etc :D

it’s a fully working & tested on windows & linux directly, builds clean on mac via the github action too (but i dont own a mac so idk if it fully works, but it should).

QoL stuff

  • audio alarms plays a sound when the timer’s up. instead of bundling a massive audio library, it just leans on native OS tools (PlaySoundW on Windows, afplay on macOS, and a fallback chain of pw-play/paplay/aplay on Linux). it supports loopable or one-shot playback of a set sound, or you can just disable it entirely.

  • visual alerts triggers a visual alert alongside the alarm using system tools (requires libnotify on linux, uses osascript notifications on mac, and triggers a classic message box popup on windows).

  • simple config file 4 “set-and-forget” config options (SoundPath, SendNotification, PlayAudio, LoopAudio) via a simple key=value format. no need to pass crazy flags or remember syntax for a good setup;
    just configure it once and run timer 5m.

  • easy peasy to use!!! i guess that counts as qol ^o^ ?

other stuff

  • simple syntax timer 5m, timer 90s, timer 1h30m20s, whatever feels natural.

p.s the ordering of time units does not matter

  • kept the scope intentionally tight: one arg in, a timer running, an alert out. no dependencies bundled in, it’s dependency-less-ish by design, leaning on existing system-level tools instead of pulling in external libraries. binary’s relatively small & fast to build because of this
  • the git repo also hosts some arch linux pkgbuilds i wrote myself if ur into that kinda thing.. easy installation for nerds :)

I’m pretty happy with it and enjoy using it myself,
honestly wasn’t too hard to do since i’ve dealt with the terminal quirks i had before, which was the biggest issue

(specifically how windows handles ansii escape sequences on its old terminals)

more info exists in the readme for configuration and usage !!

Try project → See source code →
Loading more…

Followers

Loading…