massive grid spawning

louistrudellouistrudel Member, BASIC Posts: 15

Hello there,

I have been paying around with grids a little bit and i cant seem to be able to spawn a massive grid in a short amount of time. Anything over 100X100 is taking too long.

here's a sample of what im doing: https://www.microsoft.com/en-ca/download/details.aspx?id=15697

Any ideas on making it spawn faster?
maybe a theorical mathematical grid system istead of square actors?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
  • ArmellineArmelline Member, PRO Posts: 5,368
    edited September 2015

    This sounds like a perfect competition to have. Prizes for whoever can spawn a 100x100 grid fastest, and who can do it fastest with the simplest logic.

    A 100x100 grid is 10,000 actors, though. That's a LOT to spawn. Even 50x50 is going to take a looong time even with the fastest methods developed so far.

    GameSalad's loop behaviour takes about 8.3s to iterate 500 times on my computer. That's 166 seconds to iterate the 10,000 times needed for a 100x100 grid. The method I usually use runs approximately twice as fast as the loop behaviour, which is still massively too slow, but still too fast to do even moderately complex logic in each iteration.

    HyperLoops are great, as they run REALLY fast, but the downside of this is that you really can't do a lot of things with them. It's difficult to leverage a specific number as it is iterated - for example if you want another action to happen when the number you're iterating is 123, it's not a simple matter. I don't know if anyone has tried to use hyperloops to spawn a 100x100 grid but I'll be very interested to see the result (genuinely, that's not sarcasm).

    The method in the second of @tatiang's links wouldn't really work for such a purpose either as it runs the logic to iterate multiple times within each "loop". Unless I'm understanding it wrong (I only looked at it briefly) it's not going to be any faster than other methods when each spawn needs individual considerations.

    I'm really interested to see what would come of such a dedicated investigation by the GS forum after this extra time has passed.

    Of course, 10,000 actors on scene at once will be an interesting challenge for GameSalad in itself!

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

    I agree that 10,000 actors is probably unsurmountable and kudos to you @Armelline for taking the time to explain why.

    Also, the link takes me to a Microsoft service pack update...???

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

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

    @tatiang said:
    I agree that 10,000 actors is probably unsurmountable and kudos to you @Armelline for taking the time to explain why.

    Yeah, good expiation from Armelline, the OP doesn't offer a lot of detail, for all anyone knows the actors on this grid need to disappear when you click on them, maybe they don't, maybe they are all different colours, maybe they are the same, maybe they have a number on or are spinning or . . . . . . (etc etc), without know what this grid does it's hard to recommend anything . . . if you wanted 10,000 squares on screen you could make 1 square and apply two replicate behaviours (1 x 0° x 100 copies + 1 x 90° x 100 copies), it would 'spawn' in less than a single draw cycle, so instantly, and you could tell which square the user clicks on with simple X, Y measurements . . . but without knowing anything about what this grid does this approach might not be right.

Sign In or Register to comment.