snozbot / fungus

An easy to use Unity 3D library for creating illustrated Interactive Fiction games and more.
MIT License
1.59k stars 291 forks source link

[WIP] Unit tests for creating save data #1026

Closed CG-Tespy closed 2 years ago

CG-Tespy commented 2 years ago

Description

I felt we need to solidify more of the more basic stuff, such as creating save data of specific types, starting with the numeric Fungus Variables that Flowcharts can have.

Important Notes

Main To-Do List

Secondary To-Do List

CG-Tespy commented 2 years ago

What do you think, @stevehalliwell ?

CG-Tespy commented 2 years ago

Added a to-do list

stevehalliwell commented 2 years ago

All for more tests. There is already some existing tests in fungus that load prefabs as a unit test, so there's some good reuse/refactor there.

Many of the things in the list exist and have integration tests or demo scenes right now so they can be expanded to self validate and throw.

On the types supported, don't have to support everything out of the box but the underlying system and interfaces should allow more types to be added in the future (by us or by any one else). Also I Fungus save should save Fungus stuff first and foremost, things like remembering which music track was playing are nice to haves but at the moment not entirely controlled by Fungus, (it's not a Fungus system, it's just passing an audio clip ref along to Unity).

The solve I would want to see for music is, introduce the concept of tracks, and playlists to Fungus, then saving and loading is trivial as the system is entirely Fungus data, but that (and other elements) are beyond the scope of this feature.

CG-Tespy commented 2 years ago

@stevehalliwell

Many of the things in the list exist and have integration tests or demo scenes right now so they can be expanded to self validate and throw.

Hmm, then I think it'd be best to have them separated into their own suites for the sake of better organization, much like how I have things now. Can you handle that, please?

On the types supported, don't have to support everything out of the box Yeah, especially since some things aren't really essential

...but the underlying system and interfaces should allow more types to be added in the future (by us or by any one else).

Yes, that's pretty core to the save system's design right now ^^ I'm applying an approach pretty similar to what our View system has: a plug-and-play approach that lets the user easily insert and remove parts of the system

The solve I would want to see for music is, introduce the concept of tracks, and playlists to Fungus, then saving and loading is trivial as the system is entirely Fungus data, but that (and other elements) are beyond the scope of this feature.

I think I see what you mean... And I think that the track system you're suggesting will need to be implemented and tested before the save system can really be set up to work with it

CG-Tespy commented 2 years ago

At the time of this writing, we have things set up to save nearly all the essential var types.

CG-Tespy commented 2 years ago

While there's still stuff on the secondary to-do list, I think I've done enough work here to move onto another area of the save system for now