feat: 切换至滚动阻力运行模型并更新资产、编辑器与验证

- 物理规则:现行模型仅保留滚动阻力耗能与恢复系数碰撞,风力、空气阻力、静摩擦、动摩擦不再参与运行;确认三球质量 60/330/约890 kg 及水密度、流阻参数
- 定向加速改为真实顶面接触触发的一次性 +5 m/s 速度事件,模型新增渐进式 U 形导槽出口
- 更新球体、滑槽、水/冰/墙、球洞模型与 storybook 目录、物理、实体配置
- 工坊摆放、编辑器、运行适配与检查脚本同步;删除过时的 baseline 三组检查
- 新增谜题设计参考文档、关卡草稿与本轮实验产物
This commit is contained in:
Yanchen
2026-12-05 10:37:31 +08:00
parent d1141b04c7
commit bf6c355fa6
132 changed files with 13205 additions and 1838 deletions
+10 -5
View File
@@ -77,13 +77,18 @@ assets/blocks/directional_boost/
- 工坊默认空白,保存到 [designer/drafts](designer/drafts)。内置示例从 `playtest/` 读取,保存时写入草稿副本,不直接覆盖实验原件。
- 展示:[showcase.tscn](playtest/showcase/scenes/showcase.tscn);早期试玩:[main.tscn](playtest/baseline/scenes/main.tscn)。
- `levels/` 仅用于明确发布的正式关卡。不要把试跑成功、示例或工坊草稿自动当作正式关卡。
- [blocks.md](references/design/blocks.md) 是方块完整规则的唯一维护文档,保留“滑槽 / 实体”结构;[physics_system.md](references/design/physics_system.md) 管理物理和小球数据;[game_reference.md](references/design/game_reference.md) 管理整体玩法及参考方向。
- [blocks.md](references/design/blocks.md) 是方块完整规则的唯一维护文档,保留“滑槽 / 实体”结构;[physics_system.md](references/design/physics_system.md#当前运行模型) 管理物理和小球数据,现行行为以其顶部“当前运行模型”为准,后续旧版完整刚体模型中的风力、滑滚转换和阻力矩公式不得当作现用规则;[game_reference.md](references/design/game_reference.md) 管理整体玩法及参考方向。
- 外部游戏资料在 `references/games/`,机械笔记在 `references/mechanics/`。区分资料中的建议、用户指令与已确认规则。
- 原木球、陶瓷球、铁球半径均为 0.3 m;质量和空气响应来自物理预设。当前木球 60 kg、陶瓷球 330 kg、铁球约 890.08 kg;`dragCoefficient` 分别为 0.47 / 0.04 / 0.47。铁球与其他球使用同一空气力公式;当前风场下因质量和正常接触阻力而难以推动。禁止为铁球设置风力豁免、零阻力特例或速度/位置锁定,也不得在验证中覆盖真实铁球配置来掩盖问题。
- 小球对照入口:[materials.tscn](playtest/materials/scenes/materials.tscn),支持滚动入洞、同风场和定向加速三种场景;`./scripts/run.zsh test-balls` 运行专项检查。
- 现行物理使用 Godot 4.7 / Jolt、120 Hz 固定物理步、Y 轴向上和 **9.81 m/s²** 重力。原木、陶瓷、铁球半径均为 **0.3 m**,质量分别为 **60 / 330 / 约 890.08 kg**;三种球共享同一规则,是参与动力学积分的刚体,固体方块保持静态。接触支持力、碰撞冲量与运动积分由引擎统一求解,不得另写第二套轨道积分或把同一接触反力重复作为连续力施加。
- **持续固体接触只通过滚动阻力耗能;瞬时碰撞仍按恢复系数回弹并可能耗能。** 木槽、冰面、墙面的恢复系数分别为 0.08 / 0.02 / 0.02。保留重力、碰撞、水的浮力和相对水流阻力,不能用“只有滚动阻力耗能”推导出碰撞无能量损失。
- 滚动阻力沿承托面的切向施加,近似大小为 `c_rr·N`,并限制单步冲量不超过 `m·|v_t|`,避免只靠阻力使球反向。`N` 来自重力、外载和水作用在合成承托法线上的压紧分量,不能固定取 `mg`;多个接触每球每物理步只施加一次等效阻力,系数取承载分量最大的接触面。木槽、冰面、墙面的滚动阻力系数分别为 **0.025 / 0.002 / 0.8**。球的切向滚动角速度按切向速度和半径直接同步,不通过静摩擦交换平动与转动能量,不另加旧版滚动阻力矩或纯滚动 `5/7` 加速度修正。
- 水密度为 **1000 kg/m³**,水中阻力系数为 **0.47**,单块流速固定为 **5 m/s**,逐块 `flowSpeed` 不得覆盖。浮力按球与水块并集的实际浸没体积计算;水阻力按球与浸没部分有效流速的相对速度二次计算,并限制单步冲量以避免越过流速。跨水格不重复提供浮力,不同流向按浸没部分合成有效流速。沉底不锁定球的位置或速度,只有固体河床提供滚动阻力。完整公式见 [水流与浮力](references/design/physics_system.md#35-水流与浮力)。
- 风力、空气阻力、静摩擦和动摩擦不参与当前运行,原生线性、角度阻尼也为零。`physics.json` 中非零的 `dragCoefficient`、`airDensity`、`staticFriction`、`dynamicFriction` 是保留的历史字段,运行时不读取;修改这些字段不会改变当前行为,恢复相应机制必须同时明确扩展实现、规则和验证。
- 小球对照入口:[materials.tscn](playtest/materials/scenes/materials.tscn),支持滚动入洞和定向加速;`./scripts/run.zsh test-balls` 使用真实质量和运行配置检查三种球、空中运动和定向加速。修改水、冰或墙面行为时运行 `./scripts/run.zsh test-environment`。共享物理脚本按实际影响选择并组合必要专项,历史报告不能替代本次运行结果。
- 弯槽统一为一种 **90°弯槽**(`turn_90`),双向通行,保留 0° / 90° / 180° / 270° 四个旋转朝向。菜单、库存和新存档不得再区分左右弯槽;左转/右转仅描述球的行进方向。旧存档载入时,`turn_cw` 保持角度,`turn_ccw` 额外顺时针转 90°;V1 槽上起点的路径参数反转以保持原球心与来向。保留旧源文件和历史快照,不自动改写用户草稿。
- 五种滑槽均采用实心底座,仅保留顶部滚动槽;模型和碰撞体中不得恢复底部通孔。底孔实验场景与入口已删除。
- 定向加速方块每次固定增加 **5 m/s**,工坊与运行中均不可调;旧存档的 `speedGain` 不得覆盖该规则。
- 定向加速是**真实顶面接触触发的一次性速度事件,不是持续力或额外冲量**。每次有效触发先将水平方向改为箭头方向,再令水平速率固定增加 **5 m/s**,即 `v'_h = d·(|v_h| + 5 m/s)`,其中 `d` 为箭头的水平单位方向;保留竖直速度,同一次持续接触不重复触发,充分离开后才可再次触发。增量在工坊与运行中均不可调,旧存档的 `speedGain` 不得覆盖该规则,也不得为同一事件再叠加等效力或冲量。
- 滑槽以静态碰撞体存在,不受重力或球撞击推动,**可以悬空,不需要在路线下方铺墙承托**。玩家摆放的一面依附条件属于搭建规则,不是重力支撑条件。空中点选格和预览只用于显示/选取,不得添加隐藏承托碰撞体。
- 普通教学关的小球放在固定的定向加速方块上,从静止释放并经真实顶面接触起步;不要专门铺起跑斜坡或直接设置球的初速度。缓坡、急坡用于教学路线的高差衔接。受控物理验证中的自由落体等对照球按其验证目标设置。
@@ -108,7 +113,7 @@ assets/blocks/directional_boost/
## 验证与迁移记录
- 检查脚本在 `playtest/checks/`,早期专项在 `playtest/baseline/checks/`,截图脚本在 `playtest/captures/`。
- 检查脚本在 `playtest/checks/`,截图脚本在 `playtest/captures/`。早期 `baseline-test` 及 `playtest/baseline/checks/` 中的三组过时检查已删除;早期试玩场景和历史报告保留,不得把旧报告当作仍可运行的专项。
- `playtest/artifacts/baseline/`、`styled/`、`reorganization/` 分别收纳早期产物、当前画风实验产物及迁移记录。历史报告中的旧路径是当时证据,移动文件不代表重新运行了实验。
- [迁移清单](playtest/artifacts/reorganization/files.json) 保存旧路径、新路径及迁移前 SHA-256;[路径映射](playtest/artifacts/reorganization/path_map.json) 用于追溯。
- 用户不希望为小改动重复跑全套物理实验。验证应匹配改动:目录调整主要检查路径、语法、导入和入口加载;仅在确实涉及相应行为时运行必要专项。
+1 -1
View File
@@ -37,7 +37,7 @@ Godot 工程入口是 [godot_engine/project.godot](godot_engine/project.godot)
定向加速方块固定增加 **5 m/s**,工坊与运行中均不可调;见 [方块设定](references/design/blocks.md#定向加速方块)。
工坊「小球」菜单可选原木球、陶瓷球和铁球,尺寸相同、质量及受风程度不同。[三球对照场景与验证](playtest/materials/README.md)。
工坊「小球」菜单可选原木球、陶瓷球和铁球,尺寸相同,质量及水中浮沉表现不同。[三球对照场景与验证](playtest/materials/README.md)。
[等级一:滑槽入门](playtest/tutorial/README.md) 包含五个可操作教学关,逐步练习直槽/缓坡、转弯、旋转、急缓坡搭配与综合通道。双击 `scripts/Tutorial.command`,从未完成布局开始搭建,真实入洞后进入下一关;它们仍是 `playtest/` 实验关卡。
+1 -1
View File
@@ -22,7 +22,7 @@
三种球的第一版风格化材质使用同一平滑球面与 1024×512 的颜色和粗糙度贴图。铁球以 Metal 032 的冷灰缎面和 Metal 009 的细磨痕为参考。陶瓷球用白瓷釉色与 Porcelain 001 的钴蓝弧纹。木球结合 Wood 092 的暖木面与 DeadKir 的宽木纹。原始图像和 CC0 授权见 [参考库](../references/materials/ball-materials/README.md)。[Godot 改造前后对比](balls/shared/previews/material-style-v1/comparison.png)上、下两行使用教学关镜头、光照和同一组三条直槽,顺序是铁球、陶瓷球、木球。
球洞外壳现为与墙壁同材质的 1×1×1 方块,内部保留原有锥面和落球通道,碰撞由实际带孔网格生成。制作入口为 `./scripts/asset.zsh goal_hole`;[外观对照](../playtest/artifacts/styled/goal_block/wall_comparison.png)、[入洞与侧壁专项](../playtest/checks/validate_goal_block.gd)及其[36 项检查结果](../playtest/artifacts/styled/goal_block/physics.json)记录此次修改,完整规则见[方块文档](../references/design/blocks.md#非触发方块)。
球洞外壳现为与墙壁同材质的 1×1×1 方块,内部保留原有锥面和落球通道,碰撞由实际带孔网格生成。制作入口为 `./scripts/asset.zsh goal_hole`;[外观对照](../playtest/artifacts/styled/goal_block/wall_comparison.png)、[入洞与侧壁专项](../playtest/checks/validate_goal_block.gd)及其[检查结果](../playtest/artifacts/styled/goal_block/physics.json)记录此次修改,完整规则见[方块文档](../references/design/blocks.md#非触发方块)。
90°弯槽的现用资源为 [turn_90](chutes/turn_90/README.md)。旧 `turn_cw` / `turn_ccw` 文件仅保留作历史源资产,不在现用目录配置中注册,不再出现在素材菜单;旧制作入口转调统一资源。来源快照保留原名称,制作器显式映射为统一类型。
Binary file not shown.
Binary file not shown.
Binary file not shown.
+43 -48
View File
@@ -13,20 +13,11 @@ var water_drag_force := Vector3.ZERO
var impact_contacts: Dictionary={}
var last_linear_velocity := Vector3.ZERO
var radius: float = 0.3
var drag_coefficient: float = 0.47
var air_density: float = 1.225
var wind_velocity := Vector3.ZERO
var mu_static: float = 0.42
var mu_dynamic: float = 0.32
var rolling_resistance: float = 0.025
var friction_enabled := true
var rolling_enabled := true
var drag_enabled := true
var rolling_force := Vector3.ZERO
var contact_count := 0
var ball_contact_count := 0
var contact_slip := 0.0
var air_force := Vector3.ZERO
var rolling_torque := Vector3.ZERO
var travelled := 0.0
var previous_position := Vector3.ZERO
var tracking_started := false
@@ -46,25 +37,33 @@ func _integrate_forces(state: PhysicsDirectBodyState3D) -> void:
return
contact_count = state.get_contact_count()
ball_contact_count = 0
contact_slip = 0.0
apply_water_forces(state)
var load_force := mass * state.total_gravity + constant_force + buoyancy_force + water_drag_force
var strongest_load := 0.0
var contact_bounce := base_bounce
var support_normal := Vector3.ZERO
var active_pair: Dictionary={}
var impacts: Dictionary={}
active_surface="painted_wood"
for i in range(contact_count):
var collider: Node=state.get_contact_collider_object(i)
if collider is RigidBody3D:ball_contact_count+=1
var surface: String=collider.get_meta("piece_type","") if collider!=null else ""
if surface_pairs.has(surface):
var pair: Dictionary=surface_pairs[surface]
if active_pair.is_empty() or pair.dynamicFriction>active_pair.dynamicFriction:
active_pair=pair;active_surface=surface
# Contact positions are global; the sphere's radial direction is unambiguous.
if collider is RigidBody3D:
ball_contact_count+=1
continue
if not collider is StaticBody3D:continue
var surface: String=collider.get_meta("piece_type","")
var pair: Dictionary = surface_pairs.get(surface,{})
if not pair.is_empty():contact_bounce = float(pair.restitution)
var n := (state.transform.origin - state.get_contact_local_position(i)).normalized()
var relative := state.get_contact_local_velocity_at_position(i) - state.get_contact_collider_velocity_at_position(i)
var slip := relative - n * relative.dot(n)
contact_slip = maxf(contact_slip, slip.length())
var load_on_face := -load_force.dot(n)
if load_on_face > 0.0:
support_normal += n * load_on_face
if load_on_face > strongest_load:
strongest_load = load_on_face
active_pair = pair
active_surface = surface if not active_pair.is_empty() else "painted_wood"
if surface=="ice":
var relative := state.get_contact_local_velocity_at_position(i) - state.get_contact_collider_velocity_at_position(i)
var block: Node=collider
while block!=null and not block.has_method("receive_impact"):block=block.get_parent()
if block!=null:
@@ -72,10 +71,6 @@ func _integrate_forces(state: PhysicsDirectBodyState3D) -> void:
if not impacts.has(id):impacts[id]={"block":block,"impulse":0.0,"approach":0.0}
impacts[id].impulse+=absf(state.get_contact_impulse(i).dot(n))
impacts[id].approach=maxf(impacts[id].approach,maxf(-relative.dot(n),-last_linear_velocity.dot(n)))
if n.dot(Vector3.UP) > 0.15 or (surface=="wall" and (mass*state.total_gravity+constant_force+air_force+buoyancy_force+water_drag_force).dot(n)<-.01):
support_normal += n
# Godot exposes one native friction coefficient. Select a slip-dependent
# coefficient; native contact solver still owns the friction impulse.
for id in impacts:
if not impact_contacts.has(id):
var impact: Dictionary=impacts[id]
@@ -86,12 +81,16 @@ func _integrate_forces(state: PhysicsDirectBodyState3D) -> void:
impact_contacts[id]=true
for id in impact_contacts.keys():
if not impacts.has(id):impact_contacts.erase(id)
var contact_static: float=active_pair.get("staticFriction",mu_static)
var contact_dynamic: float=active_pair.get("dynamicFriction",mu_dynamic)
var contact_rolling: float=active_pair.get("rollingResistance",rolling_resistance)
physics_material_override.friction = (contact_static if contact_slip < 0.035 else contact_dynamic) if friction_enabled else 0.0
physics_material_override.bounce=active_pair.get("restitution",base_bounce)
physics_material_override.bounce=contact_bounce
boost_controller.integrate(state, radius)
apply_rolling_resistance(state,support_normal,load_force,active_pair.get("rollingResistance",rolling_resistance))
last_linear_velocity=state.linear_velocity
if tracking_started:
travelled += state.transform.origin.distance_to(previous_position)
previous_position = state.transform.origin
tracking_started = true
func apply_water_forces(state: PhysicsDirectBodyState3D) -> void:
var water: Dictionary=Water.sample(state.transform.origin,radius,get_tree().get_nodes_in_group("water_blocks"))
submerged_fraction=water.fraction;water_velocity=water.velocity
var volume:=4.0/3.0*PI*radius*radius*radius*submerged_fraction
@@ -102,21 +101,17 @@ func _integrate_forces(state: PhysicsDirectBodyState3D) -> void:
var drag_limit:=relative_water.length()*mass/state.step
if water_drag_force.length()>drag_limit:water_drag_force=water_drag_force.normalized()*drag_limit
state.apply_central_force(buoyancy_force+water_drag_force)
var relative_air := state.linear_velocity - wind_velocity
air_force = -0.5 * air_density * drag_coefficient * PI * radius * radius * relative_air.length() * relative_air * (1.0-submerged_fraction) if drag_enabled else Vector3.ZERO
state.apply_central_force(air_force)
rolling_torque = Vector3.ZERO
if rolling_enabled and support_normal.length_squared() > 0.001:
var n := support_normal.normalized()
var roll := state.angular_velocity - n * state.angular_velocity.dot(n)
if roll.length() > 0.0001:
var support := maxf(0.0, -(mass * state.total_gravity + constant_force + air_force + buoyancy_force + water_drag_force).dot(n))
var moment := 0.4 * mass * radius * radius
var limit := roll.length() * moment / state.step
rolling_torque = -roll.normalized() * minf(contact_rolling * support * radius, limit)
state.apply_torque(rolling_torque)
last_linear_velocity=state.linear_velocity
if tracking_started:
travelled += state.transform.origin.distance_to(previous_position)
previous_position = state.transform.origin
tracking_started = true
func apply_rolling_resistance(state: PhysicsDirectBodyState3D, support_normal: Vector3, load_force: Vector3, coefficient: float) -> void:
rolling_force = Vector3.ZERO
if support_normal.length_squared() > 0.0:
var normal := support_normal.normalized()
var tangent := state.linear_velocity.slide(normal)
if rolling_enabled and not tangent.is_zero_approx():
var load_n := maxf(0.0,-load_force.dot(normal))
# One equivalent force per ball, even on a groove or a tile seam.
var magnitude := minf(coefficient * load_n, mass * tangent.length() / state.step)
rolling_force = -tangent.normalized() * magnitude
state.apply_central_force(rolling_force)
# Show rolling from the travelled speed without a tangential contact impulse.
state.angular_velocity = normal.cross(tangent) / radius + normal * state.angular_velocity.dot(normal)
Binary file not shown.
Binary file not shown.
+25 -3
View File
@@ -7,6 +7,25 @@ const SPEED_GAIN := 5.0
var active: Dictionary = {}
var events: Array = []
# Keep the solid cube under the guide. A vertical pick on the centreline can
# otherwise pass between the two mirrored triangle strips at some rotations.
static func guide_shape(mesh: Mesh, top: float) -> ConcavePolygonShape3D:
var faces := mesh.get_faces()
var raised := PackedVector3Array()
var cut := Plane(Vector3.DOWN,-top)
for i in range(0,faces.size(),3):
var triangle := faces.slice(i,i+3)
if maxf(triangle[0].y,maxf(triangle[1].y,triangle[2].y)) <= top+.00001:continue
var polygon := Geometry3D.clip_polygon(triangle,cut)
for j in range(1,polygon.size()-1):
raised.append(polygon[0])
raised.append(polygon[j])
raised.append(polygon[j+1])
var shape := ConcavePolygonShape3D.new()
shape.backface_collision = true
shape.set_faces(raised)
return shape
func integrate(state: PhysicsDirectBodyState3D, radius: float) -> void:
var touching: Dictionary = {}
for i in range(state.get_contact_count()):
@@ -19,7 +38,8 @@ func integrate(state: PhysicsDirectBodyState3D, radius: float) -> void:
var normal := (state.transform.origin - contact).normalized()
var local: Vector3 = block.to_local(contact)
var bounds: AABB = block.get_meta("boost_bounds")
if normal.y < .9 or absf(local.y - bounds.end.y) > .025:continue
var rise := float(block.get_meta("outlet_rise",0.0))
if normal.y < .9 or local.y < bounds.end.y-.025 or local.y > bounds.end.y+rise+.025:continue
touching[block.get_instance_id()] = block
for id in active.keys():
if touching.has(id):continue
@@ -27,8 +47,10 @@ func integrate(state: PhysicsDirectBodyState3D, radius: float) -> void:
if not is_instance_valid(block):active.erase(id);continue
var local: Vector3 = block.to_local(state.transform.origin)
var bounds: AABB = block.get_meta("boost_bounds")
if local.x < bounds.position.x-.025 or local.x > bounds.end.x+.025 or local.z < bounds.position.z-.025 or local.z > bounds.end.z+.025 or absf(local.y-bounds.end.y-radius) > .06:
active.erase(id)
var rise := float(block.get_meta("outlet_rise",0.0))
# The sphere can straddle the mouth after its centre leaves the tile.
var guide := AABB(Vector3(bounds.position.x,bounds.end.y,bounds.position.z),Vector3(bounds.size.x,rise,bounds.size.z))
if not guide.grow(radius+.025).has_point(local):active.erase(id)
# Stable order for the rare case of simultaneously touching two top faces.
var blocks: Array = touching.values()
blocks.sort_custom(func(a,b):return str(a.get_meta("record_id",a.name)) < str(b.get_meta("record_id",b.name)))
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,61 @@
"""Author the launcher's permanent outlet with the straight chute's mouth profile."""
from math import cos, pi, sin
def build_outlet(radius, mesh_object, outline, mats):
# The last cross-section uses the same 32 facets as the adjoining chute.
groove = [(radius * sin(i*pi/32), radius * (1-cos(i*pi/32))) for i in range(-16, 17)]
profile = [(-.5, radius), *groove, (.5, radius)]
start = -.375
def rise(x, depth):
u = min(1, max(0, (x-start)/(.5-start)))
return depth * u*u*(3-2*u)
vertices, faces = [], []
for i in range(25):
x = -.5+i/24
ring = [(x, y, 1+rise(x, depth)) for y, depth in profile]
vertices.extend([*ring, (x,.5,0), (x,-.5,0)])
width = len(profile)+2
for row in range(24):
for col in range(width):
a = row*width+col
b = row*width+(col+1)%width
faces.append((a,b,b+width,a+width))
# Blender triangulates the concave end caps on export.
faces.extend([tuple(reversed(range(width))), tuple(range(24*width,25*width))])
body = mesh_object('directional_boost',vertices,faces)
for key in ['wall','wall_top']:
body.data.materials.append(mats[key])
for face in body.data.polygons:
face.material_index = int(face.normal.z>0.001)
group = [body,outline(body)]
# Sample the graphic along the same cross-section so it lies on the wood.
for suffix,scale,lift,color in [('border',1,.003,'ink'),('fill',.82,.005,'red')]:
verts, polys = [], []
# Separate bands at the arrow shoulders to keep their sharp corners.
for low,high,shaft in [(-.28,-.12,False),(-.12,.12,True),(.12,.28,False)]:
cuts = [(low*scale,None),*((y,d) for y,d in groove if low*scale < y < high*scale),(high*scale,None)]
for y, depth in cuts:
if depth is None:
for (ya,da),(yb,db) in zip(groove,groove[1:]):
if ya<=y<=yb:
depth=da+(db-da)*(y-ya)/(yb-ya)
break
left = (-.34 if shaft else .04)*scale
right = .36*scale-.32*abs(y)/.28
for j in range(9):
x=left+(right-left)*j/8
verts.append((x,y,1+rise(x,depth)+lift))
band_start=len(verts)-9*len(cuts)
for i in range(len(cuts)-1):
for j in range(8):
a=band_start+9*i+j
polys.append((a,a+1,a+10,a+9))
arrow=mesh_object('ink_boost_arrow_'+suffix,verts,polys)
arrow.data.materials.append(mats[color])
group.append(arrow)
return group
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+35 -34
View File
@@ -2035,7 +2035,7 @@
"directional_boost": {
"role": "boost",
"category": "interactive",
"collisionShape": "box",
"collisionShape": "guidedBase",
"cellFootprint": [
1,
1
@@ -2049,19 +2049,20 @@
"max": [
0.5,
0.5,
1
1.32
],
"size": [
1,
1,
1
1.32
]
},
"declaredSize": [
1,
1,
1
1.32
],
"baseHeight": 1,
"geometryOrigin": "authored",
"arrowDirectionGodot": [
1,
@@ -2071,36 +2072,6 @@
"path": "res://assets/blocks/directional_boost/model.glb",
"sourceBlend": "assets/blocks/directional_boost/source/model.blend"
},
"wood_ball": {
"path": "res://assets/balls/wood_ball/model.glb",
"radius": 0.3,
"boundsBlender": {
"size": [
0.6,
0.6,
0.6
]
},
"albedoTexture": "res://assets/balls/wood_ball/textures/albedo.png",
"sourceBlend": "assets/balls/wood_ball/source/model.blend",
"role": "ball",
"geometrySource": "iron_ball"
},
"ceramic_ball": {
"path": "res://assets/balls/ceramic_ball/model.glb",
"radius": 0.3,
"boundsBlender": {
"size": [
0.6,
0.6,
0.6
]
},
"albedoTexture": "res://assets/balls/ceramic_ball/textures/albedo.png",
"sourceBlend": "assets/balls/ceramic_ball/source/model.blend",
"role": "ball",
"geometrySource": "iron_ball"
},
"water": {
"role": "water",
"category": "nonInteractive",
@@ -2173,6 +2144,36 @@
"geometryOrigin": "authored",
"path": "res://assets/blocks/ice/model.glb",
"sourceBlend": "assets/blocks/ice/source/model.blend"
},
"wood_ball": {
"path": "res://assets/balls/wood_ball/model.glb",
"radius": 0.3,
"boundsBlender": {
"size": [
0.6,
0.6,
0.6
]
},
"albedoTexture": "res://assets/balls/wood_ball/textures/albedo.png",
"sourceBlend": "assets/balls/wood_ball/source/model.blend",
"role": "ball",
"geometrySource": "iron_ball"
},
"ceramic_ball": {
"path": "res://assets/balls/ceramic_ball/model.glb",
"radius": 0.3,
"boundsBlender": {
"size": [
0.6,
0.6,
0.6
]
},
"albedoTexture": "res://assets/balls/ceramic_ball/textures/albedo.png",
"sourceBlend": "assets/balls/ceramic_ball/source/model.blend",
"role": "ball",
"geometrySource": "iron_ball"
}
},
"styleFamily": "railbound_inspired",
+2 -4
View File
@@ -164,10 +164,8 @@
],
"notes": [
"Game tuning: all balls have the same authored radius and shape. Wood mass 60 kg; ceramic 330 kg (confirmed initial mass, sinks and travels less than 2 m in the 8-second reference current); iron keeps its original 890.076 kg.",
"Air drag coefficients are gameplay parameters, not measured material constants: wood 0.47, ceramic 0.04, iron 0.47. Iron receives aerodynamic force through the same equation as other balls; its mass and ordinary contact resistance limit motion in the reference wind.",
"No extra fan multiplier or direct wind velocity override. All types use the established contact coefficients to isolate mass and aerodynamic differences.",
"The current native per-body friction/restitution approximation is retained; simultaneous mixed contact-pair solving is not introduced by this asset change.",
"Wall contacts use high friction and rolling resistance; ice uses low friction and rolling resistance. These are shared surface tuning, never per-level ball overrides."
"All balls use gravity, normal collisions, buoyancy and water drag. Solid contact dissipates through rollingResistance only. Air and native contact friction are disabled. dragCoefficient, airDensity, staticFriction and dynamicFriction are retained as historical configuration fields.",
"Rolling resistance coefficients are shared by the three ball types for each surface. Ice has low rolling resistance and walls have high rolling resistance."
],
"airDensity": 1.225
}
+10 -18
View File
@@ -102,7 +102,7 @@ def build_wall(name='wall'):
faces=[(0,2,3,1),(4,5,7,6),(0,1,5,4),(2,6,7,3),(0,4,6,2),(1,3,7,5)]
return mesh_object(name,vertices,faces)
build_funnel();build_wall();build_wall('directional_boost');build_wall('water');build_wall('ice')
build_funnel();build_wall();build_wall('water');build_wall('ice')
mats['water']=mat('water','74C7D8',roughness=.25)
mats['water_surface']=mat('water_surface','63B8C5',roughness=.25)
mats['ice']=mat('ice','A8DAE0',roughness=.12)
@@ -121,9 +121,10 @@ catalog['models']['water']['flowDirectionGodot']=[1,0,0]
catalog['models']['wall']={'role':'solid','category':'nonInteractive','collisionShape':'box',
'cellFootprint':[1,1],'boundsBlender':{'min':[-.5,-.5,0],'max':[.5,.5,1],'size':[1,1,1]},
'declaredSize':[1,1,1],'geometryOrigin':'authored'}
catalog['models']['directional_boost']={'role':'boost','category':'interactive','collisionShape':'box',
'cellFootprint':[1,1],'boundsBlender':{'min':[-.5,-.5,0],'max':[.5,.5,1],'size':[1,1,1]},
'declaredSize':[1,1,1],'geometryOrigin':'authored','arrowDirectionGodot':[1,0,0]}
boost_radius=catalog['models']['straight']['grooveRadius']
catalog['models']['directional_boost']={'role':'boost','category':'interactive','collisionShape':'guidedBase',
'cellFootprint':[1,1],'boundsBlender':{'min':[-.5,-.5,0],'max':[.5,.5,1+boost_radius],'size':[1,1,1+boost_radius]},
'declaredSize':[1,1,1+boost_radius],'baseHeight':1,'geometryOrigin':'authored','arrowDirectionGodot':[1,0,0]}
catalog['models']['goal_hole']={'role':'goal','category':'nonInteractive','openingRadius':.32,
'entranceRadius':.46,'funnelDepth':.35,'depth':1.0,'cellFootprint':[1,1],
'boundsBlender':{'min':[-.5,-.5,-1],'max':[.5,.5,0],'size':[1,1,1]},
@@ -160,17 +161,6 @@ def outline(obj):
bm.free()
return lines(obj.name,segments)
def boost_arrow():
# Flat authored graphic above the top face; excluded from collision like ink outlines.
points=[(-.34,-.12),(.04,-.12),(.04,-.28),(.36,0),(.04,.28),(.04,.12),(-.34,.12)]
result=[]
for suffix,scale,z,color in [('border',1,1.002,'ink'),('fill',.82,1.003,'red')]:
arrow=mesh_object('ink_boost_arrow_'+suffix,[(x*scale,y*scale,z) for x,y in points],[tuple(range(7))])
arrow.data.materials.append(mats[color]);arrow['visual_only']=True
result.append(arrow)
return result
def asset_dir(kind):
category = 'balls' if kind == 'iron_ball' else 'goals' if kind == 'goal_hole' else 'blocks' if kind in ('wall','directional_boost','water','ice') else 'chutes'
return ROOT / 'assets' / category / kind
@@ -186,6 +176,9 @@ groups=[];report=[]
all_kinds=kinds+['iron_ball','goal_hole','wall','directional_boost','water','ice']
if ONLY_ASSET is not None and ONLY_ASSET not in all_kinds:raise ValueError(ONLY_ASSET)
for kind in ([ONLY_ASSET] if ONLY_ASSET else all_kinds):
if kind=='directional_boost':
author=runpy.run_path(str(asset_dir(kind)/'source/outlet.py'))
group=author['build_outlet'](boost_radius,mesh_object,outline,mats)
obj=bpy.data.objects[snapshot_turn if kind=='turn_90' else kind]
if kind=='turn_90':
obj.name=kind
@@ -194,7 +187,7 @@ for kind in ([ONLY_ASSET] if ONLY_ASSET else all_kinds):
obj.data=obj.data.copy()
before_coords=[tuple(v.co) for v in obj.data.vertices]
old_indices=[p.material_index for p in obj.data.polygons]
obj.data.materials.clear()
if kind!='directional_boost':obj.data.materials.clear()
if kind in kinds:
for key in ['body','groove','top']:obj.data.materials.append(mats[key])
for face,old in zip(obj.data.polygons,old_indices):
@@ -228,11 +221,10 @@ for kind in ([ONLY_ASSET] if ONLY_ASSET else all_kinds):
ice_style['apply_ice_surface'](obj,mats['ice'],mats['ice_top'])
group.append(outline(obj))
category='entities'
else:
elif kind!='directional_boost':
obj.data.materials.append(mats['wall']);obj.data.materials.append(mats['wall_top'])
for face in obj.data.polygons:face.material_index=1 if face.normal.z>.5 else 0
group=[obj,outline(obj)]
if kind=='directional_boost':group+=boost_arrow()
category='entities'
obj['style_family']='railbound_inspired'
obj['collision_source']='authored mesh' if kind in ('wall','goal_hole','directional_boost','water','ice') else 'unchanged source mesh'
Binary file not shown.
+10 -6
View File
@@ -83,16 +83,20 @@ for kind,data in catalog['models'].items():
if authored:
bm=bmesh.new();bm.from_mesh(obj.data)
volume=abs(bm.calc_volume(signed=True));closed=all(e.is_manifold for e in bm.edges);bm.free()
correct=correct and closed and all(abs(d-1)<1e-6 for d in obj.dimensions)
if kind in ('wall','directional_boost'):
correct=correct and closed and (obj.dimensions-Vector(data['boundsBlender']['size'])).length<1e-6
if kind=='wall':
correct=correct and abs(volume-1)<1e-6
if kind=='directional_boost':
elif kind=='directional_boost':
base=data['baseHeight']
radius=catalog['models']['straight']['grooveRadius']
mouth=[v.co for v in obj.data.vertices if abs(v.co.x-.5)<1e-6]
profile=[Vector((.5,radius*math.sin(i*math.pi/32),base+radius*(1-math.cos(i*math.pi/32)))) for i in range(-16,17)]
correct=correct and all(any((vertex-target).length<1e-6 for vertex in mouth) for target in profile)
arrow=bpy.data.objects.get('ink_boost_arrow_fill')
correct=correct and arrow is not None
if arrow is not None:
points=[v.co for v in arrow.data.vertices]
tip=max(points,key=lambda v:v.x)
correct=correct and tip.x>0 and abs(tip.y)<1e-6 and all(1<v.z<1.01 for v in points)
tip=max((v.co for v in arrow.data.vertices),key=lambda v:v.x)
correct=correct and tip.x>0 and abs(tip.y)<1e-6 and base<tip.z<base+.01
check['arrowTipBlender']=list(tip)
elif kind=='goal_hole':
tree=BVHTree.FromPolygons([v.co for v in obj.data.vertices],
Binary file not shown.
+5 -5
View File
@@ -46,7 +46,7 @@
标准墙壁是实心 **1×1×1 m** 立方体,碰撞采用从模型包围尺寸生成的实心盒体。球洞重新建模为 **1×1×1 m** 的漏斗外形:上口半径 0.46 m,锥面下降 0.35 m 后收窄至 0.32 m 的喉口,通道总深度 1 m。锥面和喉口均有真实三角面碰撞,靠重力与接触引导球进入,没有吸附或轨迹牵引。球洞的模型原点仍在上沿,墙壁的模型原点在底部;工坊坐标栏统一显示方块底面,内部自动换算模型原点,既有存档坐标不整体平移。
原木球、陶瓷球、铁球均为独立资产,球面几何与半径完全相同。原木使用木纹,陶瓷使用浅色釉面与蓝色纹饰;各自具有源文件、制作代码、GLB 和资源索引。质量依次为 60 / 330 / 约 890.08 kg,陶瓷为原木质量的 5.5 倍;空气阻力系数依次为 0.47 / 0.04 / 0.47。铁球也受到风力;同样空气力下其加速度更小,且当前滑槽上的滚动阻力更大,因此普通测试风场难以推动它。这些是当前玩法验证参数,保存在 [physics.json](../assets/collections/storybook/physics.json),不作为真实材料测量值。共享运动逻辑见 [physics.gd](../assets/balls/shared/physics.gd)。[同场对照与结果](../playtest/materials/README.md)。
原木球、陶瓷球、铁球均为独立资产,球面几何与半径完全相同。原木使用木纹,陶瓷使用浅色釉面与蓝色纹饰;各自具有源文件、制作代码、GLB 和资源索引。质量依次为 60 / 330 / 约 890.08 kg,陶瓷为原木质量的 5.5 倍。三种球共用固体滚动阻力和水体浮沉模型。这些是当前玩法验证参数,保存在 [physics.json](../assets/collections/storybook/physics.json),不作为真实材料测量值。共享运动逻辑见 [physics.gd](../assets/balls/shared/physics.gd)。[同场对照与结果](../playtest/materials/README.md)。
[source_manifest.json](../assets/collections/storybook/source/snapshot/source_manifest.json) 记录基线来源哈希。首次复制前后均检查源文件稳定性,随后重建只读取副本快照。后续如要接入新的模型优化,应显式刷新这套快照并重新验证,避免在其他 Agent 建模时混入半成品。正式设计文档中的数值同步由原模型优化任务处理,本文件说明的是当前副本的实际资产。
@@ -58,7 +58,7 @@
末端另有一块旋转 90° 的直槽,以其可见实体侧面作为洞后止挡,承接剩余水平速度。早期没有止挡时,重复试跑曾出现越过窄洞口的情况;加入这块现有滑槽后,通过 30 次连续完整双球试跑。它也是可选中、移动和删除的普通直槽,不是隐藏墙体或新实体类型。
两球间碰撞保持开启,沿用既有摩擦、回弹与滚动阻力;铁球空气阻力系数恢复为 0.47,风力与静止空气阻力均正常计算。入洞按穿过洞口底部截面和真实孔径净空检测,每球只计一次;入洞后移除其碰撞并隐藏,全部入洞才成功,丢球不减少目标数量。
两球间碰撞保持开启,采用法向回弹及固体表面滚动阻力。球心向下进入漏斗的喉口并满足孔径净空时,立即计数一次、关闭该球碰撞并隐藏小球。洞底可以直接放在墙壁上。全部小球入洞才成功,丢球不减少目标数量。
测试场景界面只保留“启动”“重置”和初速度滑块。初速度范围为 0–5 m/s,步长 0.1 m/s,同时作用于两颗铁球,方向沿各自出生槽的下坡切线。启动后锁定滑块,再次实验先点击重置;重置恢复两颗球并保留当前滑块值。`空格` 启动,`T` 重置;右键拖动旋转观察,中键拖动平移,滚轮缩放,`F` 回到全景。
@@ -71,19 +71,19 @@
1. 在素材栏选择 **滑槽 / 小球 / 交互方块 / 非交互方块**。小球是与滑槽并列的独立菜单项,位于菜单第一行右侧;滑槽显示五种积木,选择小球后显示原木球、陶瓷球、铁球三个选项及坐标/放置控件;非交互方块显示“标准墙壁”“锥口球洞”和“水方块”;交互方块显示“定向加速”和“易碎冰块”。
2. 默认使用 **放置模式**。点击地面选择 Y=0 的位置;点击已有墙块的顶面会把待放方块底面对齐到墙顶。点击侧面拼接滑槽时,按槽口的实际滚动面自动调整高度:接滑槽对齐两端槽底,接墙壁、冰块或加速块对齐顶面。选好后点击 **放置新方块**。这个按钮始终新增,绝不会移动或替换原方块;旋转预览时重新计算与所点表面的连接高度。
3. 方块坐标统一为 **X / 底面 Y / Z**,可见地面与固定网格都是 **Y=0**。例如标准墙第一层底面为 0,第二层为 1,第三层为 2;可以直接输入坐标后连续新增,无需先取消选中。修改已有方块时切换到 **选择 / 移动**,点击目标方块,修改坐标或类型,再点 **应用修改到选中方块**。`R` 在放置模式旋转预览,在选择模式旋转选中方块;删除只作用于明确选中的方块或球。支持撤销和多层占用检查,所有十种现用方块均可放在墙顶。
4. 点击菜单中的 **小球** 并选定球种,默认使用 **贴表面点选**:点击地面或墙面会按球的实际半径计算球心,点击滑槽会对准最近的上方槽线。槽口紧邻墙体时会寻找同一槽内最近的无重叠位置,容不下球时会提示重新选点。半透明球预览落点,点击 **+ 放置原木球 / 陶瓷球 / 铁球** 才实际新增。也可以切换 **按 Y 高度点选(悬空)**,先设置球心 Y,再点击场景选择该水平面上的 X/Z;无须先放滑槽。坐标仍可按 0.01 m 精度输入或微调,Y 始终表示球心高度。切回方块菜单只隐藏小球编辑控件和预览,已放置的小球保留。
4. 点击菜单中的 **小球** 并选定球种,默认使用 **贴表面点选**:点击方块的任意可见面,球会对准顶面中央。加速块取箭头所在的槽底高度。点击滑槽会选中轨道中点,Y 汇流按点中的分支取中点。中央空间不足时会提示重新选点。点击空地仍按所点位置预览。半透明球预览落点,点击 **+ 放置原木球 / 陶瓷球 / 铁球** 才实际新增。也可以切换 **按 Y 高度点选(悬空)**,先设置球心 Y,再点击场景选择该水平面上的 X/Z;无须先放滑槽。坐标仍可按 0.01 m 精度输入或微调,Y 始终表示球心高度。切回方块菜单只隐藏小球编辑控件和预览,已放置的小球保留。
5. 移动已有球时,先从小球列表或场景中点击选球,再点击目标墙面、滑槽或指定高度平面,最后点击 **移动选中小球**。点选新位置只更新预览,不会擅自移动旧球;放置按钮始终新增选定种类的小球。也可直接改坐标后移动,支持撤销、重试和存档。移动或删除方块不会牵动已放置的小球。
6. 球洞作为非交互方块,使用与墙块相同的放置、选择、移动、删除、撤销及存档流程。可放置多个球洞,任意球进入任意球洞都只记一次;所有预设球入洞后才算成功。
7. 按空格试跑,悬空球会自由下落并与墙体、滑槽或锥面发生真实碰撞;运行和暂停期间锁定编辑。按 `T` 恢复原布局与所有球的球心坐标。
8. 在侧栏下部输入名称并保存。文件写入 `designer/drafts/<名称>.json`,覆盖时保留 `.json.bak`。从列表选择名称后点击“载入”;非法对象、非数值坐标或方块重叠会被拒绝,失败不会清空当前关卡。
自动拼接与玩家教学关共用 [placement.gd](scripts/placement.gd) 的 `align_surfaces()`。高度不再强制取整到 0.5 m,Y 坐标栏按 0.01 m 调整,存档保留实际高度;X/Z 仍对齐网格。例如加速块底面 Y=2、顶面 Y=3,陡坡高端槽底相对底面为 1.18 m,所以接入该端时陡坡底面应为 **Y=1.82**,不能同底放在 Y=2。
自动拼接与玩家教学关共用 [placement.gd](scripts/placement.gd) 的 `align_surfaces()`。高度不再强制取整到 0.5 m,Y 坐标栏按 0.01 m 调整,存档保留实际高度;X/Z 仍对齐网格。例如加速块底面 Y=2、出口槽底 Y=3,陡坡高端槽底相对底面为 1.18 m,所以接入该端时陡坡底面应为 **Y=1.82**,不能同底放在 Y=2。加速块在放置预览和单独摆放时就带有 U 形槽与方向箭头。沿箭头接坡时,出口中央和两侧槽沿同时接齐。已保存的布局重新载入即可生效。
连接只调整待放件的高度,不自动改变坡型、朝向或已有方块。两端无法同时满足时,工坊优先连接所点方块,玩家格位优先匹配更多邻接槽口、再选最接近格位高度的解;仍需选对坡型与朝向。手动输入坐标会退出此次自动面吸附,便于精确编辑。旧草稿保持原坐标,已有错误接缝需要重新点选放置或手动修正。
选择 **交互方块 → 定向加速**,选位置并点击“放置新方块”;按 `R` 旋转箭头方向。所有方块每次触发均固定增加 **5 m/s**,工坊只显示“固定增速:+5 m/s”,不提供调节入口,运行中也不可更改。
把任一种小球放在方块顶面并启动,即可在首次真实顶面接触时沿箭头起步。运动中的球先改为箭头方向,再在原水平速率上加上增量:原水平速率 2 m/s 时,触发结果为沿箭头的 7 m/s。保留当时的竖直速度和角速度;之后继续正常物理运动。侧面、底面及悬空经过不触发;每颗球每次接触只触发一次,充分离开再接触可重新触发,暂停/继续不重复增速,重置会清空触发记录。顶面被其他实体覆盖时,不会隔着覆盖物加速。方块仍提供完整实心碰撞,箭头为不参与碰撞的平面标识。
把任一种小球放在方块顶面并启动,即可在首次真实顶面接触时沿箭头起步。运动中的球先改为箭头方向,再在原水平速率上加上增量:原水平速率 2 m/s 时,触发结果为沿箭头的 7 m/s。保留当时的竖直速度和角速度;之后继续正常物理运动。侧面、底面及悬空经过不触发;每颗球每次接触只触发一次,充分离开再接触可重新触发,暂停/继续不重复增速,重置会清空触发记录。顶面被其他实体覆盖时,不会隔着覆盖物加速。方块仍提供完整实心碰撞,箭头贴合槽面,仅作方向标识。
加速方块以 `kind: "directional_boost"`、位置与 `quarter` 保存到实体记录中,支持保存/载入、移动、删除和撤销。速度增量属于固定玩法规则,不写入关卡数据。旧存档中的 `speedGain` 会在载入时忽略,再次保存时移除;任何旧数值均不能覆盖固定的 +5 m/s。不含加速方块的旧关卡不会新增加速效果。
+215
View File
@@ -0,0 +1,215 @@
{
"assetFamily": "railbound_inspired",
"balls": [
{
"ballTypeId": "iron_ball",
"id": "iron_ball_54733144_11",
"launchDirection": [
1.0,
0.0,
0.0
],
"position": [
-4.02999973297119,
3.3199999332428,
-0.0799999982118607
]
}
],
"entities": [
{
"id": "piece_15858038_1",
"kind": "wall",
"position": [
-4.0,
0.0,
1.0
],
"quarter": 0
},
{
"id": "piece_18049673_2",
"kind": "wall",
"position": [
-4.0,
1.0,
1.0
],
"quarter": 0
},
{
"id": "piece_19796675_3",
"kind": "wall",
"position": [
-4.0,
0.0,
0.0
],
"quarter": 0
},
{
"id": "piece_21292261_4",
"kind": "wall",
"position": [
-4.0,
1.0,
0.0
],
"quarter": 0
},
{
"id": "piece_23084086_5",
"kind": "wall",
"position": [
-4.0,
0.0,
-1.0
],
"quarter": 0
},
{
"id": "piece_24705746_6",
"kind": "wall",
"position": [
-4.0,
1.0,
-1.0
],
"quarter": 0
},
{
"id": "piece_26513152_7",
"kind": "wall",
"position": [
-4.0,
2.0,
-1.0
],
"quarter": 0
},
{
"id": "piece_28199731_8",
"kind": "wall",
"position": [
-4.0,
2.0,
1.0
],
"quarter": 0
},
{
"id": "piece_32033087_9",
"kind": "directional_boost",
"position": [
-4.0,
2.0,
0.0
],
"quarter": 0
},
{
"id": "piece_45816500_10",
"kind": "goal_hole",
"position": [
-2.0,
1.0,
0.0
],
"quarter": 0
}
],
"pieces": [
{
"id": "piece_70046522_12",
"kind": "straight",
"position": [
-3.0,
2.0,
0.0
],
"quarter": 0
},
{
"id": "piece_77038214_13",
"kind": "turn_90",
"position": [
-2.0,
2.0,
0.0
],
"quarter": 0
},
{
"id": "piece_89895659_14",
"kind": "gentle",
"position": [
-2.0,
2.0,
1.0
],
"quarter": 3
},
{
"id": "piece_103149940_15",
"kind": "turn_90",
"position": [
-2.0,
1.5,
2.0
],
"quarter": 2
},
{
"id": "piece_160941968_17",
"kind": "gentle",
"position": [
-1.0,
1.5,
2.0
],
"quarter": 2
},
{
"id": "piece_173516839_18",
"kind": "turn_90",
"position": [
0.0,
1.0,
2.0
],
"quarter": 1
},
{
"id": "piece_195109380_19",
"kind": "straight",
"position": [
0.0,
1.0,
1.0
],
"quarter": 1
},
{
"id": "piece_215538886_20",
"kind": "turn_90",
"position": [
0.0,
1.0,
0.0
],
"quarter": 0
},
{
"id": "piece_242631404_21",
"kind": "steep",
"position": [
-1.0,
0.5,
0.0
],
"quarter": 0
}
],
"schemaVersion": 2,
"title": "TestLevel1"
}
+115
View File
@@ -0,0 +1,115 @@
{
"assetFamily": "railbound_inspired",
"balls": [
{
"ballTypeId": "iron_ball",
"id": "iron_ball_164994389_10",
"launchDirection": [
1.0,
0.0,
0.0
],
"position": [
-4.01999998092651,
4.31999969482422,
2.95000004768372
]
}
],
"entities": [
{
"id": "piece_99132318_5",
"kind": "wall",
"position": [
-4.0,
0.0,
3.0
],
"quarter": 0
},
{
"id": "piece_100675506_6",
"kind": "wall",
"position": [
-4.0,
1.0,
3.0
],
"quarter": 0
},
{
"id": "piece_102310872_7",
"kind": "wall",
"position": [
-4.0,
2.0,
3.0
],
"quarter": 0
},
{
"id": "piece_108466479_8",
"kind": "directional_boost",
"position": [
-4.0,
3.0,
3.0
],
"quarter": 0
},
{
"id": "piece_193286052_13",
"kind": "goal_hole",
"position": [
1.0,
1.0,
3.0
],
"quarter": 2
}
],
"pieces": [
{
"id": "piece_157935970_9",
"kind": "gentle",
"position": [
-3.0,
3.3199999332428,
3.0
],
"quarter": 2
},
{
"id": "piece_172677659_11",
"kind": "straight",
"position": [
-2.0,
2.8199999332428,
3.0
],
"quarter": 2
},
{
"id": "piece_177149779_12",
"kind": "steep",
"position": [
-1.0,
2.3199999332428,
3.0
],
"quarter": 2
},
{
"id": "piece_214624797_14",
"kind": "steep",
"position": [
0.0,
1.3199999332428,
3.0
],
"quarter": 2
}
],
"schemaVersion": 2,
"title": "my_level"
}
+7 -2
View File
@@ -17,8 +17,13 @@ func valid_vector(value: Variant) -> bool:
if not (n is float or n is int) or not is_finite(float(n)):return false
return true
func overlaps(a: Dictionary,b: Dictionary) -> bool:
func overlaps(a: Dictionary,b: Dictionary, saved_layout := false) -> bool:
var ab: AABB=lib.record_bounds(a);var bb: AABB=lib.record_bounds(b)
# Earlier saves allow another block directly above the 1 m base.
# Accept those coordinates on load. New placements reserve the full rim.
if saved_layout:
if a.kind=="directional_boost":ab.size.y=lib.catalog[a.kind].baseHeight
if b.kind=="directional_boost":bb.size.y=lib.catalog[b.kind].baseHeight
var extent: Vector3=ab.end.min(bb.end)-ab.position.max(bb.position)
return extent.x>.001 and extent.y>.001 and extent.z>.001
@@ -42,7 +47,7 @@ func validate(data: Variant) -> String:
if r.kind!="goal_hole" and (r.position[0]!=round(r.position[0]) or r.position[2]!=round(r.position[2])):return "积木 X / Z 坐标必须对齐网格"
var d={"id":r.id,"kind":Chutes.canonical_kind(r.kind),"position":lib.vector(r.position),"quarter":Chutes.canonical_quarter(r.kind,int(r.quarter))}
for other in decoded:
if overlaps(d,other):return "关卡中有重叠方块"
if overlaps(d,other,true):return "关卡中有重叠方块"
decoded.append(d);ids.append(r.id)
var ball_ids: Array=[]
for b in data.balls:
+14 -3
View File
@@ -51,13 +51,23 @@ func ports(record: Dictionary) -> Array:
result.append({"surface":center+basis*local,"normal":basis*outward})
return result
func boost_mouth(record: Dictionary) -> Dictionary:
var bounds: AABB = lib.record_bounds(record)
var basis := Basis(Vector3.UP, -int(record.quarter)*PI/2)
var normal: Vector3 = basis * lib.vector(lib.catalog[record.kind].arrowDirectionGodot)
var surface := bounds.get_center() + normal*.5
surface.y = record.position.y + lib.catalog[record.kind].baseHeight
return {"surface":surface, "normal":normal}
func connections(candidate: Dictionary,neighbors: Array) -> Array:
var matches: Array=[]
for own in ports(candidate):
var is_boost: bool = candidate.kind == "directional_boost"
var own_ports: Array = [boost_mouth(candidate)] if is_boost else ports(candidate)
for own in own_ports:
for other in neighbors:
if other.id==candidate.id:continue
var targets: Array=ports(other)
if other.kind in ["wall","directional_boost","ice","goal_hole"]:
if not is_boost and other.kind in ["wall","directional_boost","ice","goal_hole"]:
# Flat solid tops and the goal rim have no groove. Use the edge at
# this lane, not the block bottom or the decorative arrow mesh.
var bounds: AABB=lib.record_bounds(other)
@@ -67,7 +77,8 @@ func connections(candidate: Dictionary,neighbors: Array) -> Array:
var lateral:=2 if axis==0 else 0
var edge: float=bounds.position[axis] if n[axis]>0 else bounds.end[axis]
if absf(p[axis]-edge)<.001 and p[lateral]>bounds.position[lateral]+.001 and p[lateral]<bounds.end[lateral]-.001:
targets.append({"surface":Vector3(p.x,bounds.end.y,p.z),"normal":-n})
var rolling_y: float = boost_mouth(other).surface.y if other.kind=="directional_boost" else bounds.end.y
targets.append({"surface":Vector3(p.x,rolling_y,p.z),"normal":-n})
for target in targets:
var delta: Vector3=target.surface-own.surface
if Vector2(delta.x,delta.z).length()>.001 or own.normal.dot(target.normal)>-.999:continue
+38 -40
View File
@@ -351,10 +351,10 @@ func refresh_palette() -> void:
option.toggle_mode=true
option.button_pressed=block_mode!="erase" and (id==ball_kind if category=="balls" else id==kind)
if category=="balls":
option.tooltip_text={"wood_ball":"原木球:容易被风吹动","ceramic_ball":"陶瓷球:330 kg,在当前水域中下沉","iron_ball":"铁球:最重,普通风下难以推动"}[id]
option.tooltip_text={"wood_ball":"原木球:60 kg,在当前水域中浮起","ceramic_ball":"陶瓷球:330 kg,在当前水域中下沉","iron_ball":"铁球:约 890 kg,在当前水域中下沉"}[id]
elif id=="water":option.tooltip_text="水体可穿入;泡沫顺流漂动,水速固定 5 m/s。R 顺时针旋转 90°。"
elif id=="ice":option.tooltip_text="低摩擦冰面;强撞击会破碎,静置承重不触发。"
elif id=="wall":option.tooltip_text="实心墙壁;高摩擦、高滚动阻力,也可搭建河床和河岸。"
elif id=="ice":option.tooltip_text="低滚动阻力冰面;强撞击会破碎,静置承重不触发。"
elif id=="wall":option.tooltip_text="实心墙壁;高滚动阻力,也可搭建河床和河岸。"
palette_box.add_child(option)
for id in category_buttons:category_buttons[id].button_pressed=id==category
if block_controls!=null:block_controls.visible=category!="balls" and block_mode!="erase"
@@ -508,7 +508,7 @@ func add_spawn() -> void:
func refresh_ball_pick_hint() -> void:
if ball_pick_hint==null:return
ball_pick_hint.text="点击场景选位置,再点“放置小球”。\n滑槽会自动对准槽内。" if ball_pick_mode.selected==0 else "先设置球心 Y,再点击场景选 X/Z,\n最后点“放置小球”。"
ball_pick_hint.text="点方块选中顶面中央,点滑槽选中槽段中点。\n确认预览后点“放置小球”。" if ball_pick_mode.selected==0 else "先设置球心 Y,再点击场景选 X/Z,\n最后点“放置小球”。"
func ball_position_is_clear(at: Vector3) -> bool:
var shape:=SphereShape3D.new();shape.radius=lib.ball_radius(ball_kind)
@@ -516,37 +516,39 @@ func ball_position_is_clear(at: Vector3) -> bool:
query.transform=Transform3D(Basis.IDENTITY,at);query.collision_mask=1;query.margin=0
return get_world_3d().direct_space_state.intersect_shape(query).is_empty()
func ball_position_on_chute(hit: Dictionary) -> Variant:
var node: Node=hit.collider
while node!=null and not node.has_meta("record_id"):node=node.get_parent()
if node==null:return null
var record: Dictionary=records[index_for(node.get_meta("record_id"))]
if record.kind not in IDS:return null
var transform:=Transform3D(Basis(Vector3.UP,-int(record.quarter)*PI/2),lib.record_center(record))
var local: Vector3=transform.affine_inverse()*Vector3(hit.position)
var point:=Vector2(local.x,local.z)
var paths: Array=lib.catalog[record.kind].upperPaths
var distance:=INF;var best_t:=0.0;var best_branch:=0
for branch in range(paths.size()):
var path: Array=paths[branch]
for i in range(path.size()-1):
var a:=Vector2(path[i][0],path[i][2]);var b:=Vector2(path[i+1][0],path[i+1][2])
var segment:=b-a
var ratio:=clampf((point-a).dot(segment)/maxf(segment.length_squared(),.000001),0,1)
var d:=point.distance_squared_to(a+segment*ratio)
if d<distance:distance=d;best_t=(i+ratio)/(path.size()-1);best_branch=branch
var candidate: Vector3=(transform*lib.ball_on_surface(record.kind,best_t,best_branch)).snapped(Vector3.ONE*.01)
if ball_position_is_clear(candidate):return candidate
# At a seam a nearby wall can obstruct the ideal groove point. Find the
# closest clear point on this same asset without moving or altering any block.
var best_distance:=INF
for branch in range(paths.size()):
for i in range(paths[branch].size()):
var t: float=float(i)/(paths[branch].size()-1)
var alternative: Vector3=(transform*lib.ball_on_surface(record.kind,t,branch)).snapped(Vector3.ONE*.01)
var d: float=alternative.distance_squared_to(Vector3(hit.position))
if d<best_distance and ball_position_is_clear(alternative):candidate=alternative;best_distance=d
return candidate
func ball_position_on_block(hit: Dictionary) -> Variant:
var node: Node = hit.collider
while node != null and not node.has_meta("record_id"):
node = node.get_parent()
if node == null:
return null
var record: Dictionary = records[index_for(node.get_meta("record_id"))]
var center: Vector3 = lib.record_center(record)
if record.kind not in IDS:
var bounds: AABB = lib.record_bounds(record)
center.y = bounds.end.y
if record.kind == "directional_boost":
center.y = record.position.y + lib.catalog[record.kind].baseHeight
return center + Vector3.UP * (lib.ball_radius(ball_kind) + .018)
var transform := Transform3D(Basis(Vector3.UP, -int(record.quarter) * PI/2), center)
var paths: Array = lib.catalog[record.kind].upperPaths
var branch := 0
if paths.size() > 1:
# The click chooses a Y-merge branch. Its spawn point stays fixed.
var local_hit: Vector3 = transform.affine_inverse() * Vector3(hit.position)
var point := Vector2(local_hit.x, local_hit.z)
var best_distance := INF
for path_index in range(paths.size()):
var path: Array = paths[path_index]
for i in range(path.size() - 1):
var a := Vector2(path[i][0], path[i][2])
var b := Vector2(path[i+1][0], path[i+1][2])
var distance := point.distance_squared_to(Geometry2D.get_closest_point_to_segment(point, a, b))
if distance < best_distance:
best_distance = distance
branch = path_index
return transform * lib.ball_on_surface(record.kind, .5, branch)
func pick_ball_position(origin: Vector3,direction: Vector3,hit: Dictionary) -> void:
var candidate: Variant=null
@@ -554,11 +556,7 @@ func pick_ball_position(origin: Vector3,direction: Vector3,hit: Dictionary) -> v
if ball_pick_mode.selected==1:
candidate=Plane(Vector3.UP,ball_cursor.y).intersects_ray(origin,direction)
elif not hit.is_empty():
candidate=ball_position_on_chute(hit)
if candidate==null:
var normal: Vector3=hit.normal
if normal.length_squared()<.001:return
candidate=hit.position+normal.normalized()*(radius+.018)
candidate=ball_position_on_block(hit)
else:
var ground=Plane(Vector3.UP,0).intersects_ray(origin,direction)
if ground!=null:candidate=ground+Vector3.UP*(radius+.018)
+24 -14
View File
@@ -29,10 +29,12 @@ func create_piece(kind: String, location := Vector3.ZERO, quarter := 0) -> Node3
if kind == Booster.KIND:
root.set_meta("boost_direction", vector(catalog[kind].arrowDirectionGodot))
var bounds: Dictionary = catalog[kind].boundsBlender
root.set_meta("boost_bounds", AABB(Vector3(bounds.min[0],bounds.min[2],-bounds.max[1]),Vector3(bounds.size[0],bounds.size[2],bounds.size[1])))
if not scene_cache.has(kind):
scene_cache[kind] = load(catalog[kind]["path"])
var visual: Node3D = scene_cache[kind].instantiate()
root.set_meta("boost_bounds", AABB(Vector3(bounds.min[0],bounds.min[2],-bounds.max[1]),Vector3(bounds.size[0],catalog[kind].baseHeight,bounds.size[1])))
root.set_meta("outlet_rise",float(bounds.size[2])-float(catalog[kind].baseHeight))
var path: String = catalog[kind].path
if not scene_cache.has(path):
scene_cache[path] = load(path)
var visual: Node3D = scene_cache[path].instantiate()
root.add_child(visual)
if kind == "ice":
IceAppearance.apply(visual, location)
@@ -57,13 +59,24 @@ func add_colliders(node: Node, kind: String) -> void:
body.collision_mask = 2
body.set_meta("piece_type",kind)
var material := PhysicsMaterial.new()
material.friction = .25 if kind=="goal_hole" else 1.0 # native pair uses min.
material.friction = 0.0
material.bounce = 0.0
body.physics_material_override = material
var collider := CollisionShape3D.new()
var use_box: bool = catalog[kind].get("collisionShape","")=="box"
var key := kind + ":" + str(node.name)
var bounds: Dictionary = catalog[kind].boundsBlender
if kind == Booster.KIND:
var base := CollisionShape3D.new()
var box := BoxShape3D.new()
box.size = Vector3(bounds.size[0],catalog[kind].baseHeight,bounds.size[1])
base.shape = box
base.position.y = float(bounds.min[2])+box.size.y*.5
body.add_child(base)
if not collision_cache.has(key):
if catalog[kind].get("collisionShape","")=="box":
if kind == Booster.KIND:
collision_cache[key]=Booster.guide_shape(node.mesh,float(catalog[kind].baseHeight))
elif use_box:
var shape:=BoxShape3D.new()
shape.size=node.mesh.get_aabb().size
collision_cache[key]=shape
@@ -72,7 +85,7 @@ func add_colliders(node: Node, kind: String) -> void:
shape.backface_collision = true
collision_cache[key] = shape
collider.shape = collision_cache[key]
if catalog[kind].get("collisionShape","")=="box":collider.position=node.mesh.get_aabb().get_center()
if use_box:collider.position=node.mesh.get_aabb().get_center()
body.add_child(collider)
node.add_child(body)
for child in node.get_children():
@@ -117,15 +130,11 @@ func create_ball(type_id: String = "iron_ball") -> RigidBody3D:
body.radius = float(data["radius"])
body.mass = float(profile["massKg"])
body.inertia = Vector3.ONE * (0.4 * body.mass * body.radius * body.radius)
body.drag_coefficient = float(profile["dragCoefficient"])
body.air_density = float(physics["airDensity"])
body.mu_static = float(pair["staticFriction"])
body.mu_dynamic = float(pair["dynamicFriction"])
body.rolling_resistance = float(pair["rollingResistance"])
body.collision_layer = 2
body.collision_mask = 3
var material := PhysicsMaterial.new()
material.friction = body.mu_static
material.friction = 0.0
material.bounce = float(pair["restitution"])
body.base_bounce=material.bounce
body.physics_material_override = material
@@ -158,7 +167,7 @@ func create_box(size: Vector3, location: Vector3, color: Color, solid := true) -
root.collision_layer = 1
root.collision_mask = 2
var pm := PhysicsMaterial.new()
pm.friction = 1.0
pm.friction = 0.0
root.physics_material_override = pm
return root
@@ -201,7 +210,8 @@ func create_goal_hole(location: Vector3) -> Node3D:
return create_piece("goal_hole",location)
func crossed_goal(previous: Vector3, current: Vector3, goal: Vector3, radius: float) -> bool:
var height: float=goal.y-float(catalog["goal_hole"].depth)
# Score at the entrance to the narrow throat, including when a block closes the exit.
var height: float=goal.y-float(catalog["goal_hole"].funnelDepth)
if previous.y<=height or current.y>height:return false
var ratio: float=(previous.y-height)/maxf(previous.y-current.y,.000001)
var crossing: Vector3=previous.lerp(current,ratio)
+1 -1
View File
@@ -4,7 +4,7 @@
| --- | --- | --- |
| [baseline](baseline/README.md) | 早期滑槽、铁球、汇流实验。 | `./scripts/playtest.zsh` |
| [showcase](showcase) | 当前画风固定展示及示例布局。 | `./scripts/showcase.zsh` |
| [materials](materials/README.md) | 三种小球的入洞、同风场与加速对照。 | `./scripts/materials.zsh` |
| [materials](materials/README.md) | 三种小球的入洞与加速对照。 | `./scripts/materials.zsh` |
| [environment](environment/README.md) | 水流 5 m/s、冰块冲击/静置、墙壁与冰面减速对照;长期保留用于三球质量调校。 | `./scripts/environment.zsh` |
| [mass_calibration](mass_calibration/README.md) | Python 浮力/质量计算与 8 秒水流位移候选核验。 | `uv run --offline --no-sync python playtest/mass_calibration/calculate.py` |
| [tutorial](tutorial/README.md) | 等级一五关:直槽/缓坡、转弯、旋转、急缓坡与综合搭建。 | `./scripts/tutorial.zsh` |
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,6 @@
{
"failed": 0,
"passed": 30,
"passed": 28,
"results": [
{
"detail": {
@@ -17,14 +17,14 @@
},
{
"detail": {
"max_speed": 3.55942463874817,
"max_speed": 2.58126783370972,
"position": [
1.98111593723297,
0.624034285545349,
0.00604082643985748
1.9847160577774,
1.17056846618652,
0.0125022642314434
],
"status": "成功入洞 · 2.90 秒",
"time": 2.89999999999999
"status": "成功入洞 · 2.69 秒",
"time": 2.69166666666666
},
"name": "default_course_reaches_hole",
"passed": true
@@ -61,22 +61,12 @@
},
{
"detail": {},
"name": "library_turn_cw",
"name": "library_turn_90",
"passed": true
},
{
"detail": {},
"name": "rotation_cycle_turn_cw",
"passed": true
},
{
"detail": {},
"name": "library_turn_ccw",
"passed": true
},
{
"detail": {},
"name": "rotation_cycle_turn_ccw",
"name": "rotation_cycle_turn_90",
"passed": true
},
{
@@ -0,0 +1,19 @@
{
"assetFamily": "railbound_inspired",
"balls": [],
"entities": [
{
"id": "water",
"kind": "water",
"position": [
0.0,
0.0,
0.0
],
"quarter": 0
}
],
"pieces": [],
"schemaVersion": 2,
"title": "my_level"
}
@@ -0,0 +1,19 @@
{
"assetFamily": "railbound_inspired",
"balls": [],
"entities": [
{
"id": "piece_4309426_3",
"kind": "ice",
"position": [
0.0,
0.0,
0.0
],
"quarter": 1
}
],
"pieces": [],
"schemaVersion": 2,
"title": "my_level"
}
@@ -0,0 +1,19 @@
{
"assetFamily": "railbound_inspired",
"balls": [],
"entities": [
{
"id": "piece_4288175_1",
"kind": "wall",
"position": [
0.0,
0.0,
0.0
],
"quarter": 1
}
],
"pieces": [],
"schemaVersion": 2,
"title": "my_level"
}
@@ -0,0 +1,19 @@
{
"assetFamily": "railbound_inspired",
"balls": [],
"entities": [
{
"id": "piece_4297824_2",
"kind": "water",
"position": [
0.0,
0.0,
0.0
],
"quarter": 1
}
],
"pieces": [],
"schemaVersion": 2,
"title": "my_level"
}
@@ -0,0 +1,24 @@
{
"sourceManifest": {
"files": {
"assets/collections/baseline/source/collection.blend": "2d948b29f8332fa0b8faaa60ce7e92d5bf3b75c05e2dbd17795e63ea35b3d197",
"assets/collections/baseline/catalog.json": "3bbe2a939f3d4542c6c733548ff0e0549db332a30e5c2f09d51fe0aba0faa7a0",
"assets/collections/baseline/physics.json": "b0f2e8fa1637de0ee55c38471be808ccf3e018eaf1c3003e5e16c8b1a8c8de22"
},
"copiedAtUnix": 1794799536.467038,
"readOnlyBaseline": true,
"geometryRevision": "solid_base_v1",
"physicsUpdatedAtUnix": 1794810704.149133
},
"models": [
{
"id": "directional_boost",
"collisionGeometryUnchanged": false,
"vertices": 925,
"separateBlend": "assets/blocks/directional_boost/source/model.blend"
}
],
"radius": 0.3,
"physicalMaterialUnchanged": true,
"outlineGeometry": "visual only"
}
+18 -11
View File
@@ -3,11 +3,12 @@
"files": {
"assets/collections/baseline/source/collection.blend": "2d948b29f8332fa0b8faaa60ce7e92d5bf3b75c05e2dbd17795e63ea35b3d197",
"assets/collections/baseline/catalog.json": "3bbe2a939f3d4542c6c733548ff0e0549db332a30e5c2f09d51fe0aba0faa7a0",
"assets/collections/baseline/physics.json": "b12802f7763c162d037b0795e79272955031162790424831e88c939288f5526e"
"assets/collections/baseline/physics.json": "b0f2e8fa1637de0ee55c38471be808ccf3e018eaf1c3003e5e16c8b1a8c8de22"
},
"copiedAtUnix": 1794799536.467038,
"readOnlyBaseline": true,
"geometryRevision": "solid_base_v1"
"geometryRevision": "solid_base_v1",
"physicsUpdatedAtUnix": 1794810704.149133
},
"models": [
{
@@ -17,16 +18,10 @@
"separateBlend": "assets/chutes/straight/source/model.blend"
},
{
"id": "turn_cw",
"id": "turn_90",
"collisionGeometryUnchanged": true,
"vertices": 1657,
"separateBlend": "assets/chutes/turn_cw/source/model.blend"
},
{
"id": "turn_ccw",
"collisionGeometryUnchanged": true,
"vertices": 1657,
"separateBlend": "assets/chutes/turn_ccw/source/model.blend"
"separateBlend": "assets/chutes/turn_90/source/model.blend"
},
{
"id": "gentle",
@@ -67,8 +62,20 @@
{
"id": "directional_boost",
"collisionGeometryUnchanged": false,
"vertices": 8,
"vertices": 925,
"separateBlend": "assets/blocks/directional_boost/source/model.blend"
},
{
"id": "water",
"collisionGeometryUnchanged": false,
"vertices": 8,
"separateBlend": "assets/blocks/water/source/model.blend"
},
{
"id": "ice",
"collisionGeometryUnchanged": false,
"vertices": 8,
"separateBlend": "assets/blocks/ice/source/model.blend"
}
],
"radius": 0.3,
@@ -0,0 +1,51 @@
{
"assetFamily": "railbound_inspired",
"balls": [
{
"ballTypeId": "wood_ball",
"id": "wood_ball_210846_1",
"launchDirection": [
1.0,
0.0,
0.0
],
"position": [
0.0,
3.5,
0.0
]
},
{
"ballTypeId": "ceramic_ball",
"id": "ceramic_ball_214670_2",
"launchDirection": [
1.0,
0.0,
0.0
],
"position": [
2.0,
3.5,
0.0
]
},
{
"ballTypeId": "iron_ball",
"id": "iron_ball_216944_3",
"launchDirection": [
1.0,
0.0,
0.0
],
"position": [
4.0,
3.5,
0.0
]
}
],
"entities": [],
"pieces": [],
"schemaVersion": 2,
"title": "my_level"
}
@@ -1,6 +1,6 @@
{
"failed": 0,
"passed": 36,
"passed": 68,
"results": [
{
"detail": {
@@ -26,9 +26,9 @@
{
"detail": {
"position": [
0.0999999940395355,
0.0,
3.3199999332428,
0.0999999940395355
0.0
]
},
"name": "mouse_picks_wall_top",
@@ -82,123 +82,178 @@
},
{
"detail": {
"position": [
-0.0499999970197678,
2.0,
0.0
]
"actual": "(0.0, 2.0, 0.0)",
"expected": "(0.0, 2.0, 0.0)"
},
"name": "chute_pick_straight_0",
"name": "chute_midpoint_straight_0_0_0.12",
"passed": true
},
{
"detail": {
"position": [
0.0,
2.0,
-0.0499999970197678
]
"actual": "(0.0, 2.0, 0.0)",
"expected": "(0.0, 2.0, 0.0)"
},
"name": "chute_pick_straight_1",
"name": "chute_midpoint_straight_0_0_0.35",
"passed": true
},
{
"detail": {
"position": [
0.0499999970197678,
2.0,
0.0
]
"actual": "(0.0, 2.0, 0.0)",
"expected": "(0.0, 2.0, 0.0)"
},
"name": "chute_pick_straight_2",
"name": "chute_midpoint_straight_1_0_0.12",
"passed": true
},
{
"detail": {
"position": [
0.0,
2.0,
0.0499999970197678
]
"actual": "(0.0, 2.0, 0.0)",
"expected": "(0.0, 2.0, 0.0)"
},
"name": "chute_pick_straight_3",
"name": "chute_midpoint_straight_1_0_0.35",
"passed": true
},
{
"detail": {
"position": [
-0.179999992251396,
2.0,
0.119999997317791
]
"actual": "(0.0, 2.0, 0.0)",
"expected": "(0.0, 2.0, 0.0)"
},
"name": "chute_pick_turn_90_0",
"name": "chute_midpoint_straight_2_0_0.12",
"passed": true
},
{
"detail": {
"position": [
-0.119999997317791,
2.0,
-0.179999992251396
]
"actual": "(0.0, 2.0, 0.0)",
"expected": "(0.0, 2.0, 0.0)"
},
"name": "chute_pick_turn_90_1",
"name": "chute_midpoint_straight_2_0_0.35",
"passed": true
},
{
"detail": {
"position": [
0.179999992251396,
2.0,
-0.119999997317791
]
"actual": "(0.0, 2.0, 0.0)",
"expected": "(0.0, 2.0, 0.0)"
},
"name": "chute_pick_turn_90_2",
"name": "chute_midpoint_straight_3_0_0.12",
"passed": true
},
{
"detail": {
"position": [
0.119999997317791,
2.0,
0.179999992251396
]
"actual": "(0.0, 2.0, 0.0)",
"expected": "(0.0, 2.0, 0.0)"
},
"name": "chute_pick_turn_90_3",
"name": "chute_midpoint_straight_3_0_0.35",
"passed": true
},
{
"detail": {
"position": [
-0.179999992251396,
1.68999993801117,
0.0
]
"actual": "(-0.15, 2.0, 0.15)",
"expected": "(-0.15, 2.0, 0.15)"
},
"name": "chute_pick_gentle_0",
"name": "chute_midpoint_turn_90_0_0_0.12",
"passed": true
},
{
"detail": {
"position": [
0.0,
1.68999993801117,
-0.179999992251396
]
"actual": "(-0.15, 2.0, 0.15)",
"expected": "(-0.15, 2.0, 0.15)"
},
"name": "chute_pick_gentle_1",
"name": "chute_midpoint_turn_90_0_0_0.35",
"passed": true
},
{
"detail": {
"position": [
0.179999992251396,
1.68999993801117,
0.0
]
"actual": "(-0.15, 2.0, -0.15)",
"expected": "(-0.15, 2.0, -0.15)"
},
"name": "chute_pick_gentle_2",
"name": "chute_midpoint_turn_90_1_0_0.12",
"passed": true
},
{
"detail": {
"actual": "(-0.15, 2.0, -0.15)",
"expected": "(-0.15, 2.0, -0.15)"
},
"name": "chute_midpoint_turn_90_1_0_0.35",
"passed": true
},
{
"detail": {
"actual": "(0.15, 2.0, -0.15)",
"expected": "(0.15, 2.0, -0.15)"
},
"name": "chute_midpoint_turn_90_2_0_0.12",
"passed": true
},
{
"detail": {
"actual": "(0.15, 2.0, -0.15)",
"expected": "(0.15, 2.0, -0.15)"
},
"name": "chute_midpoint_turn_90_2_0_0.35",
"passed": true
},
{
"detail": {
"actual": "(0.15, 2.0, 0.15)",
"expected": "(0.15, 2.0, 0.15)"
},
"name": "chute_midpoint_turn_90_3_0_0.12",
"passed": true
},
{
"detail": {
"actual": "(0.15, 2.0, 0.15)",
"expected": "(0.15, 2.0, 0.15)"
},
"name": "chute_midpoint_turn_90_3_0_0.35",
"passed": true
},
{
"detail": {
"actual": "(-0.13, 1.72, 0.0)",
"expected": "(-0.13, 1.72, 0.0)"
},
"name": "chute_midpoint_gentle_0_0_0.12",
"passed": true
},
{
"detail": {
"actual": "(-0.13, 1.72, 0.0)",
"expected": "(-0.13, 1.72, 0.0)"
},
"name": "chute_midpoint_gentle_0_0_0.35",
"passed": true
},
{
"detail": {
"actual": "(0.0, 1.72, -0.13)",
"expected": "(0.0, 1.72, -0.13)"
},
"name": "chute_midpoint_gentle_1_0_0.12",
"passed": true
},
{
"detail": {
"actual": "(0.0, 1.72, -0.13)",
"expected": "(0.0, 1.72, -0.13)"
},
"name": "chute_midpoint_gentle_1_0_0.35",
"passed": true
},
{
"detail": {
"actual": "(0.13, 1.72, 0.0)",
"expected": "(0.13, 1.72, 0.0)"
},
"name": "chute_midpoint_gentle_2_0_0.12",
"passed": true
},
{
"detail": {
"actual": "(0.13, 1.72, 0.0)",
"expected": "(0.13, 1.72, 0.0)"
},
"name": "chute_midpoint_gentle_2_0_0.35",
"passed": true
},
{
@@ -213,108 +268,245 @@
},
{
"detail": {
"position": [
0.0,
1.68999993801117,
0.179999992251396
]
"actual": "(0.0, 1.72, 0.13)",
"expected": "(0.0, 1.72, 0.13)"
},
"name": "chute_pick_gentle_3",
"name": "chute_midpoint_gentle_3_0_0.12",
"passed": true
},
{
"detail": {
"actual": "(0.0, 1.72, 0.13)",
"expected": "(0.0, 1.72, 0.13)"
},
"name": "chute_midpoint_gentle_3_0_0.35",
"passed": true
},
{
"detail": {
"actual": "(-0.21, 1.91, 0.0)",
"expected": "(-0.21, 1.91, 0.0)"
},
"name": "chute_midpoint_steep_0_0_0.12",
"passed": true
},
{
"detail": {
"actual": "(-0.21, 1.91, 0.0)",
"expected": "(-0.21, 1.91, 0.0)"
},
"name": "chute_midpoint_steep_0_0_0.35",
"passed": true
},
{
"detail": {
"actual": "(0.0, 1.91, -0.21)",
"expected": "(0.0, 1.91, -0.21)"
},
"name": "chute_midpoint_steep_1_0_0.12",
"passed": true
},
{
"detail": {
"actual": "(0.0, 1.91, -0.21)",
"expected": "(0.0, 1.91, -0.21)"
},
"name": "chute_midpoint_steep_1_0_0.35",
"passed": true
},
{
"detail": {
"actual": "(0.21, 1.91, 0.0)",
"expected": "(0.21, 1.91, 0.0)"
},
"name": "chute_midpoint_steep_2_0_0.12",
"passed": true
},
{
"detail": {
"actual": "(0.21, 1.91, 0.0)",
"expected": "(0.21, 1.91, 0.0)"
},
"name": "chute_midpoint_steep_2_0_0.35",
"passed": true
},
{
"detail": {
"actual": "(0.0, 1.91, 0.21)",
"expected": "(0.0, 1.91, 0.21)"
},
"name": "chute_midpoint_steep_3_0_0.12",
"passed": true
},
{
"detail": {
"actual": "(0.0, 1.91, 0.21)",
"expected": "(0.0, 1.91, 0.21)"
},
"name": "chute_midpoint_steep_3_0_0.35",
"passed": true
},
{
"detail": {
"actual": "(0.5, 2.0, 1.0)",
"expected": "(0.5, 2.0, 1.0)"
},
"name": "chute_midpoint_y_merge_0_0_0.12",
"passed": true
},
{
"detail": {
"actual": "(0.5, 2.0, 1.0)",
"expected": "(0.5, 2.0, 1.0)"
},
"name": "chute_midpoint_y_merge_0_0_0.35",
"passed": true
},
{
"detail": {
"actual": "(0.5, 2.0, 0.5)",
"expected": "(0.5, 2.0, 0.5)"
},
"name": "chute_midpoint_y_merge_0_1_0.12",
"passed": true
},
{
"detail": {
"actual": "(0.5, 2.0, 0.5)",
"expected": "(0.5, 2.0, 0.5)"
},
"name": "chute_midpoint_y_merge_0_1_0.35",
"passed": true
},
{
"detail": {
"actual": "(0.0, 2.0, 0.5)",
"expected": "(0.0, 2.0, 0.5)"
},
"name": "chute_midpoint_y_merge_1_0_0.12",
"passed": true
},
{
"detail": {
"actual": "(0.0, 2.0, 0.5)",
"expected": "(0.0, 2.0, 0.5)"
},
"name": "chute_midpoint_y_merge_1_0_0.35",
"passed": true
},
{
"detail": {
"actual": "(0.5, 2.0, 0.5)",
"expected": "(0.5, 2.0, 0.5)"
},
"name": "chute_midpoint_y_merge_1_1_0.12",
"passed": true
},
{
"detail": {
"actual": "(0.5, 2.0, 0.5)",
"expected": "(0.5, 2.0, 0.5)"
},
"name": "chute_midpoint_y_merge_1_1_0.35",
"passed": true
},
{
"detail": {
"actual": "(0.5, 2.0, 0.0)",
"expected": "(0.5, 2.0, 0.0)"
},
"name": "chute_midpoint_y_merge_2_0_0.12",
"passed": true
},
{
"detail": {
"actual": "(0.5, 2.0, 0.0)",
"expected": "(0.5, 2.0, 0.0)"
},
"name": "chute_midpoint_y_merge_2_0_0.35",
"passed": true
},
{
"detail": {
"actual": "(0.5, 2.0, 0.5)",
"expected": "(0.5, 2.0, 0.5)"
},
"name": "chute_midpoint_y_merge_2_1_0.12",
"passed": true
},
{
"detail": {
"actual": "(0.5, 2.0, 0.5)",
"expected": "(0.5, 2.0, 0.5)"
},
"name": "chute_midpoint_y_merge_2_1_0.35",
"passed": true
},
{
"detail": {
"actual": "(1.0, 2.0, 0.5)",
"expected": "(1.0, 2.0, 0.5)"
},
"name": "chute_midpoint_y_merge_3_0_0.12",
"passed": true
},
{
"detail": {
"actual": "(1.0, 2.0, 0.5)",
"expected": "(1.0, 2.0, 0.5)"
},
"name": "chute_midpoint_y_merge_3_0_0.35",
"passed": true
},
{
"detail": {
"actual": "(0.5, 2.0, 0.5)",
"expected": "(0.5, 2.0, 0.5)"
},
"name": "chute_midpoint_y_merge_3_1_0.12",
"passed": true
},
{
"detail": {
"actual": "(0.5, 2.0, 0.5)",
"expected": "(0.5, 2.0, 0.5)"
},
"name": "chute_midpoint_y_merge_3_1_0.35",
"passed": true
},
{
"detail": {
"actual": "(0.0, 2.32, 0.0)"
},
"name": "entity_top_center_directional_boost",
"passed": true
},
{
"detail": {
"actual": "(0.0, 2.32, 0.0)"
},
"name": "entity_top_center_water",
"passed": true
},
{
"detail": {
"actual": "(0.0, 2.32, 0.0)"
},
"name": "entity_top_center_ice",
"passed": true
},
{
"detail": {
"actual": "(0.0, 1.32, 0.0)"
},
"name": "entity_top_center_goal_hole",
"passed": true
},
{
"detail": {
"position": [
0.109999999403954,
2.23000001907349,
0.0
]
},
"name": "chute_pick_steep_0",
"passed": true
},
{
"detail": {
"position": [
0.0,
2.23000001907349,
0.109999999403954
]
},
"name": "chute_pick_steep_1",
"passed": true
},
{
"detail": {
"position": [
-0.109999999403954,
2.23000001907349,
0.0
]
},
"name": "chute_pick_steep_2",
"passed": true
},
{
"detail": {
"position": [
0.0,
2.23000001907349,
-0.109999999403954
]
},
"name": "chute_pick_steep_3",
"passed": true
},
{
"detail": {
"position": [
0.399999976158142,
2.0,
1.0
]
},
"name": "chute_pick_y_merge_0",
"passed": true
},
{
"detail": {
"position": [
0.0,
2.0,
0.399999976158142
]
},
"name": "chute_pick_y_merge_1",
"passed": true
},
{
"detail": {
"position": [
0.599999964237213,
2.0,
0.0
]
},
"name": "chute_pick_y_merge_2",
"passed": true
},
{
"detail": {
"position": [
1.0,
2.0,
0.599999964237213
]
},
"name": "chute_pick_y_merge_3",
"passed": true
},
{
"detail": {
"position": [
0.159999996423721,
2.28999996185303,
-0.209999993443489,
1.9099999666214,
0.0
]
},
@@ -0,0 +1,85 @@
{
"engine": "Godot 4.7.2 / Jolt",
"physics_hz": 120,
"gravity_mps2": 9.81,
"ball_type": "iron_ball",
"fixture": "Reconstructed workshop: launcher (-3,2,1), straight (-2,2.32,1), gentle (-1,2.32,1), gentle (0,1.82,1), goal rim (1,2,1), wall under goal. Ball starts at (-3,3.32,1+offset).",
"comparison": {
"gain_5_mps": [
{
"lateral_offset_m": 0.0,
"slope_entry_vx_mps": 3.729923,
"track_exit_vx_mps": 4.223332,
"scored": false
},
{
"lateral_offset_m": -0.05,
"slope_entry_vx_mps": 2.656222,
"track_exit_vx_mps": 3.919585,
"scored": false
},
{
"lateral_offset_m": 0.05,
"slope_entry_vx_mps": 2.645796,
"track_exit_vx_mps": 3.910903,
"scored": false
}
],
"gain_3_mps": [
{
"lateral_offset_m": 0.0,
"slope_entry_vx_mps": 2.042475,
"track_exit_vx_mps": 3.650388,
"scored": false
},
{
"lateral_offset_m": -0.05,
"slope_entry_vx_mps": 1.650456,
"track_exit_vx_mps": 3.509175,
"scored": true
},
{
"lateral_offset_m": 0.05,
"slope_entry_vx_mps": 1.640918,
"track_exit_vx_mps": 3.48999,
"scored": true
}
]
},
"gain_3_mps_repeats": {
"settling_physics_frames": [
5,
6,
7,
8,
9,
10,
11,
12,
13,
14
],
"results": [
{
"lateral_offset_m": 0,
"scored": 2,
"runs": 10
},
{
"lateral_offset_m": -0.05,
"scored": 8,
"runs": 10
},
{
"lateral_offset_m": 0.05,
"scored": 8,
"runs": 10
}
]
},
"existing_answers": {
"basic_tutorial": "5/5",
"ice": "5/5",
"water": "3/5 acceptance checks passed. Water 4 scored both balls; wood southward travel was 0.996 m (required >1 m). Water 5 scored only iron; wood touched the third low-bridge tile."
}
}
+12 -7
View File
@@ -1,6 +1,6 @@
{
"failed": 0,
"passed": 67,
"passed": 68,
"results": [
{
"detail": {},
@@ -12,6 +12,11 @@
"name": "editor_has_fixed_gain_label_and_no_speed_input",
"passed": true
},
{
"detail": {},
"name": "standalone_preview_has_guide_and_arrow",
"passed": true
},
{
"detail": {},
"name": "gui_places_boost_without_gain_override",
@@ -19,7 +24,7 @@
},
{
"detail": {},
"name": "boost_retains_solid_wall_bounds",
"name": "boost_includes_permanent_guide_bounds",
"passed": true
},
{
@@ -121,7 +126,7 @@
"detail": {
"after": "(-0.0, -0.08175, 5.0)",
"before": "(0.0, -0.08175, 0.0)",
"blockId": "piece_247642_2",
"blockId": "piece_351506_2",
"tick": 45
},
"name": "authored_start_ball_receives_rotated_boost",
@@ -370,7 +375,7 @@
{
"detail": {
"events": 1,
"position": "(-0.098283, 1.30001, 0.0)"
"position": "(0.189901, 1.300151, 0.00048)"
},
"name": "continuous_contact_does_not_repeat",
"passed": true
@@ -440,10 +445,10 @@
"tick": 796
},
{
"after": "(9.528823, -0.0, 0.0)",
"before": "(4.528823, -0.0, 0.0)",
"after": "(9.440056, 0.072312, 0.0)",
"before": "(4.440056, 0.072312, -0.001111)",
"blockId": "second",
"tick": 813
"tick": 814
}
]
},
@@ -0,0 +1,533 @@
{
"engine": "Godot 4.7.2 Jolt",
"physics_hz": 120,
"gravity_mps2": 9.81,
"boost_gain_mps": 5,
"route": "Workshop reconstruction, launch -> straight -> gentle -> gentle -> supported goal. Positions are model origins in metres.",
"pieces": [
[
-3,
2,
1
],
[
-2,
2.32,
1
],
[
-1,
2.32,
1
],
[
0,
1.82,
1
],
[
1,
2,
1
]
],
"ball": "iron_ball",
"spawn_xyz": [
-3,
3.32,
1
],
"lateral_offsets_m": [
0,
-0.05,
0.05
],
"settle_frames_each": [
5,
6,
7,
8,
9,
10,
11,
12,
13,
14
],
"measurements": "Horizontal velocity along +X on the first tick crossing x=-1.5 and x=0.5. One ball released from rest per run.",
"method": "Only chute contact pairs were assigned in memory before each scene entered the tree. All 15 standard layouts were built by simulated player input. The tutorial outcome was checked for up to 3600 physics frames; element series additionally ran their existing mechanic, contrast and repeat checks.",
"conditions": [
{
"name": "current",
"static_friction": 0.52,
"dynamic_friction": 0.4,
"rolling_resistance": 0.035,
"slope": [
{
"offset_m": 0,
"scored": 0,
"trials": 10,
"mean_exit_vx_mps": 4.2858
},
{
"offset_m": -0.05,
"scored": 5,
"trials": 10,
"mean_exit_vx_mps": 3.8811
},
{
"offset_m": 0.05,
"scored": 5,
"trials": 10,
"mean_exit_vx_mps": 3.8846
}
],
"tutorial": [
{
"all_tiles_contacted": true,
"final_position": "(2.991658, 3.314173, -0.007785)",
"final_speed": 2.95547866821289,
"goals": 1,
"number": 1,
"won": true
},
{
"all_tiles_contacted": true,
"final_position": "(-0.011518, 3.322182, 2.984367)",
"final_speed": 2.30634355545044,
"goals": 1,
"number": 2,
"won": true
},
{
"all_tiles_contacted": true,
"final_position": "(1.997693, 3.322639, -1.997168)",
"final_speed": 1.82185578346252,
"goals": 1,
"number": 3,
"won": true
},
{
"all_tiles_contacted": true,
"final_position": "(4.980642, 3.326633, 0.000458)",
"final_speed": 2.23038792610168,
"goals": 1,
"number": 4,
"won": true
},
{
"all_tiles_contacted": true,
"final_position": "(5.008936, 2.824461, 0.017642)",
"final_speed": 1.0439840555191,
"goals": 1,
"number": 5,
"won": true
}
],
"element_levels": [
{
"scene": "res://playtest/water/scenes/01.tscn",
"won": true,
"scored": [
"wood"
],
"validation_errors": []
},
{
"scene": "res://playtest/water/scenes/02.tscn",
"won": true,
"scored": [
"iron"
],
"validation_errors": []
},
{
"scene": "res://playtest/water/scenes/03.tscn",
"won": true,
"scored": [
"iron",
"wood"
],
"validation_errors": []
},
{
"scene": "res://playtest/water/scenes/04.tscn",
"won": true,
"scored": [
"iron",
"wood"
],
"validation_errors": []
},
{
"scene": "res://playtest/water/scenes/05.tscn",
"won": true,
"scored": [
"iron",
"wood"
],
"validation_errors": []
},
{
"scene": "res://playtest/ice/scenes/01.tscn",
"won": true,
"scored": [
"wood"
],
"validation_errors": []
},
{
"scene": "res://playtest/ice/scenes/02.tscn",
"won": true,
"scored": [
"iron"
],
"validation_errors": []
},
{
"scene": "res://playtest/ice/scenes/03.tscn",
"won": true,
"scored": [
"wood"
],
"validation_errors": []
},
{
"scene": "res://playtest/ice/scenes/04.tscn",
"won": true,
"scored": [
"iron",
"wood"
],
"validation_errors": []
},
{
"scene": "res://playtest/ice/scenes/05.tscn",
"won": true,
"scored": [
"iron",
"wood"
],
"validation_errors": []
}
],
"standard_solutions_won": 15,
"element_acceptance_passed": 10
},
{
"name": "slide",
"static_friction": 1.0,
"dynamic_friction": 1.0,
"rolling_resistance": 0.035,
"slope": [
{
"offset_m": 0,
"scored": 0,
"trials": 10,
"mean_exit_vx_mps": 4.2999
},
{
"offset_m": -0.05,
"scored": 0,
"trials": 10,
"mean_exit_vx_mps": 3.8859
},
{
"offset_m": 0.05,
"scored": 0,
"trials": 10,
"mean_exit_vx_mps": 3.8725
}
],
"tutorial": [
{
"all_tiles_contacted": true,
"final_position": "(3.007763, 3.328145, 0.018029)",
"final_speed": 1.45721960067749,
"goals": 1,
"number": 1,
"won": true
},
{
"all_tiles_contacted": true,
"final_position": "(-0.015006, 3.31916, 2.992017)",
"final_speed": 2.59988713264465,
"goals": 1,
"number": 2,
"won": true
},
{
"all_tiles_contacted": true,
"final_position": "(1.987617, 3.324002, -1.984607)",
"final_speed": 1.47034776210785,
"goals": 1,
"number": 3,
"won": true
},
{
"all_tiles_contacted": true,
"final_position": "(4.995434, 3.321675, 0.011485)",
"final_speed": 2.78647184371948,
"goals": 1,
"number": 4,
"won": true
},
{
"all_tiles_contacted": true,
"final_position": "(4.980324, 2.822735, -0.00203)",
"final_speed": 1.30365455150604,
"goals": 1,
"number": 5,
"won": true
}
],
"element_levels": [
{
"scene": "res://playtest/water/scenes/01.tscn",
"won": true,
"scored": [
"wood"
],
"validation_errors": []
},
{
"scene": "res://playtest/water/scenes/02.tscn",
"won": true,
"scored": [
"iron"
],
"validation_errors": []
},
{
"scene": "res://playtest/water/scenes/03.tscn",
"won": true,
"scored": [
"iron",
"wood"
],
"validation_errors": []
},
{
"scene": "res://playtest/water/scenes/04.tscn",
"won": true,
"scored": [
"iron",
"wood"
],
"validation_errors": [
"Upper route should save wood alone and leave iron submerged"
]
},
{
"scene": "res://playtest/water/scenes/05.tscn",
"won": true,
"scored": [
"iron",
"wood"
],
"validation_errors": []
},
{
"scene": "res://playtest/ice/scenes/01.tscn",
"won": true,
"scored": [
"wood"
],
"validation_errors": []
},
{
"scene": "res://playtest/ice/scenes/02.tscn",
"won": true,
"scored": [
"iron"
],
"validation_errors": []
},
{
"scene": "res://playtest/ice/scenes/03.tscn",
"won": true,
"scored": [
"wood"
],
"validation_errors": []
},
{
"scene": "res://playtest/ice/scenes/04.tscn",
"won": true,
"scored": [
"iron",
"wood"
],
"validation_errors": []
},
{
"scene": "res://playtest/ice/scenes/05.tscn",
"won": true,
"scored": [
"iron",
"wood"
],
"validation_errors": []
}
],
"standard_solutions_won": 15,
"element_acceptance_passed": 9
},
{
"name": "roll",
"static_friction": 0.52,
"dynamic_friction": 0.4,
"rolling_resistance": 1.0,
"slope": [
{
"offset_m": 0,
"scored": 10,
"trials": 10,
"mean_exit_vx_mps": 3.7925
},
{
"offset_m": -0.05,
"scored": 10,
"trials": 10,
"mean_exit_vx_mps": 2.429
},
{
"offset_m": 0.05,
"scored": 10,
"trials": 10,
"mean_exit_vx_mps": 2.4296
}
],
"tutorial": [
{
"all_tiles_contacted": true,
"final_position": "(1.503046, 3.980306, -0.000324)",
"final_speed": 0.000364574079867452,
"goals": 0,
"number": 1,
"won": false
},
{
"all_tiles_contacted": true,
"final_position": "(0.000217, 3.980318, 0.509666)",
"final_speed": 0.000156402209540829,
"goals": 0,
"number": 2,
"won": false
},
{
"all_tiles_contacted": false,
"final_position": "(-0.000292, 3.980304, -0.571028)",
"final_speed": 0.000303185224765912,
"goals": 0,
"number": 3,
"won": false
},
{
"all_tiles_contacted": true,
"final_position": "(3.488595, 3.980289, -0.000611)",
"final_speed": 0.00023356603924185,
"goals": 0,
"number": 4,
"won": false
},
{
"all_tiles_contacted": false,
"final_position": "(0.000326, 4.980325, -0.51075)",
"final_speed": 2.70238833763869e-05,
"goals": 0,
"number": 5,
"won": false
}
],
"element_levels": [
{
"scene": "res://playtest/water/scenes/01.tscn",
"won": true,
"scored": [
"wood"
],
"validation_errors": []
},
{
"scene": "res://playtest/water/scenes/02.tscn",
"won": true,
"scored": [
"iron"
],
"validation_errors": []
},
{
"scene": "res://playtest/water/scenes/03.tscn",
"won": true,
"scored": [
"iron",
"wood"
],
"validation_errors": []
},
{
"scene": "res://playtest/water/scenes/04.tscn",
"won": false,
"scored": [],
"validation_errors": [
"Answer did not get every ball into a hole"
]
},
{
"scene": "res://playtest/water/scenes/05.tscn",
"won": false,
"scored": [],
"validation_errors": [
"Answer did not get every ball into a hole"
]
},
{
"scene": "res://playtest/ice/scenes/01.tscn",
"won": true,
"scored": [
"wood"
],
"validation_errors": []
},
{
"scene": "res://playtest/ice/scenes/02.tscn",
"won": false,
"scored": [],
"validation_errors": [
"Answer did not get every ball into a hole",
"Missing iron break or later passage of wood through that gate"
]
},
{
"scene": "res://playtest/ice/scenes/03.tscn",
"won": false,
"scored": [],
"validation_errors": [
"Answer did not get every ball into a hole"
]
},
{
"scene": "res://playtest/ice/scenes/04.tscn",
"won": false,
"scored": [],
"validation_errors": [
"Answer did not get every ball into a hole",
"Missing iron break or later passage of wood through that gate"
]
},
{
"scene": "res://playtest/ice/scenes/05.tscn",
"won": false,
"scored": [],
"validation_errors": [
"Answer did not get every ball into a hole",
"Missing iron break or later passage of wood through that gate"
]
}
],
"standard_solutions_won": 4,
"element_acceptance_passed": 4
}
]
}
@@ -0,0 +1,155 @@
{
"engine": "Godot 4.7.2 Jolt",
"physics_hz": 120,
"gravity_mps2": 9.81,
"boost_gain_mps": 5,
"route": "Workshop reconstruction, launch -> straight -> gentle -> gentle -> supported goal. Positions are model origins in metres.",
"pieces": [
[
-3,
2,
1
],
[
-2,
2.32,
1
],
[
-1,
2.32,
1
],
[
0,
1.82,
1
],
[
1,
2,
1
]
],
"ball": "iron_ball",
"spawn_xyz": [
-3,
3.32,
1
],
"lateral_offsets_m": [
0,
-0.05,
0.05
],
"settle_frames_each": [
5,
6,
7,
8,
9,
10,
11,
12,
13,
14
],
"measurements": "Horizontal velocity along +X on the first tick crossing x=-1.5 and x=0.5. One ball released from rest per run.",
"conditions": [
{
"name": "original",
"static_friction": 0.42,
"dynamic_friction": 0.32,
"rolling_resistance": 0.025,
"restitution": 0.08,
"positions": [
{
"offset_m": 0,
"scores": 0,
"runs": 10,
"mean_slope_entry_vx_mps": 3.7292,
"mean_exit_vx_mps": 4.2318
},
{
"offset_m": -0.05,
"scores": 0,
"runs": 10,
"mean_slope_entry_vx_mps": 2.6574,
"mean_exit_vx_mps": 3.9196
},
{
"offset_m": 0.05,
"scores": 0,
"runs": 10,
"mean_slope_entry_vx_mps": 2.6598,
"mean_exit_vx_mps": 3.9196
}
]
},
{
"name": "sliding_friction_only",
"static_friction": 0.52,
"dynamic_friction": 0.4,
"rolling_resistance": 0.025,
"restitution": 0.08,
"positions": [
{
"offset_m": 0,
"scores": 0,
"runs": 10,
"mean_slope_entry_vx_mps": 3.5249,
"mean_exit_vx_mps": 4.3092
},
{
"offset_m": -0.05,
"scores": 0,
"runs": 10,
"mean_slope_entry_vx_mps": 2.6539,
"mean_exit_vx_mps": 3.9193
},
{
"offset_m": 0.05,
"scores": 0,
"runs": 10,
"mean_slope_entry_vx_mps": 2.6624,
"mean_exit_vx_mps": 3.9187
}
]
},
{
"name": "installed",
"static_friction": 0.52,
"dynamic_friction": 0.4,
"rolling_resistance": 0.035,
"restitution": 0.08,
"positions": [
{
"offset_m": 0,
"scores": 0,
"runs": 10,
"mean_slope_entry_vx_mps": 3.5249,
"mean_exit_vx_mps": 4.2868
},
{
"offset_m": -0.05,
"scores": 3,
"runs": 10,
"mean_slope_entry_vx_mps": 2.6403,
"mean_exit_vx_mps": 3.8827
},
{
"offset_m": 0.05,
"scores": 3,
"runs": 10,
"mean_slope_entry_vx_mps": 2.6473,
"mean_exit_vx_mps": 3.8843
}
]
}
],
"installed_checks": {
"tutorial_lessons": 5,
"element_puzzles": "10/10",
"water05_shared_bridge_runs": 20
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 KiB

After

Width:  |  Height:  |  Size: 248 KiB

@@ -0,0 +1,64 @@
{
"assetFamily": "railbound_inspired",
"balls": [
{
"ballTypeId": "wood_ball",
"id": "keep_ball",
"launchDirection": [
1.0,
0.0,
0.0
],
"position": [
4.0,
3.0,
0.0
]
}
],
"entities": [
{
"id": "wall",
"kind": "wall",
"position": [
0.0,
0.0,
0.0
],
"quarter": 0
},
{
"id": "goal",
"kind": "goal_hole",
"position": [
2.0,
1.0,
0.0
],
"quarter": 0
},
{
"id": "water",
"kind": "water",
"position": [
-2.0,
0.0,
0.0
],
"quarter": 0
},
{
"id": "ice",
"kind": "ice",
"position": [
0.0,
0.0,
2.0
],
"quarter": 0
}
],
"pieces": [],
"schemaVersion": 2,
"title": "my_level"
}
@@ -0,0 +1,266 @@
"""Blender-only authoring of a separate Railbound-inspired asset family.
Copies a stable source once; never writes to the baseline assets. To adopt a
later baseline, remove only this family's source_snapshot files explicitly.
"""
import bpy
import bmesh
import hashlib
import json
import math
import shutil
import time
import runpy
from pathlib import Path
from mathutils import Vector
ROOT = Path(__file__).resolve().parents[4]
SOURCE = Path(__file__).resolve().parent
SNAPSHOT = SOURCE / 'snapshot'
SNAPSHOT.mkdir(parents=True, exist_ok=True)
ONLY_ASSET = globals().get('ONLY_ASSET')
REPORTS = ROOT / 'playtest/artifacts/styled'
REPORTS.mkdir(parents=True, exist_ok=True)
OUT = SOURCE.parent
SOURCE.mkdir(parents=True, exist_ok=True)
snapshot = SNAPSHOT / 'source_snapshot.blend'
inputs = [ROOT/'assets/collections/baseline/source/collection.blend',
ROOT/'assets/collections/baseline/catalog.json', ROOT/'assets/collections/baseline/physics.json']
def digest(path):
return hashlib.sha256(path.read_bytes()).hexdigest()
if not snapshot.exists():
before = [digest(p) for p in inputs]
time.sleep(3)
if before != [digest(p) for p in inputs]:
raise RuntimeError('Baseline is changing. Wait for its current build, then retry.')
copies = [snapshot, SNAPSHOT/'source_catalog.json', SNAPSHOT/'source_physics.json']
for src, dst in zip(inputs, copies):
shutil.copy2(src, dst)
if before != [digest(p) for p in inputs] or before != [digest(p) for p in copies]:
for p in copies: p.unlink(missing_ok=True)
raise RuntimeError('Baseline changed during copy. No snapshot was retained.')
(SNAPSHOT/'source_manifest.json').write_text(json.dumps({
'files': {str(p.relative_to(ROOT)): h for p,h in zip(inputs,before)},
'copiedAtUnix': time.time(), 'readOnlyBaseline': True}, indent=2))
bpy.ops.wm.open_mainfile(filepath=str(snapshot))
bpy.context.preferences.filepaths.save_version=0
catalog = json.loads((SNAPSHOT/'source_catalog.json').read_text())
physics = json.loads((SNAPSHOT/'source_physics.json').read_text())
palette = {'body':'B98A56', 'top':'E9C88B', 'groove':'FFF0C5',
'ink':'342E38', 'iron':'788A9E', 'iron_light':'C6DFE5',
'red':'CB6652', 'green':'799361'}
def mat(name, color, metallic=0.0, roughness=.85):
m = bpy.data.materials.new('Storybook / '+name)
rgba = tuple(int(color[i:i+2],16)/255 for i in (0,2,4))+(1,)
# Hex palette is sRGB; Blender's material values are linear.
rgba = tuple(((v+.055)/1.055)**2.4 if v>.04045 else v/12.92 for v in rgba[:3])+(1,)
m.diffuse_color = rgba
m.use_nodes = True
bsdf = m.node_tree.nodes.get('Principled BSDF')
bsdf.inputs['Base Color'].default_value = rgba
bsdf.inputs['Metallic'].default_value = metallic
bsdf.inputs['Roughness'].default_value = roughness
return m
mats={k:mat(k,v) for k,v in palette.items()}
mats['iron']=mat('iron satin','788A9E',.35,.5)
mats['wall']=mat('wall stone','A29E8B')
mats['wall_top']=mat('wall stone top','D8D3B4')
def mesh_object(name,vertices,faces):
mesh=bpy.data.meshes.new(name)
mesh.from_pydata(vertices,[],faces);mesh.update()
bm=bmesh.new();bm.from_mesh(mesh)
bmesh.ops.recalc_face_normals(bm,faces=bm.faces);bm.to_mesh(mesh);bm.free()
obj=bpy.data.objects.new(name,mesh);bpy.context.collection.objects.link(obj)
return obj
def build_funnel():
bpy.data.objects.remove(bpy.data.objects['goal_hole'],do_unlink=True)
# A closed shell with a wide conical entrance and a true narrow outlet.
profile=[(.46,0),(.32,-.35),(.32,-1),(.36,-1),(.50,0)]
sides=96
vertices=[(radius*math.cos(i*math.tau/sides),radius*math.sin(i*math.tau/sides),z)
for radius,z in profile for i in range(sides)]
faces=[]
for ring in range(len(profile)):
next_ring=(ring+1)%len(profile)
for i in range(sides):
j=(i+1)%sides
faces.append((ring*sides+i,ring*sides+j,next_ring*sides+j,next_ring*sides+i))
return mesh_object('goal_hole',vertices,faces)
def build_wall(name='wall'):
vertices=[(x,y,z) for z in (0,1) for y in (-.5,.5) for x in (-.5,.5)]
faces=[(0,2,3,1),(4,5,7,6),(0,1,5,4),(2,6,7,3),(0,4,6,2),(1,3,7,5)]
return mesh_object(name,vertices,faces)
build_funnel();build_wall();build_wall('directional_boost')
catalog['models']['wall']={'role':'solid','category':'nonInteractive','collisionShape':'box',
'cellFootprint':[1,1],'boundsBlender':{'min':[-.5,-.5,0],'max':[.5,.5,1],'size':[1,1,1]},
'declaredSize':[1,1,1],'geometryOrigin':'authored'}
catalog['models']['directional_boost']={'role':'boost','category':'interactive','collisionShape':'box',
'cellFootprint':[1,1],'boundsBlender':{'min':[-.5,-.5,0],'max':[.5,.5,1],'size':[1,1,1]},
'declaredSize':[1,1,1],'geometryOrigin':'authored','arrowDirectionGodot':[1,0,0]}
catalog['models']['goal_hole']={'role':'goal','category':'nonInteractive','openingRadius':.32,
'entranceRadius':.46,'funnelDepth':.35,'depth':1.0,'cellFootprint':[1,1],
'boundsBlender':{'min':[-.5,-.5,-1],'max':[.5,.5,0],'size':[1,1,1]},
'declaredSize':[1,1,1],'geometryOrigin':'authored'}
def export(objects, path):
if globals().get('EXPORT_KINDS') is not None and objects[0].name not in EXPORT_KINDS:
return
bpy.ops.object.select_all(action='DESELECT')
for obj in objects: obj.select_set(True)
bpy.context.view_layer.objects.active=objects[0]
path.parent.mkdir(parents=True,exist_ok=True)
bpy.ops.export_scene.gltf(filepath=str(path),export_format='GLB',
use_selection=True,export_yup=True,export_extras=True,export_apply=True)
def lines(name, segments, radius=.012):
curve=bpy.data.curves.new('ink_'+name,'CURVE')
curve.dimensions='3D'; curve.bevel_depth=radius; curve.bevel_resolution=0
curve.resolution_u=1
for points in segments:
spline=curve.splines.new('POLY'); spline.points.add(len(points)-1)
for point, value in zip(spline.points,points):point.co=(*value,1)
obj=bpy.data.objects.new('ink_'+name,curve)
bpy.context.collection.objects.link(obj); obj.data.materials.append(mats['ink'])
obj['visual_only']=True
return obj
def outline(obj):
bm=bmesh.new();bm.from_mesh(obj.data);bm.normal_update()
segments=[]
for edge in bm.edges:
if len(edge.link_faces)!=2 or edge.calc_face_angle(0)>math.radians(36):
segments.append([tuple(v.co) for v in edge.verts])
bm.free()
return lines(obj.name,segments)
def boost_arrow():
# Flat authored graphic above the top face; excluded from collision like ink outlines.
points=[(-.34,-.12),(.04,-.12),(.04,-.28),(.36,0),(.04,.28),(.04,.12),(-.34,.12)]
result=[]
for suffix,scale,z,color in [('border',1,1.002,'ink'),('fill',.82,1.003,'red')]:
arrow=mesh_object('ink_boost_arrow_'+suffix,[(x*scale,y*scale,z) for x,y in points],[tuple(range(7))])
arrow.data.materials.append(mats[color]);arrow['visual_only']=True
result.append(arrow)
return result
def asset_dir(kind):
category = 'balls' if kind == 'iron_ball' else 'goals' if kind == 'goal_hole' else 'blocks' if kind in ('wall','directional_boost') else 'chutes'
return ROOT / 'assets' / category / kind
snapshot_turn='turn_90' if 'turn_90' in bpy.data.objects else 'turn_cw'
catalog['models']['turn_90']=dict(catalog['models'][snapshot_turn], geometrySource=snapshot_turn)
# Retire duplicate objects only in this working scene; never rewrite the snapshot.
for legacy in ('turn_cw','turn_ccw'):
if legacy!=snapshot_turn and legacy in bpy.data.objects:
bpy.data.objects.remove(bpy.data.objects[legacy],do_unlink=True)
kinds=['straight','turn_90','gentle','steep','y_merge']
groups=[];report=[]
all_kinds=kinds+['iron_ball','goal_hole','wall','directional_boost']
if ONLY_ASSET is not None and ONLY_ASSET not in all_kinds:raise ValueError(ONLY_ASSET)
for kind in ([ONLY_ASSET] if ONLY_ASSET else all_kinds):
obj=bpy.data.objects[snapshot_turn if kind=='turn_90' else kind]
if kind=='turn_90':
obj.name=kind
obj['asset_id']=kind
obj.location=(0,0,0)
obj.data=obj.data.copy()
before_coords=[tuple(v.co) for v in obj.data.vertices]
old_indices=[p.material_index for p in obj.data.polygons]
obj.data.materials.clear()
if kind in kinds:
for key in ['body','groove','top']:obj.data.materials.append(mats[key])
for face,old in zip(obj.data.polygons,old_indices):
face.material_index=1 if old==1 else (2 if face.normal.z>.55 else 0)
group=[obj,outline(obj)]
category='chutes'
elif kind=='iron_ball':
# A continuous satin sphere: the snapshot's orientation stripe and the
# former face-painted highlight read as cracks/patches during rotation.
# Let the scene lighting produce the highlight on smooth normals instead.
obj.data.materials.append(mats['iron'])
for face in obj.data.polygons:
face.material_index=0
face.use_smooth=True
group=[obj]
category='balls'
elif kind=='goal_hole':
obj.data.materials.append(mats['red'])
obj.data.materials.append(mats['top'])
obj.data.materials.append(mats['ink'])
for face in obj.data.polygons:
face.material_index=1 if face.index<96 else (2 if face.index<192 else 0)
face.use_smooth=face.index<192
group=[obj,outline(obj)]
category='environment'
else:
obj.data.materials.append(mats['wall']);obj.data.materials.append(mats['wall_top'])
for face in obj.data.polygons:face.material_index=1 if face.normal.z>.5 else 0
group=[obj,outline(obj)]
if kind=='directional_boost':group+=boost_arrow()
category='entities'
obj['style_family']='railbound_inspired'
obj['collision_source']='authored mesh' if kind in ('wall','goal_hole','directional_boost') else 'unchanged source mesh'
export(group,asset_dir(kind)/'model.glb')
catalog['models'][kind]['path']='res://'+str((asset_dir(kind)/'model.glb').relative_to(ROOT))
catalog['models'][kind]['sourceBlend']=str((asset_dir(kind)/'source/model.blend').relative_to(ROOT))
for member in group:
if member.type=='CURVE':
bpy.ops.object.select_all(action='DESELECT');member.select_set(True)
bpy.context.view_layer.objects.active=member
bpy.ops.object.convert(target='MESH')
source_path=asset_dir(kind)/'source/model.blend'
source_path.parent.mkdir(parents=True,exist_ok=True)
# A separate editable source file contains only one asset family member.
report.append({'id':kind,'collisionGeometryUnchanged':kind not in ('wall','goal_hole','directional_boost') and before_coords==[tuple(v.co) for v in obj.data.vertices],
'vertices':len(obj.data.vertices),'separateBlend':str(source_path.relative_to(ROOT))})
groups.append(group)
if ONLY_ASSET:
existing=json.loads((OUT/'catalog.json').read_text())
for legacy in ('turn_cw','turn_ccw'):existing['models'].pop(legacy,None)
existing['models'][ONLY_ASSET]=catalog['models'][ONLY_ASSET]
catalog=existing
else:
catalog['models']={k:catalog['models'][k] for k in all_kinds}
catalog['styleFamily']='railbound_inspired'
catalog['palette']=palette
(OUT/'catalog.json').write_text(json.dumps(catalog,ensure_ascii=False,indent=2))
if not ONLY_ASSET:
# Geometry rebuilds must not overwrite curated ball types or physics tuning.
if not (OUT/'physics.json').exists():
(OUT/'physics.json').write_text(json.dumps(physics,ensure_ascii=False,indent=2))
(OUT/'entities.json').write_text(json.dumps({'interactive':[{'id':'directional_boost','name':'定向加速','assetId':'directional_boost'}],
'nonInteractive':[{'id':'wall','name':'标准墙壁','assetId':'wall'},
{'id':'goal_hole','name':'锥口球洞','assetId':'goal_hole'}]},ensure_ascii=False,indent=2))
if ONLY_ASSET:
names={member.name for member in groups[0]}
for obj in list(bpy.data.objects):
if obj.name not in names:bpy.data.objects.remove(obj,do_unlink=True)
bpy.ops.wm.save_as_mainfile(filepath=str(ROOT/report[0]['separateBlend']))
else:
for i,group in enumerate(groups):
for member in group:member.location=(i%4*2.6,i//4*3,0)
bpy.ops.wm.save_as_mainfile(filepath=str(SOURCE/'collection.blend'))
group_names=[[member.name for member in group] for group in groups]
for entry, names in zip(report,group_names):
if globals().get('EXPORT_KINDS') is not None and entry['id'] not in EXPORT_KINDS:
continue
bpy.ops.wm.open_mainfile(filepath=str(SOURCE/'collection.blend'))
for obj in list(bpy.data.objects):
if obj.name not in names:bpy.data.objects.remove(obj,do_unlink=True)
else:obj.location=(0,0,0)
bpy.ops.wm.save_as_mainfile(filepath=str(ROOT/entry['separateBlend']))
(REPORTS/(('asset_'+ONLY_ASSET+'.json') if ONLY_ASSET else 'assets.json')).write_text(json.dumps({
'sourceManifest':json.loads((SNAPSHOT/'source_manifest.json').read_text()),
'models':report,'radius':catalog['models']['iron_ball']['radius'],
'physicalMaterialUnchanged':True,'outlineGeometry':'visual only'},indent=2))
print('STYLE_ASSETS_READY')
if not ONLY_ASSET:
runpy.run_path(str(ROOT/'assets/balls/shared/source/build_materials.py'))
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,124 @@
{
"schemaVersion": 1,
"ballTypes": [
{
"ballTypeId": "wood_ball",
"displayName": "原木球",
"assetId": "wood_ball",
"physicsProfileId": "wood_game"
},
{
"ballTypeId": "ceramic_ball",
"displayName": "陶瓷球",
"assetId": "ceramic_ball",
"physicsProfileId": "ceramic_game"
},
{
"ballTypeId": "iron_ball",
"displayName": "铁球",
"assetId": "iron_ball",
"physicsProfileId": "solid_iron_test"
}
],
"physicsProfiles": {
"solid_iron_test": {
"massKg": 890.0760306150601,
"inertiaModel": "solidSphere",
"dragCoefficient": 0.47,
"contactMaterialId": "iron"
},
"wood_game": {
"massKg": 60,
"inertiaModel": "solidSphere",
"dragCoefficient": 0.47,
"contactMaterialId": "wood"
},
"ceramic_game": {
"massKg": 75,
"inertiaModel": "solidSphere",
"dragCoefficient": 0.04,
"contactMaterialId": "ceramic"
}
},
"contactMaterialPairs": [
{
"materialAId": "iron",
"materialBId": "painted_wood",
"staticFriction": 0.42,
"dynamicFriction": 0.32,
"rollingResistance": 0.025,
"restitution": 0.08
},
{
"materialAId": "iron",
"materialBId": "iron",
"staticFriction": 0.35,
"dynamicFriction": 0.25,
"rollingResistance": 0.01,
"restitution": 0.15
},
{
"materialAId": "wood",
"materialBId": "painted_wood",
"staticFriction": 0.42,
"dynamicFriction": 0.32,
"rollingResistance": 0.025,
"restitution": 0.08
},
{
"materialAId": "ceramic",
"materialBId": "painted_wood",
"staticFriction": 0.42,
"dynamicFriction": 0.32,
"rollingResistance": 0.025,
"restitution": 0.08
},
{
"materialAId": "wood",
"materialBId": "wood",
"staticFriction": 0.35,
"dynamicFriction": 0.25,
"rollingResistance": 0.01,
"restitution": 0.15
},
{
"materialAId": "ceramic",
"materialBId": "ceramic",
"staticFriction": 0.35,
"dynamicFriction": 0.25,
"rollingResistance": 0.01,
"restitution": 0.15
},
{
"materialAId": "wood",
"materialBId": "ceramic",
"staticFriction": 0.35,
"dynamicFriction": 0.25,
"rollingResistance": 0.01,
"restitution": 0.15
},
{
"materialAId": "wood",
"materialBId": "iron",
"staticFriction": 0.35,
"dynamicFriction": 0.25,
"rollingResistance": 0.01,
"restitution": 0.15
},
{
"materialAId": "ceramic",
"materialBId": "iron",
"staticFriction": 0.35,
"dynamicFriction": 0.25,
"rollingResistance": 0.01,
"restitution": 0.15
}
],
"notes": [
"Game tuning: all balls have the same authored radius and shape. Wood mass 60 kg; ceramic 75 kg (+25%); iron keeps its original 890.076 kg.",
"Air drag coefficients are gameplay parameters, not measured material constants: wood 0.47, ceramic 0.04, iron 0.47. Iron receives aerodynamic force through the same equation as other balls; its mass and ordinary contact resistance limit motion in the reference wind.",
"No extra fan multiplier or direct wind velocity override. All types use the established contact coefficients to isolate mass and aerodynamic differences.",
"The current native per-body friction/restitution approximation is retained; simultaneous mixed contact-pair solving is not introduced by this asset change."
],
"airDensity": 1.225
}
@@ -0,0 +1,8 @@
{
"assets/goals/goal_hole/model.glb": "10c848ddb488c230fa957fe247c2407ce656bf1ed57d3c7b5b3dfcd982470951",
"assets/goals/goal_hole/source/model.blend": "3fe002311c2f2e3b5bab4308112c66f64b7d074995734bfdd2600a8587358102",
"assets/collections/storybook/source/collection.blend": "4611a0e8c48f282b4d72835579aa15805051de292b34c15be70881c4db9bed3a",
"assets/collections/storybook/source/build.py": "0d02bd42c841c8bedaf7f613ee7321216cd7bde6527a531eeb3a2f9296e9552e",
"assets/collections/storybook/catalog.json": "c302cfcf8d2068d172519bca7f83e210d556716a82ce0f5afe4ba2965091f447",
"assets/collections/storybook/physics.json": "24161d2574282825b3d0611505c855f5a72b100a892f746f0a236a72ce8798d8"
}
@@ -0,0 +1,7 @@
{
"otherMeshesUnchanged": true,
"replaced": [
"goal_hole",
"ink_goal_hole"
]
}
@@ -2,8 +2,43 @@
"checks": [
{
"detail": {
"contactFrames": 1133,
"end": "(0.0, -1.005104, 0.0)"
"centerY": 1.63104367256165,
"events": [
{
"ballId": "iron",
"goalId": "hole",
"position": [
2.01806831359863,
1.63104367256165,
-0.999547719955444
],
"time": 0.741666666666666
}
],
"status": "全部入洞! 0.74 秒"
},
"name": "workshop_scores_inside_supported_goal",
"passed": true
},
{
"detail": {},
"name": "skimming_above_mouth_does_not_score",
"passed": true
},
{
"detail": {},
"name": "grazing_throat_edge_does_not_score",
"passed": true
},
{
"detail": {},
"name": "rising_from_below_does_not_score",
"passed": true
},
{
"detail": {
"contactFrames": 0,
"end": "(0.0, -0.350831, 0.0)"
},
"name": "drop_wood_ball_(0.0, 0.0)",
"passed": true
@@ -11,7 +46,7 @@
{
"detail": {
"contactFrames": 1141,
"end": "(0.004692, -1.027503, -0.004689)"
"end": "(0.006718, -0.367044, 0.000499)"
},
"name": "drop_wood_ball_(0.12, 0.0)",
"passed": true
@@ -19,7 +54,7 @@
{
"detail": {
"contactFrames": 1122,
"end": "(-0.007495, -1.020418, -0.018401)"
"end": "(-0.001257, -0.363957, 0.002227)"
},
"name": "drop_wood_ball_(0.26, 0.0)",
"passed": true
@@ -27,7 +62,7 @@
{
"detail": {
"contactFrames": 1120,
"end": "(0.01457, -1.021921, -0.01245)"
"end": "(-0.00433, -0.373872, 0.004414)"
},
"name": "drop_wood_ball_(0.36, 0.0)",
"passed": true
@@ -35,7 +70,7 @@
{
"detail": {
"contactFrames": 1120,
"end": "(-0.009895, -1.023855, -0.017172)"
"end": "(0.00349, -0.373755, 0.006115)"
},
"name": "drop_wood_ball_(-0.36, 0.0)",
"passed": true
@@ -43,7 +78,7 @@
{
"detail": {
"contactFrames": 1120,
"end": "(0.013517, -1.023277, 0.00926)"
"end": "(-0.005369, -0.373896, -0.004036)"
},
"name": "drop_wood_ball_(0.0, 0.36)",
"passed": true
@@ -51,7 +86,7 @@
{
"detail": {
"contactFrames": 1120,
"end": "(-0.016024, -1.023196, -0.011723)"
"end": "(0.005562, -0.373769, 0.003615)"
},
"name": "drop_wood_ball_(0.0, -0.36)",
"passed": true
@@ -59,7 +94,7 @@
{
"detail": {
"contactFrames": 1127,
"end": "(-0.008337, -1.003462, -0.018005)"
"end": "(0.003099, -0.350407, 0.007578)"
},
"name": "drop_wood_ball_(0.24, 0.24)",
"passed": true
@@ -67,15 +102,15 @@
{
"detail": {
"contactFrames": 1126,
"end": "(0.019785, -1.012402, -0.001412)"
"end": "(-0.006216, -0.35423, -0.001589)"
},
"name": "drop_wood_ball_(-0.24, -0.24)",
"passed": true
},
{
"detail": {
"contactFrames": 1133,
"end": "(0.0, -1.007103, 0.0)"
"contactFrames": 0,
"end": "(0.0, -0.351871, 0.0)"
},
"name": "drop_ceramic_ball_(0.0, 0.0)",
"passed": true
@@ -83,7 +118,7 @@
{
"detail": {
"contactFrames": 1140,
"end": "(0.011337, -1.029251, 0.012666)"
"end": "(0.006113, -0.365548, -0.001206)"
},
"name": "drop_ceramic_ball_(0.12, 0.0)",
"passed": true
@@ -91,7 +126,7 @@
{
"detail": {
"contactFrames": 1122,
"end": "(0.004795, -1.011782, -0.017516)"
"end": "(0.017727, -0.366344, 0.006552)"
},
"name": "drop_ceramic_ball_(0.26, 0.0)",
"passed": true
@@ -99,7 +134,7 @@
{
"detail": {
"contactFrames": 1120,
"end": "(0.012047, -1.025424, -0.01322)"
"end": "(-0.003429, -0.374514, 0.008168)"
},
"name": "drop_ceramic_ball_(0.36, 0.0)",
"passed": true
@@ -107,7 +142,7 @@
{
"detail": {
"contactFrames": 1120,
"end": "(-0.015903, -1.027495, -0.011892)"
"end": "(0.003284, -0.374516, 0.00973)"
},
"name": "drop_ceramic_ball_(-0.36, 0.0)",
"passed": true
@@ -115,7 +150,7 @@
{
"detail": {
"contactFrames": 1120,
"end": "(-0.012943, -1.025432, 0.013735)"
"end": "(0.007751, -0.374488, -0.003466)"
},
"name": "drop_ceramic_ball_(0.0, 0.36)",
"passed": true
@@ -123,7 +158,7 @@
{
"detail": {
"contactFrames": 1120,
"end": "(-0.016815, -1.02467, -0.010521)"
"end": "(0.007233, -0.374468, 0.003517)"
},
"name": "drop_ceramic_ball_(0.0, -0.36)",
"passed": true
@@ -131,7 +166,7 @@
{
"detail": {
"contactFrames": 1127,
"end": "(0.017929, -1.007286, 0.003665)"
"end": "(0.007584, -0.355175, 0.017886)"
},
"name": "drop_ceramic_ball_(0.24, 0.24)",
"passed": true
@@ -139,15 +174,15 @@
{
"detail": {
"contactFrames": 1126,
"end": "(0.014751, -1.005026, 0.011379)"
"end": "(-0.005455, -0.360435, -0.003424)"
},
"name": "drop_ceramic_ball_(-0.24, -0.24)",
"passed": true
},
{
"detail": {
"contactFrames": 1133,
"end": "(0.0, -1.007105, 0.0)"
"contactFrames": 0,
"end": "(0.0, -0.351816, 0.0)"
},
"name": "drop_iron_ball_(0.0, 0.0)",
"passed": true
@@ -155,7 +190,7 @@
{
"detail": {
"contactFrames": 1141,
"end": "(0.013721, -1.032078, 0.005726)"
"end": "(0.006115, -0.365689, -0.00166)"
},
"name": "drop_iron_ball_(0.12, 0.0)",
"passed": true
@@ -163,7 +198,7 @@
{
"detail": {
"contactFrames": 1122,
"end": "(-0.015804, -1.010242, 0.009249)"
"end": "(0.007877, -0.361279, -0.006082)"
},
"name": "drop_iron_ball_(0.26, 0.0)",
"passed": true
@@ -171,7 +206,7 @@
{
"detail": {
"contactFrames": 1120,
"end": "(0.01255, -1.025249, 0.013082)"
"end": "(-0.003445, -0.374441, -0.007895)"
},
"name": "drop_iron_ball_(0.36, 0.0)",
"passed": true
@@ -179,7 +214,7 @@
{
"detail": {
"contactFrames": 1120,
"end": "(-0.012894, -1.02611, -0.015093)"
"end": "(0.003304, -0.37449, 0.007669)"
},
"name": "drop_iron_ball_(-0.36, 0.0)",
"passed": true
@@ -187,7 +222,7 @@
{
"detail": {
"contactFrames": 1120,
"end": "(0.009499, -1.025884, 0.012995)"
"end": "(-0.009605, -0.374456, -0.003244)"
},
"name": "drop_iron_ball_(0.0, 0.36)",
"passed": true
@@ -195,7 +230,7 @@
{
"detail": {
"contactFrames": 1120,
"end": "(0.009933, -1.0254, -0.012974)"
"end": "(-0.008965, -0.374423, 0.003309)"
},
"name": "drop_iron_ball_(0.0, -0.36)",
"passed": true
@@ -203,7 +238,7 @@
{
"detail": {
"contactFrames": 1127,
"end": "(-0.018326, -1.012097, -0.007675)"
"end": "(0.007256, -0.352717, 0.003666)"
},
"name": "drop_iron_ball_(0.24, 0.24)",
"passed": true
@@ -211,7 +246,7 @@
{
"detail": {
"contactFrames": 1126,
"end": "(0.009102, -1.015484, 0.015162)"
"end": "(-0.002968, -0.362735, -0.00636)"
},
"name": "drop_iron_ball_(-0.24, -0.24)",
"passed": true
@@ -255,14 +290,14 @@
"ballId": "student_ball",
"goalId": "goal",
"position": [
2.9973669052124,
0.645162343978882,
0.0196551065891981
2.99644899368286,
3.32077193260193,
0.00355775188654661
],
"time": 2.39999999999999
"time": 2.08333333333333
}
],
"time": 2.39999999999999
"time": 2.08333333333333
},
"name": "tutorial_1_enters_once",
"passed": true
@@ -274,14 +309,14 @@
"ballId": "student_ball",
"goalId": "goal",
"position": [
0.00339265912771225,
0.678770303726196,
3.01822996139526
-0.0113675752654672,
3.32657384872437,
2.98454475402832
],
"time": 3.71666666666666
"time": 2.41666666666666
}
],
"time": 3.71666666666666
"time": 2.41666666666666
},
"name": "tutorial_2_enters_once",
"passed": true
@@ -293,14 +328,14 @@
"ballId": "student_ball",
"goalId": "goal",
"position": [
1.98784899711609,
0.662082076072693,
-2.01570081710815
1.99756240844727,
3.32501268386841,
-1.9871119260788
],
"time": 4.40833333333334
"time": 2.97499999999999
}
],
"time": 4.40833333333334
"time": 2.97499999999999
},
"name": "tutorial_3_enters_once",
"passed": true
@@ -312,14 +347,14 @@
"ballId": "student_ball",
"goalId": "goal",
"position": [
5.01481342315674,
0.65211695432663,
0.0101500349119306
4.99413537979126,
3.31404900550842,
-0.00234287418425083
],
"time": 3.83333333333332
"time": 2.69166666666666
}
],
"time": 3.83333333333332
"time": 2.69166666666666
},
"name": "tutorial_4_enters_once",
"passed": true
@@ -331,19 +366,19 @@
"ballId": "student_ball",
"goalId": "goal",
"position": [
4.9877724647522,
0.159147873520851,
-0.0156376082450151
4.98896408081055,
2.81397747993469,
-0.0158765353262424
],
"time": 7.01666666666681
"time": 5.45000000000006
}
],
"time": 7.01666666666681
"time": 5.45000000000006
},
"name": "tutorial_5_enters_once",
"passed": true
}
],
"failed": 0,
"passed": 36
"passed": 40
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,7 @@
{
"assets/balls/iron_ball/model.glb": "d56c8a6e99744aa662b1f8e5ff106d1cbed15abf5044eecd4ffc9ae1eaa3c652",
"assets/balls/iron_ball/source/model.blend": "f663fd01a877a29a9e894d1c31494754458fb95b9abf8315e296711e4f6c005a",
"assets/collections/storybook/catalog.json": "c302cfcf8d2068d172519bca7f83e210d556716a82ce0f5afe4ba2965091f447",
"assets/collections/storybook/physics.json": "24161d2574282825b3d0611505c855f5a72b100a892f746f0a236a72ce8798d8",
"assets/collections/storybook/source/collection.blend": "6a6fd9bb5ffc256f7a98670bc63343b0e533dde93689dfd35ebebfe5bad8d8d7"
}
@@ -0,0 +1,28 @@
{
"snapshot": {
"vertices": 1986,
"faces": 2048,
"closedManifold": true,
"minRadius": 0.29999971336984166,
"maxRadius": 0.30000002458691494,
"smoothFaces": 2048,
"materials": {
"Iron - brushed": 1704,
"Iron ball - orientation stripe": 344
}
},
"before": {
"vertices": 1986,
"faces": 2048,
"closedManifold": true,
"minRadius": 0.29999971336984166,
"maxRadius": 0.30000002458691494,
"smoothFaces": 2048,
"materials": {
"Storybook / iron satin": 1552,
"Storybook / ink": 344,
"Storybook / iron_light": 152
}
},
"geometryMatchesSnapshot": true
}
@@ -0,0 +1,23 @@
{
"geometryUnchanged": true,
"closedManifold": true,
"vertices": 1986,
"faces": 2048,
"radius": 0.30000002458691494,
"allFacesSmooth": true,
"singleMaterial": true,
"materials": [
"Storybook / iron satin"
],
"otherCollectionObjectsUnchanged": true,
"collectionIronGeometryUnchanged": true,
"collectionIronPlacementUnchanged": true,
"collectionIronSingleMaterial": true,
"physicsFileUnchanged": true,
"catalogUnchanged": true,
"glbPrimitiveCount": 1,
"glbMaterials": [
"Storybook / iron satin"
],
"passed": true
}
@@ -3,7 +3,7 @@
"balls": [
{
"ballTypeId": "iron_ball",
"id": "iron_ball_207110_2",
"id": "iron_ball_417390_2",
"launchDirection": [
1.0,
0.0,
@@ -17,7 +17,7 @@
},
{
"ballTypeId": "iron_ball",
"id": "iron_ball_213365_3",
"id": "iron_ball_424950_3",
"launchDirection": [
1.0,
0.0,
+13 -15
View File
@@ -240,9 +240,10 @@
0.6000000238418579
],
"materials": [
"Storybook / iron satin"
"Satin iron"
],
"measuredRadius": 0.30000002458691494
"measuredRadius": 0.30000002458691494,
"packedTextureCount": 2
},
{
"id": "goal_hole",
@@ -321,7 +322,7 @@
"dimensions": [
1.0,
1.0,
1.0
1.3200000524520874
],
"materials": [
"Storybook / wall stone",
@@ -330,10 +331,10 @@
"arrowTipBlender": [
0.295199990272522,
0.0,
1.003000020980835
1.0049999952316284
],
"closedManifold": true,
"solidVolume": 0.9999999999999999
"solidVolume": 1.069741313133497
},
{
"id": "wood_ball",
@@ -353,10 +354,10 @@
0.6000000238418579
],
"materials": [
"Raw wood grain"
"Honey wood with painted grain"
],
"measuredRadius": 0.30000002458691494,
"packedTextureCount": 1
"packedTextureCount": 2
},
{
"id": "ceramic_ball",
@@ -376,18 +377,16 @@
0.6000000238418579
],
"materials": [
"Ivory ceramic glaze with cobalt rings"
"Ivory porcelain glaze with cobalt scallops"
],
"measuredRadius": 0.30000002458691494,
"packedTextureCount": 1
"packedTextureCount": 2
},
{
"id": "water",
"passed": true,
"objects": [
"water",
"ink_water_arrow_border",
"ink_water_arrow_fill"
"water"
],
"geometryMatchesSnapshot": null,
"origin": [
@@ -402,7 +401,7 @@
],
"materials": [
"Storybook / water",
"Storybook / water"
"Storybook / water_surface"
],
"closedManifold": true,
"solidVolume": 0.9999999999999999
@@ -412,8 +411,7 @@
"passed": true,
"objects": [
"ice",
"ink_ice",
"ink_ice_cracks"
"ink_ice"
],
"geometryMatchesSnapshot": null,
"origin": [
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 KiB

After

Width:  |  Height:  |  Size: 231 KiB

@@ -1,7 +1,7 @@
{
"engine": "4.7.2-stable (official)",
"failed": 0,
"passed": 42,
"passed": 68,
"results": [
{
"detail": {
@@ -149,6 +149,11 @@
"name": "screenshot_exact_y_182",
"passed": true
},
{
"detail": {},
"name": "placing_launcher_second_joins_same_surface",
"passed": true
},
{
"detail": {},
"name": "top_click_still_stacks",
@@ -174,6 +179,11 @@
"name": "neighbor_order_does_not_change_height",
"passed": true
},
{
"detail": {},
"name": "standalone_launcher_has_rims_and_arrow",
"passed": true
},
{
"detail": {
"cursor": "(0.0, 1.82, 0.0)"
@@ -233,18 +243,9 @@
},
{
"detail": {
"boosts": 1,
"contacts": [
"launch",
"slope",
"tail"
],
"final": "(-1.309487, 2.801187, -0.002228)",
"slope_y": 2.3199999332428,
"tail_y": 1.8199999332428,
"time": 0.533333333333333
"max_step_m": 0.000498771667480469
},
"name": "gentle_q0_real_ball_crosses_both_seams",
"name": "gentle_q0_full_mouth",
"passed": true
},
{
@@ -255,12 +256,13 @@
"slope",
"tail"
],
"final": "(0.002842, 2.800547, -1.321674)",
"entry_speed_mps": 4.50636196136475,
"final": "(-1.321899, 2.803678, 0.010922)",
"slope_y": 2.3199999332428,
"tail_y": 1.8199999332428,
"time": 0.541666666666667
},
"name": "gentle_q1_real_ball_crosses_both_seams",
"name": "gentle_q0_offset_0.00_real_ball",
"passed": true
},
{
@@ -271,12 +273,13 @@
"slope",
"tail"
],
"final": "(1.303655, 2.801161, 0.005427)",
"entry_speed_mps": 3.48604559898376,
"final": "(-1.300645, 2.80192, -0.007589)",
"slope_y": 2.3199999332428,
"tail_y": 1.8199999332428,
"time": 0.533333333333333
"time": 0.683333333333333
},
"name": "gentle_q2_real_ball_crosses_both_seams",
"name": "gentle_q0_offset_-0.05_real_ball",
"passed": true
},
{
@@ -287,12 +290,20 @@
"slope",
"tail"
],
"final": "(0.00585, 2.802268, 1.304691)",
"entry_speed_mps": 3.48651003837585,
"final": "(-1.306496, 2.802862, -0.009553)",
"slope_y": 2.3199999332428,
"tail_y": 1.8199999332428,
"time": 0.533333333333333
"time": 0.691666666666667
},
"name": "gentle_q3_real_ball_crosses_both_seams",
"name": "gentle_q0_offset_0.05_real_ball",
"passed": true
},
{
"detail": {
"max_step_m": 0.000498771667480469
},
"name": "gentle_q1_full_mouth",
"passed": true
},
{
@@ -303,12 +314,13 @@
"slope",
"tail"
],
"final": "(-1.699048, 2.247441, 0.007275)",
"slope_y": 1.82000017166138,
"tail_y": 1.32000017166138,
"time": 0.6
"entry_speed_mps": 4.50805997848511,
"final": "(0.010496, 2.803505, -1.323291)",
"slope_y": 2.3199999332428,
"tail_y": 1.8199999332428,
"time": 0.541666666666667
},
"name": "steep_q0_real_ball_crosses_both_seams",
"name": "gentle_q1_offset_0.00_real_ball",
"passed": true
},
{
@@ -319,12 +331,13 @@
"slope",
"tail"
],
"final": "(-0.00041, 2.24705, -1.698913)",
"slope_y": 1.82000017166138,
"tail_y": 1.32000017166138,
"time": 0.6
"entry_speed_mps": 3.48620176315308,
"final": "(0.006929, 2.801669, -1.304565)",
"slope_y": 2.3199999332428,
"tail_y": 1.8199999332428,
"time": 0.683333333333333
},
"name": "steep_q1_real_ball_crosses_both_seams",
"name": "gentle_q1_offset_-0.05_real_ball",
"passed": true
},
{
@@ -335,12 +348,20 @@
"slope",
"tail"
],
"final": "(1.698807, 2.247102, -0.00226)",
"slope_y": 1.82000017166138,
"tail_y": 1.32000017166138,
"time": 0.6
"entry_speed_mps": 3.48620343208313,
"final": "(-0.006155, 2.801658, -1.313274)",
"slope_y": 2.3199999332428,
"tail_y": 1.8199999332428,
"time": 0.691666666666667
},
"name": "steep_q2_real_ball_crosses_both_seams",
"name": "gentle_q1_offset_0.05_real_ball",
"passed": true
},
{
"detail": {
"max_step_m": 0.000498771667480469
},
"name": "gentle_q2_full_mouth",
"passed": true
},
{
@@ -351,12 +372,337 @@
"slope",
"tail"
],
"final": "(0.007345, 2.247429, 1.699053)",
"entry_speed_mps": 4.50577354431152,
"final": "(1.326657, 2.803352, -0.010376)",
"slope_y": 2.3199999332428,
"tail_y": 1.8199999332428,
"time": 0.541666666666667
},
"name": "gentle_q2_offset_0.00_real_ball",
"passed": true
},
{
"detail": {
"boosts": 1,
"contacts": [
"launch",
"slope",
"tail"
],
"entry_speed_mps": 3.48649907112122,
"final": "(1.317046, 2.801669, 0.006928)",
"slope_y": 2.3199999332428,
"tail_y": 1.8199999332428,
"time": 0.691666666666667
},
"name": "gentle_q2_offset_-0.05_real_ball",
"passed": true
},
{
"detail": {
"boosts": 1,
"contacts": [
"launch",
"slope",
"tail"
],
"entry_speed_mps": 3.48633003234863,
"final": "(1.305969, 2.801574, 0.006665)",
"slope_y": 2.3199999332428,
"tail_y": 1.8199999332428,
"time": 0.683333333333333
},
"name": "gentle_q2_offset_0.05_real_ball",
"passed": true
},
{
"detail": {
"max_step_m": 0.000498771667480469
},
"name": "gentle_q3_full_mouth",
"passed": true
},
{
"detail": {
"boosts": 1,
"contacts": [
"launch",
"slope",
"tail"
],
"entry_speed_mps": 4.50539684295654,
"final": "(0.007971, 2.802351, 1.315242)",
"slope_y": 2.3199999332428,
"tail_y": 1.8199999332428,
"time": 0.541666666666667
},
"name": "gentle_q3_offset_0.00_real_ball",
"passed": true
},
{
"detail": {
"boosts": 1,
"contacts": [
"launch",
"slope",
"tail"
],
"entry_speed_mps": 3.48614597320557,
"final": "(0.009307, 2.802734, 1.320634)",
"slope_y": 2.3199999332428,
"tail_y": 1.8199999332428,
"time": 0.7
},
"name": "gentle_q3_offset_-0.05_real_ball",
"passed": true
},
{
"detail": {
"boosts": 1,
"contacts": [
"launch",
"slope",
"tail"
],
"entry_speed_mps": 3.48637318611145,
"final": "(-0.009566, 2.802869, 1.308262)",
"slope_y": 2.3199999332428,
"tail_y": 1.8199999332428,
"time": 0.691666666666667
},
"name": "gentle_q3_offset_0.05_real_ball",
"passed": true
},
{
"detail": {
"max_step_m": 0.00099945068359375
},
"name": "steep_q0_full_mouth",
"passed": true
},
{
"detail": {
"boosts": 1,
"contacts": [
"launch",
"slope",
"tail"
],
"entry_speed_mps": 4.50545883178711,
"final": "(-1.549844, 2.359623, -0.011575)",
"slope_y": 1.82000017166138,
"tail_y": 1.32000017166138,
"time": 0.6
"time": 0.566666666666667
},
"name": "steep_q3_real_ball_crosses_both_seams",
"name": "steep_q0_offset_0.00_real_ball",
"passed": true
},
{
"detail": {
"boosts": 1,
"contacts": [
"launch",
"slope",
"tail"
],
"entry_speed_mps": 3.48655772209167,
"final": "(-1.315089, 2.305791, -0.013575)",
"slope_y": 1.82000017166138,
"tail_y": 1.32000017166138,
"time": 0.741666666666667
},
"name": "steep_q0_offset_-0.05_real_ball",
"passed": true
},
{
"detail": {
"boosts": 1,
"contacts": [
"launch",
"slope",
"tail"
],
"entry_speed_mps": 3.48620939254761,
"final": "(-1.310743, 2.300434, 0.001933)",
"slope_y": 1.82000017166138,
"tail_y": 1.32000017166138,
"time": 0.733333333333333
},
"name": "steep_q0_offset_0.05_real_ball",
"passed": true
},
{
"detail": {
"max_step_m": 0.00099945068359375
},
"name": "steep_q1_full_mouth",
"passed": true
},
{
"detail": {
"boosts": 1,
"contacts": [
"launch",
"slope",
"tail"
],
"entry_speed_mps": 4.50606155395508,
"final": "(-0.005537, 2.272588, -1.663085)",
"slope_y": 1.82000017166138,
"tail_y": 1.32000017166138,
"time": 0.591666666666667
},
"name": "steep_q1_offset_0.00_real_ball",
"passed": true
},
{
"detail": {
"boosts": 1,
"contacts": [
"launch",
"slope",
"tail"
],
"entry_speed_mps": 3.48655772209167,
"final": "(0.012681, 2.304982, -1.310319)",
"slope_y": 1.82000017166138,
"tail_y": 1.32000017166138,
"time": 0.741666666666667
},
"name": "steep_q1_offset_-0.05_real_ball",
"passed": true
},
{
"detail": {
"boosts": 1,
"contacts": [
"launch",
"slope",
"tail"
],
"entry_speed_mps": 3.48605728149414,
"final": "(0.004755, 2.301212, -1.30469)",
"slope_y": 1.82000017166138,
"tail_y": 1.32000017166138,
"time": 0.733333333333333
},
"name": "steep_q1_offset_0.05_real_ball",
"passed": true
},
{
"detail": {
"max_step_m": 0.00099945068359375
},
"name": "steep_q2_full_mouth",
"passed": true
},
{
"detail": {
"boosts": 1,
"contacts": [
"launch",
"slope",
"tail"
],
"entry_speed_mps": 4.50730752944946,
"final": "(1.663578, 2.271967, 0.001082)",
"slope_y": 1.82000017166138,
"tail_y": 1.32000017166138,
"time": 0.591666666666667
},
"name": "steep_q2_offset_0.00_real_ball",
"passed": true
},
{
"detail": {
"boosts": 1,
"contacts": [
"launch",
"slope",
"tail"
],
"entry_speed_mps": 3.48663663864136,
"final": "(1.314951, 2.300605, -0.003228)",
"slope_y": 1.82000017166138,
"tail_y": 1.32000017166138,
"time": 0.725
},
"name": "steep_q2_offset_-0.05_real_ball",
"passed": true
},
{
"detail": {
"boosts": 1,
"contacts": [
"launch",
"slope",
"tail"
],
"entry_speed_mps": 3.48620438575745,
"final": "(1.308576, 2.300469, 0.001644)",
"slope_y": 1.82000017166138,
"tail_y": 1.32000017166138,
"time": 0.733333333333333
},
"name": "steep_q2_offset_0.05_real_ball",
"passed": true
},
{
"detail": {
"max_step_m": 0.00099945068359375
},
"name": "steep_q3_full_mouth",
"passed": true
},
{
"detail": {
"boosts": 1,
"contacts": [
"launch",
"slope",
"tail"
],
"entry_speed_mps": 4.50668144226074,
"final": "(0.001801, 2.271847, 1.663327)",
"slope_y": 1.82000017166138,
"tail_y": 1.32000017166138,
"time": 0.591666666666667
},
"name": "steep_q3_offset_0.00_real_ball",
"passed": true
},
{
"detail": {
"boosts": 1,
"contacts": [
"launch",
"slope",
"tail"
],
"entry_speed_mps": 3.48678493499756,
"final": "(0.00193, 2.300435, 1.309911)",
"slope_y": 1.82000017166138,
"tail_y": 1.32000017166138,
"time": 0.733333333333333
},
"name": "steep_q3_offset_-0.05_real_ball",
"passed": true
},
{
"detail": {
"boosts": 1,
"contacts": [
"launch",
"slope",
"tail"
],
"entry_speed_mps": 3.48651027679443,
"final": "(0.008731, 2.302601, 1.307388)",
"slope_y": 1.82000017166138,
"tail_y": 1.32000017166138,
"time": 0.733333333333333
},
"name": "steep_q3_offset_0.05_real_ball",
"passed": true
}
]
@@ -0,0 +1,34 @@
{
"assetFamily": "railbound_inspired",
"balls": [
{
"ballTypeId": "iron_ball",
"id": "ball",
"launchDirection": [
1.0,
0.0,
0.0
],
"position": [
1.89999997615814,
2.0,
-2.0
]
}
],
"entities": [],
"pieces": [
{
"id": "bend",
"kind": "turn_90",
"position": [
2.0,
1.0,
-2.0
],
"quarter": 0
}
],
"schemaVersion": 2,
"title": "my_level"
}
@@ -0,0 +1 @@
{"assetFamily":"railbound_inspired","balls":[{"ballTypeId":"iron_ball","id":"ball","position":[1.9,2,-2]}],"entities":[],"pieces":[{"id":"bend","kind":"turn_ccw","position":[2,1,-2],"quarter":3}],"schemaVersion":2}
File diff suppressed because it is too large Load Diff
+7 -23
View File
@@ -33,7 +33,7 @@
- Y 形在同一侧设置两个相邻、等高的入口,中心相距 1 m,各自连接一个单格直槽;公共出口与其中一路对齐,另一路以连续 S 形曲线并入,不要求对称。单件场景同时展示两个输入直槽和一个输出直槽,验证真实接缝。
- 编辑器按 Y 形四格占用进行选择、替换、旋转及重叠检查;数量配额计为一块。只有上方槽面参与路线连接。
目标洞口现由 Blender 制作并导出为 `goal_hole.glb`:入口与喉部净半径均为 0.32 m,深度 0.55 m,壁厚 0.04 m。碰撞使用同一空心网格,避免只缩小视觉开口。入洞检测记录球心向下跨过洞底平面的交点,再按洞口净空校验水平位置。
目标洞口现由 Blender 制作并导出为 `goal_hole.glb`:入口与喉部净半径均为 0.32 m,深度 0.55 m,壁厚 0.04 m。碰撞使用同一空心网格,避免只缩小视觉开口。这款直筒球洞的喉口位于上沿,球心向下跨入上口并满足孔径净空时即算入洞。
独立半径对比实验已完成选择并清理:删除其 Blender 模型、GLB、Godot 场景、脚本和报告,以及旧镜像下层导轨夹具;当前保留连续轨道、单件试跑、自由搭建和双球汇流四个试玩预设。底孔测试预设及独立底孔场景均已删除。
@@ -42,35 +42,19 @@
铁球为 SphereShape3D 刚体,半径读取生成的资产目录;均匀实心球惯量按质量和半径生成。所有轨道为静态三角网格碰撞体,铁球与轨道、铁球与铁球碰撞均开启。固定物理频率为 120 Hz,启用连续碰撞检测。
当前 `physics.json` 中的名义铁密度假设为 7870 kg/m³,半径 0.3 m 对应约 890.08 kg;质量值保存在物理预设中。木材接触试验系数为:静摩擦 0.42、动摩擦 0.32、滚动阻力 0.025、回弹 0.08;空气密度 1.225 kg/m³,铁球阻力系数为 0.47,正常计算风力和静止空气阻力。质量与接触值沿用首轮验证参数,不是实验测得的材质常数。
当前 `physics.json` 中的名义铁密度假设为 7870 kg/m³,半径 0.3 m 对应约 890.08 kg;质量值保存在物理预设中。木槽滚动阻力为 0.025,恢复系数为 0.08。与工坊共用固体滚动阻力模型,空气阻力已停用。
Godot 原生 PhysicsMaterial 只暴露一个摩擦参数;本轮根据接触点滑速切换静/动摩擦系数,再由原生求解器计算接触冲量。这是用于本轮试验的近似,不等价于完整的逐接触双系数材质求解。滚动阻力另施加受限力矩,空气作用使用相对空气速度计算,不额外修改轨道速度。多材质同时接触和铁球之间的独立材质配对尚未完整标定;目前原生回弹合成会使两个铁球各 0.08 的回弹得到约 0.16 的相对恢复表现。[Godot PhysicsMaterial](https://docs.godotengine.org/en/4.7/classes/class_physicsmaterial.html)
接触数据和力矩在刚体积分回调中读取、施加,轨迹记录只用于显示与测量。[Godot PhysicsDirectBodyState3D](https://docs.godotengine.org/en/4.7/classes/class_physicsdirectbodystate3d.html)
## 验证范围
## 验证与历史记录
本次实心底座修改已通过 42 项基础物理检查;另有两套模型的 151 项碰撞/场景检查和 16 项源文件检查,见 [本次验证索引](../README.md)。以下交互流程与双球汇流的完整历史结果未在本轮重复运行。
早期 `baseline-test` 及其物理、交互流程和双球汇流三组自动检查已删除,不再提供这些过时断言的运行入口,也不再保留 `playtest/baseline/checks/`。早期试玩场景仍可通过 `./scripts/playtest.zsh` 和 `./scripts/run.zsh merge` 手动检查。
运行 `./scripts/run.zsh baseline-test` 会刷新 Godot 导入并运行物理、交互流程和双球汇流三组测试。报告记录实际参数、轨迹和结果;退出码非零表示测试失败。
[基础物理报告](../artifacts/baseline/physics_report.json)、[交互报告](../artifacts/baseline/playtest_report.json) 和 [双球汇流报告](../artifacts/baseline/merge_report.json) 仅作为历史产物保留,不代表当前场景或共享物理脚本已经通过同一组检查。历史默认路线约 2.90 秒入洞;窗口关闭或不同操作路径不会被这些数值覆盖,需要按实际试玩继续验证。
物理测试移除底孔通过用例后共 42 项:
- 真空自由落体与球在半圆槽中的静止接触。
- 30° 理想平面上实心球滚动,加速度与解析值比较。
- 水平滚动时关闭/开启滚动阻力的速度差异。
- 两个铁球副本迎面碰撞,检查速度方向与总动量。
- 六种滑槽、四个朝向的顶部槽面通行;Y 形分别测试两个岔口,共 28 项路径测试。
- Y 形连接两个相邻直槽及一个出口直槽后,分别测试两个入口和四个朝向,共 8 项完整连接测试。连接测试初速度为 1.6 m/s,其余既有路径测试继续使用原有的 1.2 m/s 或坡道静止释放条件。
- 无接触条件下,质量相差十倍时的风响应比较;该解析基准直接读取当前铁球的非零阻力配置,仅改变质量,不再单独覆盖阻力系数。
交互流程测试共 30 项:默认重力路线穿过真实洞口、释放、暂停、重试、六种资产选择与四次旋转复位、相邻放置、运行后编辑锁定、删除、拒绝悬空放置、场景配额及鼠标射线选取可见方块;另覆盖 Y 形的合法四格尺寸、超界标记区分、重叠拒绝、四格选择、中心旋转和替换后释放多余格子。
较长的完整连接测试采用 1.6 m/s 初速度,场景中仍可用滑块调整;试验只设置初始速度,未添加持续推力、速度锁定或关闭摩擦。低初速度是否足够到达后续路线,继续由实际行程和摩擦耗能决定。
测试调用真实 Godot 场景和物理引擎。界面按钮通过信号触发、选格通过引擎输入事件路径验证;原生渲染已截图检查。没有声称通过操作系统鼠标自动化完成所有按钮测试。
当前基础物理结果见 [物理报告](../artifacts/baseline/physics_report.json),历史交互结果见 [交互报告](../artifacts/baseline/playtest_report.json)。历史默认路线约 2.90 秒入洞;当前 30° 平面验证仍与约 3.5036 m/s² 的解析值比较。窗口关闭或不同操作路径不会被这些数值覆盖,需要按实际试玩继续验证。
当前自动检查按改动范围使用 `playtest/checks/` 中的专项,入口见 [脚本说明](../../scripts/README.md)。
## 双铁球汇流场景
@@ -82,7 +66,7 @@ Godot 原生 PhysicsMaterial 只暴露一个摩擦参数;本轮根据接触点
入洞按球的唯一编号计数,每球只记录一次。已入洞球隐藏并退出碰撞;部分入洞不成功,任何一球丢失也不能通过减少剩余球数完成通关。重试会重建两球并清空入洞、轨迹及暂停状态。预设演示场景不开放方块编辑,可切回自由搭建场景调整其他布局。
双球专项验证共 16 项,覆盖同高分支、同时释放、球间碰撞开关、两球暂停、分别通过不同入口及共同出口、两球进入同一洞口、部分入洞、事件去重、退出模拟、重试复现、丢球不判胜及切回单球场景。实际完成时间约 5.4 秒,具体轨迹和逐球入洞事件见 [双球汇流报告](../artifacts/baseline/merge_report.json)。
历史双球专项曾有 16 项,覆盖同高分支、同时释放、球间碰撞开关、两球暂停、分别通过不同入口及共同出口、两球进入同一洞口、部分入洞、事件去重、退出模拟、重试复现、丢球不判胜及切回单球场景。当时实际完成时间约 5.4 秒,具体轨迹和逐球入洞事件见保留的 [双球汇流报告](../artifacts/baseline/merge_report.json);该专项现已删除,不再作为当前运行证明。
## 后续需验证
@@ -1,84 +0,0 @@
extends SceneTree
var results: Array=[]
var failures:=0
func _initialize() -> void:call_deferred("run")
func check(name: String, ok: bool, detail: Dictionary={}) -> void:
results.append({"name":name,"passed":ok,"detail":detail.duplicate(true)})
if not ok:failures+=1
print(("PASS " if ok else "FAIL ")+name+" "+JSON.stringify(detail))
func run() -> void:
var app=load("res://playtest/baseline/scenes/main.tscn").instantiate()
root.add_child(app)
app.build_preset(3)
await physics_frame
check("two_iron_balls_ready",app.merge_balls.size()==2 and app.merge_balls.all(func(b):return b.freeze and is_equal_approx(b.radius,.3) and b.linear_velocity.is_zero_approx()))
check("separate_equal_height_branches",is_equal_approx(app.merge_balls[0].position.y,app.merge_balls[1].position.y) and is_equal_approx(absf(app.merge_balls[0].position.z-app.merge_balls[1].position.z),1.0))
check("ball_collision_enabled",app.merge_balls.all(func(b):return (b.collision_layer&2)!=0 and (b.collision_mask&2)!=0))
app.start_button.pressed.emit()
check("simultaneous_release",app.merge_release_ticks.size()==2 and app.merge_release_ticks[0]==app.merge_release_ticks[1] and app.merge_balls.all(func(b):return not b.freeze and b.linear_velocity.is_zero_approx()))
for i in range(35):await physics_frame
app.toggle_run()
var positions: Array=app.merge_balls.map(func(b):return b.position)
var time: float=app.elapsed
for i in range(20):await physics_frame
check("pause_stops_both_balls",app.paused and app.merge_balls[0].position.is_equal_approx(positions[0]) and app.merge_balls[1].position.is_equal_approx(positions[1]) and is_equal_approx(time,app.elapsed))
app.toggle_run()
var partial_seen:=false
var premature_win:=false
for i in range(2400):
await physics_frame
if app.merge_entered.size()==1:
partial_seen=true
premature_win=premature_win or app.status.begins_with("成功")
if app.merge_entered.size()+app.merge_lost.size()==2:break
check("both_balls_enter_common_hole",app.merge_entered.size()==2 and app.merge_lost.is_empty(),{"status":app.status,"time":app.elapsed,"hole_events":app.merge_hole_events,"ball_collision_frames":app.merge_collision_frames,"a_position":[app.merge_balls[0].position.x,app.merge_balls[0].position.y,app.merge_balls[0].position.z],"b_position":[app.merge_balls[1].position.x,app.merge_balls[1].position.y,app.merge_balls[1].position.z]})
check("one_ball_is_not_a_win",partial_seen and not premature_win)
check("two_unique_hole_events",app.merge_hole_events.size()==2 and app.merge_hole_events[0].ballId!=app.merge_hole_events[1].ballId)
var first_run: Array=app.merge_samples.duplicate(true)
var correct_inlets:=true
var common_outlet:=true
for i in range(2):
var key: String="a" if i==0 else "b"
var inlet_seen:=false
var outlet_seen:=false
for sample in first_run:
var p: Array=sample[key]
if p[0]>-.6 and p[0]<-.1 and absf(p[2]-i)<.2 and p[1]>1.8:inlet_seen=true
if p[0]>1.3 and p[0]<1.7 and absf(p[2]-1)<.2 and p[1]>1.5:outlet_seen=true
correct_inlets=correct_inlets and inlet_seen
common_outlet=common_outlet and outlet_seen
check("both_use_distinct_y_inlets",correct_inlets)
check("both_use_common_y_outlet",common_outlet)
for i in range(60):await physics_frame
check("hole_events_not_repeated",app.merge_hole_events.size()==2)
check("entered_balls_exit_simulation",app.merge_balls.all(func(b):return b.freeze and not b.visible and b.collision_mask==0 and b.collision_layer==0))
app.reset_ball()
await physics_frame
check("retry_restores_two_balls",app.merge_balls.size()==2 and app.merge_balls.all(func(b):return b.freeze and b.visible and b.collision_mask==3) and app.merge_entered.is_empty() and app.merge_hole_events.is_empty() and app.elapsed==0)
app.toggle_run()
for i in range(2400):
await physics_frame
if app.merge_entered.size()+app.merge_lost.size()==2:break
check("repeat_run_completes",app.merge_entered.size()==2 and app.merge_lost.is_empty(),{"time":app.elapsed})
app.reset_ball();app.toggle_run()
app.merge_balls[0].position=Vector3(0,-2,0)
for i in range(1800):
await physics_frame
if app.merge_entered.size()+app.merge_lost.size()==2:break
check("lost_ball_does_not_reduce_target",app.merge_lost.size()==1 and app.merge_entered.size()==1 and not app.status.begins_with("成功"))
app.build_preset(0)
await physics_frame
var dynamic_balls:=0
for child in app.get_children():
if child is RigidBody3D:dynamic_balls+=1
check("switch_back_to_single_ball_scene",app.merge_balls.is_empty() and dynamic_balls==1 and is_instance_valid(app.ball))
var path=ProjectSettings.globalize_path("res://playtest/artifacts/baseline/merge_report.json")
var file=FileAccess.open(path,FileAccess.WRITE)
file.store_string(JSON.stringify({"passed":results.size()-failures,"failed":failures,"results":results,"first_run_trace":first_run}," "))
file.close()
app.queue_free()
await process_frame
quit(1 if failures else 0)
@@ -1 +0,0 @@
uid://mumonx8gdgce
@@ -1,178 +0,0 @@
extends SceneTree
const Library = preload("res://playtest/baseline/scripts/asset_library.gd")
var lib = Library.new()
var arena: Node3D
var results: Array = []
var failures := 0
func _initialize() -> void:
call_deferred("run")
func vec(v: Vector3) -> Array:
return [snappedf(v.x,.000001),snappedf(v.y,.000001),snappedf(v.z,.000001)]
func clear_arena() -> void:
if is_instance_valid(arena):
root.remove_child(arena)
arena.queue_free()
arena=Node3D.new()
root.add_child(arena)
await physics_frame
await physics_frame
func record(name: String, passed: bool, detail: Dictionary) -> void:
results.append({"name":name,"passed":passed,"detail":detail})
if not passed:failures+=1
print(("PASS " if passed else "FAIL ")+name+" "+JSON.stringify(detail))
func run_path(kind: String, rotation_step: int, branch: int, connected := false) -> void:
await clear_arena()
var basis:=Basis(Vector3.UP,-rotation_step*PI/2)
arena.add_child(lib.create_piece(kind,Vector3.ZERO,rotation_step))
var sphere=lib.create_ball()
sphere.freeze=true
var descending: bool=kind in ["gentle","steep"]
var t:=.80 if descending else .05
var direction: Vector3=lib.path_tangent(kind,0,branch)
var start: Vector3
var target: Vector3
var exit_direction: Vector3
start=lib.ball_on_surface(kind,t,branch)
target=lib.ball_on_surface(kind,0 if descending else 1,branch)
exit_direction=-lib.path_tangent(kind,0,branch) if descending else lib.path_tangent(kind,1,branch)
if connected:
for local_center in lib.y_connectors():arena.add_child(lib.create_piece("straight",basis*local_center,rotation_step))
start=lib.path_point(kind,0,branch)+Vector3(-.65,-float(lib.catalog[kind].grooveRadius)+sphere.radius+.018,0)
target=lib.path_point(kind,1,branch)+Vector3(.85,-float(lib.catalog[kind].grooveRadius)+sphere.radius,0)
direction=Vector3.RIGHT
arena.add_child(sphere)
sphere.position=basis*start
await physics_frame
sphere.freeze=false
var initial_speed: float=1.6 if connected else 1.2
sphere.linear_velocity=Vector3.ZERO if descending else basis*direction*initial_speed
sphere.angular_velocity=Vector3.UP.cross(sphere.linear_velocity)/sphere.radius
var closest:=100.0
var reached:=false
var contact_frames:=0
var highest_speed:=0.0
var trace: Array=[]
var time_at_exit:=-1.0
for frame in range(720):
await physics_frame
var p: Vector3=basis.inverse()*sphere.position
var delta_to_goal:=p-target
var axial:=delta_to_goal.dot(exit_direction)
var lateral:=(delta_to_goal-exit_direction*axial).length()
closest=minf(closest,delta_to_goal.length())
highest_speed=maxf(highest_speed,sphere.linear_velocity.length())
if sphere.contact_count>0:contact_frames+=1
if frame%12==0:trace.append({"t":frame/120.0,"p":vec(p),"v":vec(basis.inverse()*sphere.linear_velocity)})
if axial>.04 and lateral<.22:
reached=true
time_at_exit=frame/120.0
break
if p.y < -2:break
var path_name:="connected" if connected else "upper"
record("%s_%s_r%d_b%d" % [path_name,kind,rotation_step*90,branch],reached and contact_frames>0,
{"reached_exit":reached,"time":time_at_exit,"initial_speed":0.0 if descending else initial_speed,"closest_m":closest,"contact_frames":contact_frames,"max_speed":highest_speed,"final":vec(basis.inverse()*sphere.position),"trace":trace})
func run() -> void:
Engine.physics_ticks_per_second=120
await clear_arena()
var falling=lib.create_ball()
falling.drag_enabled=false
falling.rolling_enabled=false
arena.add_child(falling)
falling.position=Vector3(0,10,0)
await physics_frame
var start_y: float=falling.position.y
var start_v: float=falling.linear_velocity.y
for i in range(120):await physics_frame
var expected_drop: float=-start_v+4.905
var observed_drop: float=start_y-falling.position.y
record("vacuum_freefall_1s",absf((falling.linear_velocity.y-start_v)+9.81)<.02 and absf(observed_drop-expected_drop)<.05,
{"initial_velocity":start_v,"velocity_delta":falling.linear_velocity.y-start_v,"distance":observed_drop,"analytic_distance":expected_drop,"position_error":absf(observed_drop-expected_drop)})
await clear_arena()
arena.add_child(lib.create_piece("straight"))
var resting=lib.create_ball()
arena.add_child(resting)
resting.position=Vector3(0,1.8,0)
for i in range(300):await physics_frame
record("sphere_groove_rest",absf(resting.position.y-(1.0-float(lib.catalog["straight"].grooveRadius)+resting.radius))<.035 and resting.linear_velocity.length()<.1,
{"position":vec(resting.position),"speed":resting.linear_velocity.length(),"contacts":resting.contact_count})
# An independent analytic benchmark: sphere rolling on a 30 degree plane.
await clear_arena()
var plane=lib.create_box(Vector3(20,.2,4),Vector3(0,-.1,0),Color.GRAY)
plane.rotation.z=-PI/6
arena.add_child(plane)
var ramp_ball=lib.create_ball()
ramp_ball.drag_enabled=false
ramp_ball.rolling_enabled=false
arena.add_child(ramp_ball)
var normal: Vector3=plane.basis*Vector3.UP
var downhill: Vector3=plane.basis*Vector3.RIGHT
ramp_ball.position=plane.transform*Vector3(0,.1,0)+normal*(ramp_ball.radius+.005)
for i in range(30):await physics_frame
var first_velocity: float=ramp_ball.linear_velocity.dot(downhill)
for i in range(60):await physics_frame
var acceleration: float=(ramp_ball.linear_velocity.dot(downhill)-first_velocity)/.5
var slip: float=absf(ramp_ball.linear_velocity.dot(downhill)-ramp_ball.angular_velocity.length()*ramp_ball.radius)
record("solid_sphere_30_degree_plane",absf(acceleration-3.503571)<.09 and slip<.06,{"acceleration":acceleration,"analytic_acceleration":3.503571,"rolling_slip":slip})
var horizontal_speeds: Array=[]
for enabled in [false,true]:
await clear_arena()
arena.add_child(lib.create_box(Vector3(30,.2,4),Vector3(0,-.1,0),Color.GRAY))
var rolling_ball=lib.create_ball()
rolling_ball.drag_enabled=false
rolling_ball.rolling_enabled=enabled
arena.add_child(rolling_ball)
rolling_ball.position=Vector3(0,rolling_ball.radius+.001,0)
rolling_ball.linear_velocity=Vector3(2,0,0)
rolling_ball.angular_velocity=Vector3(0,0,-2/rolling_ball.radius)
for i in range(240):await physics_frame
horizontal_speeds.append(rolling_ball.linear_velocity.length())
record("rolling_resistance_dissipates",absf(horizontal_speeds[0]-2)<.05 and horizontal_speeds[1]<horizontal_speeds[0]-.15,{"disabled_enabled_speeds":horizontal_speeds})
await clear_arena()
var left=lib.create_ball()
var right=lib.create_ball()
for sphere in [left,right]:
sphere.gravity_scale=0
sphere.drag_enabled=false
sphere.rolling_enabled=false
arena.add_child(sphere)
left.position=Vector3(-1,2,0);right.position=Vector3(1,2,0)
left.linear_velocity=Vector3.RIGHT;right.linear_velocity=Vector3.LEFT
for i in range(150):await physics_frame
var momentum_error: float=(left.linear_velocity+right.linear_velocity).length()
record("ball_to_ball_collision_enabled",left.linear_velocity.x<-.02 and right.linear_velocity.x>.02 and momentum_error<.02,{"left_velocity":vec(left.linear_velocity),"right_velocity":vec(right.linear_velocity),"normalized_momentum_error":momentum_error})
for kind in ["straight","turn_90","gentle","steep","y_merge"]:
for q in range(4):
for branch in range(2 if kind=="y_merge" else 1):
await run_path(kind,q,branch)
for q in range(4):
for branch in range(2):await run_path("y_merge",q,branch,true)
# Air response independently of contacts; compare actual simulated velocities.
var air_velocities: Array=[]
for mass_factor in [1.0,10.0]:
await clear_arena()
var sphere=lib.create_ball()
sphere.gravity_scale=0
sphere.mass*=mass_factor
sphere.wind_velocity=Vector3(20,0,0)
arena.add_child(sphere)
sphere.position=Vector3(0,5,0)
for i in range(60):await physics_frame
air_velocities.append(sphere.linear_velocity.x)
var ratio: float=air_velocities[0]/maxf(air_velocities[1],.000001)
record("wind_mass_response",absf(ratio-10)<.15,{"speeds":air_velocities,"ratio":ratio})
var output={"engine":Engine.get_version_info().string,"physics_engine":ProjectSettings.get_setting("physics/3d/physics_engine"),"ticks_per_second":120,"passed":results.size()-failures,"failed":failures,"results":results}
var path: String=ProjectSettings.globalize_path("res://playtest/artifacts/baseline/physics_report.json")
var file:=FileAccess.open(path,FileAccess.WRITE)
file.store_string(JSON.stringify(output," "))
file.close()
print("PHYSICS_REPORT "+path+" failures="+str(failures))
if is_instance_valid(arena):arena.queue_free()
await process_frame
quit(1 if failures else 0)
@@ -1 +0,0 @@
uid://byeccpbcfaoj3
@@ -1,89 +0,0 @@
extends SceneTree
var results: Array=[]
var failed:=0
func _initialize() -> void:
call_deferred("run")
func check(name: String, passed: bool, detail: Dictionary={}) -> void:
results.append({"name":name,"passed":passed,"detail":detail})
if not passed:failed+=1
print(("PASS " if passed else "FAIL ")+name+" "+JSON.stringify(detail))
func run() -> void:
var app=load("res://playtest/baseline/scenes/main.tscn").instantiate()
root.add_child(app)
await physics_frame
check("one_iron_ball_ready",is_instance_valid(app.ball) and app.ball.freeze and is_equal_approx(app.ball.radius,.3),{"mass_kg":app.ball.mass,"radius_m":app.ball.radius})
app.start_button.pressed.emit()
check("release_button",app.started and not app.ball.freeze)
for i in range(1800):
await physics_frame
if app.status.begins_with("成功") or app.status.begins_with("已离开"):break
check("default_course_reaches_hole",app.status.begins_with("成功"),{"status":app.status,"time":app.elapsed,"position":[app.ball.position.x,app.ball.position.y,app.ball.position.z],"max_speed":app.max_speed})
app.reset_ball()
await physics_frame
check("retry_clears_state",not app.started and app.ball.freeze and app.trail_points.is_empty() and app.elapsed==0)
check("scenario_specific_quotas",app.quota("steep")==0 and app.quota("straight")==6)
app.choose_kind("steep")
check("reject_unavailable_type",app.selected_kind!="steep")
var click:=InputEventMouseButton.new()
click.button_index=MOUSE_BUTTON_LEFT
click.pressed=true
click.position=app.camera.unproject_position(Vector3(0,1.3,.5))
app._unhandled_input(click)
check("ray_select_visible_tile",app.selected_index==app.find_cell(Vector2i(0,0)) and is_equal_approx(app.placement_height,.5))
app.build_preset(1)
await physics_frame
for kind in app.IDS:
app.choose_kind(kind)
await physics_frame
check("library_"+kind,app.records.size()==1 and app.records[0].kind==kind and app.pieces.size()==1)
for i in range(4):app.rotate_selected()
check("rotation_cycle_"+kind,app.preview_quarter==0 and app.records[0].quarter==0)
check("y_has_declared_four_cell_footprint",app.lib.footprint("y_merge")==Vector2i(2,2) and app.lib.catalog.y_merge.declaredBoundsFits and app.lib.catalog.y_merge.ports.size()==3)
check("y_not_mislabelled_as_steep_exception",not app.warning_label.text.contains("陡坡"))
app.build_preset(2)
await physics_frame
var previous: int=app.records.size()
app.selected_cell=Vector2i(2,0)
app.placement_height=.5
app.choose_kind("turn_90")
app.place_selected()
check("place_adjacent_tile",app.records.size()==previous+1 and app.find_cell(Vector2i(2,0))>=0)
app.toggle_run()
var locked: int=app.records.size()
app.remove_selected()
check("editing_locked_after_release",app.records.size()==locked)
app.toggle_run()
check("pause_preserves_run_lock",app.paused and app.started and app.ball.freeze)
app.reset_ball()
app.remove_selected()
check("delete_after_retry",app.records.size()==previous)
app.selected_cell=Vector2i(4,4)
app.place_selected()
check("reject_unattached_tile",app.records.size()==previous)
app.selected_cell=Vector2i(0,0)
app.placement_height=.5
app.choose_kind("y_merge")
app.place_selected()
check("reject_y_overlap_with_neighbor",app.records.size()==previous and app.records[app.find_cell(Vector2i(0,0))].kind=="straight" and app.status.contains("重叠"))
app.selected_cell=Vector2i(-1,1)
app.place_selected()
var y_index: int=app.find_cell(Vector2i(-1,1))
var all_cells_match: bool=y_index>=0
for cell in [Vector2i(-1,1),Vector2i(0,1),Vector2i(-1,2),Vector2i(0,2)]:all_cells_match=all_cells_match and app.find_cell(cell)==y_index
check("y_reserves_four_cells",app.records.size()==previous+1 and all_cells_match)
var model_center: Vector3=app.pieces[y_index].position
for i in range(4):app.rotate_selected()
check("y_rotates_about_fixed_center",app.pieces[y_index].position.is_equal_approx(model_center) and app.preview_quarter==0)
app.choose_kind("straight")
app.place_selected()
check("replace_y_releases_extra_cells",app.find_cell(Vector2i(-1,1))==y_index and app.find_cell(Vector2i(0,2))==-1)
var path=ProjectSettings.globalize_path("res://playtest/artifacts/baseline/playtest_report.json")
var out=FileAccess.open(path,FileAccess.WRITE)
out.store_string(JSON.stringify({"passed":results.size()-failed,"failed":failed,"results":results}," "))
out.close()
app.queue_free()
await process_frame
quit(1 if failed else 0)
@@ -1 +0,0 @@
uid://ddf8i08g3bf4k
+6 -8
View File
@@ -34,7 +34,7 @@ func add_colliders(node: Node, kind: String) -> void:
body.collision_mask = 2
body.set_meta("piece_type",kind)
var material := PhysicsMaterial.new()
material.friction = .25 if kind=="goal_hole" else 1.0 # native pair uses min.
material.friction = 0.0
material.bounce = 0.0
body.physics_material_override = material
var collider := CollisionShape3D.new()
@@ -60,16 +60,13 @@ func create_ball() -> RigidBody3D:
body.radius = float(data["radius"])
body.mass = float(profile["massKg"])
body.inertia = Vector3.ONE * (0.4 * body.mass * body.radius * body.radius)
body.drag_coefficient = float(profile["dragCoefficient"])
body.air_density = float(physics["airDensity"])
body.mu_static = float(pair["staticFriction"])
body.mu_dynamic = float(pair["dynamicFriction"])
body.rolling_resistance = float(pair["rollingResistance"])
body.collision_layer = 2
body.collision_mask = 3
var material := PhysicsMaterial.new()
material.friction = body.mu_static
material.friction = 0.0
material.bounce = float(pair["restitution"])
body.base_bounce = material.bounce
body.physics_material_override = material
var shape := SphereShape3D.new()
shape.radius = body.radius
@@ -100,7 +97,7 @@ func create_box(size: Vector3, location: Vector3, color: Color, solid := true) -
root.collision_layer = 1
root.collision_mask = 2
var pm := PhysicsMaterial.new()
pm.friction = 1.0
pm.friction = 0.0
root.physics_material_override = pm
return root
@@ -143,7 +140,8 @@ func create_goal_hole(location: Vector3) -> Node3D:
return create_piece("goal_hole",location)
func crossed_goal(previous: Vector3, current: Vector3, goal: Vector3, radius: float) -> bool:
var height: float=goal.y-float(catalog["goal_hole"].depth)
# This older straight bore has its throat entrance at the rim.
var height: float=goal.y
if previous.y<=height or current.y>height:return false
var ratio: float=(previous.y-height)/maxf(previous.y-current.y,.000001)
var crossing: Vector3=previous.lerp(current,ratio)
+1 -67
View File
@@ -1,67 +1 @@
extends RigidBody3D
var radius: float = 0.3
var drag_coefficient: float = 0.47
var air_density: float = 1.225
var wind_velocity := Vector3.ZERO
var mu_static: float = 0.42
var mu_dynamic: float = 0.32
var rolling_resistance: float = 0.025
var friction_enabled := true
var rolling_enabled := true
var drag_enabled := true
var contact_count := 0
var ball_contact_count := 0
var contact_slip := 0.0
var air_force := Vector3.ZERO
var rolling_torque := Vector3.ZERO
var travelled := 0.0
var previous_position := Vector3.ZERO
var tracking_started := false
func _ready() -> void:
continuous_cd = true
contact_monitor = true
max_contacts_reported = 12
can_sleep = false
linear_damp_mode = RigidBody3D.DAMP_MODE_REPLACE
angular_damp_mode = RigidBody3D.DAMP_MODE_REPLACE
linear_damp = 0.0
angular_damp = 0.0
func _integrate_forces(state: PhysicsDirectBodyState3D) -> void:
if freeze:
return
contact_count = state.get_contact_count()
ball_contact_count = 0
contact_slip = 0.0
var support_normal := Vector3.ZERO
for i in range(contact_count):
if state.get_contact_collider_object(i) is RigidBody3D:ball_contact_count+=1
# Contact positions are global; the sphere's radial direction is unambiguous.
var n := (state.transform.origin - state.get_contact_local_position(i)).normalized()
var relative := state.get_contact_local_velocity_at_position(i) - state.get_contact_collider_velocity_at_position(i)
var slip := relative - n * relative.dot(n)
contact_slip = maxf(contact_slip, slip.length())
if n.dot(Vector3.UP) > 0.15:
support_normal += n
# Godot exposes one native friction coefficient. Select a slip-dependent
# coefficient; native contact solver still owns the friction impulse.
physics_material_override.friction = (mu_static if contact_slip < 0.035 else mu_dynamic) if friction_enabled else 0.0
var relative_air := state.linear_velocity - wind_velocity
air_force = -0.5 * air_density * drag_coefficient * PI * radius * radius * relative_air.length() * relative_air if drag_enabled else Vector3.ZERO
state.apply_central_force(air_force)
rolling_torque = Vector3.ZERO
if rolling_enabled and support_normal.length_squared() > 0.001:
var n := support_normal.normalized()
var roll := state.angular_velocity - n * state.angular_velocity.dot(n)
if roll.length() > 0.0001:
var support := maxf(0.0, -(mass * state.total_gravity + air_force).dot(n))
var moment := 0.4 * mass * radius * radius
var limit := roll.length() * moment / state.step
rolling_torque = -roll.normalized() * minf(rolling_resistance * support * radius, limit)
state.apply_torque(rolling_torque)
if tracking_started:
travelled += state.transform.origin.distance_to(previous_position)
previous_position = state.transform.origin
tracking_started = true
extends "res://assets/balls/shared/physics.gd"
-10
View File
@@ -68,7 +68,6 @@ var start_button: Button
var quota_label: Label
var mode_selector: OptionButton
var speed_slider: HSlider
var wind_slider: HSlider
var type_buttons: Array = []
var ui_font: SystemFont
var capture_frames := -1
@@ -262,12 +261,6 @@ func setup_ui() -> void:
if not started: configure_spawn(); reset_ball()
)
column.add_child(speed_slider)
column.add_child(label_for("横风速度(m/s)",13,MUTED))
wind_slider = HSlider.new()
wind_slider.min_value = 0
wind_slider.max_value = 60
wind_slider.step = 5
column.add_child(wind_slider)
var checks := HBoxContainer.new()
var trail_check := CheckButton.new()
trail_check.text = "轨迹"
@@ -323,7 +316,6 @@ func build_preset(new_mode: int) -> void:
selected_kind="y_merge"
launch_speed=0
speed_slider.set_value_no_signal(0)
wind_slider.set_value_no_signal(0)
elif previous_mode==3:
launch_speed=1.2
speed_slider.set_value_no_signal(launch_speed)
@@ -674,7 +666,6 @@ func _physics_process(delta: float) -> void:
process_merge(delta)
return
if not is_instance_valid(ball):return
ball.wind_velocity=Vector3(0,0,float(wind_slider.value))
if started and not paused and not ball.freeze:
elapsed+=delta
max_speed=maxf(max_speed,ball.linear_velocity.length())
@@ -785,7 +776,6 @@ func process_merge(delta: float) -> void:
for i in range(merge_balls.size()):
if merge_entered.has(i) or merge_lost.has(i):continue
var sphere=merge_balls[i]
sphere.wind_velocity=Vector3(0,0,float(wind_slider.value))
max_speed=maxf(max_speed,sphere.linear_velocity.length())
if sphere.ball_contact_count>0:touching_ball=true
if lib.crossed_goal(merge_previous_positions[i],sphere.position,goal_position,sphere.radius):
@@ -19,12 +19,4 @@ func run() -> void:
app.status="同一球面 · 半径 0.3 m · 原木 / 陶瓷 / 铁";app.refresh_ui()
await capture("ball_materials")
root.remove_child(app);app.queue_free();await process_frame
var demo=load("res://playtest/materials/scenes/materials.tscn").instantiate();root.add_child(demo)
demo.load_mode("wind")
for i in range(3):await physics_frame
demo.toggle_run()
for i in range(600):await physics_frame
demo.toggle_run()
await capture("ball_materials_wind")
root.remove_child(demo);demo.queue_free();await process_frame
quit()
+1 -1
View File
@@ -7,7 +7,7 @@ func run() -> void:
entities.append({"id":"boost_"+str(quarter),"kind":"directional_boost","position":[quarter*2,0,0],"quarter":quarter})
app.apply_data({"schemaVersion":2,"pieces":[],"entities":entities,"balls":[]})
app.select_record("boost_0");app.target=Vector3(3,.5,0);app.camera_size=9;app.pitch=.95;app.update_camera()
app.status="定向加速 · 四种朝向 · 顶面接触后先转向,再固定增加 5 m/s";app.refresh_ui()
app.status="定向加速 · 四种朝向 · 顶面接触后先转向,再固定增加 %.0f m/s" % app.Booster.SPEED_GAIN;app.refresh_ui()
for i in range(15):await process_frame
await RenderingServer.frame_post_draw
root.get_texture().get_image().save_png(ProjectSettings.globalize_path("res://playtest/artifacts/styled/directional_boost.png"))
@@ -10,10 +10,10 @@ func run() -> void:
app.records=[launch,slope,tail]
for y in [0,1]:app.records.append(placement.record_at("wall",Vector3(-1,y,0),0,"wall_%d"%y))
app.spawn_specs=[{"id":"ball","ballTypeId":"iron_ball","position":[-1,3.32,0]}]
app.rebuild();app.reset_simulation();app.select_record("slope")
app.target=Vector3(0,1.5,0);app.camera_size=6.8;app.yaw=.9;app.update_camera()
app.rebuild();app.reset_simulation();app.kind="";app.refresh_selection()
app.target=Vector3(-.4,2.6,0);app.camera_size=5.6;app.yaw=.9;app.update_camera()
app.sidebar_scroll.scroll_vertical=150
app.status="陡坡底面 Y 1.82 · 高端槽底 Y 3.00,与加速方块顶面齐平";app.refresh_ui()
app.status="加速出口接陡坡 · 槽底 Y 3.00 · 两侧槽沿 Y 3.32";app.refresh_ui()
for i in range(12):await process_frame
RenderingServer.force_draw(false);RenderingServer.force_sync()
root.get_texture().get_image().save_png(ProjectSettings.globalize_path("res://playtest/artifacts/styled/surface_alignment.png"))
+12 -68
View File
@@ -5,7 +5,6 @@ var results: Array=[]
var failures:=0
var app
var demo
var wind_measurements: Dictionary={}
func _initialize() -> void: call_deferred("run")
func check(name: String, ok: bool, detail: Dictionary={}) -> void:
@@ -84,7 +83,7 @@ func run() -> void:
var correct:=false
if not event.is_empty():
var before: Vector3=event.before;var after: Vector3=event.after
var expected:=direction*(Vector2(before.x,before.z).length()+5)
var expected: Vector3=direction*(Vector2(before.x,before.z).length()+app.Booster.SPEED_GAIN)
correct=Vector3(after.x,0,after.z).distance_to(expected)<.0001 and is_equal_approx(before.y,after.y)
var pos: Vector3=body.position
await frames(8)
@@ -114,75 +113,20 @@ func run() -> void:
for kind in TYPES:
check("roll_into_hole_%s_run%d"%[kind,attempt+1],demo.events.any(func(event):return event.ballId==kind),{"events":demo.events})
check("roll_three_unique_goal_events_run%d"%(attempt+1),demo.entered.size()==3 and demo.events.size()==3 and demo.lost.is_empty())
for with_wind in [false,true]:
demo.load_mode("wind");await frames(3)
for body in demo.balls:body.wind_velocity=Vector3(20,0,0) if with_wind else Vector3.ZERO
var peaks: Array=[0.0,0.0,0.0]
demo.toggle_run()
for frame in range(600):
await physics_frame
for i in range(3):peaks[i]=maxf(peaks[i],demo.balls[i].air_force.length())
var measurements: Dictionary={}
for i in range(3):
var body=demo.balls[i]
measurements[TYPES[i]]={"dx":body.position.x-demo.spawn_specs[i].position[0],"speed":body.linear_velocity.length(),"peakAirForceN":peaks[i]}
wind_measurements["wind" if with_wind else "calm"]=measurements
var wood_delta: float=wind_measurements.wind.wood_ball.dx-wind_measurements.calm.wood_ball.dx
var ceramic_delta: float=wind_measurements.wind.ceramic_ball.dx-wind_measurements.calm.ceramic_ball.dx
var iron_delta: float=wind_measurements.wind.iron_ball.dx-wind_measurements.calm.iron_ball.dx
check("wind_clearly_moves_wood",wood_delta>1.0,{"windMinusCalmMeters":wood_delta})
check("ceramic_weak_wind_response",ceramic_delta>=-.001 and ceramic_delta<.2 and ceramic_delta<wood_delta*.15,{"windMinusCalmMeters":ceramic_delta})
check("iron_receives_nonzero_wind_force",wind_measurements.wind.iron_ball.peakAirForceN>30 and wind_measurements.wind.iron_ball.peakAirForceN<35,
{"peakAirForceN":wind_measurements.wind.iron_ball.peakAirForceN})
check("heavy_iron_barely_moves_in_reference_wind",absf(iron_delta)<.1 and absf(iron_delta)<wood_delta*.1,
{"windMinusCalmMeters":iron_delta,"maxDisplacementMeters":.1})
# The same physical iron must move when a sufficiently stronger wind acts.
demo.load_mode("wind");await frames(3)
for body in demo.balls:body.wind_velocity=Vector3.ZERO
var iron=demo.balls[2];iron.wind_velocity=Vector3(100,0,0)
var start_x: float=iron.position.x
demo.toggle_run();await frames(360)
check("strong_wind_can_move_iron",iron.position.x-start_x>.5 and iron.air_force.x>0,
{"windSpeedMps":100,"durationSeconds":3,"displacementMeters":iron.position.x-start_x,"airForceN":iron.air_force.x})
root.remove_child(demo);demo.queue_free();await process_frame
# Isolate mass with two otherwise identical iron bodies in free space.
# No drag override: this tests the actual configured iron profile.
var heavy=lib.create_ball("iron_ball")
var light=lib.create_ball("iron_ball")
var calm=lib.create_ball("iron_ball")
light.mass=heavy.mass/10
light.inertia=Vector3.ONE*(.4*light.mass*light.radius*light.radius)
var bodies=[heavy,light,calm]
for i in range(3):
var body=bodies[i]
body.freeze=true;body.gravity_scale=0;root.add_child(body);body.position=Vector3(0,10,i*3)
body.wind_velocity=Vector3(20,0,0) if i<2 else Vector3.ZERO
await frames(3)
check("iron_profile_has_normal_air_drag",heavy.drag_enabled and is_equal_approx(heavy.drag_coefficient,.47) and
is_equal_approx(heavy.drag_coefficient,lib.physics.physicsProfiles.wood_game.dragCoefficient))
for body in bodies:body.freeze=false
calm.linear_velocity=Vector3(2,0,0)
await frames(2)
var forces: Array=[heavy.air_force.x,light.air_force.x]
await frames(118)
var k: float=.5*heavy.air_density*heavy.drag_coefficient*PI*heavy.radius*heavy.radius
var expected_force: float=k*20*20
check("mass_does_not_change_initial_wind_force",forces[0]>0 and absf(forces[0]-expected_force)<.1 and absf(forces[1]-expected_force)<.1,
{"heavyLightForceN":forces,"analyticForceN":expected_force})
# dv/dt = k/m * (u-v)^2, v(0)=0, integrated for one second.
for body in [heavy,light]:
var expected_speed: float=20.0-20.0/(1.0+k/body.mass*20.0)
check("wind_motion_matches_equation_mass_"+str(body.mass),absf(body.linear_velocity.x-expected_speed)<maxf(.0005,expected_speed*.02),
{"massKg":body.mass,"speedMps":body.linear_velocity.x,"analyticSpeedMps":expected_speed})
check("lower_mass_increases_wind_acceleration",heavy.linear_velocity.x>.02 and light.linear_velocity.x>heavy.linear_velocity.x*9,
{"heavyLightSpeedsMps":[heavy.linear_velocity.x,light.linear_velocity.x]})
check("iron_still_air_drag_is_active",calm.air_force.dot(calm.linear_velocity)<0 and calm.linear_velocity.x<1.9999,
{"speedMps":calm.linear_velocity.x,"airForceX":calm.air_force.x})
for body in bodies:root.remove_child(body);body.queue_free()
await process_frame
# All production profiles keep their horizontal speed during free flight.
for kind in TYPES:
var body=lib.create_ball(kind)
root.add_child(body);body.position=Vector3(0,40,0)
body.linear_velocity=Vector3(4,0,0)
await physics_frame
var initial:Vector3=body.linear_velocity
await frames(120)
var delta:Vector3=body.linear_velocity-initial
check("gravity_only_in_air_"+kind,absf(delta.x)<.001 and absf(delta.y+9.81)<.02 and body.rolling_force.is_zero_approx() and body.physics_material_override.friction==0.0,{"velocity_change_1s":delta})
root.remove_child(body);body.queue_free()
var file:=FileAccess.open("res://playtest/artifacts/styled/ball_materials_report.json",FileAccess.WRITE)
file.store_string(JSON.stringify({"engine":Engine.get_version_info().string,"physicsHz":120,
"windSpeedMps":20,"windDurationSeconds":5,"windComparisons":wind_measurements,
"passed":results.size()-failures,"failed":failures,"results":results}," "));file.close()
print("BALL_MATERIALS_REPORT ",results.size()-failures," passed, ",failures," failed")
quit(1 if failures else 0)
+19 -5
View File
@@ -41,7 +41,7 @@ func run() -> void:
{"id":"wall2","kind":"wall","position":[0,2,0],"quarter":0}],"balls":[]})
app.select_category("balls");app.target=Vector3(0,1,0);app.camera_size=9;app.update_camera();await settle()
await click_world(app,Vector3(.1,3.001,.1))
check("mouse_picks_wall_top",app.ball_cursor.distance_to(Vector3(.1,3.32,.1))<.02 and no_overlap(app,app.ball_cursor),{"position":app.codec.array_from(app.ball_cursor)})
check("mouse_picks_wall_top",app.ball_cursor.is_equal_approx(Vector3(0,3.32,0)) and no_overlap(app,app.ball_cursor),{"position":app.codec.array_from(app.ball_cursor)})
await click_button(app.add_ball_button);await settle()
var original: Vector3=app.balls[0].position
await click_world(app,Vector3(2,0,1))
@@ -71,11 +71,15 @@ func run() -> void:
app.yaw=.72+quarter*PI/2;app.pitch=.95;app.camera_size=7;app.update_camera();await settle()
var record: Dictionary=app.records[0]
var transform:=Transform3D(Basis(Vector3.UP,-quarter*PI/2),app.lib.record_center(record))
var target: Vector3=transform*(app.lib.path_point(kind,.45)-Vector3.UP*float(app.lib.catalog[kind].grooveRadius))
var paths: Array = app.lib.catalog[kind].upperPaths
for branch in range(paths.size()):
var expected: Vector3 = (transform * app.lib.ball_on_surface(kind,.5,branch)).snapped(Vector3.ONE*.01)
# Both Y branches have distinct inlets; the outlet is shared.
for t in [.12, .35]:
var target: Vector3 = transform * (app.lib.path_point(kind,t,branch) - Vector3.UP * float(app.lib.catalog[kind].grooveRadius))
app.ball_cursor = Vector3(10,10,10)
await click_world(app,target)
var local: Vector3=transform.affine_inverse()*app.ball_cursor
var bounds: AABB=app.lib.record_bounds(record).grow(.35)
check("chute_pick_"+kind+"_"+str(quarter),bounds.has_point(app.ball_cursor) and no_overlap(app,app.ball_cursor) and local.y>.4,{"position":app.codec.array_from(app.ball_cursor)})
check("chute_midpoint_%s_%d_%d_%.2f" % [kind,quarter,branch,t],app.ball_cursor.is_equal_approx(expected) and no_overlap(app,app.ball_cursor),{"actual":app.ball_cursor,"expected":expected})
# The picked location must remain a normal rigid-body spawn, not attached to the track.
if kind=="gentle" and quarter==2:
await click_button(app.add_ball_button);await settle()
@@ -87,6 +91,16 @@ func run() -> void:
await click_world(app,Vector3(3,0,3))
check("simulation_blocks_ball_picking",app.ball_cursor.is_equal_approx(pending))
app.reset_simulation()
for kind in ["directional_boost","water","ice","goal_hole"]:
var level := empty_level()
level.entities = [{"id":"top","kind":kind,"position":[0,1,0],"quarter":1}]
app.apply_data(level)
app.select_category("balls")
app.pitch=1.1;app.camera_size=7;app.update_camera();await settle()
var top_y := 1.0 if kind=="goal_hole" else 2.0
app.ball_cursor = Vector3(10,10,10)
await click_world(app,Vector3(.42,top_y,.35))
check("entity_top_center_"+kind,app.ball_cursor.is_equal_approx(Vector3(0,top_y+.32,0)) and no_overlap(app,app.ball_cursor),{"actual":app.ball_cursor})
var seam:=empty_level()
seam.pieces=[{"id":"ramp","kind":"steep","position":[0,1,0],"quarter":0}]
seam.entities=[{"id":"back_wall","kind":"wall","position":[1,1.5,0],"quarter":0}]
+4 -2
View File
@@ -44,10 +44,12 @@ func run() -> void:
check("interactive_palette_exposes_boost",app.kind=="directional_boost" and app.boost_controls.is_visible_in_tree())
check("editor_has_fixed_gain_label_and_no_speed_input",app.boost_controls.find_children("*","SpinBox",true,false).is_empty() and app.boost_controls.find_children("*","Label",true,false).any(func(l):return l.text=="固定增速:+5 m/s"))
app.quarter=3;app.cursor=Vector3(2,0,-1);app.refresh_selection()
var preview=app.selection
check("standalone_preview_has_guide_and_arrow",preview.find_children("ink_boost_arrow_fill*","MeshInstance3D",true,false).size()==1 and preview.find_children("directional_boost*","MeshInstance3D",true,false).any(func(m):return is_equal_approx(m.mesh.get_aabb().size.y,1.32)))
await click(app.place_button);await frames(3)
var id: String=app.last_placed_id
check("gui_places_boost_without_gain_override",app.records.size()==1 and not app.records[0].has("speedGain") and app.records[0].quarter==3)
check("boost_retains_solid_wall_bounds",app.lib.record_bounds(app.records[0]).size==Vector3.ONE and app.pieces[0].find_children("*","StaticBody3D",true,false).size()==1)
check("boost_includes_permanent_guide_bounds",app.lib.record_bounds(app.records[0]).size.is_equal_approx(Vector3(1,1.32,1)) and app.pieces[0].find_children("*","StaticBody3D",true,false).size()==1)
app.select_record(id);app.cursor.y=1;await click(app.apply_button)
check("gui_moves_selected_boost",app.records[0].position.y==1)
app.undo();check("undo_restores_boost_position",app.records[0].position.y==0)
@@ -76,7 +78,7 @@ func run() -> void:
await load_case([{"id":"base","kind":"wall","position":[0,0,0],"quarter":0}],[])
app.select_category("interactive");app.cursor=Vector3(0,1,0);app.quarter=1;app.refresh_selection()
await click(app.place_button);await frames(3)
check("boost_stacks_on_wall",app.records.size()==2 and app.lib.record_bounds(app.records[1]).end.y==2)
check("boost_stacks_on_wall",app.records.size()==2 and is_equal_approx(app.lib.record_bounds(app.records[1]).end.y,2.32))
app.select_category("balls");await frames(3)
await click_point(app.camera.unproject_position(Vector3(0,2.001,0)))
check("mouse_places_ball_on_boost_top",app.ball_cursor.distance_to(Vector3(0,2.32,0))<.02)
+3 -2
View File
@@ -145,14 +145,15 @@ func run() -> void:
var name: String=kind+("_rolling" if rolling else "_sliding")
measurements.braking[name]={"wall":wall,"ice":ice}
check("wall_quick_stop_"+name,wall.speedMps<.1 and wall.stopSeconds>0 and wall.stopSeconds<1.2 and wall.distanceM<1.8,wall)
check("zero_native_friction_"+name,is_zero_approx(wall.nativeFriction) and is_zero_approx(ice.nativeFriction))
check("ice_remains_slippery_"+name,ice.distanceM>wall.distanceM+2 and ice.speedMps>1.5,ice)
# Wall side faces also select the same rough contact material.
# A loaded wall face brakes tangential travel with zero native friction.
for kind in TYPES:
await clear();piece("wall",Vector3.ZERO)
var body=ball(kind,Vector3(.802,.5,0));body.gravity_scale=0
await frames(3);body.freeze=false;body.constant_force=Vector3(-body.mass*9.81,0,0);body.linear_velocity=Vector3(0,0,1)
await frames(30)
check("wall_side_uses_high_friction_"+kind,body.active_surface=="wall" and body.physics_material_override.friction>=.9 and absf(body.linear_velocity.z)<.6,{"speedZ":body.linear_velocity.z,"surface":body.active_surface})
check("loaded_wall_side_uses_only_rolling_resistance_"+kind,body.active_surface=="wall" and is_zero_approx(body.physics_material_override.friction) and absf(body.linear_velocity.z)<.6,{"speedZ":body.linear_velocity.z,"surface":body.active_surface})
await clear()
# Real editor registry, flow rendering, ray selection, serialization, reset.
var app=load("res://designer/scenes/workshop.tscn").instantiate();root.add_child(app);await frames(3)
+2 -2
View File
@@ -50,7 +50,7 @@ func run() -> void:
var launcher:Dictionary=app.records[app.index_for("launcher")]
var bounds:AABB=lib.record_bounds(launcher)
var start_ball:Vector3=app.balls[0].position
check("L%d_ball_on_boost"%(index+1),launcher.kind=="directional_boost" and absf(start_ball.y-bounds.end.y-.32)<.0001 and absf(start_ball.x-bounds.get_center().x)<.5)
check("L%d_ball_on_boost"%(index+1),launcher.kind=="directional_boost" and absf(start_ball.y-launcher.position.y-lib.catalog.directional_boost.baseHeight-.32)<.0001 and absf(start_ball.x-bounds.get_center().x)<.5)
check("L%d_has_no_support_walls_or_grid_colliders"%(index+1),app.records.filter(func(r):return r.kind=="wall").all(func(r):return r.id=="stop") and app.slots_view.find_children("*","CollisionObject3D",true,false).is_empty() and app.ground_view.find_children("*","CollisionObject3D",true,false).is_empty())
# Empty virtual grids cannot catch a sphere or satisfy physics support.
var query:=PhysicsShapeQueryParameters3D.new();var shape:=SphereShape3D.new();shape.radius=.12
@@ -74,7 +74,7 @@ func run() -> void:
var boosts:Array=app.balls[0].boost_controller.events
var gain:=0.0
if boosts.size()==1:gain=Vector2(boosts[0].after.x,boosts[0].after.z).length()-Vector2(boosts[0].before.x,boosts[0].before.z).length()
check("L%d_boosted_floating_run_%d"%[index+1,repeat+1],app.solved and boosts.size()==1 and boosts[0].blockId=="launcher" and absf(gain-5)<.00001 and app.pieces.map(func(p):return p.global_transform)==originals,{"time":app.elapsed,"boosts":boosts.size(),"speed_gain":gain})
check("L%d_boosted_floating_run_%d"%[index+1,repeat+1],app.solved and boosts.size()==1 and boosts[0].blockId=="launcher" and absf(gain-app.Booster.SPEED_GAIN)<.00001 and app.pieces.map(func(p):return p.global_transform)==originals,{"time":app.elapsed,"boosts":boosts.size(),"speed_gain":gain})
var file:=FileAccess.open("res://playtest/artifacts/tutorial/floating_report.json",FileAccess.WRITE)
file.store_string(JSON.stringify({"passed":results.size()-failures,"failed":failures,"engine":Engine.get_version_info().string,"results":results}," "));file.close()
quit(1 if failures else 0)
+27
View File
@@ -12,8 +12,31 @@ func check(name: String, passed: bool, detail: Dictionary = {}) -> void:
if not passed:failures += 1
print(("PASS " if passed else "FAIL ") + name)
func check_supported_workshop_goal() -> void:
var workshop = load("res://designer/scenes/workshop.tscn").instantiate()
root.add_child(workshop)
workshop.apply_data({"schemaVersion":2, "pieces":[], "entities":[
{"id":"support", "kind":"wall", "position":[2,0,-1], "quarter":0},
{"id":"hole", "kind":"goal_hole", "position":[2,2,-1], "quarter":0}
], "balls":[{"id":"iron", "ballTypeId":"iron_ball", "position":[2.24,3.2,-1]}]})
await physics_frame
workshop.toggle_run()
for frame in range(360):
await physics_frame
var ball = workshop.balls[0]
check("workshop_scores_inside_supported_goal", workshop.events.size()==1
and workshop.events[0].goalId=="hole" and workshop.entered.size()==1
and workshop.status.begins_with("全部入洞") and not ball.visible and ball.position.y>1.3,
{"events":workshop.events.duplicate(true), "centerY":ball.position.y, "status":workshop.status})
root.remove_child(workshop)
workshop.queue_free()
func run() -> void:
await check_supported_workshop_goal()
var lib = Library.new()
check("skimming_above_mouth_does_not_score", not lib.crossed_goal(Vector3(-.3,.4,0),Vector3(.3,.3,0),Vector3.ZERO,.3))
check("grazing_throat_edge_does_not_score", not lib.crossed_goal(Vector3(.08,.4,0),Vector3(.08,-1.2,0),Vector3.ZERO,.3))
check("rising_from_below_does_not_score", not lib.crossed_goal(Vector3.DOWN*1.2,Vector3.UP,Vector3.ZERO,.3))
var arena := Node3D.new();root.add_child(arena)
var trials: Array = []
var offsets := [Vector2.ZERO,Vector2(.12,0),Vector2(.26,0),Vector2(.36,0),
@@ -60,6 +83,10 @@ func run() -> void:
app.started=false;app.unlocked=4;app.open_lesson(index)
for r in Maps.solution(app.lesson):
app.records.append({"id":r.id,"kind":r.kind,"position":app.lib.vector(r.position),"quarter":int(r.quarter)})
if index==0:
# Exercise a rolling approach with the exit sealed, as in the workshop.
var bottom: Vector3 = app.placement.bottom_of(app.goals[0])
app.records.append({"id":"support","kind":"wall","position":bottom-Vector3.UP,"quarter":0})
app.rebuild();app.reset_simulation()
for i in range(3):await physics_frame
app.toggle_run()
+32 -7
View File
@@ -70,6 +70,8 @@ func run() -> void:
var slope:=placement.align_surfaces(record("steep",Vector3(0,2,0),2),[launcher])
check("screenshot_reproduces_old_018_lip",absf(seam(record("steep",Vector3(0,2,0),2),launcher)-.18)<.00001)
check("screenshot_exact_y_182",absf(slope.position.y-1.82)<.00001 and seam(slope,launcher)<.00001)
var reverse_join := placement.align_surfaces(record("directional_boost",launcher.position+Vector3.UP*.5,0,"launcher"),[slope])
check("placing_launcher_second_joins_same_surface",reverse_join.position.is_equal_approx(launcher.position))
var wall:=record("wall",Vector3(-1,2,0),0,"wall")
check("top_click_still_stacks",placement.on_face(wall,Vector3(-1,3,0),Vector3.UP,"steep",2)==Vector3(-1,3,0))
check("wall_side_still_bottom_aligned",placement.on_face(wall,Vector3(-.5,2.5,0),Vector3.RIGHT,"wall",0)==Vector3(0,2,0))
@@ -81,14 +83,18 @@ func run() -> void:
# No direct initial velocity or test-only material overrides: normal iron,
# real launcher top contact, real imported solid meshes, all four rotations.
for kind in ["gentle","steep"]:
for quarter in range(4):await roll_across(kind,quarter)
for quarter in range(4):
for offset in [0.0,-.05,.05]:await roll_across(kind,quarter,offset)
var file:=FileAccess.open(Output,FileAccess.WRITE)
file.store_string(JSON.stringify({"engine":Engine.get_version_info().string,"passed":results.size()-failures,"failed":failures,"results":results}," "));file.close()
quit(1 if failures else 0)
func check_interfaces(launcher:Dictionary) -> void:
var app=load("res://designer/scenes/workshop.tscn").instantiate();root.add_child(app);await frames(3)
app.records=[launcher];app.rebuild();app.select_category("chutes");app.kind="steep";app.quarter=2
app.records=[launcher];app.rebuild()
var meshes:Array=app.pieces[0].find_children("*","MeshInstance3D",true,false)
check("standalone_launcher_has_rims_and_arrow",meshes.any(func(m):return not str(m.name).begins_with("ink_") and absf(m.mesh.get_aabb().size.y-1.32)<.001) and meshes.any(func(m):return str(m.name).begins_with("ink_boost_arrow_fill")))
app.select_category("chutes");app.kind="steep";app.quarter=2
app.target=Vector3(0,2,0);app.camera_size=8;app.update_camera();await frames(3)
await click(app.camera.unproject_position(Vector3(-.499,2.7,0)))
check("workshop_mouse_side_pick_aligns",not app.face_pick.is_empty() and absf(app.cursor.y-1.82)<.00001,{"cursor":str(app.cursor)})
@@ -123,27 +129,46 @@ func check_interfaces(launcher:Dictionary) -> void:
check("player_preview_matches_commit",index>=0 and app.records[index].position.is_equal_approx(preview))
root.remove_child(app);app.queue_free();await frames(3)
func roll_across(kind:String,quarter:int) -> void:
func roll_across(kind:String,quarter:int,offset:float) -> void:
var basis:=Basis(Vector3.UP,-quarter*PI/2)
var direction:Vector3=basis*Vector3.LEFT # local high end to low end
var launch:=record("directional_boost",-direction+Vector3.UP*2,(quarter+2)%4,"launch")
var slope:=placement.align_surfaces(record(kind,Vector3.UP*2,quarter,"slope"),[launch])
var tail:=placement.align_surfaces(record("straight",direction+Vector3.UP*2,quarter,"tail"),[slope])
var arena:=Node3D.new();root.add_child(arena)
for item in [launch,slope,tail]:
var pieces := [launch,slope,tail]
var across := direction.cross(Vector3.UP)
for item in pieces:
var piece:Node3D=lib.create_piece(item.kind,lib.record_center(item),item.quarter)
piece.set_meta("record_id",item.id);arena.add_child(piece)
var ball=lib.create_ball();ball.freeze=true;arena.add_child(ball)
ball.position=launch.position+Vector3.UP*(1+lib.ball_radius()+.02)
await frames(3);ball.freeze=false
ball.position=launch.position+Vector3.UP*(1+lib.ball_radius()+.02)+across*offset
await frames(3)
var mouth:Vector3 = launch.position + Vector3.UP + direction*.5
if offset==0:
# Compare both sides 1 mm from the joint, across floor, curved sides and rims.
var max_step := 0.0
for z in [-.45,-.32,-.25,-.15,0,.15,.25,.32,.45]:
var heights:Array[float]=[]
for side in [-1,1]:
var sample:Vector3=mouth+across*z+direction*.001*side
var ray:=PhysicsRayQueryParameters3D.create(sample+Vector3.UP,sample-Vector3.UP,1)
var hit:=arena.get_world_3d().direct_space_state.intersect_ray(ray)
heights.append(hit.position.y if not hit.is_empty() else INF)
max_step=maxf(max_step,absf(heights[0]-heights[1]))
check("%s_q%d_full_mouth" % [kind,quarter],max_step<.003,{"max_step_m":max_step})
ball.freeze=false
var entry_speed := -1.0
var contacts:Array=[];var crossed:=false;var time:=0.0
for tick in range(480):
await physics_frame;time=(tick+1)/120.0
if entry_speed<0 and (ball.position-mouth).dot(direction)>.06:
entry_speed=ball.linear_velocity.dot(direction)
for collider in ball.get_colliding_bodies():
var node:Node=collider
while node!=null and not node.has_meta("record_id"):node=node.get_parent()
if node!=null and node.get_meta("record_id") not in contacts:contacts.append(node.get_meta("record_id"))
if ball.position.dot(direction)>1.3 and "tail" in contacts:crossed=true;break
if ball.position.y<0:break
check("%s_q%d_real_ball_crosses_both_seams"%[kind,quarter],crossed and "slope" in contacts and ball.boost_controller.events.size()==1,{"contacts":contacts,"time":time,"final":str(ball.position),"slope_y":slope.position.y,"tail_y":tail.position.y,"boosts":ball.boost_controller.events.size()})
check("%s_q%d_offset_%.2f_real_ball"%[kind,quarter,offset],entry_speed>lib.Booster.SPEED_GAIN*.5 and crossed and "slope" in contacts and ball.boost_controller.events.size()==1,{"entry_speed_mps":entry_speed,"contacts":contacts,"time":time,"final":str(ball.position),"slope_y":slope.position.y,"tail_y":tail.position.y,"boosts":ball.boost_controller.events.size()})
root.remove_child(arena);arena.queue_free();await frames(3)
+1 -1
View File
@@ -115,7 +115,7 @@ func run() -> void:
check("L%d_gui_solution_enters_goal"%(index+1),app.solved and app.entered.size()==1 and app.lost.is_empty() and app.events.size()==1 and app.events[0].goalId=="goal" and required.all(func(id):return app.contact_ids.has(id)),{"time":app.elapsed,"contacts":app.contact_ids.keys(),"events":app.events})
if not app.solved:write_report();quit(1);return
var boosts:Array=app.balls[0].boost_controller.events
check("L%d_real_launch_block_fires_once"%(index+1),boosts.size()==1 and boosts[0].blockId=="launcher" and is_equal_approx(Vector2(boosts[0].after.x,boosts[0].after.z).length()-Vector2(boosts[0].before.x,boosts[0].before.z).length(),5.0))
check("L%d_real_launch_block_fires_once"%(index+1),boosts.size()==1 and boosts[0].blockId=="launcher" and is_equal_approx(Vector2(boosts[0].after.x,boosts[0].after.z).length()-Vector2(boosts[0].before.x,boosts[0].before.z).length(),app.Booster.SPEED_GAIN))
var accepted:Dictionary={"lesson":index+1,"time":app.elapsed,"layout":layout,"input_events":app.interface_events.duplicate(true),"contacts":app.contact_ids.keys(),"goal_events":app.events.duplicate(true),"trace":app.samples.duplicate(true),"launch_boosts":boosts.map(func(e):return {"blockId":e.blockId,"before":app.codec.array_from(e.before),"after":app.codec.array_from(e.after),"tick":e.tick})}
runs.append(accepted);save_json("%02d_accepted.json"%(index+1),accepted)
await snapshot("%02d_completed"%(index+1))
+7 -7
View File
@@ -18,15 +18,15 @@
水流固定为 **5 m/s**,由 [behavior.gd](../../assets/blocks/water/behavior.gd) 的常量定义;关卡只保存位置与朝向,没有逐块速度控件。额外写入的 `flowSpeed` 字段不会被载入为速度,也不保留在再次保存的文件中。
当前测试使用水密度 1000 kg/m³、水中阻力系数 0.47,三种球共用水的作用公式,保持原有质量、尺寸和空气响应配置。浸没体积通过球体竖直截柱与相邻水格范围的并集求得;浮力为排开水的重量,水阻力按相对流速计算。跨格不产生固体接缝,重叠体积不会重复提供浮力。不同流向接缝按浸没部分合成当前有效流速,是首版近似。
当前测试使用水密度 1000 kg/m³、水中阻力系数 0.47,三种球共用水的作用公式,保留原有质量和尺寸。浸没体积通过球体竖直截柱与相邻水格范围的并集求得;浮力为排开水的重量,水阻力按相对流速计算。跨格不产生固体接缝,重叠体积不会重复提供浮力。不同流向接缝按浸没部分合成当前有效流速,是首版近似。
当前是由作者铺设的固定水域,不进行水源扩散、水量守恒或河道流体求解。方块朝向指定局部流向;水不能把球穿过实际河岸。没有按球种类硬编码浮沉或锁定沉底球。
三球同时释放后,木球浮起并到达下游;330 kg 陶瓷球与铁球沉到粗糙墙壁河床,仍受水流作用。8 秒模拟时陶瓷球最大水平位移约 1.36 m、速度约 0.10 m/s;铁球位移约 0.38 m、速度约 0.039 m/s。木球到达尽头后会受到岸壁碰撞和摩擦,截图中的最终浸没比例不应当作为自由漂浮平衡比例。水速 5 m/s 不等于小球必须以 5 m/s 运动。
三球同时释放后,木球浮起并到达下游;330 kg 陶瓷球与铁球沉到粗糙墙壁河床,仍受水流作用。旧接触模型的 8 秒模拟中,陶瓷球最大水平位移约 1.36 m、速度约 0.10 m/s;铁球位移约 0.38 m、速度约 0.039 m/s。木球到达尽头后会受到岸壁碰撞和摩擦,截图中的最终浸没比例不应当作为自由漂浮平衡比例。水速 5 m/s 不等于小球必须以 5 m/s 运动。
## 冰块
冰块是静态实心 1×1×1 方块。与三种球的接触参数统一采用静摩擦 0.03、动摩擦 0.02、滚动阻力 0.002、恢复系数 0.02;配置见 [physics.json](../../assets/collections/storybook/physics.json)。
冰块是静态实心 1×1×1 方块。与三种球的接触参数统一采用滚动阻力 0.002、恢复系数 0.02;配置见 [physics.json](../../assets/collections/storybook/physics.json)。
破碎按一次真实接触事件的**法向冲量 1000 N·s**判定,接近速度需达到 0.5 m/s 以排除静态接触及低速噪声。冲量是力对碰撞时间的积分,这里不使用依赖物理步长的单帧“力峰值”。同一事件的接触点合并计算,持续承重不累计冲量;预测接触不会提前消耗本次撞击。破碎后移除该冰块的实体碰撞与外观,重置恢复完整冰块及判定状态。
@@ -44,11 +44,11 @@ Jolt 的接触冲量属于预估值,多物体同时接触时可能不精确。
## 墙壁减速
所有现用 `wall` 方块与三种球的接触参数均调整为静摩擦 **1.0**、动摩擦 **0.9**、滚动阻力 **0.8**、恢复系数 **0.02**。各面共享同一规则,无需逐块配置;滑槽、球洞、加速方块不因外观接近墙块而继承这些数值。
所有现用 `wall` 方块与三种球的运行时接触参数为滚动阻力 **0.8**、恢复系数 **0.02**。各面共享同一规则,无需逐块配置;滑槽、球洞、加速方块不因外观接近墙块而继承这些数值。
滑动摩擦由原生接触求解,滚动阻力通过受限力矩耗能;受压墙侧面也参与。没有按位置停止球、修改球质量或添加泥沙机制。当前仍沿用每刚体摩擦近似:同时接触多种表面时选择较粗糙的已配置接触对,不等价于独立逐接触材质求解。
原生接触摩擦为零。滚动阻力作用在承托面的切向,受压墙侧面也参与。多个接触同时存在时合成承托方向,只对球施加一次滚动阻力。
3 m/s 初速的专项测试中,三球从滑动开始约 0.40~0.41 秒、0.52 m 后降至停止容差;从纯滚动开始约 0.54 秒、0.81 m。停止容差为线速度低于 0.05 m/s。相同初态的冰面对照在 2 秒后仍有约 2.4~2.8 m/s。
旧接触模型的 3 m/s 初速专项测试中,三球从滑动开始约 0.40~0.41 秒、0.52 m 后降至停止容差;从纯滚动开始约 0.54 秒、0.81 m。停止容差为线速度低于 0.05 m/s。相同初态的冰面对照在 2 秒后仍有约 2.4~2.8 m/s。
可视墙面/冰面场景使用相同固定加速块从静止起步(+5 m/s);上述 3 m/s 初态只用于受控制动测量。
@@ -56,7 +56,7 @@ Jolt 的接触冲量属于预估值,多物体同时接触时可能不精确。
实际修改 [现用 physics.json](../../assets/collections/storybook/physics.json) 中对应预设的 `massKg`:原木 `wood_game`、陶瓷 `ceramic_game`、铁球 `solid_iron_test`。当前起始质量为 60 / 330 / 890.0760306150601 kg;330 kg 陶瓷球已正式应用,计算阶段的 75 kg 输入与原结果作为历史记录保留。质量改变后,运行时按原半径和惯量模型重新计算转动惯量,不需要重建模型。
每轮先明确预期,优先只改一种球的质量;固定水速、冰块阈值、表面接触参数、几何及对照初态。重跑相关场景,记录浮沉、冲量/破碎、停止时间和距离。三球从相同高度释放,不通过改变初速度或高度抵消质量变化;既有受风、入洞和加速回归仍在 `playtest/materials/`。
每轮先明确预期,优先只改一种球的质量;固定水速、冰块阈值、表面接触参数、几何及对照初态。重跑相关场景,记录浮沉、冲量/破碎、停止时间和距离。三球从相同高度释放,不通过改变初速度或高度抵消质量变化;自由飞行、入洞和加速回归仍在 `playtest/materials/`。
`test-environment` 与 `test-balls` 的断言包含当前质量、比例和玩法预期。调整后若失败,应先解释差异并确认新的目标,再更新预期;不能静默覆盖测试中的真实质量或为了通过而降低检查标准。将每轮实际配置、初态与报告保留到 `playtest/artifacts/environment/mass_tuning/<轮次>/`,完整约定见 [质量调校流程](../../references/design/physics_system.md#25-小球质量的持续调校)。
+2 -2
View File
@@ -88,8 +88,8 @@ func refresh_ui() -> void:
description.text={"water":"流速固定 5 m/s · 水面泡沫顺流漂动\n水体可穿入 · 河床/岸壁是独立墙块",
"ice":"同一高度从静止释放 · 冲量 ≥ 1000 N·s 破碎\n不累计静置承重 · 不是按球种类判定",
"rest":"三球直接放在冰面上 · 无释放落差\n检验重铁球持续承重也不会压碎冰块",
"wall":"固定加速块起步 +5 m/s · 粗糙墙面制动\n三种球使用相同的墙面接触规则",
"ice_slide":"相同加速起点 · 冰面低摩擦、低滚阻\n与墙面场景对比滑行距离"}[test_mode]
"wall":"固定加速块起步 +%.0f m/s · 粗糙墙面制动\n三种球使用相同的墙面接触规则" % Booster.SPEED_GAIN,
"ice_slide":"相同加速起点 · 冰面滚动阻力低\n与墙面场景对比滑行距离"}[test_mode]
var lines: PackedStringArray=[]
for i in range(balls.size()):
var ball=balls[i]
@@ -0,0 +1,13 @@
Godot Engine v4.7.2.stable.official.ed1daf0bf - https://godotengine.org
MASS_TRIAL 75.0 kg; x=8.20289516448975 m; final_y=1.93543541431427
MASS_TRIAL 114.0 kg; x=8.20000076293945 m; final_y=1.42689049243927
MASS_TRIAL 150.0 kg; x=8.20236778259277 m; final_y=1.30000948905945
MASS_TRIAL 200.0 kg; x=8.20000267028809 m; final_y=1.3000100851059
MASS_TRIAL 250.0 kg; x=7.8447847366333 m; final_y=1.30000996589661
MASS_TRIAL 300.0 kg; x=2.97876834869385 m; final_y=1.30000984668732
MASS_TRIAL 310.0 kg; x=2.23834562301636 m; final_y=1.30000984668732
MASS_TRIAL 330.0 kg; x=1.36199700832367 m; final_y=1.30000984668732
MASS_TRIAL 350.0 kg; x=1.11907255649567 m; final_y=1.29922604560852
MASS_TRIAL 400.0 kg; x=0.95344060659409 m; final_y=1.30000984668732
MASS_TRIAL 500.0 kg; x=0.73166847229004 m; final_y=1.2998274564743

Some files were not shown because too many files have changed in this diff Show More