* This blog post is a summary of this video.

Creating Stunning 2D Game Assets with AI Art Tools

Author: Binary LunarTime: 2023-12-30 00:10:01

Table of Contents

Introduction to AI Art Tools Mid-Journey and Stable Diffusion

AI art tools like Mid-Journey and Stable Diffusion are revolutionizing how game assets can be created. These tools allow you to generate stunning 2D and 3D art by simply describing what you want in text prompts. In this blog post, we'll explore using these AI tools to recreate the beautiful 2D art style of Rayman Legends for a platformer game built in Unity.

We'll start by overviewing the capabilities of Mid-Journey and Stable Diffusion, and show some initial tests recreating the Rayman art style. Then we'll generate trees, terrain textures, clouds, and other environment assets. After that, we'll create and animate a player character. Finally, we'll import everything into Unity and assemble a full playable 2D platformer level showcasing the AI-generated art.

Overview and Capabilities of AI Art Tools

Tools like Mid-Journey and Stable Diffusion use deep learning techniques to generate images from text descriptions. You input a text prompt specifying what you want to create, along with some example images if desired, and the AI will output a novel image matching the description. These tools open up amazing new possibilities for game asset creation. Instead of needing to manually create each asset, developers and artists can now generate endless variations by tweaking text prompts and AI parameters. This can massively speed up environment, prop, and character design.

Recreating Rayman Legends Art Style with AI

Rayman Legends features beautiful hand-drawn 2D art that would be great to emulate in our own game. To test the AI tools, I provided various example images from Rayman as input to Mid-Journey prompts requesting similar game assets. The results successfully replicated the lively, cartoonish style with clean lines and vibrant colors. With some experimentation to refine the prompts, I was able to reliably generate trees, terrain, clouds and more that fit right into the Rayman aesthetic.

Generating 2D Game Assets with Mid-Journey

With the initial Rayman art style tests successful, I started generating usable 2D sprites for a platformer game environment. Getting high quality results required very specific prompts indicating the exact type of asset needed along with background removal instructions.

For example, prompts like "2D big tree concept art Rayman Legend style plain background" produced nice isolated tree sprites that could be easily brought into Unity. I generated various vegetation like trees, bushes, and grass tiles this way. I also prompted for clouds, sky gradients, and mountains to build up the scene background.

Creating Background Elements Like Trees

To generate detailed trees matching the Rayman style, my prompts specified characteristics like "2D", "big tree", "concept art", and crucially "plain background". The plain background made it easy to remove cleanly in Photoshop. After generating promising tree images with Mid-Journey, I carefully selected and cut out the tree in Photoshop using selection tools. Small manual touch ups were needed to cleanly isolate the tree silhouette. The resulting transparent PNG sprite was then ready to easily import into my Unity environment.

Generating Seamless Textures with Stable Diffusion

Besides discrete sprites, I also needed seamless terrain textures for grounds and walls. Mid-Journey struggled with generating properly tiling textures. So I turned to Stable Diffusion which has explicit tiling options. Taking an initial Mid-Journey generated terrain texture, I used Stable Diffusion to re-generate a modified version with the key prompt addition of "seamless". Enabling tiling output produced a continuous terrain texture that tiles perfectly in any direction.

Animating a 2D Character in Unity

Alongside environment assets, a playable platformer also needs an animated character that can run, jump and more. I again used Mid-Journey to generate a player avatar matching Rayman's art style. After compositing body parts in Photoshop, I imported to Unity to rig and animate.

Rigging attached joint components enabling independent movement of limbs and other parts. Simple animation controllers drove animations for running, jumping, and idling. I also added player control scripts and a virtual camera for gameplay. The resulting character felt right at home in the AI-generated environment.

Rigging and Animating the 2D Character

To animate generated characters, they first need rigging that connects body parts into an articulated hierarchy. I used Unity's powerful 2D animation framework including bones, constraints and controllers to rig up joints for the head, torso, limbs and more. With rigging applied, I authored a few basic animations in Unity itself. An idle animation showed natural shifting body posture over time. A run cycle animation depicted believable foot, arm and head movements at speed.

Adding Player Controller and Camera

Alongside animations, interactivity via scripts brought the character to life. A character controller handled horizontal and vertical movement across grounds. Jump mechanics let the player hop between platforms. A tagging system marked environment pieces like collectables. To follow the action, a virtual camera was added and configured using Cinemachine to track the character as they explored the scene.

Assembling All Assets into a 2D Platformer Scene

With a rich cast of AI-generated assets created, it was time to assemble everything into a small vertical slice 2D platformer scene. I arranged trees, clouds, terrain pieces and other environment elements into an engaging background composition.

In front, I positioned the rigged player character along with some basic platforms to traverse. Overall the unity between the assets was impressive - the AI art harmonized wonderfully thanks to the consistent Rayman art style prompting.

Importing Assets and Arranging Environment

Bringing assets into Unity was straightforward thanks to the transparent PNG sprites produced earlier in Photoshop. I simply dragged tree, bushes, clouds and terrain textures into my scene hierarchy. Sprite Shape tools also helped quickly layout instant level segments. Arranging the elements was enjoyable thanks to the diversity of assets generated. I composed interesting clusters of trees, floating islands and walls generatively designed by AI. Dynamic camera angles emphasized the vivid style.

Testing Full 2D Platformer Built with AI Art

Seeing the animated character platform through the AI generated world was highly gratifying. The art harmonized perfectly thanks to sharing the consistent Rayman Legends aesthetic. Running, jumping and collecting gems flowed smoothly thanks to Unity's tight 2D workflows. The virtual camera kept action in frame from cinematic angles. This small vertical slice serves as compelling proof-of-concept for larger scope 2D games leveraging AI art.

Conclusion and Next Steps for Commercial Game

This exploratory project successfully showcased Mid-Journey, Stable Diffusion and other AI tools generating impressive game-ready 2D art assets. Clear prompts and post-processing fits output to desired style.

Next steps could involve expanding scope to complete game production quality. More environment and character variation, puzzles, enemies, UI and polish would demonstrate commercial readiness. Streamlining asset integration could optimize developer workflows. AI art democratizes game creation - with imagination, stunning experiences are possible by anyone willing to prompt!


Q: How can AI art tools help game developers?
A: AI art tools like Mid-Journey and Stable Diffusion can greatly speed up asset creation and open new creative possibilities for game art and design.

Q: What kind of assets were created in the video?
A: The video demonstrated creating 2D sprites like trees and bushes, seamless ground textures, animated character rigs, and full environment scenes.