Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

| 자산 | 작가 | 출처 | 라이선스 | 사용 위치 |
| --- | --- | --- | --- | --- |
| 기본 32×32 도트 sprite pack | 프로젝트 내부 제작 | `Assets/MagicExamHall/Resources/Sprites` | 프로젝트 라이선스 | 시험장 배경, 플레이어, 설치물, 룬, 원소 문양 |
| 기본 32×32 도트 sprite pack | 프로젝트 내부 제작 | `Assets/MagicExamHall/Resources/Sprites` | 프로젝트 라이선스 | 시험장 배경, 설치물, 룬, 원소 문양 |
| Zelda-like tilesets and sprites (캐릭터 시트) | ArMM1998 | <https://opengameart.org/content/zelda-like-tilesets-and-sprites> | CC0 | 플레이어 4방향 idle/walk/cast 프레임, 멘토 NPC 15종 (`scripts/import-character-pack.py`로 슬라이스·리컬러) |
| Procedural fallback sprite | 프로젝트 내부 제작 | `PixelArtFactory.cs` | 프로젝트 라이선스 | PNG 누락 시 fallback |

## 사운드
Expand All @@ -22,7 +23,8 @@

| 자산 | 작가 | 출처 | 라이선스 | 사용 위치 |
| --- | --- | --- | --- | --- |
| Unity 기본 Arial | — | Unity 번들 | — | HUD, 룬 라벨, 노트 |
| Galmuri11 / Galmuri14 (한글 비트맵 폰트) | Lee Minseo (quiple) | <https://github.com/quiple/galmuri> | SIL Open Font License 1.1 | HUD, 룬 라벨, 노트, 멘토 대사 등 모든 UI 텍스트 (`Resources/Fonts/`) |
| Unity 기본 Arial | — | Unity 번들 | — | Galmuri 로드 실패 시 fallback |

## 자산 추가 시 작성 규칙

Expand Down
93 changes: 93 additions & 0 deletions docs/asset-licenses/fonts/Galmuri-LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright (c) 2019–2025 Lee Minseo (quiple@quiple.dev)

This font software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
15 changes: 15 additions & 0 deletions docs/asset-licenses/fonts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Font Asset Notes

추가일: 2026-06-13

## Galmuri (SIL Open Font License 1.1)

| 파일 | 원본 | 작가 | 출처 | 라이선스 |
| --- | --- | --- | --- | --- |
| `Resources/Fonts/Galmuri11.ttf` | Galmuri11 v2.40.3 | Lee Minseo (quiple) | <https://github.com/quiple/galmuri> | SIL OFL 1.1 |
| `Resources/Fonts/Galmuri11-Bold.ttf` | Galmuri11 Bold | Lee Minseo (quiple) | 〃 | SIL OFL 1.1 |
| `Resources/Fonts/Galmuri14.ttf` | Galmuri14 | Lee Minseo (quiple) | 〃 | SIL OFL 1.1 |

- 선정 사유: 게임 UI 전반의 한글 텍스트를 OS 폰트(Malgun Gothic) 의존 없이 모든 머신에서 동일하게 픽셀 단위로 또렷하게 렌더링하기 위함. 픽셀 아트 톤과도 맞는 비트맵 스타일.
- 로더: `ExamGameController.LoadGameFont`가 `Resources/Fonts/Galmuri11`을 우선 로드하고, 없으면 Malgun Gothic/Arial OS 폰트로 fallback.
- OFL 전문은 `Galmuri-LICENSE.txt` 참조. OFL은 폰트 번들·임베드를 허용하며, 폰트 파일 자체를 판매하지 않는 한 게임에 포함 가능.
133 changes: 133 additions & 0 deletions scripts/import-character-pack.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
#!/usr/bin/env python3
"""'Zelda-like tilesets and sprites' (ArMM1998, CC0) 캐릭터 시트를
Magic Exam Hall의 드롭인 규약 프레임으로 슬라이스·리컬러한다.

원본: https://opengameart.org/content/zelda-like-tilesets-and-sprites (gfx_3.zip)
시트 배치: character.png 16x32 셀, 행 0=down 1=right 2=up 3=left,
열 0-3 = 걷기 4프레임, x=80~127 = 팔 들어올리기 3프레임(시전용).

산출:
Resources/Sprites/Player/ — idle/walk 방향별 + cast 공용 (PlayerSpriteLibrary 규약, PPU32)
Resources/Sprites/<Kind> — 멘토 15종 (PixelSpriteKind 이름, 무드별 포즈 + 로브색, PPU16)

플레이어는 PlayerSpriteLibrary가 PPU32로, 멘토는 PixelArtFactory가 PPU16으로 로드하므로
같은 1x2 월드 크기를 내려면 플레이어만 2배 업스케일한다.

사용: python scripts/import-character-pack.py <character.png 경로>
"""

import sys
from pathlib import Path

