Speed using tables to spawn room items - question based on DeepBlueApps' old "Collision With Tables"

mhedgesmhedges Raised on VCSMember Posts: 634

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    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

  • mhedgesmhedges Raised on VCS Member Posts: 634

    @tatiang said:
    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).

    Thanks for the tip - I'm using Loop on another project and totally forgot about it.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited September 2016

    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

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2016

    @tatiang said:

    You're welcome. Here's a demo using Loop to spawn 300 squares in 0.083 seconds . . .

    Nice ! :smile:

    I upped your max-loops to 600 and got a time of 0.017 !!

  • mhedgesmhedges Raised on VCS Member Posts: 634

    @Socks said:
    Use Loop, and > @tatiang said:

    You're welcome. Here's a demo using Loop to spawn 300 squares in 0.083 seconds . . .

    Nice ! :smile:

    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. :D

  • SocksSocks London, UK.Member Posts: 12,822

    @mhedges said:
    . . . if you want to share that 0.017 test run file . . .

    tatiang posted it above.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    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

  • ArmellineArmelline Member, PRO Posts: 5,327

    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!

Sign In or Register to comment.