diff --git a/red4ext/EdgeWeightGPS/src/Main.cpp b/red4ext/EdgeWeightGPS/src/Main.cpp index 0f3dd1e..411c0e9 100644 --- a/red4ext/EdgeWeightGPS/src/Main.cpp +++ b/red4ext/EdgeWeightGPS/src/Main.cpp @@ -178,8 +178,10 @@ constexpr uintptr_t kGpsFilteredCostProviderVtableRva = 0x2AE60F8; constexpr uintptr_t kGpsAuxMultiplierRva = 0x040BB00; constexpr uintptr_t kGpsNodeMultiplierRva = 0x040BB40; constexpr uintptr_t kGpsCostMultiplierTableRva = 0x3154D28; -constexpr uint64_t kGpsResolveTraceWindowMs = 5000; -constexpr uint32_t kGpsResolveSelectedRetLogLimit = 4096; +constexpr uint64_t kGpsResolveTraceWindowMs = 1200; +constexpr uint32_t kGpsResolveSelectedRetLogLimit = 24; +constexpr uint32_t kGpsResolveStartupLogLimit = 8; +constexpr uint32_t kGpsResolveVerboseDumpLimit = 4; constexpr std::array kGpsPatchedCostMultipliers = { 12.0f, 7.0f, 2.5f, 0.0f, 3.0f, 2.0f, 1.25f, }; @@ -4011,7 +4013,7 @@ int32_t DetourGpsResolveHandle(void* aGraph, uint64_t aHandle, void* aOutSegment shouldLog = result >= 0 && hasSegment && hasPoint && ((IsSelectedGpsResolveReturnRva(returnRva) && inTraceWindow && returnCallCount < kGpsResolveSelectedRetLogLimit) || - callCount < 32); + callCount < kGpsResolveStartupLogLimit); } if (shouldLog) @@ -4044,13 +4046,19 @@ int32_t DetourGpsResolveHandle(void* aGraph, uint64_t aHandle, void* aOutSegment AppendPointerWithRva(line, "segment_p30", aux30); AppendPointerWithRva(line, "segment_p38", aux38); AppendGpsPointSummary(line, "pointSummary", point); - AppendBytesPointer(line, "segment_raw68", segment, 0x68); - AppendBytesPointer(line, "point_raw14", point, 0x14); - AppendBytesPointer(line, "segment_p08_raw30", segmentMeta, 0x30); - AppendBytesPointer(line, "segment_p20_raw40", aux20, 0x40); - AppendBytesPointer(line, "segment_p28_point_raw18", aux28Point, 0x18); - AppendBytesPointer(line, "segment_p30_raw40", aux30, 0x40); - AppendBytesPointer(line, "segment_p38_raw40", aux38, 0x40); + const auto shouldDumpBytes = + callCount < kGpsResolveVerboseDumpLimit || returnCallCount < kGpsResolveVerboseDumpLimit; + line << " dump=" << (shouldDumpBytes ? 1 : 0); + if (shouldDumpBytes) + { + AppendBytesPointer(line, "segment_raw68", segment, 0x68); + AppendBytesPointer(line, "point_raw14", point, 0x14); + AppendBytesPointer(line, "segment_p08_raw30", segmentMeta, 0x30); + AppendBytesPointer(line, "segment_p20_raw40", aux20, 0x40); + AppendBytesPointer(line, "segment_p28_point_raw18", aux28Point, 0x18); + AppendBytesPointer(line, "segment_p30_raw40", aux30, 0x40); + AppendBytesPointer(line, "segment_p38_raw40", aux38, 0x40); + } if (gActiveGpsRouteProducerCall != UINT32_MAX) { line << " routeProducerCall=" << gActiveGpsRouteProducerCall;