Welcome to AI for Game Development! This series demonstrates how to create a fully functional farming game in just five days using AI tools. By the end, you'll know how to integrate AI into art style, game design, 3D/2D assets, and story. This first part focuses on establishing the art style with Stable Diffusion and bringing it into Unity.
Prerequisites: Familiarity with Unity and C# is assumed.
Day 1: Art Style
We'll use Stable Diffusion, an open-source text-to-image model, to define our game's visual style.
Setting Up Stable Diffusion
Choose between a local install (recommended for full features) or an online service.
Local Setup (Windows)
- Requirements: Nvidia GPU with ≥8GB VRAM, Python 3.10.6, git.
- Install Python (check "Add to PATH").
- Install git.
- Clone the Automatic1111 WebUI:
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git - Download Stable Diffusion 1.5 weights into the
modelsfolder. - Run
webui-user.bat. - Access the UI at
localhost:7860.
Online Options
- Use Hugging Face Spaces (e.g., Stable Diffusion 2.1 Demo).
- Or write your own with Diffusers.
Note: Advanced features like image2image may not be available online.
Generating Concept Art
Simple steps: type a prompt, click generate. To get good results:
- Use lexica.art for inspiration.
- Constrain output with words like "isometric," "simple," "solid shapes."
- Avoid weak keywords like "low poly."
- Reference specific artists for style.
I used: isometric render of a farm by a river, simple, solid shapes, james gilleard, atey ghailan.
Bringing it to Unity
- Create a Unity project (2021.9.3f1) with Universal Render Pipeline.
- Block out the scene with basic shapes.
- Apply materials inspired by the concept art.
- Configure lighting: warm sun (#FFE08C, intensity 1.25), soft ambient (#B3AF91).
- Set camera to orthographic projection.
- Add water using the Stylized Water Shader.
- Set up post-processing.
Stay tuned for Day 2, where we'll design the game mechanics!