ad
ad

I Tried MidJourney to create 2D Assets for Game in Unity

Entertainment


Introduction

In this article, we will dive into the fascinating world of AI art generation, specifically using tools like MidJourney and Stable Diffusion to create stunning 2D game assets. We will also guide you through the process of importing and utilizing these assets in Unity, one of the most popular game engines available today. This guide is tailored for developers, artists, or anyone interested in AI-generated art, so grab a cup of coffee, and let's get started!

Exploring AI Art for Game Development

With all the buzz surrounding AI technology, I set out to test its potential for generating 2D game assets. Drawing inspiration from the art style of Rayman Legends, I aimed to recreate a scene in Unity using AI-generated art. After experimenting with these tools, I can confidently say they are invaluable for game developers and artists, helping to save time while unlocking new avenues for creativity and design.

We will focus on three types of assets:

  1. 2D Sprites: This includes elements such as trees, grass, and clouds.
  2. Characters: We will create characters that can be animated in Unity.
  3. Terrain: This refers to the ground or platforms upon which players will walk, using Unity’s Sprite Shape tool.

Creating 2D Sprites

To start with normal assets like trees, I crafted some specific prompts like “2D big tree concept art in Rayman Legends style on a plain background.” This level of specificity is crucial for generating high-quality assets.

  1. Using Photoshop for Editing: Once generated, I imported the images into Photoshop. Utilizing the Object Selection Tool allowed me to select elements like the tree quickly. While this tool is effective, some manual adjustment using the Quick Selection Tool is often necessary to refine the selection and remove unwanted background areas.
  2. Final Adjustments: After masking and refining the edges, I exported these images as PNGs, ensuring a transparent background for use in the game. Importing these into Unity was straightforward, and I began populating my scene with the newly created assets.

For other game elements, I repeated this process by generating assets like bushes, clouds, and even a minimalistic blue sky gradient using appropriate prompts.

Creating Ground/Platform Assets

Next, I turned my attention to creating platforms for characters to walk on. Using Unity’s Sprite Shape tool, I created new ground shapes by importing generated textures. Again, I employed MidJourney for creating new grass tops to enhance these platforms.

To ensure seamless textures, I also explored Stable Diffusion. By using the Image to Image feature, I created seamless ground textures that perfectly fit my game environment.

Character Creation

Creating a character came next. I wrote the prompt "2D game hero character design in Rayman style," and followed the same editing process to refine the character's image. An essential aspect of character design involves ensuring that individual limbs can be animated in Unity.

I saved the character as a PSB file, allowing for more complex rigging and animation options in Unity. After some basic animations for idle and running states were created, I added a player controller to facilitate movement around the game environment.

Finalizing the Scene

With the environment and characters set up, I organized everything in Unity and added a virtual camera to follow the player.

In conclusion, using AI art generation with tools like MidJourney and Stable Diffusion has streamlined the process of creating 2D game assets. The final result—a fully functional 2D platformer—demonstrates the potential of AI in game development. We encourage you to explore this technology and see how it can enhance your game design process.

If you're curious about making your game commercially viable or want to delve deeper into the creative process, feel free to explore more tutorials and resources on this subject.


Keywords

  • AI Art
  • MidJourney
  • Stable Diffusion
  • 2D Game Assets
  • Unity
  • Sprites
  • Character Design
  • Level Design
  • Textures

FAQ

Q1: What AI tools were used to create the assets?
A1: The primary tools used were MidJourney and Stable Diffusion for generating 2D assets.

Q2: How can I ensure the generated art fits my game style?
A2: Be specific in your prompts to ensure the generated assets align with your desired art style, like referencing popular styles such as Rayman Legends.

Q3: What format should I save my images in for Unity?
A3: Save your images as PNG files to retain transparency for easier integration into Unity.

Q4: Can I animate characters created through AI art?
A4: Yes, after designing your character, you can save it as a PSB file for rigging and animation in Unity.

Q5: Is there any compatibility with other game engines?
A5: While this tutorial focuses on Unity, similar processes can be applied in other game engines.