stardance has been extended another month! the new deadline is october 31 :)

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

3h 50m logged

uuid-bound script wrappers…, logger sinks…., and a pile of small editor stuff….

mostly scripting + logging plumbing this time, plus a couple of editor things I’d been wanting…

changes

script wrappers are uuid-bound now

entity wrappers used to capture the raw runtime id, which is a problem if ids get recycled or the registry gets rebuilt. now every wrapper holds the entity’s uuid and resolves the live id on each call, so it keeps pointing at the right entity (or does nothing if it’s gone).

  • new FindEntityByUUID(uuid) global and GetUUID() / .uuid on entity objects
  • SetParent matches an entity object by uuid, a plain number is still a runtime id
  • same treatment for UI wrappers: they resolve by uuid instead of name, so renaming or duplicate names don’t break them
  • added FindUIByUUID, GetUUID() and Destroy() on UI elements, and SetImage / GetImage on images (acquires the texture through the scene asset scope like fonts do)
  • still by name: FindUI, DestroyUI and the button state queries (WasClicked / IsHovered / IsHeld). UI scripting is still weird… work in progress i guess…

logger sinks

the old way was swapping the logger’s std::ostream for a stringstream that the UI panel also read from, which was a data race waiting to happen (logger thread writes, main thread reads). replaced it with actual sinks:

  • ILogSink with ConsoleSink (stdout/stderr like before) and UILogSink (mutex -ed pending buffer the panel drains each frame)
  • the editor and runtime both register a ConsoleSink, and the editor adds the UI sink on top, so the Logs panel is always there now instead of only when there’s no tty
  • console panels color lines by severity now
  • interpreter output goes through a small UiStream ostream into the ObSL panel, with stdout and stderr split (needed the bumped obsl, Interpreter takes both streams now…)
  • ObSL panel clears when you enter play mode

editor

  • F focuses the camera on the selected entity, press it again to go back to the origin. its smooth…., ..panning cancels the focus
  • keyboard pan only gets called when there’s actually input now..
  • editing a material in the inspector no longer mutates shared runtime-only materials. if it isn’t a catalog asset it gets cloned into assets.json first, and edits to catalog materials get “upserted” back to the catalog. “Clone Material” writes to the catalog too
  • new scripts from the project browser come with an on_update stub instead of just a comment

scripting runtime

  • script top-level code now runs with the command buffer in “immediate” mode (BeginImmediate/EndImmediate), so registry writes at the top of a script apply right away instead of waiting for a flush that hasn’t been set up yet during init
  • Hex_GetNeighbors wasn’t GC protecting its array while filling it, fixed….

grid tile textures

a tile type with no texture used to fall back to hex_tex both when collecting dependencies and when loading scenes, which would pull in a texture that might not exist. now no texture means no texture… as it should…

misc

  • bumped obsl (new using alias feature, and err output stream settings)
  • docs for all the uuid stuff, the F key, and the new UI/image methods… of course…

oh also … new demo scene testin thingamabob im messing with…

0
35

Comments 0

No comments yet. Be the first!