Sponsored By
Read the Game Developer team's GDC 2023 coverage here, including Talk writeups and interviews from the show, as well as our favorite GDC Vault videos covering 2023 Talks.

Building the brutal (and brilliant) bullet hell systems of Luna Abyss

Luna Abyss developer Bonsai Collective explains how it preserved performance by taking a unique approach to its bullet hell system.

Chris Kerr, News Editor

April 14, 2023

4 Min Read
A screenshot from Luna Abyss featuring enemies in a crimson red corridor

Luna Abyss feels like a rhythm game disguised as a bullet hell shooter. Bonsai Collective's atmospheric adventure plunges players into the depths of a brutalist prison hidden below the surface of a "mimic moon" known as Luna to recover forgotten technology and learn more about the lost colony that previously inhabited the centuries-old construct.

Once players have slipped beneath the surface of the crimson megastructure, Luna Abyss goes full tilt, peppering them with cosmic horrors, eldritch monstrosities, and bullets. So. Many. Bullets. It's during those frenetic moments that Luna Abyss comes into its own, demanding players combine a myriad of weapons, abilities, and platforming skills to become an unstoppable kinetic force every bit as demonic as their foes.

Building those electric skirmishes, however, required plenty of iteration. Speaking to Game Developer earlier this year, Bonsai Collective co-founder Benni Hill and programmer Matthew Reynolds explained that constructing a bullet hell system that could push players was an "incredibly complex" challenge that required the remote studio to get crafty.

Hell is other bullets

For instance, when the team first stated prototyping, Luna Abyss felt more like a standard first-person shooter than a bullet-drenched slalom, largely because players weren't being confronted by complex bullet patterns that could only be countered with a more dynamic approach.

"When we originally built the system for our early concept demo, we were using a dynamic spawn system. So, the bullets were spawning dynamically from the enemy and being sent out in a pattern of our choosing. That was very rudimentary, and basically involved us saying 'we want to spawn X amount of bullets and then send them off in different directions to create a bullet pattern of some kind,'" said Hill.

Bonsai's programming team quickly realized that system wouldn't deliver on Luna Abyss' potential, and might actually hamstring performance. With that in mind, they worked to implement an alternative that essentially builds the bullets somewhere else–away from players–and then moves that (rather deadly) stockpile into the game space when required. According to Luna Abyss programmer Matthew Reynolds, creating a production line of bullets outside the play space and yanking them into place as needed (rather than relying on dynamic spawning) massively improved performance.

"Spawning bullets dynamically has a significant performance cost," said Reynolds. "If we only spawn a few then it often won't have a very noticeable impact on performance, but our game features many large-scale attacks meaning performance takes a significant hit. As this means the worst performance hitches would happen in the heat of combat, we decided to take a different approach."

Providing more specifics on the system itself, he explained Luna Abyss spawns in all of the bullets used by regular enemies into a "few big pools" during the initial load stage before grouping them by bullet type. Then, anytime an enemy wants to fire a specific bullet, it can grab one from the appropriate pool and teleport it to its initial firing location. At that point, the bullet is activated and appears as you'd expect until it hits something or has been around too long. It's then deactivated and returned to the bullet pool where it'll be recycled for the next attack.

"This implementation massively helps performance but does mean the bullets exist in memory. As a result, we have been careful to ensure their memory usage is very low," added Reynolds. "For example, we keep the number of bullets in the pools lower by creating boss bullet pools as the player approaches the battle arena and destroying them after the fight is completed, so we do not need to hold onto many bullets that are only used at one point in the game." 

It's a clever workaround, but one that also caused some design ripples. Hill explained the solution allowed the team to use more bullets and produce increasingly complex patterns, but that in turn highlighted the need for more expansive arenas. "From a design standpoint, as that system grew and we realized what we could do with it, we knew the levels would have to be bigger to accommodate [the shift] and give players the space needed to actually move out of the way," continues Hill.

"We built some really great environments, which were fine until we decided to put hundreds of bullets in them. So, I think we've learned to break our levels down into much smaller chunks so we can stream things in and stream things out. If you're loading a big chunk level, that's fine if you're doing a puzzle game, but when you're doing a combat game and filling it with lots of enemies you're going to be doing a bunch of optimization. It's going to be so much nicer on the next project to get ahead of that problem."

About the Author(s)

Chris Kerr

News Editor, GameDeveloper.com

Game Developer news editor Chris Kerr is an award-winning journalist and reporter with over a decade of experience in the game industry. His byline has appeared in notable print and digital publications including Edge, Stuff, Wireframe, International Business Times, and PocketGamer.biz. Throughout his career, Chris has covered major industry events including GDC, PAX Australia, Gamescom, Paris Games Week, and Develop Brighton. He has featured on the judging panel at The Develop Star Awards on multiple occasions and appeared on BBC Radio 5 Live to discuss breaking news.

Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like