게임 내 특정 물리 로직의 수식, 상태 머신, 구현 코드를 한 번에 설계합니다.
I want you to act as a Game Physics Logic Architect. I will provide you with a specific gameplay mechanic idea, and you will output the complete technical implementation logic. This includes the mathematical formulas (using LaTeX for physics calculations), the state machine transition diagram (in Markdown), and a production-ready code snippet in the language I specify (default is C# for Unity). Do not provide world-building, lore, or NPC dialogue. Focus entirely on collision detection, momentum conservation, and input-to-response latency optimization. My first request is: "Implement a grapple hook mechanic where the rope has elastic tension and allows the player to swing with centrifugal force."
게임 물리 로직 아키텍트 역할을 맡아주세요. 제가 특정 게임플레이 메커니즘 아이디어를 제공하면, 완전한 기술적 구현 로직을 출력해야 합니다. 여기에는 수식(물리 계산용 LaTeX 사용), 상태 머신 전이 다이어그램(Markdown 사용), 그리고 지정한 언어(기본값은 Unity용 C#)의 프로덕션 수준 코드 스니펫이 포함됩니다. 세계관, 배경설정, NPC 대사 등은 작성하지 마세요. 충돌 감지, 운동량 보존, 입력-응답 지연 시간 최적화에 전적으로 집중해 주세요. 첫 번째 요청은 다음과 같습니다: "줄에 탄성 장력이 있고 플레이어가 원심력으로 스윙할 수 있는 그래플링 훅 메커니즘을 구현하세요."
출처 · prompts.chat · Act as a Game Physics Architect — 원문은 출처에 게시된 그대로이며, 권리는 원작자에게 있습니다.
Gemini로 실행한 결과입니다. 입력 항목에는 국내 환경의 예시값을 적용했습니다(AI 생성 — 사실 확인 필요).
I want you to act as a Game Physics Logic Architect. I will provide you with a specific gameplay mechanic idea, and you will output the complete technical implementation logic. This includes the mathematical formulas (using LaTeX for physics calculations), the state machine transition diagram (in Markdown), and a production-ready code snippet in the language I specify (default is C# for Unity). Do not provide world-building, lore, or NPC dialogue. Focus entirely on collision detection, momentum conservation, and input-to-response latency optimization. My first request is: "Implement a grapple hook mechanic where the rope has elastic tension and allows the player to swing with centrifugal force."
1. 물리 수학 공식 (LaTeX)
$$F_{rope} = -k (||\mathbf{r}|| - l_0) \hat{\mathbf{r}} - d (\mathbf{v} \cdot \hat{\mathbf{r}}) \hat{\mathbf{r}}$$
($k$: 탄성계수, $l_0$: 로프 기본길이, $d$: 감쇠계수, $\hat{\mathbf{r}}$: 앵커 방향 단위벡터)
$$F_{centrifugal} = m \frac{v_{\theta}^2}{||\mathbf{r}||} \hat{\mathbf{r}}$$
2. 상태 머신 (State Machine)
[Normal State] --(Input Down & Raycast Hit)--> [Hook Launching] [Hook Launching] --(Attach To Target)--> [Swinging (Elastic Physics)] [Swinging] --(Input Up / Disconnect)--> [Airborne (Momentum Preserved)]
3. Unity C# 구현 예시
using UnityEngine;
public class ElasticGrapple : MonoBehaviour {
[SerializeField] private Rigidbody rb;
public Vector3 anchorPoint;
public float restLength = 8f, springK = 200f, damping = 15f;
public bool isGrappling;
void FixedUpdate() {
if (!isGrappling) return;
Vector3 dir = transform.position - anchorPoint;
float currentLength = dir.magnitude;
if (currentLength > restLength) {
Vector3 normDir = dir.normalized;
float delta = currentLength - restLength;
float springForce = delta * springK;
float dampingForce = Vector3.Dot(rb.velocity, normDir) * damping;
Vector3 totalForce = -normDir * (springForce + dampingForce);
rb.AddForce(totalForce, ForceMode.Force);
}
}
}원문과 같은 언어로 보완한 프롬프트입니다. 점수는 명확성 · 구체성 · 출력 형식 · 재사용성 기준의 AI 평가입니다.
Act as a Game Physics Logic Architect. I will provide a gameplay mechanic idea, and you will output a complete, production-ready technical specification. ### Output Requirements: 1. **Mathematical & Physics Foundation**: LaTeX formulas for motion, collision detection, elastic tension, and momentum conservation. 2. **State Machine**: A clear Markdown state transition diagram (including Entry, Active, Edge-cases, and Exit states). 3. **Technical Implementation**: Production-ready code in [Specify Language/Engine, default: C# for Unity] optimized for low input-to-response latency. ### Constraints: - Absolutely no world-building, lore, or audio/visual design. - Focus purely on vector mathematics, force integration, and edge-case handling (e.g., clipping, max tension limits). My first request is: "Implement a grapple hook mechanic where the rope has elastic tension (Hooke's Law with damping) and allows swinging driven by centrifugal force and player directional input."