QuadCubedStudios / GoDAW

A Godot DAW
MIT License
98 stars 11 forks source link

Project Saving #43

Closed IsotoxalDev closed 1 year ago

IsotoxalDev commented 2 years ago

Saving a project

A project is GoDAW a "Project" resource which consists of:

  1. Project Name
  2. Project Type (SongScript or GUI)
  3. Song Sequence
  4. Song Script as text

File formats for saving

There are many existing file formats for saving data. for eg.

  1. LMMS's file format .mmp,
  2. .MIDI
  3. .XML

We could also have our own file format or we can save projects as .res and .tres file formats. In that case importing in Godot would be very easy.

The files formats i think we should or can use are:

1. .XML

XML is a widely used Markup language. XML has been used for saving files for very long. Godot has a inbuilt XML parser so writing and reading can be done with ease

2. .res and .tres

Godot can save Godot resources as .res and .tres files. As you may have read earlier SongSequence is a Godot resorurce. With saving as resource writing and reading is much more easier than xml. we can load the file as is and use it without parsing the data.

3. .gdw

A custom file format. TBH this is just for the coolness factor. We may need to write a custom way to parse it and save it.

IsotoxalDev commented 2 years ago

We can now save Projects as .res and .tres files. If anyone feels the need of having a seperate specific format like a custom one this issue can stay open.

IsotoxalDev commented 1 year ago

This issue will be reopened as i have encountered this https://www.youtube.com/watch?v=j7p7cGj20jU. The resource files ( .tres, .res ) are not safe as it has the ability to run code by attaching a script to the resource file and it may destroy your system.

Unless and until we have a safe and reliable way to load the projects in a sandboxed environment we may stop the use of saving the projects as Resources.

IsotoxalDev commented 1 year ago

Did a bit of a check by importing a file that prints "YOUR PC IS DOOMED" on init as we're not initializing the script and has type checking as well it didn't print it