From 96fb41748b1eea7816f8773b95678643380cf29a Mon Sep 17 00:00:00 2001 From: EJClaw Date: Thu, 29 Oct 2026 20:44:50 +0900 Subject: [PATCH] =?UTF-8?q?1=EC=9D=B8=EC=B9=AD=20=EC=A1=B0=EC=A4=80?= =?UTF-8?q?=EC=A0=90:=20=EB=A6=AC=ED=94=8C=EB=A0=88=EC=9D=B4=EC=9D=98=20?= =?UTF-8?q?=EC=84=A0=EC=88=98=20=EC=A1=B0=EC=A4=80=EC=A0=90=20=C2=B7=20?= =?UTF-8?q?=EC=82=AC=EC=9D=B4=ED=8A=B8=20=EC=A0=84=EC=B2=B4=20=EB=82=B4=20?= =?UTF-8?q?=EC=A1=B0=EC=A4=80=EC=A0=90=20=EC=84=A4=EC=A0=95=20=C2=B7=20v1.?= =?UTF-8?q?8.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 변환기 Crosshair.cs: BombPlayerState 에 복제된 선수 조준점 프로필(주 · 정조준 · 저격 점 · 이름)을 두 번째 읽기로 읽어 players[].crosshair (바뀐 시각마다 전체 설정). 첫 읽기 필드 목록으로 번호를 찾고 패치로 밀려도 이름이 맞는 자리를 찾는다. --fields 디버그, --self-test 에 자리 찾기 · 기본색 검사 - 사이트 lib/crosshair.ts 그리기 · 발로란트 조준점 코드 읽기, CrosshairPanel: 선수 조준점(없으면 내 조준점) / 모든 선수에 내 조준점, 직접 고치기 · 코드 가져오기 · 선수 조준점 복사 - 1인칭: 정조준 조준점 · 저격 조준경 가운데 점 · 사격/이동 오차로 벌어짐 - 앱 1.8.2 (버전이 바뀌면 리플레이를 다시 변환해 조준점이 생긴다) Co-Authored-By: Claude Opus 5.5 --- app/package-lock.json | 4 +- app/package.json | 2 +- docs/dev/replay-3d.md | 12 +- site/web/src/components/CrosshairPanel.tsx | 166 +++++++++++++++ site/web/src/components/ReplayViewer.tsx | 42 +++- site/web/src/lib/crosshair.ts | 230 +++++++++++++++++++++ site/web/src/lib/replay.ts | 9 +- site/web/src/store/settings.ts | 6 +- site/web/src/styles.css | 122 ++++++++--- tools/replay-extract/src/Collector.cs | 3 + tools/replay-extract/src/Crosshair.cs | 195 +++++++++++++++++ tools/replay-extract/src/Model.cs | 2 + tools/replay-extract/src/Program.cs | 41 +++- 13 files changed, 794 insertions(+), 40 deletions(-) create mode 100644 site/web/src/components/CrosshairPanel.tsx create mode 100644 site/web/src/lib/crosshair.ts create mode 100644 tools/replay-extract/src/Crosshair.cs diff --git a/app/package-lock.json b/app/package-lock.json index dffc40c..ce05136 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -1,12 +1,12 @@ { "name": "gvr-app", - "version": "1.8.1", + "version": "1.8.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gvr-app", - "version": "1.8.1", + "version": "1.8.2", "license": "UNLICENSED", "dependencies": { "@discordjs/voice": "^0.19.2", diff --git a/app/package.json b/app/package.json index aaa85c8..82807f7 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "name": "gvr-app", "productName": "겜녹이", - "version": "1.8.1", + "version": "1.8.2", "description": "겜녹이 (Game Voice Recorder) - 게임 연동 디스코드 음성 기록", "private": true, "main": "dist/main.cjs", diff --git a/docs/dev/replay-3d.md b/docs/dev/replay-3d.md index bd8cacc..04eaceb 100644 --- a/docs/dev/replay-3d.md +++ b/docs/dev/replay-3d.md @@ -75,7 +75,7 @@ - 사이트 `lib/viewmodel.ts`: 맵과 따로 장면 하나(카메라 공간, 깊이를 지우고 맵 위에 그림). 무기 뿌리 = 팔 뼈 MasterWeapon × 회전 (0.5,−0.5,0.5,0.5) (총구 → 팔 앞, 탄창 → 아래가 되는 축 맞춤, 모든 총 같음). 눈 = 팔 Camera 뼈(대기 자세). - 자세는 시각만으로: 꺼내기(equips) > 재장전(states ReloadState) > 사격(shots, 60ms 총구 불꽃) > 걷기(0.2초에 30cm 넘게 움직임) > 정조준(ZoomState*) > 대기. 죽었거나 스킬 · 맨손이면 숨긴다. - 줌: 소총 등 1.25배, 저격총 2.5배(2단 5배) + 조준경 테두리(검은 원 · 가는 십자선), 저격 줌 중에는 팔 · 총을 숨긴다. -- 조준점: 녹색 점 → 발로란트 기본 (흰 선 4개 · 가운데 틈 · 검은 외곽선, `.r3d-cross`). +- 조준점: 녹색 점 → 발로란트 기본 (흰 선 4개 · 가운데 틈 · 검은 외곽선). 1.8.2 부터 선수 조준점 · 내 조준점 (아래). - 안 한 것: 총소리 · 발소리(Wwise 사운드뱅크라 따로 풀어야 함), HUD 체력 · 탄약(리플레이에 값 없음), 탄흔(맞은 자리 `hits` 로 가능), 스킨(기본 스킨만), 스킬 1인칭 동작, 재장전 중 탄창이 손으로 옮겨 가는 것(소켓 바꾸기라 탄창이 잠깐 안 보임). ## 남은 일 @@ -96,3 +96,13 @@ - 보관: nextcloud `claude/game-voice-recorder/valorant/13.08/` (nextcloud 에서는 `claude/` 폴더 안만 다룬다, 사용자 규칙) (abyss-13.08.tar.gz = glb · scene.json · 미리보기 · usmap · 도구 사본, usmap 단독). 계정은 secrets `nextcloud.192.168.10.10`. - 실험은 반드시 `systemd-run --user --scope -p MemoryMax=6G -p MemorySwapMax=0` 안에서. - 디스크: .9 는 150GB 이상 비워 둔다 (사용자 요청). 게임 파일은 다시 받을 수 있으므로 지웠다. 큰 결과물은 nextcloud(.10:8080)로 (로그인 정보 필요). + +## 선수 조준점 · 내 조준점 (2026-10-29, v1.8.2) +- 리플레이에 있다: `BombPlayerState` 에 선수마다 조준점 프로필이 복제된다 (관전자에게 보이는 조준점). 파서 형식에는 없어서 `gvr-replay --fields` 로 필드 이름을 보고 찾았다. + - 13.08 번호: 39~85 주 조준점, 86~132 정조준, 133~179 (값이 온 적 없음), 180~197 저격 조준경(가운데 점 색 · 크기 · 불투명도 · 표시) · `bUsePrimaryCrosshairForADS` · `bUseAdvancedOptions` · `ProfileName`. + - 묶음 안 순서: 색 BGRA · 사용자 지정 색 BGRA · bUseCustomColor · 외곽선(켬 · 두께 · 색 · 불투명도) · 가운데 점(크기 · 불투명도 · 켬) · … · 안쪽 선 12개 · 바깥쪽 선 12개 (두께 · 길이 · 세로 길이 · 간격 · 세로 따로 · 이동 오차 · 사격 오차 · 최소 오차 · 불투명도 · 켬 · 사격 배율 · 이동 배율). + - 기본값과 다를 때만 오고(색 흰색 255 · 숫자 0 · 끔), 바뀐 것만 다시 온다. 확인: 프로필 이름 "1 4 2 0" 선수 = 불투명도 1 · 길이 4 · 두께 2 · 간격 0, "점" 선수들 = 가운데 점만. 저격 점은 10명 모두 빨강(게임 기본). +- 변환기 `src/Crosshair.cs`: 첫 읽기의 필드 목록에서 기준 번호를 찾고(이름이 모두 맞는 자리, 패치로 밀리면 ±80 안에서 찾음, 못 찾으면 조준점 없이 변환) 이 필드만 읽는 두 번째 읽기 (`IncludedPaths`, 어비스 리플레이 +0.4초). 출력 `players[].crosshair` = 바뀐 시각마다 전체 설정 (`t · name · primary · ads · sniper · adsFromPrimary · advanced`, color 는 실제 보이는 색). +- 사이트 `lib/crosshair.ts` (그리기 · 발로란트 조준점 코드 읽기) · `components/CrosshairPanel.tsx`: 1인칭 "조준점" 버튼 → 선수 조준점(없으면 내 조준점) / 모든 선수에 내 조준점, 내 조준점 직접 고치기 · 코드 가져오기 · 선수 조준점 복사. 설정은 브라우저 `gvr.settings.v1` `crosshair`. + - 정조준(저격총 아님) 중에 고급 설정 + 정조준 조준점 따로면 ads, 저격 줌은 조준경 가운데 점. 사격 오차 · 이동 오차 켠 선은 쏜 뒤 0.35초 · 걷는 동안 벌어진다 (총마다 다른 실제 퍼짐이 아니라 대략). +- 옛 리플레이 JSON 에는 없다. 앱은 버전이 바뀌면 다시 변환하므로 1.8.2 로 올리면 다음에 열 때 생긴다. diff --git a/site/web/src/components/CrosshairPanel.tsx b/site/web/src/components/CrosshairPanel.tsx new file mode 100644 index 0000000..291e430 --- /dev/null +++ b/site/web/src/components/CrosshairPanel.tsx @@ -0,0 +1,166 @@ +import { useEffect, useRef, useState } from 'react'; +import { settings, useSettings } from '../store/settings'; +import { CROSS_COLORS, DEFAULT_CROSSHAIR, drawCrosshair, parseCrosshairCode, prepCanvas, type CrossLines, type CrossSet, type CrosshairAt, type CrosshairProfile } from '../lib/crosshair'; + +/** 조준점 미리보기 (어두운 바탕) */ +function Preview({ set }: { set: CrossSet }) { + const ref = useRef(null); + useEffect(() => { + const g = ref.current && prepCanvas(ref.current); + if (g) drawCrosshair(g.ctx, g.cx, g.cy, set); + }, [set]); + return ; +} + +function Range({ label, value, min, max, step, onChange }: { label: string; value: number; min: number; max: number; step: number; onChange: (v: number) => void }) { + return ( + + ); +} + +function Check({ label, value, onChange }: { label: string; value: boolean; onChange: (v: boolean) => void }) { + return ( + + ); +} + +function LinesEdit({ title, l, maxOffset, onChange }: { title: string; l: CrossLines; maxOffset: number; onChange: (l: CrossLines) => void }) { + const up = (p: Partial) => onChange({ ...l, ...p, ...(p.length != null ? { vLength: p.length } : {}) }); + return ( +
+ + up({ on })} /> + + {l.on && ( + <> + up({ opacity })} /> + up({ length })} /> + up({ thickness })} /> + up({ offset })} /> + up({ moveError })} /> + up({ fireError })} /> + + )} +
+ ); +} + +/** + * 1인칭 조준점 설정: 선수 조준점을 쓸지, 사이트 전체에 쓰는 내 조준점 (직접 고치기 · 발로란트 조준점 코드 가져오기). + * 설정은 이 브라우저에 저장한다 + */ +export default function CrosshairPanel({ playerName, player, hasAny, onClose }: { playerName: string | null; player: CrosshairAt | null; hasAny: boolean; onClose: () => void }) { + const cfg = useSettings().crosshair; + const mine = cfg.mine; + const [code, setCode] = useState(cfg.code ?? ''); + const [err, setErr] = useState(null); + const save = (p: Partial) => settings.set({ crosshair: { ...cfg, ...p } }); + const setMine = (m: CrosshairProfile, c?: string) => save({ mine: m, code: c }); + // 직접 고치면 정조준 조준점도 같이 (발로란트 '정조준에도 주 조준점') + const upSet = (p: Partial) => { + const primary = { ...mine.primary, ...p }; + setMine({ ...mine, primary, ads: primary, adsFromPrimary: true }); + }; + const presetIdx = CROSS_COLORS.findIndex((c) => c.hex === mine.primary.color.toLowerCase()); + const importCode = () => { + const p = parseCrosshairCode(code); + if (!p) { + setErr('조준점 코드 형식이 아닙니다 (예: 0;P;c;5;h;0;0l;4;0o;2;0a;1;0f;0;1b;0)'); + return; + } + setErr(null); + setMine(p, code.trim()); + }; + const s = mine.primary; + return ( +
+
+ 조준점 + +
+ + + {player ? ( +
+ +
+
+ {playerName ?? '이 선수'} 조준점{player.name ? · {player.name} : null} +
+ +
+
+ ) : ( +
+ {hasAny ? '이 선수는 조준점 기록이 없어 내 조준점을 씁니다.' : '이 리플레이에는 선수 조준점 기록이 없어 내 조준점을 씁니다. 게임 PC 앱을 1.8.2 이상으로 올리면 리플레이를 열 때 다시 변환해 기록이 생깁니다.'} +
+ )} +
+
+ 내 조준점 + +
+ +
+ setCode(e.target.value)} placeholder="발로란트 조준점 코드 붙여넣기" aria-label="조준점 코드" onKeyDown={(e) => e.key === 'Enter' && importCode()} /> + +
+ {err &&
{err}
} + +
+ + upSet({ outline })} /> + + {s.outline && ( + <> + upSet({ outlineOpacity })} /> + upSet({ outlineThickness })} /> + + )} +
+
+ + upSet({ dot })} /> + + {s.dot && ( + <> + upSet({ dotOpacity })} /> + upSet({ dotSize })} /> + + )} +
+ upSet({ inner })} /> + upSet({ outer })} /> +
+
+ ); +} diff --git a/site/web/src/components/ReplayViewer.tsx b/site/web/src/components/ReplayViewer.tsx index 39ec375..27d565f 100644 --- a/site/web/src/components/ReplayViewer.tsx +++ b/site/web/src/components/ReplayViewer.tsx @@ -10,6 +10,8 @@ import { equipAt, equipLabel, equipTracks, indexAt, isDead, roundAt, samplePath, import { findMap3d, loadMap3d, mapMaterial, worldMatrix } from '../lib/map3d'; import { AgentRig, isGun, loadAgent, loadAnims, loadWeapon, weaponCat } from '../lib/agents3d'; import { Viewmodel, viewmodelIndex } from '../lib/viewmodel'; +import { crossFor, crosshairAt, drawCrosshair, drawSniperDot, prepCanvas } from '../lib/crosshair'; +import CrosshairPanel from './CrosshairPanel'; import { buildAnimIndex, rigInput } from '../lib/replayAnim'; import { abilityLook, type AbilityLook } from '../lib/abilities'; import { loadVfxDb, vfxCoverage, VfxObject, type Place, type VfxDb } from '../lib/vfx'; @@ -133,6 +135,12 @@ export default function ReplayViewer({ m, replay, sync }: Props) { const [ceilNow, setCeilNow] = useState(null); // 1인칭 저격총 조준경 (줌 중) const [scoped, setScoped] = useState(false); + // 1인칭 조준점 (그리는 캔버스 · 설정 창) + const crossRef = useRef(null); + const xhairRef = useRef(cfg.crosshair); + xhairRef.current = cfg.crosshair; + const [xOpen, setXOpen] = useState(false); + const hasCrosshairs = useMemo(() => replay.players.some((p) => !!p.crosshair?.length), [replay]); // 바닥(미니맵) 높이: 선수 높이의 하위 5% (떨어져 죽은 기록은 뺀다) const zBase = useMemo(() => { @@ -929,6 +937,20 @@ export default function ReplayViewer({ m, replay, sync }: Props) { vm.set(chr, fp.kind!); vm.pose(fp.input); } + // 조준점: 선수 조준점(설정에 따라) 또는 내 조준점. 저격총 줌은 조준경 가운데 점, 정조준은 정조준 조준점 + const g = crossRef.current && prepCanvas(crossRef.current); + if (g) { + const xc = xhairRef.current; + const prof = (xc.usePlayer ? crosshairAt(replay.players[selIdx].crosshair, t) : null) ?? xc.mine; + if (sc) drawSniperDot(g.ctx, g.cx, g.cy, prof.sniper); + else { + const shot = fp?.input.shotMs; + drawCrosshair(g.ctx, g.cx, g.cy, crossFor(prof, !!fp && fp.zoom > 0), { + fire: shot != null && shot < 350 ? 1 - shot / 350 : 0, + move: fp?.input.walkMs != null ? 1 : 0, + }); + } + } } else if (mode === 'free') { euler.set(free.pitch, free.yaw, 0, 'YXZ'); camera.quaternion.setFromEuler(euler); @@ -1054,13 +1076,14 @@ export default function ReplayViewer({ m, replay, sync }: Props) { )} {cam === 'fp' && scoped &&
} - {cam === 'fp' && !scoped && ( -
- - - - -
+ {cam === 'fp' && } + {cam === 'fp' && xOpen && ( + setXOpen(false)} + /> )} {cam === 'free' &&
끌기: 둘러보기 · W A S D: 이동 · Q / E: 아래 / 위 · Shift: 빠르게 (화면을 한 번 누른 뒤)
} {selInfo && cam !== 'free' && ( @@ -1128,6 +1151,11 @@ export default function ReplayViewer({ m, replay, sync }: Props) { ))} + {cam === 'fp' && ( + + )} {cam === 'top' && (