Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: chippers on October 19, 2020, 02:22:55 PM

Title: Best practice for large variable pools
Post by: chippers on October 19, 2020, 02:22:55 PM
I'm trying to shave seconds off of the start-up load time and keep performance unaffected by about 10,000 vars, all bools, strings & floats. They're all in Don'tDestroyOnLoad, since I need them around at all times. Some questions:
1. Does dividing them all into massive arrays, instead of individual variables, help performance?
2. Is it useful to deactivate these objects/groups of objects when I don't need them, even though they're static and just for data?
3. I know global variables have a bad rep, but aren't global arrays efficient for this type of data storage? They seem the easiest to implement.
Thank you!
Title: Re: Best practice for large variable pools
Post by: nFighter on October 19, 2020, 03:28:14 PM
10000 vars as “don’t destroy”... That doesn’t look like efficient solution in any case, why not using database and pick up only those you actually need at the current time? But if you REALLY operate 10000 values at one time maybe you should check DOTS/ECS. Unity’s monobehavior and playmaker is not the best solution for 10000 simultaneous calculations
Title: Re: Best practice for large variable pools
Post by: chippers on October 19, 2020, 04:03:22 PM
Thanks for the reply, I'm sure you're right, I'm at my first game :'(. So what is the best, most light-weight way to store such a giant database that can be accessed from FSMs at any time (and modified from time to time)? One huge non-monobehaviour script? And optionally, since they are currently only in FSMs now, is it possible to transfer them to that?
Title: Re: Best practice for large variable pools
Post by: nFighter on October 19, 2020, 06:23:51 PM
One of the best save/load solutions for unity/playmaker is Easy Save. I'm using it all the time.
https://moodkie.com/easysave/

Also, people recommend BG Database. (I have not tried it yet, but looks like it's a really good database solution for unity/playmaker)
https://www.bansheegz.com/BGDatabase/
Title: Re: Best practice for large variable pools
Post by: chippers on October 19, 2020, 06:59:49 PM
I'm using Easy Save 3 heavily, but that takes its sweet time too, the BG Database looks like it hits the nail on the head, just need to fork out the 30 bones ::) Guess it wasn't as straightforward an issue as I had hoped. Anyway, thanks a million!
Edit: Lucky me, I already had a similar asset called Databox from a Humble Bundle that also has PM support, throwing that in in case this gets some eyes from Google 8)
Title: Re: Best practice for large variable pools
Post by: djaydino on October 20, 2020, 05:24:54 AM
Hi.

Hash Tables can be helpful here, you can find them in the Array maker package on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181).

Also check this topic :
https://hutonggames.com/playmakerforum/index.php?topic=20829.0

10000 vars as “don’t destroy”... That doesn’t look like efficient solution in any case, why not using database and pick up only those you actually need at the current time? But if you REALLY operate 10000 values at one time maybe you should check DOTS/ECS. Unity’s monobehavior and playmaker is not the best solution for 10000 simultaneous calculations

10000 vars as single vars might not be the best solution for handling, but performance wise it would be better than loading / saving on each scene change.

DOTS is a lot worse and slower than playmaker due to mirroring, same for BOLT.