Installed #gram (https://gram.liten.app/) by @krig, an AI and telemetry free fork of the code editor zed, and started feeling my way back into the engine project :)
Doing some janitorial work first, setting up a repo for the sample game now so that there's something for people to actually run. Faced with the eternal question, where do I put game assets? I don't mind just checking them into git but I don't want to overwhelm Codeberg's servers with large files.
The database backend for scene representation is finally falling into place :D Integrated it into the actual engine and updated the editor application. You can load a scene, move nodes around or hide them, save, and the changes are reflected on the next launch. Previously scenes were defined in handwritten YAML files that could be loaded from but not saved to.
There's a million issues still under the hood but debugging will be easier (and more fun) with 3D scenes to look at.
Can't wait to post screenshots / clips again soon. Been over half a year (?!) since I had any visual progress - the SQLite backend is essential but not really exciting to look at.
Still not doing any new rendering stuff in the near future probably, but editor workflow stuff mainly.
successfully did a math. years of education with vectors have not been in vain
turns out in the end I don't actually like what the algorithm does but at least it did the bad thing correctly
It's funny how some things in gamedev you never ever think about as a user are actually non-trivial problems. Like say you have a transform gizmo in a 3D editor. You click one of the arrows and drag the mouse somewhere to move it.
When the mouse remains on the axis of movement it's clear where it should end up. But what if the mouse is not exactly on the axis? You still want to move the gizmo in the general direction but confined to the axis. Where to exactly? There is no right answer
Update: Instead of redesigning the foundation I put more duct tape on it. Gonna try to build more on top to see where the system really breaks and learn what the requirements of a better alternative would actually be.
In other news, the SQLite based scene serialization/modding system is more or less fully integrated into the editor now. It works! You can spawn, rename, move, and delete nodes.
Next up: Show components in the inspector panel and make them editable.
#Qt has a model/view system that I'd like to use for the inspector. But I want to use nested views - one for a list of components of the node, and one for the properties of each component.
Looked at how you would do that idiomatically in Qt with delegates but there seem to be a lot of headaches involved to have a full view widget as the delegate for the items of a parent list view: https://blog.ortham.net/posts/2022-01-15-qt-view-delegates/
Thinking of giving QtQuick another try, maybe it's easier there. Problem is I couldn't find any libraries or guides for making a docking system. Currently I use the "Advanved Docking System" library, based on widgets. A dock can contain QtQuick-based content so mixing and matching is technically possible, but then it's probably difficult to handle drag and drop actions across docks.
So my options are:
- Live with widgets
- Develop docking system for QML
- Custom GUI library (pls don't make me)
Current status: Giving QtQuick/QML another try, to see if that has better support for the kind of composable UI elements and model/view delegates I'm looking for.
Really hope I can move on to gameplay in a not too distant future, or at least rendering code, but the foundation must stand first...
@tracefree Yeah it's an interesting problem and hadn't I made Marble Game from a FPS-VR idea I would have encountered it myself by now.
I remember in my first game I had a laser beam I wanted to emit a sound along its entire length. But sound emitter in Unity is spherical. There was a simple formula that mapped the emitter on the position of the beam closest to the player. Assuming the beam is the gizmo vector and the player the mouse cursor position mapped to 3D space - that would work.
@memoriesin8bit Yes that's what I mean. The proof doesn't fit on the margins of this toot but basically you derive it by realizing the shortest line connecting the two lines must be at a right angle to both of them. You express this relationship with dot products being zero, writing all the equations and solving for the unknown parameter.
It works well enough but doesn't _feel_ quite like I want it to, can ket you know once I have the next iteration