from PIL import Image

REPO = Path(__file__).resolve().parent.parent
SPRITES = REPO / "unity/MagicExamHall/Assets/MagicExamHall/Resources/Sprites"
PLAYER_OUT = SPRITES / "Player"

CELL_W, CELL_H = 16, 32
PLAYER_SCALE = 2 # 16x32 -> 32x64, PPU32 기준 1x2 유닛
MENTOR_SCALE = 1 # 16x32 그대로, PPU16 기준 1x2 유닛
ROW_BY_FACING = {"down": 0, "right": 1, "up": 2, "left": 3}
CAST_CELLS_X = (80, 96, 112) # 팔 들어올리기 3프레임 (down 행)

# 플레이어 로브(파랑 계열) — ExamGameController의 기존 fallback robe 색과 동일 계열
PLAYER_ROBE = (78, 148, 235)

# MentorProfile.ForFloor의 로브 색 (0-1 -> 0-255)
MENTOR_ROBES = {
"Mentor": (133, 82, 219), # 1층 발착층 조교 (보라)
"MentorScholar": (46, 158, 184), # 2층 벽화 연구원 (청록)
"MentorGuide": (107, 179, 92), # 3층 다리 안내원 (초록)
"MentorWatcher": (179, 61, 71), # 4층 균열 감시자 (적색)
"MentorArchivist": (64, 92, 199), # 5층 성좌 기록관 (남색)
}


def is_shirt(pixel) -> bool:
r, g, b, a = pixel
return a > 0 and r > g + 28 and r > b + 28


def recolor(frame: Image.Image, robe) -> Image.Image:
"""셔츠(붉은 계열)만 로브 색으로 바꾸고 명암은 원본 비율을 유지한다."""
out = frame.copy()
px = out.load()
rr, rg, rb = robe
for y in range(out.height):
for x in range(out.width):
p = px[x, y]
if is_shirt(p):
lum = max(p[0], 1) / 200.0 # 원본 빨강 밝기 -> 음영 비율
lum = min(lum, 1.25)
px[x, y] = (
min(int(rr * lum), 255),
min(int(rg * lum), 255),
min(int(rb * lum), 255),
p[3],
)
return out


def cell(sheet: Image.Image, x: int, row: int) -> Image.Image:
return sheet.crop((x, row * CELL_H, x + CELL_W, (row + 1) * CELL_H))


def save(frame: Image.Image, path: Path, scale: int) -> None:
path.parent.mkdir(parents=True, exist_ok=True)
frame.resize((frame.width * scale, frame.height * scale), Image.NEAREST).save(path)


def export_player(sheet: Image.Image) -> int:
count = 0
for facing, row in ROW_BY_FACING.items():
walk = [recolor(cell(sheet, i * CELL_W, row), PLAYER_ROBE) for i in range(4)]
for i, frame in enumerate(walk):
save(frame, PLAYER_OUT / f"walk_{facing}_{i}.png", PLAYER_SCALE)
count += 1
for i, frame in enumerate((walk[0], walk[2])):
save(frame, PLAYER_OUT / f"idle_{facing}_{i}.png", PLAYER_SCALE)
count += 1

down = ROW_BY_FACING["down"]
cast = [recolor(cell(sheet, x, down), PLAYER_ROBE) for x in CAST_CELLS_X]
for i, frame in enumerate(cast):
save(frame, PLAYER_OUT / f"cast_charge_{i}.png", PLAYER_SCALE)
count += 1
save(cast[2], PLAYER_OUT / "cast_release_0.png", PLAYER_SCALE)
save(recolor(cell(sheet, 0, down), PLAYER_ROBE), PLAYER_OUT / "cast_release_1.png", PLAYER_SCALE)
return count + 2


def export_mentors(sheet: Image.Image) -> int:
"""무드별 포즈: Neutral=정면 서기, Happy=팔 들어올리기, Frown=옆으로 돌아섬."""
down, left = ROW_BY_FACING["down"], ROW_BY_FACING["left"]
poses = {
"Neutral": cell(sheet, 0, down),
"Happy": cell(sheet, CAST_CELLS_X[2], down),
"Frown": cell(sheet, 0, left),
}
count = 0
for prefix, robe in MENTOR_ROBES.items():
for mood, frame in poses.items():
save(recolor(frame, robe), SPRITES / f"{prefix}{mood}.png", MENTOR_SCALE)
count += 1
return count


def main() -> int:
if len(sys.argv) < 2:
print(__doc__)
return 1

sheet = Image.open(sys.argv[1]).convert("RGBA")
player = export_player(sheet)
mentors = export_mentors(sheet)
print(f"player frames: {player}, mentor overrides: {mentors}")
print(f"-> {PLAYER_OUT}")
print(f"-> {SPRITES} (mentors)")
return 0


if __name__ == "__main__":
sys.exit(main())
Loading