Correct format to use on a 'scene' file

Just got me wondering, similar to Godot's scene (.tscn) what existing format would be just as convenient when implementing a similar thing, which is to handle 'Node' trees and instancing another scene instead of writing your own custom format? i guess that would include adding filepath as field for instancing non-built-in stuff like resources and other scenes.

It depends a lot on what you want it to contain and how you want to process it. Also whether you want it to be nice to edit by hand. JSON is a well supported format if you just need software-to-software data that's still readable. TOML is a bit nicer to edit, but can be very similar.

I think a couple of key things that makes a file format like this easy for source control (and I believe this applies to Godot too) is that it's deterministic and not all in a single, compact line. You want line based diffs to not be too coarse and you don't want parts of the content to move around sporadically when serialized again.

On one end, YAML (or other similar line-based text formats, eg TOML, KDL) - automatic git merge support, easily generated and hand edited, but now you need a bunch of validation

On the other end: sqlite. High performance, easy implementation, powerful functionality out of the box, but needs a pretty specific design to take real advantage of it.

Regardless, ignore the temptation to parent/child relationships as being nested in the serialized (and in memory if you can) format: it's obvious and easy and simple right up until it's an absolute nightmare. Take the early loss of needing to reconstruct the tree on demand (likely from a parent id) and then it's clear skies, plain sailing.