Greetings.
This thread is for suggesting changes and new features to the rig definition file format, aka 'truck' fileformat: https://docs.rigsofrods.org/vehicle-creation/fileformat-truck/
Just to be perfectly clear - I'm never going to stop supporting the truck file format or any part of it. I never intended to, although I might have created that impression. If an incompatible change ever needs to be made, I'll introduce a new `fileformatversion` for it. So relax and read on.
I've just had a very good chat about this with Max98 on Discord - coincidentally he suggested a feature that I've had in mind for a while. With his permission, I'm reposting the chat here for further discussion and questions.
Max98 — 02/09/2022
hey ptr, I wanted to ask, if ror going to support multiple truck files for one vehicle one day?
only_a_ptr — 02/16/2022
hi, do you mean creating a vehicle by combining parts in several .truck files? Yes, I'm definitely doing that in a foreseeable future, I had an idea of an "import <truckfile>" directive in truck file which would (at spawn time) combine the content of the imported truck file with the existing content. Only named nodes would be supported, tho, and I need to figure some way to create mass-distribution groups, because currently mass is set in globals and you probably want each truck file to define it's own mass for it's nodes.
Max98 — 02/16/2022
Perfect
only_a_ptr — 02/16/2022
I need to finish this first, tho - https://github.com/RigsOfRods/rigs-of-rods/pull/2829 - because presently sectionconfig & named nodes don't work as they should
Max98 — 02/16/2022
Also, does RoR generate@id numbers for nodes2?
only_a_ptr — 02/16/2022
absolutely, it cannot work otherwise
but it generates them on spawn time, depending on what precedes them
that way you can theoreticaly have section/end_section parts with variable node counts. The following named nodes just end up with different numbers, but thats fine
at least thats how it worked in 2013, but then I broke it. I only figured it out last year because that feat is undocumented and nobody used it to full extent
Max98 — 02/16/2022
Interesting
I always thought it would lookup for nodes with their name instead of their index
only_a_ptr — 02/17/2022
It does. I guess I confused you - it looks up using names on spawn, but you can always use the assigned number, too. IIRC some sections didn't process names at all (flexbodies, props or camera rails, IDK right now). when simulated though, it's all numbers (or pointers)
gotta go
, I'm glad you're into the multi-truckfile idea, I'll know who to talk to when I try coding it
Max98 — 02/17/2022
Honestly, if you'd ask me, I guess RoR needs a new truck format
Not really "new" but like remastered
It keeps all the parsing as is and everything, but for eg, no more numbred nodes
an other file for just the 'global' things and 'slots' (slimiair to beamng)
etc
only_a_ptr — 02/18/2022
I had the same thoughts back in 2013-14, but out of necessity I got so familiar with the current one I don't feel the need anymore
I'm actually remastering it as we speak - specifically undoing my clever shared_ptr tricks from 2013-14 and making it sequential like it was, see updated code at https://github.com/only-a-ptr/rigs-.../rig_def_fileformat/RigDef_File.h#L1547-L1619
the only elements left to do are set_node/beam_defaults
next I'll make named nodes supported everywhere, which will make it possible to add various-sized N/Bs in sections.
and finally I'll add the possibility to import other truck files, with named nodes
Max98 — 02/18/2022
That’s what we need
This thread is for suggesting changes and new features to the rig definition file format, aka 'truck' fileformat: https://docs.rigsofrods.org/vehicle-creation/fileformat-truck/
Just to be perfectly clear - I'm never going to stop supporting the truck file format or any part of it. I never intended to, although I might have created that impression. If an incompatible change ever needs to be made, I'll introduce a new `fileformatversion` for it. So relax and read on.
I've just had a very good chat about this with Max98 on Discord - coincidentally he suggested a feature that I've had in mind for a while. With his permission, I'm reposting the chat here for further discussion and questions.
Max98 — 02/09/2022
hey ptr, I wanted to ask, if ror going to support multiple truck files for one vehicle one day?
only_a_ptr — 02/16/2022
hi, do you mean creating a vehicle by combining parts in several .truck files? Yes, I'm definitely doing that in a foreseeable future, I had an idea of an "import <truckfile>" directive in truck file which would (at spawn time) combine the content of the imported truck file with the existing content. Only named nodes would be supported, tho, and I need to figure some way to create mass-distribution groups, because currently mass is set in globals and you probably want each truck file to define it's own mass for it's nodes.
Max98 — 02/16/2022
Perfect
only_a_ptr — 02/16/2022
I need to finish this first, tho - https://github.com/RigsOfRods/rigs-of-rods/pull/2829 - because presently sectionconfig & named nodes don't work as they should
Max98 — 02/16/2022
Also, does RoR generate@id numbers for nodes2?
only_a_ptr — 02/16/2022
absolutely, it cannot work otherwise
but it generates them on spawn time, depending on what precedes them
that way you can theoreticaly have section/end_section parts with variable node counts. The following named nodes just end up with different numbers, but thats fine
at least thats how it worked in 2013, but then I broke it. I only figured it out last year because that feat is undocumented and nobody used it to full extent
Max98 — 02/16/2022
Interesting
I always thought it would lookup for nodes with their name instead of their index
only_a_ptr — 02/17/2022
It does. I guess I confused you - it looks up using names on spawn, but you can always use the assigned number, too. IIRC some sections didn't process names at all (flexbodies, props or camera rails, IDK right now). when simulated though, it's all numbers (or pointers)
gotta go

Max98 — 02/17/2022
Honestly, if you'd ask me, I guess RoR needs a new truck format
Not really "new" but like remastered
It keeps all the parsing as is and everything, but for eg, no more numbred nodes
an other file for just the 'global' things and 'slots' (slimiair to beamng)
etc
only_a_ptr — 02/18/2022
I had the same thoughts back in 2013-14, but out of necessity I got so familiar with the current one I don't feel the need anymore
I'm actually remastering it as we speak - specifically undoing my clever shared_ptr tricks from 2013-14 and making it sequential like it was, see updated code at https://github.com/only-a-ptr/rigs-.../rig_def_fileformat/RigDef_File.h#L1547-L1619
the only elements left to do are set_node/beam_defaults
next I'll make named nodes supported everywhere, which will make it possible to add various-sized N/Bs in sections.
and finally I'll add the possibility to import other truck files, with named nodes
Max98 — 02/18/2022
That’s what we need
Last edited: