Not Really to improve maybe a downgrade to the race07 logs would be perfect Dont know if its possible to get logs which the race07 dedis saved.
For each car (including the player) I'd like driver name, car and car class, world position, isInPitLane (or is on limiter), last lap time, is current lap valid, current tyre type, laps completed, outstanding penalties, current sector, current lap distance, and maybe some other stuff. I'd also like the track name and layout. Or a look up for these
Not really. These were plain text files with some structure. Parsing was possible but not the best way. The new json-format is considerable better. But we need more information in it. Here is a list of necessary data fields: Overall race time Lap Count per driver Race status (fnished, dnf etc.) Quali best lap/result R3E names and not the Steam names. I would also take more but these are essential.
So.. I'll aim to add these for each car (did I miss something?): typedef struct { r3e_u8char name; r3e_int32 car_number; r3e_int32 class_id; r3e_int32 model_id; r3e_int32 team_id; r3e_int32 livery_id; r3e_int32 manufacturer_id; r3e_int32 class_performance_index; } r3e_driver_info; typedef struct { r3e_driver_info driver_info; r3e_int32 place; r3e_float32 lap_distance; r3e_vec3_f32 position; r3e_int32 track_sector; r3e_int32 completed_laps; r3e_int32 current_lap_valid; r3e_float32 lap_time_current_self; r3e_float32 lap_time_previous_self; r3e_float32 lap_time_best_self; r3e_float32 lap_time_delta_leader; r3e_float32 sector_time_previous_self[3]; r3e_float32 time_delta_front; r3e_float32 time_delta_behind; r3e_int32 in_pitlane; r3e_int32 num_pitstops; r3e_int32 num_penalties; r3e_float32 car_speed; r3e_int32 tire_type; } r3e_driver_data_1; @mr_belowski : what do you mean by Car Status?
Thank you Robert!!! Are the car world positions x, y, z available so that I can draw the track and cars? They don't really have to be World positions, but at least some coordinates. Cheers Stefan
I didn't ask for car status - that was Stefan. Not sure what it means either For the penalties, can we split into cut track, stop go, time deduction, and drive through? Can we also have a value indicating whether this car has completed its mandatory pitstop (another enum I guess - not_needed, to_be_done, completed). Or something like that. This will be utterly brilliant for my app Oh, and the X/Y/Z co-ordinates, are these cartesian and in metres? I can use that to make the spotter do proper left / right differentiation, assuming the orientation of the opponent car is fairly similar to the orientation of the player's car. Doesn't really matter where the origin is as long as the player's car as a similar set of co-ordinates relative to the same origin
Oh, and won't the r3e_driver_data struct need an identifier for that driver too? Just an int32 SlotID or something I had a chat with Mikel (if I remember correctly) about the noise in the data - we were wondering if it might be worth introducing a shared mutex locked before R3E starts writing one tick's worth of data, and unlocked when that's complete. The client apps could (if they wanted to) block until R3E had finished writing all the data for that tick
ah sorry, asking Stefan then @Stefan Mizzi Car Status? do you mean like DQ, DNF? i'll look into penalties and pitstop status. x/y/z are world coordinates, and I guess you can pinpoint relative positions with existing data (orientation). you could find current car in array by comparing position/place, but perhaps it'd be better adding slotId. Mikael is gonna look into mutex lock to prevent jitter.
Yes exactly thanks! I agree with Jim, SlotID/CarID/DriverID (whatever it is) will be very helpful! Damn, I'm getting so excited....hope the wife does not invent any outings this weekend (so that I prepare the framework)
Need to be careful that whatever mutex approach you take, you can obtain the lock at your end even if my app is behaving badly and not releasing it in a timely manner. Not that it would
I was a naughty boy over the last couple of weeks and ported Crew Chief to Project Cars, decoupling it from the R3E shared memory format. PCars has driver names, car positions, and other stuff in its shared memory. This means that my app is only a short hack away from being able to use much this planned new data for R3E. I'd better get recording more driver names - once this is in for R3E I'll record some of the R3E AI drivers' names, and I'll need a list of everyone's R3E online names to add to the nearly 600 AI names I already done for PCars
think I've got it all in there, looks like this now: typedef struct { r3e_u8char name[64]; r3e_int32 car_number; r3e_int32 class_id; r3e_int32 model_id; r3e_int32 team_id; r3e_int32 livery_id; r3e_int32 manufacturer_id; r3e_int32 slot_id; r3e_int32 class_performance_index; } r3e_driver_info; typedef struct { r3e_driver_info driver_info; r3e_finish_status finish_status; r3e_int32 place; r3e_float32 lap_distance; r3e_vec3_f32 position; r3e_int32 track_sector; r3e_int32 completed_laps; r3e_int32 current_lap_valid; r3e_float32 lap_time_current_self; r3e_float32 lap_time_previous_self; r3e_float32 lap_time_best_self; r3e_float32 lap_time_delta_leader; r3e_float32 sector_time_previous_self[3]; r3e_float32 time_delta_front; r3e_float32 time_delta_behind; r3e_pitstop_status pitstop_status; r3e_int32 in_pitlane; r3e_int32 num_pitstops; r3e_cut_track_penalties penalties; r3e_float32 car_speed; r3e_int32 tire_type; } r3e_driver_data_1;
typedef struct { r3e_int32 drive_through; r3e_int32 stop_and_go; r3e_int32 pit_stop; r3e_int32 time_deduction; r3e_int32 slow_down; } r3e_cut_track_penalties; you can only have one of each currently, so can be considered booleans
Looks great indeed, will we also get a trackID? as for mutex, with two incarnation counters, we can also detect if data was written during copy. r3e would increment one counter at begin-edit, and one at end-edit. By definiton these writes are happening atomically (32-bit) on x86. Only the compiler has to be instructed to strictly order the writes to those variables. The third party app copying from shared can then test the counters for consistency of the data. It doesn't prevent inconsistent blocks, but one will be able to ignore them.
yes, track- and layout id as well. (..and tyre dirt per wheel, and rps per wheel, and pitlimiter active/inactive for current car)
see post #158 https://forum.sector3studios.com/index.php?threads/shared-memory-api.1525/page-8#post-33129