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

torkel

@torkel

Joined June 1st, 2026

  • 117Devlogs
  • 2Projects
  • 2Ships
  • 34Votes
a so called "programmer"

banner credit @lix
Open comments for this post

4h 12m 52s logged

spritesheets / animation

finally … spritesheet support

spritesheets

added a new SpriteSheetComponent with:

  • texture
  • rows / columns
  • optional row + column spacing
  • start frame
  • animation length
  • FPS
  • looping
  • playing / paused state
  • current frame

basically the renderer can now render only a specific UV region of a texture

animation

also added a small sprite animation system that advances frames based on FPS and handles looping / stopping at the end etc etc

animations also update while in the editor… might be annoying for some, might be less annoying for others.. but thats how i like it

editor stuff

you can pick the texture, set rows / columns and spacing, choose the start frame + animation length, change FPS, toggle looping / playback, scrub the current frame, restart the animation, etc. etc

EngineLib

scripts can inspect stuff like the current frame, frame count, FPS, rows / columns and texture, and can also change the texture/grid/animation, set frames, play, pause, restart and stop animations.

Collider also has a proper EngineLib component wrapper instead of collision only being accessible through the callback hooks. right now that’s just getting / setting whether it’s a trigger, but it’s there.

also added both Collider and SpriteSheet to the normal GetComponent, AddComponent, RemoveComponent, HasComponent, etc. obviously.

some cleanup

did a bit of registry / EngineLib locking cleanup while I was in there too, mostly around entity wrappers being created while the registry lock is already held.

also fixed one very stupid collision callback typo where on_collision_stay was looking up the wrong hook… oops…..

im also starting on documenting this stuff…. yep.. pain…

spritesheet used in video attached for testing is : https://opengameart.org/content/animated-butterfly

0
0
160
Open comments for this post

2h 10m 35s logged

collision callbacks

scripts can do collision things now….!!!

script collision callbacks

ObSL scripts can now define collision hooks:

  • on_collision_enter(other)
  • on_collision_stay(other)
  • on_collision_exit(other)
  • on_trigger_enter(other)
  • on_trigger_stay(other)
  • on_trigger_exit(other)

the other argument is a normal EngineLib entity wrapper, scripts can do stuff like check its name, components, etc.

collision events get collected by the CollisionWorld, then dispatched to the relevant script instances afterwards. they’re also run through the existing script command buffer ofc

2D collider shapes are back too…

added explicit 2D shapes alongside the 3D ones:

  • Rectangle
  • Circle

so the full set is now:

  • Box
  • Sphere
  • Cylinder
  • Rectangle
  • Circle

rectangle / circle are flat shapes. which is nicer for sprites and other 2d things

movement actually respects colliders

hex movement now checks whether an entity can actually occupy its next tile before moving there.

added a CanOccupy() collision query which builds the entity’s collider at the target position, it blocks the move if something solid is in the way.

triggers don’t block movement.

collision robustness stuff

also did a bunch of smaller fixes around the collision

  • added a shared collision tolerance instead of random 1e-6s in different places
  • AABB overlap now uses that tolerance too
  • improved collider validation depending on the actual shape
  • fixed gizmo world-to-local conversion to use the proper inverse transform
  • more finite-value / clipping checks in the collider gizmo
  • GJK Indeterminate results preserve the previous collision state instead of automatically counting as a collision

p.s, heres a lil photo of my attempt at making syntax highlighting for obsl using textmate grammar… :D

0
0
31
Open comments for this post

3h 3m 39s logged

collision system round 2 i guess

ended up pretty much reworking most of the collision system…..

the first version was still basically 2D, with separate box vs box / circle vs circle / box vs circle functions. that worked as a starting point, but it was gonna get annoying …

so… it is 3D now.

colliders

ColliderComponent now supports:

  • boxes
  • spheres
  • cylinders
  • 3D offsets / dimensions
  • triggers
  • entity-space or billboard orientation

