Geode - A module providing a way to render randomly tweening dots that will be able to connect depending on their distance to each other

Geode, previously known as Geometry Lines Background, is a module providing a way to render randomly tweening dots that will be able to connect depending on their distance to each other.

This is a full refactor from the old version, the API has significantly changed, it is recommended to read the API reference again for changes

Get the module from GitHub Gist

See the documentation at my site

8 Likes

Version 2 changes:

  • Renamed to Geode
  • Full refactor
  • Lines are now cached instead of creating and destroying old lines (unused lines will be cached until Stop is called which will destroy all lines in the cache)

Documentation update TODO

1 Like

Version 2.1 changes:

  • Fixed a bug where Enabled is not set at all in Start() and Stop()
  • Add deconstructor method
  • Changed heartbeat connection to be disposed only at deconstruct

Documentation @ About - RE Docs

Would stand out more if it’s optimized for performance. I’ve tried this in the past and trust me, it’d get laggier even if you just add a few more. If you haven’t, try using a quadtree to lessen the number of checks needed

How would these data structures help optimize the performance? (I’m not that well-versed in those kinds of topics, apologies if I sound a bit stupid here)

You see, I’ve also been looking for ways to improve the performance but even after 2 years, nothing much really came to my mind on how do I improve the performance.

1 Like

not at all, I’m not that well informed about quadtrees as well.

A quadtree recursively splits your 2D space into four quadrants (octrees for 3D). So in dense areas, the tree will divide more until each box has just a few nodes. When you need to find neighbors for a node, instead of scanning the whole space, you only search the relevant quadrants.

When searching, start at the root and work your way down. For each quadrant, check if it even intersects with the node radius (assuming you use a radius). If a quadrant is completely outside the radius, just skip it. Also if you find that a whole quadrant is inside the radius, you can just grab all the nodes in that box to avoid unnecessary checks.

There are of course more to this but this is all I know about them. I recommend seeing this video from TheCodingTrain to see how to implement this in code:

1 Like

use bulkmoveto api to optimzie this

aren’t bulkmoveto only for baseparts?