Dots

Post your nifty GP projects here!

Moderator: MSandro

Post Reply
JohnM
Posts: 379
Joined: Sep 11th, '15, 14:42

Dots

Post by JohnM » Sep 11th, '15, 19:20

Here's a fun, simple, interactive project that uses many instances of one sprite, each of them responding to the distance and direction to the mouse.
Dots.png
Dots.gpp
(1.35 KiB) Downloaded 492 times

mguzdial
Posts: 70
Joined: Sep 15th, '15, 11:21

Re: Dots

Post by mguzdial » Sep 15th, '15, 17:45

So cool, John! I'm still wrapping my head around instantiating new objects within GP.

What are the effective limits to number of instances and their size? I'm wondering if I could do some Kedama-like things, where I create single-pixel instances that get their color from some image, and then have them align themselves on the stage to do MediaComp manipulations by object-as-pixel.

JohnM
Posts: 379
Joined: Sep 11th, '15, 14:42

Re: Dots

Post by JohnM » Sep 15th, '15, 18:09

Small-scale Kedama-like things involving up to 1000 instances are fairly practical. I'm hoping we can push that up to a few thousand instances, which may be enough to process small images in a Kedama-like way. But Kedama (like StarLogo) was a SIMD system optimized for massive parallelism, which GP is not. So every running script in GP is a separate task, so the overhead of scheduling all those tasks takes a toll as you get into the thousands. In contrast, looping over the pixels in a single script requires only one task, so there's no task switching overhead.

That said, the "Diffusion" project is implemented in a Kedama-like style and for a 20x20 grid (400 instances) the performance isn't bad. But I think performance is not so great for a 50x50 grid (2500 instances).

Post Reply