billboard colliders follow the same camera-facing basis as billboard rendering, which means billboard sprites can still have colliders that actually line up with how they appear on screen.

GJK

got rid of all the individual boxVBox, boxVCircle, etc. collision functions and replaced them with support-mapped collision detection using GJK.

each collider shape just provides a support point now, the intersection test doesn’t care what combination of shapes it’s checking.

i dont fully understand the math completely yet.. but it kinda makes sense :D

still no collision response / physics yet. this is just detection + events, i think ill prolly get it into EngineLib.. soon…

events

the CollisionWorld still tracks collisions between frames and generates:

  • Enter
  • Stay
  • Exit

trigger state is kept with the collision too.

this is for EngineLib integration.
scripts should be able to react to collisions / triggers like unity

I have not gotten around to this yet though…

collider gizmos

also had to redo the collider gizmos now that colliders aren’t just flat 2D shapes anymore…
its a lil janky
but it works..

billboard cleanup

while doing the billboard collider stuff I also cleaned up billboard rendering a bit

billboards used to have their world transform temporarily modified by SpriteBillboardSystem before rendering. now the billboard matrix is generated when the entity is submitted to the renderer instead, so the actual ECS transform can stay as the real entity transform

there’s now one shared billboard matrix helper used by both rendering and collision, which is considerably less cursed.


um
scripting integration next i guess.. if something dosent explode ! :D

0
0
54
Open comments for this post

3h 25m 25s logged

collision stuff

been working on a collider system.
still pretty early and not hooked into EngineLib yet, but most of the basic backend + editor stuff is there

planning to expose it to scripts in a similar way to how Unity handles collision callbacks / triggers, but that’s for later…….

collision

added a new ColliderComponent with:

  • box and circle colliders
  • offsets
  • size / radius
  • trigger support

collision system currently handles:

  • box vs box
  • circle vs circle
  • box vs circle
  • collision normals + penetration depth
  • ‘trigger’ collisions

also added a CollisionWorld that keeps track of collisions between frames and generates Enter, Stay, and Exit events. mostly groundwork for when I hook this into EngineLib…

collider editing

colliders are editable from the editor

theres a collider inspector widget for changing the shape, offset, size/radius, and whether it’s a trigger, plus a viewport gizmo for directly moving and resizing them

collider edits also go through the undo system, because every new editor feature needs to become an undo/redo problem eventually……… :D

other editor fixes

  • entity copy/paste now copies the whole child hierarchy instead of only the selected entity
  • pasted hierarchies keep their parent relationships
  • added copy/paste to the entity and UI context menus
  • fixed stale entity / UI selections after the thing being selected gets deleted
  • fixed single-key shortcuts like V, T, R, etc. firing while Ctrl/Alt/Shift was held
  • keyboard camera movement no longer fights with Ctrl/Alt shortcuts
  • a few smaller include / cleanup things

mostly collision work though. next step is probably getting the collision events into EngineLib and experimentiung w. it

its still a bit jank of course but it works i guess :DDDDD

0
0
38
Open comments for this post

4h 51m 4s logged

copy paste (kinda)

also too much time fighting windows builds

tried to get entity copy/paste working and it’s… janky.

also ended up wasting a stupid amount of time just getting windows builds to actually build again because i lowk forgot again about how it wont let me pass paths as strings implictly as it does on every other damn os…

changes

copy/paste (wip, kinda broken)

  • started on ctrl+c/ctrl+v for entities & ui in the editor it kinda works but is really janky and does not feel good to use, also tried implementing it in the context menu but its not workiong at all -.-

other

  • the windows fixes….

  • some resharper reccomendation inspection type shi

but lowk its been a while since i logged soo yep

0
0
37
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
120
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
39
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
80
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
50
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
130
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
49
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
54
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
49
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
28
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
38
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
34
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
80
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
59
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
58
Loading more…

Followers

Loading…