Enable Tracks 7-9 across menus, loaders, modes, tests, and update README

This commit is contained in:
Luxferre committed 2026-12-01 14:18:37 +02:00
1 parent 5a42ca9968
commit fc76e447fe
15 files changed
+256 -103

No files matched your search

+14 -6
View File
@@ -32,11 +32,13 @@ int main() {
Vfs vfs;
CHECK(vfs.init(HIOCTANE_DEFAULT_DATA_DIR));
// 1. Palette & ColorTables (0..5)
CHECK(assets::count_available_tracks(vfs) == 9);
// 1. Palette & ColorTables (0..8)
Palette pal;
CHECK(pal.load(vfs));
CHECK(pal.colors[1].a == 255);
for (int w = 0; w < 6; ++w) {
for (int w = 0; w < 9; ++w) {
ColorTables tbl;
CHECK(tbl.load(vfs, w, pal));
WorldTextures wtex;
@@ -44,16 +46,22 @@ int main() {
CHECK(wtex.tile_rgba.size() == 256u * 64u * 64u * 4u);
CHECK(wtex.sky_rgba.size() == 256u * 256u * 4u);
}
std::cout << "[PASS] Palette, 6 ColorTables, 6 WorldTextures & Skies\n";
std::cout << "[PASS] Palette, 9 ColorTables, 9 WorldTextures & Skies\n";
// 2. All 6 Levels (decompression, CRC16, entities, columns, blocks, waypoints, checkpoints)
for (int l = 1; l <= 6; ++l) {
// 2. All 9 Levels (decompression, CRC16, entities, columns, blocks, waypoints, checkpoints)
for (int l = 1; l <= 9; ++l) {
LevelData lvl;
CHECK(lvl.load(vfs, l));
CHECK(lvl.map.size() == kMapWidth * kMapHeight);
CHECK(!lvl.main_waypoints.empty());
CHECK(!lvl.checkpoints.empty());
CHECK(lvl.checkpoints[0].index == 0);
for (const auto& cp : lvl.checkpoints) {
CHECK(cp.x0 != cp.x1 || cp.z0 != cp.z1);
}
if (l == 7) {
CHECK(lvl.checkpoints.size() == 6);
}
// Verify all referenced columns & floor tiles are within valid bounds
int col_cells = 0;
@@ -80,7 +88,7 @@ int main() {
<< " pickups=" << lvl.pickups.size()
<< " h=[" << min_h << ".." << max_h << "]\n";
}
std::cout << "[PASS] All 6 Levels parsed & validated\n";
std::cout << "[PASS] All 9 Levels parsed & validated\n";
// 3. Object texture atlases & all 3D models in OBJECTS/DATA/
ObjectTextureAtlas obj_atlas;
+36 -9
View File
@@ -8,6 +8,7 @@
#include <algorithm>
#include <cmath>
#include <filesystem>
#include <fstream>
#include <iostream>
using namespace top_octane;
@@ -109,14 +110,16 @@ int main() {
std::filesystem::remove_all(tmp_dir);
{
game::ChampionshipState ch;
ch.start_new("ACE", 3, 7, 1);
ch.start_new("ACE", 3, 7, 1, 8);
ch.record_race_results(sim.crafts());
CHECK(ch.current_track == 2);
CHECK(ch.total_tracks == 8);
CHECK(ch.save_slot(tmp_dir, 0));
game::ChampionshipState loaded;
CHECK(loaded.load_slot(tmp_dir, 0));
CHECK(loaded.current_track == 2);
CHECK(loaded.total_tracks == 8);
CHECK(loaded.player_name == "ACE");
CHECK(loaded.drivers[0].points == ch.drivers[0].points);
@@ -124,19 +127,43 @@ int main() {
hs.clear();
int flags = hs.submit_race(1, sim.crafts());
CHECK((flags & 3) == 3);
int flags9 = hs.submit_race(9, sim.crafts());
CHECK((flags9 & 3) == 3);
CHECK(hs.save(tmp_dir / "hiscores.dat"));
game::HighscoreTable hs2;
CHECK(hs2.load(tmp_dir / "hiscores.dat"));
CHECK(hs2.tracks[0].best_lap == hs.tracks[0].best_lap);
CHECK(game::save_clone_recording(tmp_dir, rec));
CHECK(std::abs(hs2.tracks[8].best_lap - hs.tracks[8].best_lap) < 1e-6f);
// Legacy V1 highscores backwards-compatibility (6 entries)
{
std::ofstream ofs(tmp_dir / "hiscores_v1.dat", std::ios::trunc);
ofs << "TOPOCTANE_HISCORE_V1\n";
for (int i = 0; i < 6; ++i) {
ofs << (12.5f + i) << " " << (42.0f + i) << "\nLEGACY" << i << "\nLEGACYR" << i << "\n";
}
}
game::HighscoreTable hs_v1;
CHECK(hs_v1.load(tmp_dir / "hiscores_v1.dat"));
CHECK(std::abs(hs_v1.tracks[0].best_lap - 12.5f) < 1e-5f);
CHECK(hs_v1.tracks[0].best_lap_driver == "LEGACY0");
CHECK(hs_v1.tracks[8].best_lap == 0.0f);
CHECK(game::save_clone_recording(tmp_dir, rec));
sim::CloneRecording rec2;
CHECK(game::load_clone_recording(tmp_dir, 1, rec2));
CHECK(rec2.frames.size() == rec.frames.size());
sim::CloneRecording rec7 = rec;
rec7.track_number = 7;
CHECK(game::save_clone_recording(tmp_dir, rec7));
sim::CloneRecording rec7_out;
CHECK(game::load_clone_recording(tmp_dir, 7, rec7_out));
CHECK(rec7_out.track_number == 7 && rec7_out.frames.size() == rec7.frames.size());
}
std::filesystem::remove_all(tmp_dir);
std::cout << "[PASS] Championship save/load, Highscores & Clone disk round-trip validated\n";
std::cout << "[PASS] Championship save/load, 9-track Highscores (V1/V2) & Clone disk round-trip validated\n";
// 5. Gameplay Rule Toggles (fuel, weapons, damage, pickups, track morphing)
{
@@ -636,8 +663,8 @@ int main() {
// 8. Authentic Pitstop Fuel / Shield / Ammo Charger Bays
{
const size_t expected_pad_counts[6] = {3, 3, 3, 7, 6, 7};
for (int l = 1; l <= 6; ++l) {
const size_t expected_pad_counts[9] = {3, 3, 3, 7, 6, 7, 4, 4, 3};
for (int l = 1; l <= 9; ++l) {
assets::LevelData lvl;
CHECK(lvl.load(vfs, l));
CHECK(lvl.pads.size() == expected_pad_counts[l - 1]);
@@ -780,7 +807,7 @@ int main() {
CHECK(p1.fuel <= 20.0f);
}
}
std::cout << "[PASS] Authentic pitstop Fuel/Shield/Ammo chargers verified across all 6 tracks\n";
std::cout << "[PASS] Authentic pitstop Fuel/Shield/Ammo chargers verified across all 9 tracks\n";
// 9. Original Explosions, Volumetric Smoke Trails, Wreck Plumes & Steam Vents
{
@@ -1003,8 +1030,8 @@ int main() {
}
std::cout << "[PASS] Authentic pickup subtypes (upgrades, double caps, invincible, invisible) validated\n";
// 11. Full 8-racer AI anti-stuck & progression check across all 6 tracks
for (int l = 1; l <= 6; ++l) {
// 11. Full 8-racer AI anti-stuck & progression check across all 9 tracks
for (int l = 1; l <= 9; ++l) {
assets::LevelData lvl;
CHECK(lvl.load(vfs, l));
sim::RaceSetup ms;
@@ -1053,7 +1080,7 @@ int main() {
}
CHECK(progressed >= 6);
}
std::cout << "[PASS] All 6 tracks 8-racer AI anti-stuck & progression validated\n";
std::cout << "[PASS] All 9 tracks 8-racer AI anti-stuck & progression validated\n";
return 0;
}
+9 -9
View File
@@ -24,8 +24,8 @@ int main() {
Vfs vfs;
CHECK(vfs.init(HIOCTANE_DEFAULT_DATA_DIR));
// 1. Verify starting grid across all 6 levels is collision-free and finite
for (int l = 1; l <= 6; ++l) {
// 1. Verify starting grid across all 9 levels is collision-free and finite
for (int l = 1; l <= 9; ++l) {
assets::LevelData lvl;
CHECK(lvl.load(vfs, l));
@@ -57,7 +57,7 @@ int main() {
}
}
}
std::cout << "[PASS] Start grid valid & collision-free across all 6 tracks\n";
std::cout << "[PASS] Start grid valid & collision-free across all 9 tracks\n";
// 2. Verify fixed-step determinism (running two identical sims produces bit-identical state)
assets::LevelData lvl1;
@@ -250,8 +250,8 @@ int main() {
}
std::cout << "[PASS] Overhead gantry overpass & ceiling clamping verified\n";
// 7. All 6 tracks 1-lap autopilot completion
for (int l = 1; l <= 6; ++l) {
// 7. All 9 tracks 1-lap autopilot completion
for (int l = 1; l <= 9; ++l) {
assets::LevelData lvl;
CHECK(lvl.load(vfs, l));
sim::RaceSetup setup;
@@ -272,12 +272,12 @@ int main() {
<< " time=" << p1.race_time << "s\n";
CHECK(p1.finished);
}
std::cout << "[PASS] 1-lap autopilot completion verified across all 6 tracks\n";
std::cout << "[PASS] 1-lap autopilot completion verified across all 9 tracks\n";
// 8. 8-direction full-boost ramming stress test across all 6 tracks (0 column/cliff traps)
// 8. 8-direction full-boost ramming stress test across all 9 tracks (0 column/cliff traps)
{
float dt = static_cast<float>(FixedStepClock::kFixedDt);
for (int l = 1; l <= 6; ++l) {
for (int l = 1; l <= 9; ++l) {
assets::LevelData lvl;
CHECK(lvl.load(vfs, l));
for (const auto& wp : lvl.main_waypoints) {
@@ -322,7 +322,7 @@ int main() {
}
}
}
std::cout << "[PASS] 8-direction boost ramming stress test: 0 texture/cliff traps across all 6 tracks\n";
std::cout << "[PASS] 8-direction boost ramming stress test: 0 texture/cliff traps across all 9 tracks\n";
// 9. Targeted containment, bridge deck, cliff, and escape edge cases
{
+6 -6
View File
@@ -25,8 +25,8 @@ int main() {
assets::Palette pal;
CHECK(pal.load(vfs));
// Verify CPU geometry generation for all 6 tracks
for (int l = 1; l <= 6; ++l) {
// Verify CPU geometry generation for all 9 tracks
for (int l = 1; l <= 9; ++l) {
assets::LevelData lvl;
CHECK(lvl.load(vfs, l));
@@ -129,15 +129,15 @@ int main() {
<< " column_tris=" << geo.column_indices.size() / 3 << "\n";
}
// Verify TRACK0-1 full track silhouette preview sprites for all 6 tracks
// Verify TRACK0-1 full track silhouette preview sprites for all 9 tracks
{
assets::SpriteBank track_bank;
CHECK(track_bank.load(vfs, "DATA/TRACK0-1.DAT", "DATA/TRACK0-1.TAB", pal));
static constexpr int kPreviewIndices[6] = {1, 3, 6, 7, 9, 11};
static constexpr int kPreviewIndices[9] = {1, 3, 6, 7, 9, 11, 12, 14, 15};
for (int idx : kPreviewIndices) {
CHECK(static_cast<size_t>(idx) < track_bank.sprites.size());
const auto& sp = track_bank.sprites[idx];
CHECK(sp.width >= 50 && sp.height >= 90);
CHECK(sp.width >= 24 && sp.height >= 90);
CHECK(!sp.rgba.empty());
}
}
@@ -176,6 +176,6 @@ int main() {
CHECK(mg.indices.size() == mesh.triangles.size() * 3u);
}
std::cout << "[PASS] All 6 Levels & Vehicle 3D Render Geometry validated\n";
std::cout << "[PASS] All 9 Levels & Vehicle 3D Render Geometry validated\n";
return 0;
}