2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ゲーム制作初心者がchatGPTの画像生成を使って1週間でゲームを作った話

2
Last updated at Posted at 2025-08-30

背景

社会人になってから「自分でもゲームを作ってみたいな」って気持ちはあったんですが、実際に手を動かすのはかなりハードルが高く感じてました。
一から設計するには時間も知識も足りないし、正直どこから手をつければいいのかも分からない。

そこで思いついたのが、
「ChatGPTを相棒にすれば、短期間でも形になるんじゃないか?」
という発想です。

今回は「1週間でとりあえず動くものを作る」という目標を決めて、題材はシンプルなローグライク風ゲームにしました。
実装は Python + pygame。キャラクターのドット絵やコードのひな形は ChatGPT にお願いして、出てきたものをGPT君にフィードバックを返しながら調整して仕上げました。(ちなみにこの記事の文章も添削してもらってます笑)

完成品はまだ「アルファ版」で最低限のシステムしかありませんが、企画から形になるところまでを一通り体験できたのは大きな収穫でした。やる気が出ればフリゲサイトとかに投稿してみたいものです。

モンスターが徘徊するダンジョンを探索して、階層移動、kill数でスコアを算出して競うゲームにしようとふんわり想像して開始しました。

#工数と進め方

平日:2時間 × 5日

土曜:5時間
合計 15時間

この短時間で動くゲームができたのは、ChatGPT を「相棒」としてフル活用したおかげです。プロンプトの生成から、コードの叩き台まで全部お願いしました。無茶振りもしましたが(笑)

ゲーム画面.png

2.png

とりあえずゲームが動いて、プレイできて、とても感動しました。

特に共有したいのは2種類のchatGPTによる画像生成です。

使ったプロンプトと、生成されたもの
ここで使ったプロンプトは
当然chatGPTに作らせたpromptです、自分の命令文は自分で書かせると挙動が安定しますね

prompt.txt
A retro-style 2D pixel art sprite strip of the SAME young witch character,
to be used as RPG game assets.

This character must appear consistently in all four directions (north, south, east, west)
with the same design.

She has:

short dark blue hair

a navy cloak

a plain pointy navy hat (no star or decorations)

brown boots

a wooden staff topped with a glowing blue orb

Now generate the NORTH-facing version (facing upwards).

Three frames:

idle

walking frame 1

walking frame 2

These frames should be arranged horizontally in one strip.

Frame requirements:

Each frame must be exactly 64x64 pixels

The ENTIRE character, including hat and staff, must fit completely within each 64x64 square

No part of the character may be cut off at the edges

Add enough transparent padding around the character so it is centered and fully contained

Style:

Pixel art

Crisp outlines

Vibrant limited palette

Retro RPG sprite

Output:
A single PNG file with transparent background (alpha channel),
so it can be used directly as game assets.

NORTH.png

この.txtのNORTHをほかの方角に書き換えて生成したものがこれ

SOUTH.png
ChatGPT Image 2025年8月30日 20_19_31.png
ChatGPT Image 2025年8月30日 20_22_39.png

ご覧の通り、だんだん統一感が崩れ、ルール違反まで発生。
seed値を固定しても安定しませんでした。

そこで取ったアプローチが、
ドット絵を描く Python コードを ChatGPT に生成させる方です。
内部パラメータを自分+GPTで調整することで、品質を揃えられるようになりました。

prompt.py
from PIL import Image, ImageDraw
# 一部抜粋
def main():
    # 歩行サイクル(3コマ)
    walk1 = draw_frame(gait=1,  tilt=-1, sway=1)
    idle  = draw_frame(gait=0,  tilt=0,  sway=0)
    walk2 = draw_frame(gait=-1, tilt=1,  sway=-1)

    frames = [walk1, idle, walk2]
    ...

これによって生成されたのがこれ

witch_chibi_south_walk.gif

かわいいですね

学びと今後

  • プロンプト直書きだと品質がブレやすい

  • コード化してパラメータで制御する方が安定

  • ChatGPTは「絵師」より「アシスタントエンジニア」として使うのが効果的

今後もゲームを作るたびに Qiita へ備忘録として残していこうと思います。
画像生成の品質統一に詳しい方がいたら、ぜひコメントで教えてください。

画像の生成に関して、品質統一方法の知識ある方がいたらぜひ教えていただきたいです。

今後も何か作るたびにQiitaへ備忘録として残そうと思います。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?