xiandie/README.md
2025-01-31 18:44:33 +08:00

98 lines
3.6 KiB
Markdown
Raw 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.

# xiandie
《衔蝶》开发代码
# 说明
- animation framesres://config/animation/entity_sprite_frames.tres
## 插件
- [DialogueManager 使用与维护说明](https://docs.qq.com/doc/DWG5vaEZ1Qk9EdVVw)
- [GIF 插件](https://godotengine.org/asset-library/asset/2255)
### ProAnimatedSprite2D
插件路径addons/property-inspector/pro_animation_sprite2d
![ProAnimatedSprite2D 配置示例](readme_image/image.png)
ProAnimatedSprite2D增强 AnimatedSprite2D 的表现,在其基础上增加:
1. 播放+移动:播放特定动画时自动移动,可配置移速
2. 播放某动画后自动跳转:播放一个动画结束后,自动播放另一个
3. 自动跳转可以设置循环播放次数,若干次后再跳转
4. 跳转前可以等待 wait_time 时长
其中:
1. action configs 配置动画跳转逻辑
2. move configs 配置播放特定动画时的移动速度
3. ProAnimatedSprite2D 配置项跳过保存默认值,有利于统一控制、变更默认值
## Ground 与 GroundLoader
- 正常游戏Main -> GroundLoader -> Ground
- 开发阶段:直接编辑 Ground
### Ground 说明
#### AnimationPlayer每个 Ground 都有一个 AnimationPlayer脚本继承自定义的 AnimationRoot
主要功能说明:
1. 正常的 AnimationPlayer 功能
2. oneshot_animation 场景首次加载时播放的 animation
主要方法与数据说明:
1. _default_data() : 本场景的默认存档数据
2. _on_ground_ready(): 在父节点 Ground 加载完成后回调
3. set_data(property: StringName, value: Variant):用于设置需要存档的数据
4. ground_archive存档数据
#### Entity 说明
位置res://scene/entity/
子目录说明:
1. ambient光照
2. general音效等
3. partical粒子效果
4. ux用户交互
主要类型说明:
1. ambush触发区域触发后执行回调
1. 可以配置是否一次性
2. 可配置触发方式enter, area_enter, interact
3. 可在场景加载时触发
4. 触发效果有播放对话期间锁定玩家播放动画回调方法AnimationPlayer 的方法注意“_”开头的方法会被忽略
2. inspectable可在检阅窗口进行审视的物品可以附加文案
3. local_inspectable运镜+检阅,无需检阅窗口
4. note显示文案
1. 显示方式os玩家头顶气泡ballon下方字幕可播放配音
5. npc
6. portal传送门
1. 名称有: left默认, right默认, 1, 2, 3, ...
2. 关键参数targer_scene 与 target_portaltarget_portal 为 none 时不启用)
3. 三种模式default通道opened打开的门locked锁定的门对应不同图标与操作音效
4. 锁定的门可以配置启用钥匙prop_key可在使用后自动消耗该钥匙
## 存档结构
- 存档命名为:"save"+三位数字
- 如果不足三位数字,则会忽略;超过三位数字不会忽略,可以正常读取
- 这是为了方便多存档功能进行文本排序等
- 开发阶段 debug 存档save000
- 开发阶段 index 页面进入的游戏存档save001
- 发行后,玩家游戏过程中,自动保存的存档编号范围(最多 10 个循环保存000-019
- 发行后,玩家游戏过程中,手动保存的存档编号范围(最多 10 个栏位050-059
- 发行后,玩家游戏过程中最多有以上 20 个存档
每个场景都有一份 GroundArchive 存档,通过 ArchiveManager.archive.ground_archive() 可以获得。
current_scene 是通过 GroundLoader 加载的,在 ground loader 加载 ground 时,会先更新 archive 的 current scene然后加载 ground。