DEV Community

ABA Games
ABA Games

Posted on

Generative Reroll Game Development Using LLMs

Continuously running an LLM until it generates a game you like. Let's call this Generative Reroll Game Development.

With the emergence of high-performance LLMs like Claude 3.5 Sonnet, it has become possible to have LLMs create simple game ideas and even implement them. Many of the games that come out of LLMs are mediocre, unbalanced, or incorrectly implemented. However, by repeatedly having the LLM generate games, you can occasionally obtain code that exhibits interesting behavior, just one step away from being a game.

For example:

When given the theme "fragile pillars" to the above prompt, it proposes the following game:

Pillar Paraglider: Control a paraglider flying through a course of fragile pillars. The paraglider constantly descends. Press the button to ascend, but each press also sends a shockwave that can damage nearby pillars. Core mechanic: Balancing ascent with pillar preservation.

After elaborating on and implementing this idea, the following game was created. This is Claude's output as-is:

Pressing the button makes the red player character ascend while simultaneously emitting a circular shockwave around it. The shockwave destroys pillars. While it seems overly influenced by Flappy Bird, it has implemented some interesting behavior as a game.

However, this game clearly has several issues:

  • It's too easy. You can nullify pillars with shockwaves by continuously pressing the button. Nothing happens when the player character reaches the top or bottom of the screen, so you almost never get a game over.
  • The scoring system is simplistic. The score is just based on the distance traveled, so risky actions don't lead to higher scores.
  • It doesn't realize the original core mechanic. It says "balancing ascent with pillar preservation," so the original intent was probably to make a game where you avoid destroying pillars with shockwaves. However, it's not implemented that way. Also, if we faithfully implement that mechanic, it would result in a stressful game where you play with a player character that has a large hitbox.

In Generative Reroll Game Development, the important process is how to improve these imperfect games with interesting behaviors into games that are also fun to play.

For this game, I made the following changes:

  • The circular shockwave emitting in all directions is too powerful, so we gave the player character a direction and made the shockwave emit only in a limited angle in front of it. Also, the shockwave now destroys only the part of the pillar it hits, not the entire pillar. Additionally, the game ends if the player character touches the top or bottom of the screen.
  • Score is given for each destroyed part. Also, continuous destruction increases the score, encouraging risky behavior of advancing towards pillars for higher scores.
  • I ignore the core mechanic. Generally, a game about "destroying" is more fun than one about "avoiding destruction."

As a result, the game became as follows:

wavybird screenshot

It became a game about making holes in pillars with shockwaves to progress. While it might feel a bit too difficult, it has achieved a more appropriate balance of risk and reward than the initial version, increasing its completeness as a game.

The code differences between the improved version and the original are as follows:

Looking at this, it seems like nothing remains of the original code, but in reality, it's much easier than creating from scratch because you can modify it while referring to the original framework.

The completed version with sound and title became:

This is the current state of Generative Reroll Game Development using LLMs. If asked whether this is easier than a person coming up with ideas normally and implementing them, it's not particularly easy. However, the development process of facing challenges from computers, such as selecting games proposed by LLMs and figuring out how to make them interesting, has a different kind of appeal compared to conventional development processes. It's also important to enjoy the process of developing and improving prompts for generation alongside game development in Generative Reroll Game Development.

In the future, we might be able to simply tell an LLM "make an interesting game" without thinking, and it will implement and return a nice game. At present, it's normal to need dozens of rerolls to get a game with interesting behavior, and the hit rate is undeniably low. However, with previous LLMs, it was common for only mediocre games that we've seen somewhere before to come out, and getting anything with interesting behavior was virtually impossible. The fact that we can now generate something that feels at least somewhat novel, thanks to the evolution of LLMs over the past year or so, is a good sign.

If LLMs continue to evolve at this rate, the quality of ideas will improve, and they will be able to implement ideas more accurately as code. They might also be able to modify the code in response to pointed out issues like those mentioned above. This would allow us to create playable games with fewer rerolls and simpler improvements. The future development of Generative Reroll Game Development is exciting to anticipate.

Top comments (0)