138 std::stringstream Info;
144 File.open(Filename2, std::ios::binary);
147 Info <<
"File " << Filename2 <<
" not found on server\n";
152 bool bFramePrinted =
false;
155 auto PrintFrame = [
this](std::stringstream& Info)
181 bFramePrinted =
true;
184 bFramePrinted =
false;
189 ReadValue<uint16_t>(
File, Total);
190 if (Total > 0 && !bFramePrinted)
193 bFramePrinted =
true;
195 for (i = 0; i < Total; ++i)
205 Info <<
" " << TCHAR_TO_UTF8(*Att.Id) <<
" = " << TCHAR_TO_UTF8(*Att.Value) << std::endl;
212 ReadValue<uint16_t>(
File, Total);
213 if (Total > 0 && !bFramePrinted)
216 bFramePrinted =
true;
219 Info <<
" Weathers: " << Total << std::endl;
220 for (i = 0; i < Total; ++i)
242 ReadValue<uint16_t>(
File, Total);
243 if (Total > 0 && !bFramePrinted)
246 bFramePrinted =
true;
248 for (i = 0; i < Total; ++i)
257 ReadValue<uint16_t>(
File, Total);
258 if (Total > 0 && !bFramePrinted)
261 bFramePrinted =
true;
263 for (i = 0; i < Total; ++i)
273 ReadValue<uint16_t>(
File, Total);
274 if (Total > 0 && !bFramePrinted)
277 bFramePrinted =
true;
279 for (i = 0; i < Total; ++i)
296 ReadValue<uint16_t>(
File, Total);
297 if (Total > 0 && !bFramePrinted)
300 bFramePrinted =
true;
302 Info <<
" Positions: " << Total << std::endl;
303 for (i = 0; i < Total; ++i)
317 ReadValue<uint16_t>(
File, Total);
318 if (Total > 0 && !bFramePrinted)
321 bFramePrinted =
true;
323 Info <<
" State traffic lights: " << Total << std::endl;
324 for (i = 0; i < Total; ++i)
339 ReadValue<uint16_t>(
File, Total);
340 if (Total > 0 && !bFramePrinted)
343 bFramePrinted =
true;
345 Info <<
" Vehicle animations: " << Total << std::endl;
346 for (i = 0; i < Total; ++i)
360 ReadValue<uint16_t>(
File, Total);
361 if (Total > 0 && !bFramePrinted)
364 bFramePrinted =
true;
366 Info <<
" Vehicle wheel animations: " << Total << std::endl;
367 for (i = 0; i < Total; ++i)
373 Info <<
" Location: " <<
static_cast<int>(Wheel.Location) <<
374 " Steering: " << Wheel.SteeringAngle <<
375 " Tire rotation: " << Wheel.TireRotation << std::endl;
387 ReadValue<uint16_t>(
File, Total);
388 if (Total > 0 && !bFramePrinted)
391 bFramePrinted =
true;
393 Info <<
" Walker animations: " << Total << std::endl;
394 for (i = 0; i < Total; ++i)
408 ReadValue<uint16_t>(
File, Total);
409 if (Total > 0 && !bFramePrinted)
412 bFramePrinted =
true;
414 Info <<
" Biker animations: " << Total << std::endl;
415 for (i = 0; i < Total; ++i)
430 ReadValue<uint16_t>(
File, Total);
431 if (Total > 0 && !bFramePrinted)
434 bFramePrinted =
true;
436 Info <<
" Vehicle door animations: " << Total << std::endl;
437 for (i = 0; i < Total; ++i)
444 std::string opened_doors_list;
447 Info <<
" Doors opened: ";
449 Info <<
" Front Left " << std::endl;
451 Info <<
" Front Right " << std::endl;
453 Info <<
" Rear Left " << std::endl;
455 Info <<
" Rear Right " << std::endl;
457 Info <<
" Hood " << std::endl;
459 Info <<
" Trunk " << std::endl;
461 Info <<
" All " << std::endl;
473 ReadValue<uint16_t>(
File, Total);
474 if (Total > 0 && !bFramePrinted)
477 bFramePrinted =
true;
479 Info <<
" Vehicle light animations: " << Total << std::endl;
480 for (i = 0; i < Total; ++i)
486 std::string enabled_lights_list;
488 enabled_lights_list +=
"Position ";
490 enabled_lights_list +=
"LowBeam ";
492 enabled_lights_list +=
"HighBeam ";
494 enabled_lights_list +=
"Brake ";
495 if (
State.RightBlinker)
496 enabled_lights_list +=
"RightBlinker ";
497 if (
State.LeftBlinker)
498 enabled_lights_list +=
"LeftBlinker ";
500 enabled_lights_list +=
"Reverse ";
502 enabled_lights_list +=
"Interior ";
504 enabled_lights_list +=
"Fog ";
506 enabled_lights_list +=
"Special1 ";
508 enabled_lights_list +=
"Special2 ";
510 if (enabled_lights_list.size())
513 enabled_lights_list.substr(0, enabled_lights_list.size() - 1) << std::endl;
529 ReadValue<uint16_t>(
File, Total);
530 if (Total > 0 && !bFramePrinted)
533 bFramePrinted =
true;
535 Info <<
" Scene light changes: " << Total << std::endl;
536 for (i = 0; i < Total; ++i)
553 ReadValue<uint16_t>(
File, Total);
554 if (Total > 0 && !bFramePrinted)
557 bFramePrinted =
true;
559 Info <<
" Dynamic actors: " << Total << std::endl;
560 for (i = 0; i < Total; ++i)
565 <<
" angular_velocity: ("
578 ReadValue<uint16_t>(
File, Total);
579 if (Total > 0 && !bFramePrinted)
582 bFramePrinted =
true;
584 Info <<
" Actor bounding boxes: " << Total << std::endl;
585 for (i = 0; i < Total; ++i)
607 ReadValue<uint16_t>(
File, Total);
608 if (Total > 0 && !bFramePrinted)
611 bFramePrinted =
true;
613 Info <<
" Actor trigger volumes: " << Total << std::endl;
614 for (i = 0; i < Total; ++i)
639 bFramePrinted =
true;
656 bFramePrinted =
true;
669 ReadValue<uint16_t>(
File, Total);
670 if (Total > 0 && !bFramePrinted)
673 bFramePrinted =
true;
676 Info <<
" Physics Control events: " << Total <<
'\n';
677 for (i = 0; i < Total; ++i)
683 <<
" max_torque = " << Control.max_torque <<
'\n'
684 <<
" max_rpm = " << Control.max_rpm <<
'\n'
685 <<
" MOI = " << Control.rev_up_moi <<
'\n'
686 <<
" rev_down_rate = " << Control.rev_down_rate <<
'\n'
687 <<
" differential_type = " << Control.differential_type <<
'\n'
688 <<
" front_rear_split = " << Control.front_rear_split <<
'\n'
689 <<
" use_gear_auto_box = " << (Control.use_automatic_gears ?
"true" :
"false") <<
'\n'
690 <<
" gear_change_time = " << Control.gear_change_time <<
'\n'
691 <<
" final_ratio = " << Control.final_ratio <<
'\n'
692 <<
" change_up_rpm = " << Control.change_up_rpm <<
'\n'
693 <<
" change_down_rpm = " << Control.change_down_rpm <<
'\n'
694 <<
" transmission_efficiency = " << Control.transmission_efficiency <<
'\n'
695 <<
" mass = " << Control.mass <<
'\n'
696 <<
" drag_coefficient = " << Control.drag_coefficient <<
'\n'
697 <<
" center_of_mass = " <<
"(" << Control.center_of_mass.x <<
", " << Control.center_of_mass.y <<
", " << Control.center_of_mass.z <<
")" <<
'\n';
698 Info <<
" torque_curve =";
699 for (
auto& vec : Control.torque_curve)
701 Info <<
" (" << vec.x <<
", " << vec.y <<
")";
704 Info <<
" steering_curve =";
705 for (
auto& vec : Control.steering_curve)
707 Info <<
" (" << vec.x <<
", " << vec.y <<
")";
710 Info <<
" forward_gear_ratios:" <<
'\n';
712 for (
auto& Gear : Control.forward_gear_ratios)
714 Info <<
" gear " << count <<
": ratio " << Gear <<
'\n';
717 Info <<
" reverse_gear_ratios:" <<
'\n';
719 for (
auto& Gear : Control.reverse_gear_ratios)
721 Info <<
" gear " << count <<
": ratio " << Gear <<
'\n';
726 for (
auto& Wheel : Control.wheels)
728 Info <<
"\nwheel #" << Index <<
":\n"
729 " axle_type: " << Wheel.axle_type <<
731 " wheel_radius: " << Wheel.wheel_radius <<
732 " wheel_width: " << Wheel.wheel_width <<
733 " wheel_mass: " << Wheel.wheel_mass <<
734 " cornering_stiffness: " << Wheel.cornering_stiffness <<
735 " friction_force_multiplier: " << Wheel.friction_force_multiplier <<
736 " side_slip_modifier: " << Wheel.side_slip_modifier <<
737 " slip_threshold: " << Wheel.slip_threshold <<
738 " skid_threshold: " << Wheel.skid_threshold <<
739 " max_steer_angle: " << Wheel.max_steer_angle <<
740 " affected_by_steering: " << Wheel.affected_by_steering <<
741 " affected_by_brake: " << Wheel.affected_by_brake <<
742 " affected_by_handbrake: " << Wheel.affected_by_handbrake <<
743 " affected_by_engine: " << Wheel.affected_by_engine <<
744 " abs_enabled: " << Wheel.abs_enabled <<
745 " traction_control_enabled: " << Wheel.traction_control_enabled <<
746 " max_wheelspin_rotation: " << Wheel.max_wheelspin_rotation <<
747 " external_torque_combine_method: " << Wheel.external_torque_combine_method <<
748 " lateral_slip_graph: " <<
FormatCurveLike(Wheel.lateral_slip_graph) <<
750 " suspension_force_offset: " <<
FormatVectorLike(Wheel.suspension_force_offset) <<
751 " suspension_max_raise: " << Wheel.suspension_max_raise <<
752 " suspension_max_drop: " << Wheel.suspension_max_drop <<
753 " suspension_damping_ratio: " << Wheel.suspension_damping_ratio <<
754 " wheel_load_ratio: " << Wheel.wheel_load_ratio <<
755 " spring_rate: " << Wheel.spring_rate <<
756 " spring_preload: " << Wheel.spring_preload <<
757 " suspension_smoothing: " << Wheel.suspension_smoothing <<
758 " rollbar_scaling: " << Wheel.rollbar_scaling <<
759 " sweep_shape: " << Wheel.sweep_shape <<
760 " sweep_type: " << Wheel.sweep_type <<
761 " max_brake_torque: " << Wheel.max_brake_torque <<
762 " max_hand_brake_torque: " << Wheel.max_hand_brake_torque <<
763 " wheel_index: " << Wheel.wheel_index <<
779 ReadValue<uint16_t>(
File, Total);
780 if (Total > 0 && !bFramePrinted)
783 bFramePrinted =
true;
786 Info <<
" Traffic Light time events: " << Total << std::endl;
787 for (i = 0; i < Total; ++i)
804 ReadValue<uint16_t>(
File, Total);
805 if (Total > 0 && !bFramePrinted)
808 bFramePrinted =
true;
811 Info <<
" Walkers Bones: " << Total << std::endl;
812 for (i = 0; i < Total; ++i)
819 Info <<
" Bone: \"" << TCHAR_TO_UTF8(*Bone.Name) <<
"\" relative: " <<
"Loc("
820 << Bone.Location.X <<
", " << Bone.Location.Y <<
", " << Bone.Location.Z <<
") Rot("
821 << Bone.Rotation.X <<
", " << Bone.Rotation.Y <<
", " << Bone.Rotation.Z <<
")\n";
840 Info <<
"\nFrames: " <<
Frame.
Id <<
"\n";
850 std::stringstream Info;
856 File.open(Filename2, std::ios::binary);
859 Info <<
"File " << Filename2 <<
" not found on server\n";
867 char Categories[] = {
'o',
'v',
'w',
't',
'h',
'a' };
869 struct ReplayerActorInfo
874 std::unordered_map<uint32_t, ReplayerActorInfo> Actors;
877 std::size_t operator()(
const std::pair<uint32_t, uint32_t>& P)
const
879 std::size_t hash = P.first;
885 std::unordered_set<std::pair<uint32_t, uint32_t>, PairHash > oldCollisions, newCollisions;
888 Info << std::setw(8) <<
"Time";
889 Info <<
" " << std::setw(6) <<
"Types";
890 Info <<
" " << std::setw(6) << std::right <<
"Id";
891 Info <<
" " << std::setw(35) << std::left <<
"Actor 1";
892 Info <<
" " << std::setw(6) << std::right <<
"Id";
893 Info <<
" " << std::setw(35) << std::left <<
"Actor 2";
913 oldCollisions = std::move(newCollisions);
914 newCollisions.clear();
919 ReadValue<uint16_t>(
File, Total);
920 for (i = 0; i < Total; ++i)
930 ReadValue<uint16_t>(
File, Total);
931 for (i = 0; i < Total; ++i)
945 ReadValue<uint16_t>(
File, Total);
946 for (i = 0; i < Total; ++i)
953 uint8_t Type1, Type2;
965 if (Category1 ==
'a')
967 else if (Category1 == Type1)
973 if (Category2 ==
'a')
975 else if (Category2 == Type2)
985 if (oldCollisions.count(collisionPair) == 0)
987 Info << std::setw(8) << std::setprecision(0) << std::right << std::fixed <<
Frame.
Elapsed;
988 Info <<
" " <<
" " << Type1 <<
" " << Type2 <<
" ";
996 newCollisions.insert(collisionPair);
1020 Info <<
"\nFrames: " <<
Frame.
Id <<
"\n";
1030 std::stringstream Info;
1036 File.open(Filename2, std::ios::binary);
1037 if (!
File.is_open())
1039 Info <<
"File " << Filename2 <<
" not found on server\n";
1048 struct ReplayerActorInfo
1052 FVector LastPosition;
1056 std::unordered_map<uint32_t, ReplayerActorInfo> Actors;
1058 std::multimap<double, std::string, std::greater<double>> Results;
1061 Info << std::setw(8) <<
"Time";
1062 Info <<
" " << std::setw(6) <<
"Id";
1063 Info <<
" " << std::setw(35) << std::left <<
"Actor";
1064 Info <<
" " << std::setw(10) << std::right <<
"Duration";
1087 ReadValue<uint16_t>(
File, Total);
1088 for (i = 0; i < Total; ++i)
1098 ReadValue<uint16_t>(
File, Total);
1099 for (i = 0; i < Total; ++i)
1119 ReadValue<uint16_t>(
File, Total);
1120 for (i = 0; i < Total; ++i)
1136 std::stringstream Result;
1137 Result << std::setw(8) << std::setprecision(0) << std::fixed << Actors[
Position.
DatabaseId].Time;
1139 Result <<
" " << std::setw(35) << std::left << TCHAR_TO_UTF8(*Actors[
Position.
DatabaseId].Id);
1140 Result <<
" " << std::setw(10) << std::setprecision(0) << std::fixed << std::right << Actors[
Position.
DatabaseId].Duration;
1141 Result << std::endl;
1168 for (
auto& Actor : Actors)
1171 if (Actor.second.Duration >= MinTime)
1173 std::stringstream Result;
1174 Result << std::setw(8) << std::setprecision(0) << std::fixed << Actor.second.Time;
1175 Result <<
" " << std::setw(6) << Actor.first;
1176 Result <<
" " << std::setw(35) << std::left << TCHAR_TO_UTF8(*Actor.second.Id);
1177 Result <<
" " << std::setw(10) << std::setprecision(0) << std::fixed << std::right << Actor.second.Duration;
1178 Result << std::endl;
1179 Results.insert(std::make_pair(Actor.second.Duration, Result.str()));
1184 for (
auto& Result : Results)
1186 Info << Result.second;
1189 Info <<
"\nFrames: " <<
Frame.
Id <<
"\n";