uuids, collision layers, save settings, and other stuff
bit of a mixed bag this time. mostly cleaning up some systems that were already there and filling in stuff I’d need…
entity UUIDs
entities have proper UUIDs now, separate from their normal runtime entity IDs.
the regular generational ID still does all the normal ECS stuff, while the UUID is a stable identity that gets serialized with the entity.
this mostly fixes how persistent entities work between scenes.
previously I was deduplicating persistent entities by name, which was obviously not ideal since names aren’t actually identities.
persistent entities + their children now keep their UUIDs when moving between scenes, and if the destination already has an entity with the same UUID it gets replaced by the carried-over one.
two things can have the exact same name now without persistence randomly deciding they’re the same thing.
normal prefab instances / newly created entities still get new UUIDs.
collision layers
colliders now have proper layers + masks.
there are 32 collision layers, and every collider has:
- a layer
- a 32-bit mask of layers it accepts
both colliders have to accept each other’s layer for the pair to interact.
the same filtering is used for normal overlap events and movement blocking, so there isn’t a separate set of collision rules depending on which system happens to be asking.
added editor controls for this too, including the layer selector, all 32 mask toggles, and select all / deselect all buttons because clicking 32 checkboxes individually sounds incredibly fun.
scripts can also read / change the layer and mask now.
collision-aware script movement
also added Transform.TryMoveTo(x, y, z) to ObSL.
unlike SetPosition, this checks whether the entity can actually occupy the destination before moving it.
the normal hex movement system uses the same helper now too, so script-controlled collision-aware movement and normal movement go through the same path.
direct SetPosition is still basically teleporting, which is intentional.
also fixed on_collision_stay actually looking up the collision stay callback instead of the trigger stay callback.
whoops.
more save settings
did some more work around the save system from the last update.
saving can now be enabled / disabled per project, and projects can choose where save files go:
- Data Home, the normal OS application-data location
- Portable, relative to the executable
both still use the project UUID underneath so different projects don’t start sharing save files because somebody named both of them game.
these are editable from Project Settings now.
also added a confirmation dialog when regenerating the project UUID since doing that changes which save directory the project looks at. the old saves aren’t deleted, the project just gets a new identity and stops finding them automatically.
graphics config stuff
changed packaged builds so graphics.json can live beside the executable and override the version inside the package. (i.e if someone decides to unignore the graphics config and package it)
couple random fixes
particle emitters now keep their actual live particle count, so GetAliveCount() in ObSL finally returns the real value instead of the completely useless placeholder it had before.
fixed a prefab revert issue where the code was reading the prefab path from the component after destroying the entity. very intelligent.
also made theme font loading a bit less fragile. missing / broken font files get logged and skipped instead of potentially taking the whole theme load down with them, plus some parsing cleanup.
and updated another mountain of docs to match all the collision, persistence, save, prefab, post-processing and export changes.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.