Speed using tables to spawn room items - question based on DeepBlueApps' old "Collision With Tables"
Hello -
Digging out of the old subdirectory. Back in the day when DeepBlueApps made templates for GameSalad, a little demo template called "Collision With Tables" was released. It's quite the nifty way to generate rooms/scenes based on whatever values you assign to a table, and from there you could run with the ball to create walls or items or whathaveya.
One thing I noticed about the template is that the scene generation is not instantaneous, but rather line by line (or two lines at a time, in some of the scenes in that template). The speed is basically a function of how many rows and columns the table has.
That said, would there be an instantaneous way to generate all blocks as on the table? For example, if 0 is empty and 1 is a wall, have all 0s and 1s spawned at once.
Thanks, regards.
Comments
It's not technically possible to have them spawn "at once" but you can get a lot better results with the current Loop behavior or some of the community-generated speed trials (e.g. FastForLoop, HyperLoop).
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks for the tip - I'm using Loop on another project and totally forgot about it.
My Blog / App Store / Google Play
You're welcome. Here's a demo using Loop to spawn 300 squares in 0.083 seconds on a Mac and 0.067 seconds on an iPhone 6.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang said:
Nice !
I upped your max-loops to 600 and got a time of 0.017 !!
Waitaminnit, before I start salivating, the loop needs to read from a table. I can try that over here, but if you want to share that 0.017 test run file we'll be more than happy to look under the hood.
My Blog / App Store / Google Play
tatiang posted it above.
Sorry, I didn't use tables. Only because I wanted to post a demo quickly. It can be adapted for tables and someone can post the time differences.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
The option they gave to set the max frames per loop was a real sleeper hit. Such a huge feature that went almost unnoticed. The fast loop using spawns is no longer necessary as we can do it just as quick with loops! One little input box and made loops so much more powerful!
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support