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
+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",
+1 -1
View File
@@ -28,4 +28,4 @@
"assetId": "water"
}
]
}
}
+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.
+14 -10
View File
@@ -83,17 +83,21 @@ 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':
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)
check['arrowTipBlender']=list(tip)
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:
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],
[list(p.vertices) for p in obj.data.polygons])