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

[Question] Does splitting out the flowchart into smaller flowcharts improve performance? #1037

Closed TheEmbracedOne closed 1 year ago

TheEmbracedOne commented 2 years ago

Has anyone done any extensive testing regarding flowchart/block performance? Amalgam on the Discord server mentioned that having a lot of blocks in a flowchart are a huge drain. If you can distribute your blocks among more flowcharts performance is better

I've experienced problems with performance, I had most of my game's content in one big scene with ~50 flowcharts, some with thousands of blocks. Loading the scene took Unity about 40-50secs.

I've since split out my flowcharts into several small scenes, pretty much 1 flowchart per scene and got a nice <5sec load time on most... but I'm wondering whether there's a worthwhile gain to be had from splitting flowcharts into smaller ones within the same scene.

I've done a small test where I took a scene with one medium sized flowchart in it, duplicated it, and split out the flowchart into smaller flowcharts in the duplicate scene.

So in one, I have one all the blocks in one flowchart image

In the other I have the same content split out into 5 small flowcharts like this image

Load time is almost the same however, there's no noticeable difference between loading the two scenes.

Has anyone done more testing on this? At what point does the performance "gain" become noticeable, if ever?

TheEmbracedOne commented 1 year ago

Doing more testing since, I found that having no more than 3-5 flowcharts, with each having max 200 components/commands on them helps loading times immensely, but this is not really a Fungus-specific issue; if you have hundreds of components on several gameObjects, Unity will take longer loading.