This repository has been archived on 2026-10-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Ananta-ps/internal/catalogs/ped_spawn_table4229938.go

61 lines
2.5 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package catalogs
import (
"encoding/json"
"os"
"path/filepath"
"sync"
)
var _ = json.RawMessage{}
var _ = sync.Mutex{}
var _ = os.ReadFile
var _ = filepath.Join
//
// 一个「过街等待区」里的站位槽。
// ★ 这份数据的真身是客户端 MassAI.MassCrowd.CrowdWaitAreaData
// (dump.cs TypeDefIndex 57264:
// NativeArray<CrowdWaitSlot> Slots + NativeList<int> ConnectedLanes
// + int NumFreeSlots + int CrossLaneHandle),槽位本体
// CrowdWaitSlot(57263)= Position / Forward / Radius / bOccupied。
// 行人沿 ConnectedLanes 汇入 → 占一个 Slot 站定(Radius + bOccupied 保证人不重叠)
// → 等路口相位 → 放行后走 CrossLaneHandle(人行横道)过街 → 释放槽位。
// ⛑⛑ 关键边界:整套结构是客户端 C# 原生 ECS(burst 段 RVA 0x17246xxx),
// Lua 侧 grep 零命中 ⇒ **服务端发不进去**。客户端 crowd 散人自己就在用它。
// 本表唯一用途:让**服务端自建的 NPC**(街区市民 / ambient ped)站在
// 「官方人群本来会站的地方」,并遵守官方的密度纪律(同一等待区别塞满)。
//
type PedSpawnPoint struct {
WaitAreaIndex int32 `json:"waitAreaIndex"`
SlotIndex int32 `json:"slotIndex"`
X float32 `json:"x"`
Y float32 `json:"y"`
Z float32 `json:"z"`
ForwardX float32 `json:"forwardX"`
ForwardZ float32 `json:"forwardZ"`
UrbanDiversityConfigId uint32 `json:"urbanDiversityConfigId"`
//
// 朝向(度)。ForwardX/ForwardZ 是世界空间的前向量,0° = +Z、顺时针为正
// (对齐 SyncAetherAICrowdAdd 的写法,见硬规则 27)。
//
FacingDeg float32 `json:"facingDeg"`
}
//
// 官方 ZoneGraph「行人等待区 + 槽位」表(2026-10-02 从捐赠端 PrivateServerPor 搬来)。
// CSV 列:wait_area_index,slot_index,x,y,z,forward_x,forward_z,urban_diversity_config_id
// 数据 4070 行。同一 wait_area_index 下挂多个 slot_index —— 一个路口等待区多个站位。
// ⛑ 与 StaticNpcSpawnTable(捐赠端那套沿车道网等距烘焙的固定站位)**不是一回事**:
// 那边是一维点池(SlotKey = point.Index),这边是二维「区 + 槽」
// (SlotKey = WaitAreaIndex<<32 | SlotIndex)。
//
type PedSpawnTable4229938 struct {
Cache []PedSpawnPoint `json:"cache"`
Points []PedSpawnPoint `json:"points"`
Count int32 `json:"count"`
// 表可用(文件存在且至少有一条数据)。文件缺失不算错误 —— 相关开关默认不依赖它。
Available bool `json:"available"`
}