Bullet Hell Roguelike

2024

test thumbnail

Background

The game is a First-Person Shooter with a combination of Bullet Hell and Roguelike elements. It was developed using the Unity game engine, with version 2022.3.

The player can move around, jump, dash, and fire projectiles that serve as bullets.

Contents

Procedural Elements

The game makes use of several procedural and randomized elements as part of its gameplay.

Map Generation

Maps use a depth-first search, inspired by the dungeon generation algorithm used by popular roguelike game The Binding of Isaac. More information regarding its algorithm can be found here.

In general, the generator begins from the center of a grid and iterates through possible directions, checking whether another room is in the way, or by random chance. If it cannot add additional rooms, then it becomes an end room and returns to a previously generated room and repeats the process until a set number of rooms are finished. In higher difficulties, the number of rooms are increased.

The game does modify this algorithm slightly: While the original algorithm uses a 10x10 grid as a base size, changes were made so that the maximum grid is customizable. In addition, the Binding of Isaac algorithm generates secret rooms, but I do not utilize it for this project.

The furthest end room becomes a boss room, and other end rooms become treasure rooms; these treasure rooms contain an Augment that can be picked up. All other rooms besides the starting room spawn enemies.

A randomly generated room layout
A randomly generated room layout
A randomly generated second room layout
A randomly generated second room layout

Augment Generation

Augments are equipable stat modifiers. The algorithm was created from scratch, without referencing other existing solutions. Only one can be equipped by the player at one time.

In its first iteration, a stat table was used to specify specific stats from an enumerator list to modify. However, this was quickly changed to utilize a factory design pattern to ensure modularity for any additional stats that are to be modified.

Augments are generated from a pool of potential positive and negative stats.

  • Attack Damage, the ratio of damage the player can deal to an enemy.
  • Attack Rate, how fast the player can fire.
  • Defense, the ratio of damage the player can mitigate.
  • Flow, which gives bonuses based on player attack timing.
  • Health, the amount of extra health the player can have.
  • Movement Speed, how fast the player can move.
The augment stat generator
The augment stat generator

Augments are assigned a rarity, which influences its baseline cost. The cost influences the stat benefits that can be pulled from the pool, adding to the augment’s baseline cost. Once satisfied, the algorithm randomly chooses stats that negatively affect the player, to equalize the cost back to its baseline. Stats cannot appear twice in a single augment.

In addition to stat randomization, the icon generated is also selected based on the augments chosen. The left side of the icon represents positive stats, right side represents negative stats.

A generated Augment texture
A generated Augment texture
A second generated Augment texture
A second generated Augment texture
A third generated Augment texture
A third generated Augment texture

Tree Generation

The game generates random trees for each room, selecting from a pool of potential tree styles, then using an L-system structure to generate the tree itself.

The game does make use of a tool called Broccoli to help with tree generation. It allows for defining nodes that are used to generate the tree.

The tree allows specifying structures, which consists of Branches, Roots, and Sprout nodes. Once the base tree is generated, modifiers such as girth transform and branch mesh generator is used to affect the visual detail of the tree.

The tree generator tree
The tree generator tree
The tree generator algorithm
The tree generator algorithm

Enemy Spawn

Rooms have 5 spawn points in which enemies can spawn from. Enemies do not spawn at existing spawn points taken up by another enemy. The number of enemies generated is determined by the level’s difficulty level.

Enemy Behavior

Enemies also make use of a behavior tree to make decisions, including wander, approach player, and fire bullets. Enemies may also randomly delay the firing of bullets. I make use of NodeCanvas to help set up the behavior tree as a graph. While the nodes that it provides are powerful by itself, I did have to extend it to create unique behaviors.

The behavior tree of enemies
The behavior tree of enemies

Enemies/Bullet Spawn Generation

Bullets and their intervals are random, with bullet groups randomizing spread, movement speed, and angular rotation on creation. This creates unique bullet patterns that the player will need to avoid such that they come out victorious.

Critique and Future Work

This game was a project that I had wanted to work on for a while prior to taking this course, and this assignment serves as a great opportunity to experiment for an expanded experience in the future. Reflecting on the progress made thus far, I believe there are several elements that could be modified, along with additional ideas in which I would like to implement.

First, I do not believe that rooms are sufficiently diverse from each other in their current state. While each room generates unique tree patterns, their locations are not random. In addition to that, I would like to incorporate vines and other fauna into the world for increased diversity between rooms. Ideally, I would like to create vegetation that is aesthetically unique while maintaining appeal to audiences.

Similarly, there is not enough variety in enemy and bullet behaviors. I would like to extend the enemy decision trees to encourage the player to utilize their tools in combat.

Further down the line, I would like to incorporate a story into this game. While the overall plot throughout the completed game may be set in stone, the dialogue between characters may be randomly selected from a pool of possibilities to help create diversity and intrigue within the game’s world.

Looking at the game from a gameplay standpoint, I find that the First-Person Shooter aspect does not mesh strongly with the Bullet Hell genre, as bullets can be difficult to avoid when out of view. I believe it would help prevent frustrations to convert the game into a third-person shooter instead.

The game also has occasional lag spikes, which I did not have the time to investigate during development. Addressing those spikes could help performance in the future. Alongside performance, builds of the game did not work as well compared to within the editor. As such, I would like to perform extensive investigation to resolve this issue.