ECHOPULSE New Raycast System
What I worked on
I have completely finished remodeling the raycasting system for ECHOPULSE. The biggest highlight is my new "memory orbs" system, which sustains previously mapped-out parts of the world for 15 seconds. This was very challenging because it expanded my existing orb count by 1200 orbs, which introduced various performance drains on top of my existing pool of 2000 orbs.
Technical Details
New World Raycast System
Despite the challenges of setting up a memory system, I still pursued it because it would completely redefine the experience for players. Instead of always having a limited view of the world around you, you're briefly rewarded for your exploration by still seeing some of where you were last. It provides a level of comfort and creates a stark contrast between explored vs. unexplored areas (which are completely dark), making the game more visible. Without the memory orbs , the players would hardly see much, but now it provides a level of depth and world-building that is hard to find elsewhere.
I accomplished this primarily through object pooling since creating and destroying thousands of objects in Roblox is a memory drain, and I paired this with a memory reclamation process when the pool maxes out to reuse the oldest memory orbs first (often called Swap-and-Pop). I also had to be aware of how often the thread needs to bridge between Luau and the C++ engine, which I reduced by utilizing the BulkMoveTo function instead of modifying the CFrame of thousands of individual parts. I now use a fair bit of spatial hashing to avoid parts stacking on top of each other , and I found noticeable gains in performance when I reduced math operations such as math.sqrt inside large loops (which are computationally expensive) and replaced them with squared values instead (B ² + C ² = D ² ), and pre-baked my math.random functions in a table to cycle through for orb jitter instead of performing math.random inside the loops for every orb. I also split up my threads based on priority to ensure certain background tasks, such as color and transparency changes, ran at 20Hz instead of the regular 60-120Hz for critical tasks like CFrame tracking and vector positioning.
This was extremely hard to create since running this many orbs and property changes constantly is very demanding on performance, and every small detail matters because it is used at a large scale, but the results were absolutely beautiful:
Previously
Now
New Player Raycast System
With the new world raycasting, I realized it was time to improve my player raycasting system as well. Previously, players were mapped out randomly, which resulted in little structure and definition of their silhouette. I improved this by forcing all the orbs to map to the body parts' perimeter. This isn't too heavy on performance right now, but I might implement similar hashing and pre-baked functions used in the world raycasting for players later. This defines their body much better and allows me to explore custom character designs now that their features are well visible. I have built on this further to create a unique structure for specific skin rarities, such as an outline band for secret skins and projecting the orbs further out for legendary skins to get a firefly effect:
Previously
Now
Up Next
So far, it has run without issues with multiple people in a server and runs perfectly on mobile too. With this done, I'm planning to finalize the new inventory system and items, with another post on that system and one on the new zone.