Fix pickup billboards, AI stuck recovery, vehicle top speeds, and add Revision assets

This commit is contained in:
Luxferre committed 2026-12-01 13:59:43 +02:00
1 parent d001f214aa
commit 5a42ca9968
48 files changed
+995 -160

No files matched your search

+51 -6
View File
@@ -381,23 +381,23 @@ int main() {
CHECK(c.curr_pose.pos.y >= deck_y + 0.14f);
}
// 9c. Sheer terrain cliff blocking (Level 1 z=58..59) vs downhill drop clearance (Level 5 (22,99))
// 9c. Sheer terrain cliff blocking (Level 1 x=34..35) vs downhill drop clearance (Level 5 (22,99))
{
sim::CraftState cliff_car;
cliff_car.id = 0;
cliff_car.vehicle_idx = 0;
cliff_car.curr_pose.pos = Vec3(28.5f, lvl1.sample_height_world(28.5f, 57.5f) + 0.28f, 57.5f);
cliff_car.curr_pose.yaw = 0.0f;
cliff_car.curr_pose.pos = Vec3(32.5f, lvl1.sample_height_world(32.5f, 57.5f) + 0.28f, 57.5f);
cliff_car.curr_pose.yaw = kHalfPi;
cliff_car.prev_pose = cliff_car.curr_pose;
cliff_car.vel = Vec3(0.0f, 0.0f, 14.0f);
cliff_car.vel = Vec3(14.0f, 0.0f, 0.0f);
cliff_car.fuel = cliff_car.max_fuel = 100.0f;
CraftInput in;
in.throttle = 1.0f;
for (int t = 0; t < 40; ++t) {
sim::step_craft_physics(cliff_car, in, lvl1, dt, false);
}
CHECK(cliff_car.curr_pose.pos.z < 58.65f);
CHECK(cliff_car.curr_pose.pos.y < 1.0f);
CHECK(cliff_car.curr_pose.pos.x < 33.85f);
CHECK(cliff_car.curr_pose.pos.y < 0.0f);
sim::CraftState drop_car;
drop_car.id = 0;
@@ -434,5 +434,50 @@ int main() {
trapped.curr_pose.pos.y));
}
std::cout << "[PASS] Sloped column, overpass deck, cliff wall, downhill drop & escape verified\n";
// 10. Verify all 6 vehicles accelerate to strictly distinct stat-ordered cruise and boost top speeds
{
assets::LevelData flat_lvl;
flat_lvl.map.resize(assets::kMapWidth * assets::kMapHeight);
for (auto& m : flat_lvl.map) {
m.height = 2048;
m.tex_or_col = 0;
}
float dt = static_cast<float>(FixedStepClock::kFixedDt);
auto measure_max_speed = [&](int veh_idx, bool with_boost) -> float {
sim::CraftState c;
c.id = 0;
c.vehicle_idx = veh_idx;
c.curr_pose.pos = Vec3(15.0f, 0.28f, 80.0f);
c.curr_pose.yaw = kHalfPi;
c.prev_pose = c.curr_pose;
c.fuel = c.max_fuel = 1000.0f;
c.shield = c.max_shield = 100.0f;
CraftInput in;
in.throttle = 1.0f;
in.boost = with_boost;
for (int t = 0; t < 270; ++t) { // 4.5 seconds unobstructed +X run (kMapWidth = 256)
sim::step_craft_physics(c, in, flat_lvl, dt, false);
}
return c.speed_horizontal();
};
// Ordered strictly from lowest stat_speed to highest: Jugga(4) < Beserker(5) < Speeder(7) < Flexiwing(8) < Outrider(9) < Vampyr(10)
constexpr int kSpeedOrder[6] = {2, 1, 0, 5, 4, 3};
float cruise[6]{};
float boosted[6]{};
for (int v = 0; v < 6; ++v) {
cruise[v] = measure_max_speed(v, false);
boosted[v] = measure_max_speed(v, true);
}
for (int k = 0; k < 5; ++k) {
int va = kSpeedOrder[k];
int vb = kSpeedOrder[k + 1];
CHECK(cruise[vb] - cruise[va] >= 1.2f);
CHECK(boosted[vb] - boosted[va] >= 1.8f);
}
CHECK(cruise[3] - cruise[2] >= 8.5f); // Vampyr vs Jugga
std::cout << "[PASS] Vehicle top speeds & boost velocities strictly differentiate all 6 crafts\n";
}
return 0;
}