PDA

View Full Version : [HowTo] Companion App - UDP Streaming



Pages : [1] 2 3 4 5 6

Umer Ahmad
30-09-2015, 10:17
UDP Port 5606 on all platforms.

Stream rate can be set in the 'Game play' menu:

UDP off
UDP 1 60/sec (16ms)
UDP 2 50/sec (20ms)
UDP 3 40/sec (25ms)
UDP 4 30/sec (32ms)
UDP 5 20/sec (50ms)
UDP 6 15/sec (66ms)
UDP 7 10/sec (100ms)
UDP 8 05/sec (200ms)
UDP 9 01/sec (1000ms)

The data structure is as follows:



struct sParticipantInfo
{
s16 sWorldPosition[3]; // 0
u16 sCurrentLapDistance; // 6
u8 sRacePosition; // 8
u8 sLapsCompleted; // 9
u8 sCurrentLap; // 10
u8 sSector; // 11
f32 sLastSectorTime; // 14
// 16
};

#pragma pack(push)
#pragma pack(1)

struct sParticipantInfoStrings
{
static const u32 sPacketSize = 1347;
u16 sBuildVersionNumber; // 0
u8 sPacketType; // 2
char sCarName[64]; // 3
char sCarClassName[64]; // 67
char sTrackLocation[64]; // 131
char sTrackVariation[64]; // 195
char sName[16][64]; // 259
f32 sFastestLapTime[16]; // 1283
// 1347
};

#pragma pack(pop)

struct sParticipantInfoStringsAdditional
{
static const u32 sPacketSize = 1028;
u16 sBuildVersionNumber; // 0
u8 sPacketType; // 2
u8 sOffset; // 3
char sName[16][64]; // 4
// 1028
};

struct sTelemetryData
{
static const u32 sPacketSize = 1367;
u16 sBuildVersionNumber; // 0
u8 sPacketType; // 2

// Game states
u8 sGameSessionState; // 3

// Participant info
s8 sViewedParticipantIndex; // 4
s8 sNumParticipants; // 5

// Unfiltered input
u8 sUnfilteredThrottle; // 6
u8 sUnfilteredBrake; // 7
s8 sUnfilteredSteering; // 8
u8 sUnfilteredClutch; // 9
u8 sRaceStateFlags; // 10

// Event information
u8 sLapsInEvent; // 11

// Timings
f32 sBestLapTime; // 12
f32 sLastLapTime; // 16
f32 sCurrentTime; // 20
f32 sSplitTimeAhead; // 24
f32 sSplitTimeBehind; // 28
f32 sSplitTime; // 32
f32 sEventTimeRemaining; // 36
f32 sPersonalFastestLapTime; // 40
f32 sWorldFastestLapTime; // 44
f32 sCurrentSector1Time; // 48
f32 sCurrentSector2Time; // 52
f32 sCurrentSector3Time; // 56
f32 sFastestSector1Time; // 60
f32 sFastestSector2Time; // 64
f32 sFastestSector3Time; // 68
f32 sPersonalFastestSector1Time; // 72
f32 sPersonalFastestSector2Time; // 76
f32 sPersonalFastestSector3Time; // 80
f32 sWorldFastestSector1Time; // 84
f32 sWorldFastestSector2Time; // 88
f32 sWorldFastestSector3Time; // 92

u16 sJoyPad; // 96

// Flags
u8 sHighestFlag; // 98

// Pit info
u8 sPitModeSchedule; // 99

// Car state
s16 sOilTempCelsius; // 100
u16 sOilPressureKPa; // 102
s16 sWaterTempCelsius; // 104
u16 sWaterPressureKpa; // 106
u16 sFuelPressureKpa; // 108
u8 sCarFlags; // 110
u8 sFuelCapacity; // 111
u8 sBrake; // 112
u8 sThrottle; // 113
u8 sClutch; // 114
s8 sSteering; // 115
f32 sFuelLevel; // 116
f32 sSpeed; // 120
u16 sRpm; // 124
u16 sMaxRpm; // 126
u8 sGearNumGears; // 128
u8 sBoostAmount; // 129
s8 sEnforcedPitStopLap; // 130
u8 sCrashState; // 131

f32 sOdometerKM; // 132
f32 sOrientation[3]; // 136
f32 sLocalVelocity[3]; // 148
f32 sWorldVelocity[3]; // 160
f32 sAngularVelocity[3]; // 172
f32 sLocalAcceleration[3]; // 184
f32 sWorldAcceleration[3]; // 196
f32 sExtentsCentre[3]; // 208

// Wheels / Tyres
u8 sTyreFlags[4]; // 220
u8 sTerrain[4]; // 224
f32 sTyreY[4]; // 228
f32 sTyreRPS[4]; // 244
f32 sTyreSlipSpeed[4]; // 260
u8 sTyreTemp[4]; // 276
u8 sTyreGrip[4]; // 280
f32 sTyreHeightAboveGround[4]; // 284
f32 sTyreLateralStiffness[4]; // 300
u8 sTyreWear[4]; // 316
u8 sBrakeDamage[4]; // 320
u8 sSuspensionDamage[4]; // 324
s16 sBrakeTempCelsius[4]; // 328
u16 sTyreTreadTemp[4]; // 336
u16 sTyreLayerTemp[4]; // 344
u16 sTyreCarcassTemp[4]; // 352
u16 sTyreRimTemp[4]; // 360
u16 sTyreInternalAirTemp[4]; // 368
f32 sWheelLocalPositionY[4]; // 376
f32 sRideHeight[4]; // 392
f32 sSuspensionTravel[4]; // 408
f32 sSuspensionVelocity[4]; // 424
u16 sAirPressure[4]; // 440

// Extras
f32 sEngineSpeed; // 448
f32 sEngineTorque; // 452

// Car damage
u8 sAeroDamage; // 456
u8 sEngineDamage; // 457

// Weather
s8 sAmbientTemperature; // 458
s8 sTrackTemperature; // 459
u8 sRainDensity; // 460
s8 sWindSpeed; // 461
s8 sWindDirectionX; // 462
s8 sWindDirectionY; // 463

sParticipantInfo sParticipantInfo[56]; // 464
// 56*16=896
f32 sTrackLength; // 1360
u8 sWings[2]; // 1364
u8 sDPad; // 1366
// 1368 struct is padded to
};


mBuildVersionNumber=mTelemetryData.sBuildVersionNumber=(u16)pMemory->mBuildVersionNumber; // u32->u16
mTelemetryData.sPacketType=0|((mCount&63)<<2); // Packet type | (sequence<<2)

// Game state
mTelemetryData.sGameSessionState=((u8)pMemory->mGameState)|(((u8)pMemory->mSessionState)<<4); // (enum 3 bits/enum 3 bits)->u8
mTelemetryData.sRaceStateFlags=((u8)pMemory->mRaceState) | // (enum 3 bits)->u8
(pMemory->mLapInvalidated?8:0)|(pMemory->mAntiLockActive?16:0)|(pMemory->mBoostActive?32:0); // (bool/bool/bool)->u8

// Participant info
mTelemetryData.sViewedParticipantIndex=(s8)pMemory->mViewedParticipantIndex; // s32->s8
mTelemetryData.sNumParticipants=(s8)pMemory->mNumParticipants; // s32->s8

// Unfiltered input
mTelemetryData.sUnfilteredThrottle=(u8)(Clamp(pMemory->mUnfilteredThrottle, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sUnfilteredBrake=(u8)(Clamp(pMemory->mUnfilteredBrake, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sUnfilteredSteering=(s8)(Clamp(pMemory->mUnfilteredSteering, -1.0f, 1.0f)*127.0f); // f32->s8
mTelemetryData.sUnfilteredClutch=(u8)(Clamp(pMemory->mUnfilteredClutch, 0.0f, 1.0f)*255.0f); // f32->u8

// Event information
mTelemetryData.sTrackLength=(f32)pMemory->mTrackLength; // f32->f32
mTelemetryData.sLapsInEvent=(u8)min(pMemory->mLapsInEvent,255); // u32->u8

// Timings
mTelemetryData.sBestLapTime=pMemory->mBestLapTime; // f32->f32
mTelemetryData.sLastLapTime=pMemory->mLastLapTime; // f32->f32
mTelemetryData.sCurrentTime=pMemory->mCurrentTime; // f32->f32
mTelemetryData.sSplitTimeAhead=pMemory->mSplitTimeAhead; // f32->f32
mTelemetryData.sSplitTimeBehind=pMemory->mSplitTimeBehind; // f32->f32
mTelemetryData.sSplitTime=pMemory->mSplitTime; // f32->f32
mTelemetryData.sEventTimeRemaining=pMemory->mEventTimeRemaining; // f32->f32
mTelemetryData.sPersonalFastestLapTime=pMemory->mPersonalFastestLapTime; // f32->f32
mTelemetryData.sWorldFastestLapTime=pMemory->mWorldFastestLapTime; // f32->f32
mTelemetryData.sCurrentSector1Time=pMemory->mCurrentSector1Time; // f32->f32
mTelemetryData.sCurrentSector2Time=pMemory->mCurrentSector2Time; // f32->f32
mTelemetryData.sCurrentSector3Time=pMemory->mCurrentSector3Time; // f32->f32
mTelemetryData.sFastestSector1Time=pMemory->mFastestSector1Time; // f32->f32
mTelemetryData.sFastestSector2Time=pMemory->mFastestSector2Time; // f32->f32
mTelemetryData.sFastestSector3Time=pMemory->mFastestSector3Time; // f32->f32
mTelemetryData.sPersonalFastestSector1Time=pMemory->mPersonalFastestSector1Time; // f32->f32
mTelemetryData.sPersonalFastestSector2Time=pMemory->mPersonalFastestSector2Time; // f32->f32
mTelemetryData.sPersonalFastestSector3Time=pMemory->mPersonalFastestSector3Time; // f32->f32
mTelemetryData.sWorldFastestSector1Time=pMemory->mWorldFastestSector1Time; // f32->f32
mTelemetryData.sWorldFastestSector2Time=pMemory->mWorldFastestSector2Time; // f32->f32
mTelemetryData.sWorldFastestSector3Time=pMemory->mWorldFastestSector3Time; // f32->f32

// Flags
mTelemetryData.sHighestFlag=((u8)pMemory->mHighestFlagColour) | (((u8)pMemory->mHighestFlagReason)<<4); // (enum 3 bits/enum 2 bits)

// Pit info
mTelemetryData.sPitModeSchedule=((u8)pMemory->mPitMode) | (((u8)pMemory->mPitSchedule)<<4); // (enum 3 bits/enum 2 bits)

// Car state
mTelemetryData.sCarFlags=(u8)pMemory->mCarFlags; // enum->u8
mTelemetryData.sOilTempCelsius=(s16)pMemory->mOilTempCelsius; // f32->s16
mTelemetryData.sOilPressureKPa=(u16)pMemory->mOilPressureKPa; // f32->u16
mTelemetryData.sWaterTempCelsius=(s16)pMemory->mWaterTempCelsius; // f32->s16
mTelemetryData.sWaterPressureKpa=(u16)pMemory->mWaterPressureKPa; // f32->u16
mTelemetryData.sFuelPressureKpa=(u16)pMemory->mFuelPressureKPa; // f32->u16
mTelemetryData.sFuelCapacity=(u8)pMemory->mFuelCapacity; // f32->u8
mTelemetryData.sBrake=(u8)(Clamp(pMemory->mBrake, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sFuelLevel=pMemory->mFuelLevel; // f32->f32
mTelemetryData.sSpeed=pMemory->mSpeed; // f32->f32
mTelemetryData.sRpm=(u16)pMemory->mRpm; // f32->u16
mTelemetryData.sMaxRpm=(u16)pMemory->mMaxRPM; // f32->u16
mTelemetryData.sThrottle=(u8)(Clamp(pMemory->mThrottle, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sClutch=(u8)(Clamp(pMemory->mClutch, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sSteering=(s8)(Clamp(pMemory->mSteering, -1.0f, 1.0f)*127.0f); // f32->s8
u8 gear=pMemory->mGear<0?0x0f:min((u8)(pMemory->mGear&0xff), 7);
u8 numGears=max((u8)(pMemory->mNumGears&0xff), 0);
mTelemetryData.sGearNumGears=(gear&0x0f)|((numGears&0x0f)<<4); // s32/s32->u8
mTelemetryData.sOdometerKM=pMemory->mOdometerKM; // f32->f32
mTelemetryData.sBoostAmount=(u8)pMemory->mBoostAmount; // f32->u8
mTelemetryData.sOrientation[0]=pMemory->mOrientation[0]; // f32->f32
mTelemetryData.sOrientation[1]=pMemory->mOrientation[1]; // f32->f32
mTelemetryData.sOrientation[2]=pMemory->mOrientation[2]; // f32->f32
mTelemetryData.sLocalVelocity[0]=pMemory->mLocalVelocity[0]; // f32->f32
mTelemetryData.sLocalVelocity[1]=pMemory->mLocalVelocity[1]; // f32->f32
mTelemetryData.sLocalVelocity[2]=pMemory->mLocalVelocity[2]; // f32->f32
mTelemetryData.sWorldVelocity[0]=pMemory->mWorldVelocity[0]; // f32->f32
mTelemetryData.sWorldVelocity[1]=pMemory->mWorldVelocity[1]; // f32->f32
mTelemetryData.sWorldVelocity[2]=pMemory->mWorldVelocity[2]; // f32->f32
mTelemetryData.sAngularVelocity[0]=pMemory->mAngularVelocity[0]; // f32->f32
mTelemetryData.sAngularVelocity[1]=pMemory->mAngularVelocity[1]; // f32->f32
mTelemetryData.sAngularVelocity[2]=pMemory->mAngularVelocity[2]; // f32->f32
mTelemetryData.sLocalAcceleration[0]=pMemory->mLocalAcceleration[0]; // f32->f32
mTelemetryData.sLocalAcceleration[1]=pMemory->mLocalAcceleration[1]; // f32->f32
mTelemetryData.sLocalAcceleration[2]=pMemory->mLocalAcceleration[2]; // f32->f32
mTelemetryData.sWorldAcceleration[0]=pMemory->mWorldAcceleration[0]; // f32->f32
mTelemetryData.sWorldAcceleration[1]=pMemory->mWorldAcceleration[1]; // f32->f32
mTelemetryData.sWorldAcceleration[2]=pMemory->mWorldAcceleration[2]; // f32->f32
mTelemetryData.sExtentsCentre[0]=pMemory->mExtentsCentre[0]; // f32->f32
mTelemetryData.sExtentsCentre[1]=pMemory->mExtentsCentre[1]; // f32->f32
mTelemetryData.sExtentsCentre[2]=pMemory->mExtentsCentre[2]; // f32->f32

// Wheels / Tyres
u32 i;
for (i=0;i<4;i++)
{
mTelemetryData.sTyreFlags[i]=(u8)pMemory->mTyreFlags[i]; // (enum 3 bits)->u8
mTelemetryData.sTerrain[i]=(u8)pMemory->mTerrain[i]; // (enum 6 bits)->u8
mTelemetryData.sTyreY[i]=pMemory->mTyreY[i]; // f32->f32
mTelemetryData.sTyreRPS[i]=pMemory->mTyreRPS[i]; // f32->f32
mTelemetryData.sTyreSlipSpeed[i]=pMemory->mTyreSlipSpeed[i]; // f32->f32
mTelemetryData.sTyreTemp[i]=(u8)Clamp(pMemory->mTyreTemp[i], 0.0f, 255.0f); // f32->u8
mTelemetryData.sTyreGrip[i]=(u8)Clamp(pMemory->mTyreGrip[i], 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sTyreHeightAboveGround[i]=pMemory->mTyreHeightAboveGround[i]; // f32->f32
mTelemetryData.sTyreLateralStiffness[i]=pMemory->mTyreLateralStiffness[i]; // f32->f32
mTelemetryData.sTyreWear[i]=(u8)(Clamp(pMemory->mTyreWear[i], 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sBrakeDamage[i]=(u8)(Clamp(pMemory->mBrakeDamage[i], 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sSuspensionDamage[i]=(u8)(Clamp(pMemory->mSuspensionDamage[i], 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sBrakeTempCelsius[i]=(s16)pMemory->mBrakeTempCelsius[i]; // f32->s16
mTelemetryData.sTyreTreadTemp[i]=(u16)pMemory->mTyreTreadTemp[i]; // f32->u16
mTelemetryData.sTyreLayerTemp[i]=(u16)pMemory->mTyreLayerTemp[i]; // f32->u16
mTelemetryData.sTyreCarcassTemp[i]=(u16)pMemory->mTyreCarcassTemp[i]; // f32->u16
mTelemetryData.sTyreRimTemp[i]=(u16)pMemory->mTyreRimTemp[i]; // f32->u16
mTelemetryData.sTyreInternalAirTemp[i]=(u16)pMemory->mTyreInternalAirTemp[i]; // f32->u16
mTelemetryData.sWheelLocalPositionY[i]=pMemoryExtras->mWheelLocalPositionY[i]; // f32->f32
mTelemetryData.sRideHeight[i]=pMemoryExtras->mRideHeight[i]; // f32->f32
mTelemetryData.sSuspensionTravel[i]=pMemoryExtras->mSuspensionTravel[i]; // f32->f32
mTelemetryData.sSuspensionVelocity[i]=pMemoryExtras->mSuspensionVelocity[i]; // f32->f32
mTelemetryData.sAirPressure[i]=pMemoryExtras->mAirPressure[i]; // f32->u16
}

// Extras
mTelemetryData.sEngineSpeed=pMemoryExtras->mEngineSpeed; // f32->f32
mTelemetryData.sEngineTorque=pMemoryExtras->mEngineTorque; // f32->f32
mTelemetryData.sWings[0]=pMemoryExtras->mWings[0]; // f32->u8
mTelemetryData.sWings[1]=pMemoryExtras->mWings[1]; // f32->u8
mTelemetryData.sEnforcedPitStopLap=(s8)pMemoryExtras->mEnforcedPitStopLap; // S32->s8

//Car damage
mTelemetryData.sCrashState=(u8)pMemory->mCrashState; // (enum 3 bits)->u8
mTelemetryData.sAeroDamage=(u8)(Clamp(pMemory->mAeroDamage, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sEngineDamage=(u8)(Clamp(pMemory->mEngineDamage, 0.0f, 1.0f)*255.0f); // f32->u8

// Weather
mTelemetryData.sAmbientTemperature=(s8)Clamp(pMemory->mAmbientTemperature, -127.0f, 127.0f); // f32->s8
mTelemetryData.sTrackTemperature=(s8)Clamp(pMemory->mTrackTemperature, -127.0f, 127.0f); // f32->s8
mTelemetryData.sRainDensity=(u8)(Clamp(pMemory->mRainDensity, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sWindSpeed=(u8)(Clamp(pMemory->mWindSpeed*0.5f, 0.0f, 255.0f)); // f32->u8
mTelemetryData.sWindDirectionX=(s8)Clamp(pMemory->mWindDirectionX*127.0f, -127.0f, 127.0f); // f32->s8
mTelemetryData.sWindDirectionY=(s8)Clamp(pMemory->mWindDirectionY*127.0f, -127.0f, 127.0f); // f32->s8

for (i=0;i<(u32)Clamp(pMemory->mNumParticipants, 0, 56);i++)
{
mTelemetryData.sParticipantInfo[i].sWorldPosition[0]=(s16)Clamp(pMemory->mParticipantInfo[i].mWorldPosition[0], -32768.0f, 32767.0f); // f32->s16
mTelemetryData.sParticipantInfo[i].sWorldPosition[1]=(s16)Clamp(pMemory->mParticipantInfo[i].mWorldPosition[1], -32768.0f, 32767.0f); // f32->s16
mTelemetryData.sParticipantInfo[i].sWorldPosition[2]=(s16)Clamp(pMemory->mParticipantInfo[i].mWorldPosition[2], -32768.0f, 32767.0f); // f32->s16
mTelemetryData.sParticipantInfo[i].sCurrentLapDistance=(u16)min(pMemory->mParticipantInfo[i].mCurrentLapDistance, 65535.0f); // f32->u16
mTelemetryData.sParticipantInfo[i].sRacePosition=((u8)pMemory->mParticipantInfo[i].mRacePosition)|(pMemory->mParticipantInfo[i].mIsActive?128:0); // u32+bool->u8 (top bit is active)
mTelemetryData.sParticipantInfo[i].sLapsCompleted=((u8)min(pMemory->mParticipantInfo[i].mLapsCompleted, 127))|(pMemoryExtras->mLapInvalidated[i]?128:0); // u32+bool->u8 (top bit is lap invalidated)
mTelemetryData.sParticipantInfo[i].sCurrentLap=(u8)min(pMemory->mParticipantInfo[i].mCurrentLap, 255); // u32->u8
mTelemetryData.sParticipantInfo[i].sSector=(u8)pMemory->mParticipantInfo[i].mCurrentSector; // (enum 3 bits)->u8
// Extra accuracy bits for x/z
u32 x=((u32)floorf(pMemory->mParticipantInfo[i].mWorldPosition[0]*4.0f))&3;
u32 z=((u32)floorf(pMemory->mParticipantInfo[i].mWorldPosition[2]*4.0f))&3;
mTelemetryData.sParticipantInfo[i].sSector=((u8)pMemory->mParticipantInfo[i].mCurrentSector)|((u8)x<<6)|((u8)z<<4)|(pMemoryExtras->mSameClass[i]?8:0); // (enum 3 bits)+(x 2 bits, z 2 bits)+(1 bit same class)->u8
mTelemetryData.sParticipantInfo[i].sLastSectorTime=pMemoryExtras->mLastSectorTime[i]; // f32->f32
}

mTelemetryData.sJoyPad=(u16)JOYPAD BUTTON MASK 0-15
mTelemetryData.sDPad=(u8)JOYPAD DPAD MASK (button mask 16-19 <<4)
mTelemetryData.sCrashState|=(button mask 20-23 <<4)

// This packet below is sent less often
BStrcpy(mParticipantStrings.sCarName, 64, pMemory->mCarName);
BStrcpy(mParticipantStrings.sCarClassName, 64, pMemory->mCarClassName);
BStrcpy(mParticipantStrings.sTrackLocation, 64, pMemory->mTrackLocation);
BStrcpy(mParticipantStrings.sTrackVariation, 64, pMemory->mTrackVariation);
for (i=0;i<(u32)Clamp(pMemory->mNumParticipants, 0, 16);i++)
{
BStrcpy(mParticipantStrings.sName[i], 64, pMemory->mParticipantInfo[i].mName);
}
mParticipantStrings.sBuildVersionNumber=mBuildVersionNumber;
mParticipantStrings.sPacketType=1|((mCount&63)<<2); // Packet type | (sequence<<2)


// These extra packets are sent if participants>16
for (groups of 16)
{
BStrcpy(mParticipantStringsAdditional.sName[i], 64, pMemory->mParticipantInfo[i].mName);
}
mParticipantStringsAdditional.sOffset=(u8)OFFSET IN 16's, so 1st packet of this type offset will be 16, 2nd 32 etc
mParticipantStringsAdditional.sBuildVersionNumber=mBuildVersionNumber;
mParticipantStringsAdditional.sPacketType=2|((mCount&63)<<2); // Packet type | (sequence<<2)


Please see the 'Shared memory API' documentation here http://forum.projectcarsgame.com/showthread.php?30903-Project-CARS-Shared-Memory-or-how-do-I-make-my-own-app&highlight=shared+memory+api regarding the field usage and enums.

Note that this field has been updated in the shared memory API:



// (Type#9) Car Flags (to be used with 'mCarFlags')
enum
{
CAR_HEADLIGHT = (1<<0),
CAR_ENGINE_ACTIVE = (1<<1),
CAR_ENGINE_WARNING = (1<<2),
CAR_SPEED_LIMITER = (1<<3),
CAR_ABS = (1<<4),
CAR_HANDBRAKE = (1<<5),
CAR_STABILITY = (1<<6),
CAR_TRACTION_CONTROL = (1<<7),
};


Packet type 0 is sent at the update rate. Packet types 1 & 2 are sent at the beginning of a race, when the number of participants changes or when the lap count increases.


VALUE PC XB PS4
1
2
4
8
16StartStartOption
32BackBack
64L3L3L3
128R3R3R3
256LBLBLB
512RBRBRB
1024
2048
4096AACross
8192BBCircle
16384XXSquare
32768YYTriangle





PAD PC XB PS4
1 Up Up Up
2 Down Down Down
4 Left Left Left
8 Right Right Right


Buttons are mapped from the active device to the 16 bits in .sJoyPad, the top 4 bits of sDPad and the top 4 bits of sCrashState, giving a total of 24 buttons.

Umer Ahmad
30-09-2015, 10:18
[RESERVED 2]

cjorgens79
30-09-2015, 11:46
So will this be the thread where the new API will be posted, or will that be a different thread again?

Tim Mann
30-09-2015, 11:47
All in here.

Vennt
30-09-2015, 11:54
I think I've just decided what to do with the Raspberry Pi I'm not currently doing much with at the moment, add a cheap 7" screen to it, and write a UDP based wireless dashboard for P.Cars on PS4.

Was going to go the Arduino route like some others have, but this'll give me more flexibility and an excuse to refresh my C or Java skills :D

Fun!

Fre.Mo
30-09-2015, 12:34
I think I've just decided what to do with the Raspberry Pi I'm not currently doing much with at the moment, add a cheap 7" screen to it, and write a UDP based wireless dashboard for P.Cars on PS4.

Was going to go the Arduino route like some others have, but this'll give me more flexibility and an excuse to refresh my C or Java skills :D

Fun!

GOOD NEWS. I can't wait seeing this on PS4.

PureMalt77
30-09-2015, 13:43
This proves once again what a Community-Driven game is all about!
You would never get such a feedback and feature updates like this from EA, Codemasters, Ubisoft, Sony, you-name-it!

Thanks guys!

Mr.Smoke
30-09-2015, 14:18
Cant wait for this to happen!!

Im up for testing out apps as well, as im sure MANY others will be! Really need to start using my 7" galaxy tab2 thats collecting dust.

As i mentioned in the thread in the PS4 section, it would be great if its possible to have anapp designed in a similar way to the TORQUE OBDII app where you can select style, size, position of each seperate gauge/graph for each bit of telemetry info. Almost like having a custom gauge cluster mounted in a car.

ElectricBlues85
30-09-2015, 14:47
Subbed. Can't wait to have a go of this :)

TrueNOS2
30-09-2015, 15:08
Awesomeness!:applause: Thanks for bringing this into reality Tim! I hope cjorgens79 will create a nice app for this. I am really looking forward to it! Thanks again guys.

PTG Baby Cow
30-09-2015, 15:13
Any idea of what data will be available to the app developer? Will it be race data (lap times, current position, fastest lap, time behind, sector times), or strictly car data (telemetry). Just curious.

TheReaper GT
30-09-2015, 15:17
Any idea of what data will be available to the app developer? Will it be race data (lap times, current position, fastest lap, time behind, sector times), or strictly car data (telemetry). Just curious.

not yet, but I think both race, track and car data will be broadcasted through the network. That would be not only useful to telemetry and dash apps, but to league management too.

azidahaka
30-09-2015, 16:18
This proves once again what a Community-Driven game is all about!
You would never get such a feedback and feature updates like this from EA, Codemasters, Ubisoft, Sony, you-name-it!

Thanks guys!
You should let alone Sony since they allowed for this to be... >_>

PTG Baby Cow
30-09-2015, 17:01
Reaper. That's pretty much why I asked. A teammate makes apps and he'd like to try one for league type data I believe

PTG Baby Cow
30-09-2015, 17:02
Reaper. That's pretty much why I asked. A teammate makes apps and he'd like to try one for league type data I believe.

I guess a better question would be what data is currently available on pc as that's what will likely be available to us.

TheReaper GT
30-09-2015, 17:10
Reaper. That's pretty much why I asked. A teammate makes apps and he'd like to try one for league type data I believe.

I guess a better question would be what data is currently available on pc as that's what will likely be available to us.

There's a thread with that information. I couldn't find it, but I'm sure it's out there.

ElectricBlues85
30-09-2015, 17:42
Reaper. That's pretty much why I asked. A teammate makes apps and he'd like to try one for league type data I believe.

I guess a better question would be what data is currently available on pc as that's what will likely be available to us.


There's a thread with that information. I couldn't find it, but I'm sure it's out there.

You can see most of that info in this thread I believe:

http://forum.projectcarsgame.com/showthread.php?30903-Project-CARS-Shared-Memory-or-how-do-I-make-my-own-app&p=984616&viewfull=1#post984616

In the first post the 'code' window shows all of the data types that are included.

PTG Baby Cow
30-09-2015, 18:19
Really looking forward to this if we dont get some smaller version due to restrictions from ms/sony.

Vennt
30-09-2015, 18:54
Really looking forward to this if we dont get some smaller version due to restrictions from ms/sony.

I would imagine that the Max UDP size is likely to restrict the telemetry output long before any concerns of the platform providers becomes an issue.

I haven't even looked at the shared memory file structure yet and therefore it's likely size, but the recommended max UDP size is just under 1500 bytes.

You want to avoid packet fragmentation, therefore the maximum amount of data that can be sent in a packet needs to be under the typical MTU (Maximum Transmission Unit), which on most hardware these days is just under 1500 bytes.

If the entire structure sent is under this number, great, we have a wealth of data coming our way, if it's over, well either Tim gets creative with compression techniques or compromises will have to be made, or probably both :P

Another option would be to interleave packets, so it sends a "race state" packet first, then follows up with a "car state" packet after and then the data can be split into two packets doubling the amount of data that can be sent, however this isn't free as for each different packet type you add you will reduce the "frame rate" of the data, so to speak.

Note to programmers, I've tried to laymans-ify the above, I know its not that simple, but serves as an illustration, if any of the above is wrong, correct me! - development is just a hobby for me, and I'm hellishly rusty, and i always welcome a chance to learn! :P

PureMalt77
01-10-2015, 07:58
You should let alone Sony since they allowed for this to be... >_>

I understand your fear! But don't worry, they will not turn it back because of my comment. :)

What I'm refering to is not Sony as a whole, but in general game publishers.
Specifically to racing games, I played GT3 to GT6 and almost every F1 game since 2010, and have never seen user requested features implemented in any of them.

New features are usually analyzed and maybe implemented in a next version. Actually PCars2 will have many of the requested features listed in this forum.

But this is a completely new feature that will be implemented in the current version and deserves attention! Many people come over here only to complain: "I want my money back", "this game is unplayable/unfinished", and these people fail to see that for a team sized as SMS and the budget that was made available, we have a hell of a game, constant patches and features. In short: they are listening to us, this is all I wanted to say in the first place!

memoric77
01-10-2015, 08:02
would it be possible to feed a arduino with the Data to use a analog rev counter / Drehzahlmesser as an output?

Pyromaniak666
01-10-2015, 08:11
Subscription added, can't wait to see what's up in here

ElectricBlues85
01-10-2015, 08:30
would it be possible to feed a arduino with the Data to use a analog rev counter / Drehzahlmesser as an output?

From what I understand, we're getting pretty much the same info as PC users. The shared memory does have 'car state' info such as:


float mRpm; // [ UNITS = Revolutions per minute ] [ RANGE = 0.0f->... ] [ UNSET = 0.0f ]

Therefore, in theory we can have apps such as Arduino.

Two key things before any of this happens. 1) Tim will communicate exactly what we get (it might not be the same) and 2) the 3rd party app developers may or may not decide to implement PS4/XBOX support. We may get a slew of completely new apps, we may get none.

If 1) and 2) turn out like I hope, we're in for a treat :)

cjorgens79
01-10-2015, 12:20
My pCars Dash app will be updated to support the PS4/XB1 api, i have already done most of the preliminary work expected for this so it shouldn't take me too long once the interface is formalized.

Fil140
01-10-2015, 16:02
Ok,all you people saying this is a good thing,please stop.
I've followed with passion and have kept my friends informed of all the new developments but now I need a new asthma inhaler and I think I've just shit my pants!!
So thanks Tim!nice one!
Lol. Woohoo,oh no,I need more space!!!

Fil140
01-10-2015, 16:03
And yes,that's all ps4 only!up and running

Spitfire77
01-10-2015, 16:44
My pCars Dash app will be updated to support the PS4/XB1 api, i have already done most of the preliminary work expected for this so it shouldn't take me too long once the interface is formalized.

Sorry If I missed it, but which app is yours? Just curious and would like to check it out ahead of time. :D

And of course thank you!

madmax2069
01-10-2015, 16:54
Sorry If I missed it, but which app is yours? Just curious and would like to check it out ahead of time. :D

And of course thank you!

Its called Pcars Dash

http://forum.projectcarsgame.com/showthread.php?33388-pCars-Dash-Second-screen-telemetry-app which was found by going into his profile and looking at his started/created threads.

Which is a instant buy for me because he supports windows phones, once this comes to fruition.

Spitfire77
01-10-2015, 18:10
Its called Pcars Dash

http://forum.projectcarsgame.com/showthread.php?33388-pCars-Dash-Second-screen-telemetry-app which was found by going into his profile and looking at his started/created threads.

Which is a instant buy for me because he supports windows phones, once this comes to fruition.

Ah cool thanks.. I was looking for it in his info, but not created threads.

Rudolph523
01-10-2015, 21:05
it may sound dumb, but we are finally going to be able to use apps for pcars on the console versions? like Pcars dash? because for me it wasnt really clear yet.

Gravit8
01-10-2015, 21:09
This proves once again what a Community-Driven game is all about!
You would never get such a feedback and feature updates like this from EA, Codemasters, Ubisoft, Sony, you-name-it!

Thanks guys!

Not to be a buzz kill, but in interest of truth, this is a unique situation. Normally developers have a licensed Sony developer handle this stuff. SMS or Tim are not, so they are asking for permission to work around. As I understand it. This is different than how war thunder accomplished second screen functionality before.
This is only new in the way SMS are getting access/permission to do apps. Whereas, war thunder staff didn't need it. They already had access being an inside Sony studio.

Umer Ahmad
01-10-2015, 21:10
Yes, that is the goal. So people can write apps to capture and display stream of game data (like the PC version already supports)



it may sound dumb, but we are finally going to be able to use apps for pcars on the console versions? like Pcars dash? because for me it wasnt really clear yet.

Gravit8
01-10-2015, 21:13
I understand your fear! But don't worry, they will not turn it back because of my comment. :)

What I'm refering to is not Sony as a whole, but in general game publishers.
Specifically to racing games, I played GT3 to GT6 and almost every F1 game since 2010, and have never seen user requested features implemented in any of them.


New features are usually analyzed and maybe implemented in a next version. Actually PCars2 will have many of the requested features listed in this forum.

But this is a completely new feature that will be implemented in the current version and deserves attention! Many people come over here only to complain: "I want my money back", "this game is unplayable/unfinished", and these people fail to see that for a team sized as SMS and the budget that was made available, we have a hell of a game, constant patches and features. In short: they are listening to us, this is all I wanted to say in the first place!


Seems like a work around to no proper telemetry in replays, but that's none of my business

Gravit8
01-10-2015, 21:18
it may sound dumb, but we are finally going to be able to use apps for pcars on the console versions? like Pcars dash? because for me it wasnt really clear yet.

It's not a done deal, but it sounds close. I think that's the question you asked.

Schnizz58
01-10-2015, 21:19
Seems like a work around to no proper telemetry in replays, but that's none of my business
In a sense you're right but in some ways it's better than telemetry in replays.

Umer Ahmad
01-10-2015, 21:22
Seems like a work around to no proper telemetry in replays, but that's none of my business

Replay files would blow up in size (and create new bugs) if they captured the physics data. So i like this workaround. People have written nice apps so far on the PC side

STEELJOCKEY
01-10-2015, 22:14
So I use pCars Dash for current PC version, hoping it will also be compatible with Xbox, so I only need one app, or will there need to be a separate version for each console?

cjorgens79
02-10-2015, 01:23
So I use pCars Dash for current PC version, hoping it will also be compatible with Xbox, so I only need one app, or will there need to be a separate version for each console?

the intention is that it will be the same app that is compatible with both PC and console

falcon2081
02-10-2015, 01:27
People have written nice apps so far on the PC side

They have except most of them have bugs because the API has not been updated in months. I really hope it at least starts getting updated soon. The possibilities are endless, I mean look at what the guy who did CrewChief do. Amazing work using a buggy API.

diesel97
02-10-2015, 01:57
They have except most of them have bugs because the API has not been updated in months. I really hope it at least starts getting updated soon. The possibilities are endless, I mean look at what the guy who did CrewChief do. Amazing work using a buggy API.

That Crewchief app looks great, can you that and pcars dash at the same time on the PC ? If so i hope we PS4 and Xbox players will be able to do the same.

falcon2081
02-10-2015, 03:03
That Crewchief app looks great, can you that and pcars dash at the same time on the PC ? If so i hope we PS4 and Xbox players will be able to do the same.

I run Profiler Telemetry and CrewChief at the same time. No issues.

PureMalt77
02-10-2015, 06:40
Not to be a buzz kill, but in interest of truth, this is a unique situation. Normally developers have a licensed Sony developer handle this stuff. SMS or Tim are not, so they are asking for permission to work around. As I understand it. This is different than how war thunder accomplished second screen functionality before.
This is only new in the way SMS are getting access/permission to do apps. Whereas, war thunder staff didn't need it. They already had access being an inside Sony studio.

Not to be a double buzz kill :rolleyes:, but SMS does have official Development Kit and Licenses for the PS4, otherwise they could not develop the game in the first place!

If they went the direction of Second Screen API, it would be hard for 3rd party developers, because they don't have either the kit or licenses and the only way would be if SMS launched their own official app.

By streaming data over network is not violating any "rules" - therefore they got approval from 1st parties, and developers don't need to have costly licenses, makes the way open to anyone to build whatever they like (already seen guys here talking about Arduino and analog RPM gauges), so yes, the sky is the limit! And what I like most is that it is a multi platform and simple solution, call it workaround or not.

Fil140
02-10-2015, 08:09
Seems like a work around to no proper telemetry in replays, but that's none of my business

Glass half empty?why cant people just be positive!

SkyyJuice
02-10-2015, 09:21
:cool: Was hearing that there would be a spotter app coming to PC, Just wondered if this would be possible for console, much like how it is integrated/executed on Iracing, but it would be good to have visual placement of cars on track (on the app), as well, as audio placement. :positive: Even different languages or dialects could be added later as a different version pack.

cjorgens79
02-10-2015, 11:36
:cool: Was hearing that there would be a spotter app coming to PC, Just wondered if this would be possible for console, much like how it is integrated/executed on Iracing, but it would be good to have visual placement of cars on track (on the app), as well, as audio placement. :positive: Even different languages or dialects could be added later as a different version pack.

My "pCars Dash" app has track maps which shows the position of all cars on the track in real time as well as each players position in the race

inthebagbud
02-10-2015, 11:56
:cool: Was hearing that there would be a spotter app coming to PC, Just wondered if this would be possible for console, much like how it is integrated/executed on Iracing, but it would be good to have visual placement of cars on track (on the app), as well, as audio placement. :positive: Even different languages or dialects could be added later as a different version pack.


We may be running before we can walk but if this race engineer http://forum.projectcarsgame.com/showthread.php?38922-Crew-Chief-an-alternative-race-engineer-for-PC-users/page8 could be ported to this app and consoles I think we would all be rightly giddy with excitement.

I have posted the developer and he may consider in future

diesel97
02-10-2015, 12:28
My "pCars Dash" app has track maps which shows the position of all cars on the track in real time as well as each players position in the race

Can you cycle through different screens on your "pcars Dash" app from a button box ? Just wondering if your Tablet Screen and button box talk to each other ?

SkyyJuice
02-10-2015, 15:01
My "pCars Dash" app has track maps which shows the position of all cars on the track in real time as well as each players position in the race

I had seen your pCars apps before on the Project Cars menu page, and as a PS4 owner I could look no further as it was no use to me or other console racers, but Tim has more or less got the go ahead from Sony, hoping that there will be some sort of collaboration with you and Tim, under SMS's umbrella you could get this going on.

Also could there be some consideration to this http://forum.projectcarsgame.com/sho...PC-users/page8

for the new upgraded version, lots to chew on and ponder hmmm

Gravit8
02-10-2015, 21:35
Not to be a double buzz kill :rolleyes:, but SMS does have official Development Kit and Licenses for the PS4, otherwise they could not develop the game in the first place!

If they went the direction of Second Screen API, it would be hard for 3rd party developers, because they don't have either the kit or licenses and the only way would be if SMS launched their own official app.

By streaming data over network is not violating any "rules" - therefore they got approval from 1st parties, and developers don't need to have costly licenses, makes the way open to anyone to build whatever they like (already seen guys here talking about Arduino and analog RPM gauges), so yes, the sky is the limit! And what I like most is that it is a multi platform and simple solution, call it workaround or not.


Perhaps I'm getting the details wrong. But I know there's something different about this situation compared to what war thunder did for second screen apps when they did it a year ago or at launch.
The fact that that other pS4 developers and teams had done this a long time ago, compared to the fact SMS are acting like they are "special" for doing it now may be what's causing some confusion for me.
Maybe you guys are doing it same way war thunder did, and just acting like your reinventing the wheel.
Not sure. Something's missing though.
This second screen app is old news for Sony. Not ground breaking or anything. Been there since launch.

PTG Baby Cow
02-10-2015, 21:41
It's not second screen apps that's groundbreaking it's that fact that it will be opened to 3rd party developers not just sms.

Gravit8
02-10-2015, 21:42
Glass half empty?why cant people just be positive!

Because the glass. (Telemetry is empty almost completely) adding work around telemetry of any kind, would add some liquid, to what's mostly empty. second screen apps fill it up if we get them.
Sorry. I just don't like sippin on empty glasses.
Ever

Gravit8
02-10-2015, 21:45
It's not second screen apps that's groundbreaking it's that fact that it will be opened to 3rd party developers not just sms.

Ok. So there's a difference between first party and third and that's why you need permission and monitoring.
War thunder had a first party license I assume. And SMS carry a third party or are utilizing a third party for this? Meaning Tim? Does that mean Tim does or does not collect checks from SMS? Or is he a freelancer doing this for free?

That's similar to what I was inferring, but MAYBE it's cleared up, as long as I got that right. But I'm not sure. Haha.

Liquid7394
02-10-2015, 22:36
I believe Tim is setting up a data stream that will allow 3rd party apps to use second screen functionality on console, that's the difference. All other second screen apps on console are designed by the developer if I'm not mistaken. The AC: Black Flag companion app is made by Ubisoft, and some games use the PS Apps second screen feature.

PTG Baby Cow
02-10-2015, 22:46
No Tim is with sms. But Tim has received permission to organize and put out the data for anyone to make an app for it. For instance if u have the ability to make an app you would be able to make an app using the data from pcars and Ms or ps4 and have it integrate in lice time.

Gravit8
02-10-2015, 23:02
No Tim is with sms. But Tim has received permission to organize and put out the data for anyone to make an app for it. For instance if u have the ability to make an app you would be able to make an app using the data from pcars and Ms or ps4 and have it integrate in lice time.

So I take the difference to be. War thunder and others had one proprietary app. Developed in partnership with the game and it's developers.
This is you providing the same tools open source, (so to speak) to third parties so they can make their own apps.
If that is correct, or as close as can be stated, then I understand the difference now.
And I appreciate the Requested feature from Sony tons. As well as their reply.
Cool beans.

TheReaper GT
02-10-2015, 23:14
So I take the difference to be. War thunder and others had one proprietary app. Developed in partnership with the game and it's developers.
This is you providing the same tools open source, (so to speak) to third parties so they can make their own apps.
If that is correct, or as close as can be stated, then I understand the difference now.
And I appreciate the Requested feature from Sony tons. As well as their reply.
Cool beans.

Exactly that. The new thing on this process is the data release over network for everybody to grab it. You if you have a good idea about what to do with that data and know how to make it happen, it's all you need.

MikeyTT
03-10-2015, 00:37
Firstly:

From what I understand we, as community developers, won't have any "tools" at our disposal. In the same way that MS did with glass apps, and by the sounds of it AC did, those apps are developed in close union with the game and have access to a lot more inner workings, not to mention potential 2-way comms with the game.

What we are getting is a stream of data over the network from the console. That's it, nothing fancy and only 1-way (from the console). If you want to write an app to read it, then anyone can do that, in practically any dev language. What's ground breaking is that I'm not aware of any other console game where that has been allowed or done in the past. Many PC games have allowed this for donkeys, so it's nothing new on that side. But console, it's new and exciting. Well maybe just new ;)

Secondly:

As soon as we get the required bits and bobs from Tim, I'll be updating my vrHive app to support PS4/XB1 too.

All of the features available in that today, should be perfectly fine for console integration, such as the live data dashes, saved telemetry data and analysis, serial port data output (Arduino/Raspberry Pi), client/server operation (multiple clients with differing dash views, i.e. Win 8.1/10 Tablet)

You can find more on it here: http://forum.projectcarsgame.com/showthread.php?33881-vrHive-Dashes-Telemetry-Live-Data-Arduino-Client-Server-etc

May need help from the community to test, as I only have pCars on PC tho.

Mr.Smoke
03-10-2015, 04:03
May need help from the community to test, as I only have pCars on PC tho.

If it works on an andriod tablet/phone, im more then happy to help test it.

inthebagbud
03-10-2015, 05:46
May need help from the community to test, as I only have pCars on PC tho.

Count me in as a tester along with every user of consoles I would expect

madmax2069
03-10-2015, 07:07
May need help from the community to test, as I only have pCars on PC tho.

If its on windows phone and android im game.

cjorgens79
03-10-2015, 11:25
Can you cycle through different screens on your "pcars Dash" app from a button box ? Just wondering if your Tablet Screen and button box talk to each other ?

You can on the PC version as i have my transmitter app running on the PC which can hook the controller (including button box) inputs and direct messages to the tablet. This wont be possible for the consoles though as i have no way to get the button box inputs.

MikeyTT
03-10-2015, 11:30
Thanks for the support for vrHive. I'll reach out when I need help testing.

Unfortunately Android isn't supported, and likely won't be due to the change in language and environment for me as a developer. I'm a part time dev (read hobbyist), with limited skills and time. C# I know fairly well now, so moving into full on Android dev would be a stretch.

Windows Phone will however be supported. I have a base app for that now. I just need to implement the dash editor in my main app and the control definition in the Phone app and that'll come together nicely.

Mr.Smoke
03-10-2015, 12:34
Unfortunately Android isn't supported....

Damn.....

:(

Pappa_Stig
03-10-2015, 12:53
I'll also throw my hat in the ring to test any Android apps on PS4. I have a Samsung Galaxy Tab 2 10 inch tablet that is covered in dust, and screaming out for something to be useful as lol, and Pcars apps would give it a reason to live.

Alan_Bernardo
03-10-2015, 13:48
You can find more on it here: http://forum.projectcarsgame.com/sho...ent-Server-etc

You ought to be more careful about linking to links that don't work.

ports
03-10-2015, 13:51
You ought to be more careful about linking to links that don't work.

The link works fine for me http://forum.projectcarsgame.com/showthread.php?33881-vrHive-Dashes-Telemetry-Live-Data-Arduino-Client-Server-etc

Keithb23
03-10-2015, 16:28
Just a quick suggestion. I am very happy for all of you console players that you will hopefully have access to second screen apps soon. I would like a moderator to add a small change to the title of the thread to avoid confusion. Could we have the thread say, " Companion app UDP streaming [I]for consoles"? It took me several posts to realize that is what we were discussing. Cheers!

TheReaper GT
03-10-2015, 16:29
Just a quick suggestion. I am very happy for all of you console players that you will hopefully have access to second screen apps soon. I would like a moderator to add a small change to the title of the thread to avoid confusion. Could we have the thread say, " Companion app UDP streaming [I]for consoles"? It took me several posts to realize that is what we were discussing. Cheers!

But the udp streaming will come to pc too

MikeyTT
03-10-2015, 16:41
The link works fine for me http://forum.projectcarsgame.com/showthread.php?33881-vrHive-Dashes-Telemetry-Live-Data-Arduino-Client-Server-etc


You ought to be more careful about linking to links that don't work.

I could, but won't retort with some tempting sarcasm, instead I'll just say that the link works fine for me, certainly on tablet and PC.

Try the main vrhive web site link too: http://www.vrhive.co.uk

madmax2069
03-10-2015, 19:58
I could, but won't retort with some tempting sarcasm, instead I'll just say that the link works fine for me, certainly on tablet and PC.

Try the main vrhive web site link too: http://www.vrhive.co.uk

It works for me, it just takes a minute before it starts doing anything.

Alan_Bernardo
04-10-2015, 03:54
It works for me, it just takes a minute before it starts doing anything.

That link may work, but the other did not. But no one admits to anything around here. As such, nothing gets done.

What a mess this all is. It's like this game is developed by ONE person, working out of his basement, who has trouble with organization.

Fil140
04-10-2015, 14:26
That link may work, but the other did not. But no one admits to anything around here. As such, nothing gets done.

What a mess this all is. It's like this game is developed by ONE person, working out of his basement, who has trouble with organization.

If you are that unhappy, you know where the door is. I bet you are a flawless programmer with a 100% perfect track record in everything that you do yeh?

diesel97
04-10-2015, 16:14
That link may work, but the other did not. But no one admits to anything around here. As such, nothing gets done.

What a mess this all is. It's like this game is developed by ONE person, working out of his basement, who has trouble with organization.

All this over a Link ??? First world problems. Hate to see it when you hit the real world and your ice cream is to cold.

CPU M Rossi
04-10-2015, 16:20
All this over a Link ??? First world problems. Hate to see it when you hit the real world and your ice cream is to cold.
ice cream can never be too cold :p

Mr.Smoke
04-10-2015, 18:10
ice cream can never be too cold :p

For those of us with sensitive teeth, yes it can be :(

Keithb23
05-10-2015, 00:00
But the udp streaming will come to pc too

Thanks, there was no mention of this coming to pc as well, hence the confusion, as all of the posts so far have been related to consoles. I did a little research and I understand that udp is the current trend for client/server apps. Does this mean that the people who have already written server apps will have to re-write them? Just curious to know if this is going to cause major headaches for all the people who have developed apps for the current api on pc.

TheReaper GT
05-10-2015, 00:10
Thanks, there was no mention of this coming to pc as well, hence the confusion, as all of the posts so far have been related to consoles. I did a little research and I understand that udp is the current trend for client/server apps. Does this mean that the people who have already written server apps will have to re-write them? Just curious to know if this is going to cause major headaches for all the people who have developed apps for the current api on pc.

I think the server apps will still have access to the shared memory. But in my opinion the game will do the server side as well now, so in theory the client side can catch the data from the game stream instead of the server stream.

TrueNOS2
05-10-2015, 02:38
My pCars Dash app will be updated to support the PS4/XB1 api, i have already done most of the preliminary work expected for this so it shouldn't take me too long once the interface is formalized.

cjorgens79, Question, will SMS have to publish a patch in order to make your app able to interface with Project Cars and PS4? If so, have you been able to get any timing on when this will happen? I am really excited that this type of interface is coming to console, can't wait!

cjorgens79
05-10-2015, 12:23
cjorgens79, Question, will SMS have to publish a patch in order to make your app able to interface with Project Cars and PS4? If so, have you been able to get any timing on when this will happen? I am really excited that this type of interface is coming to console, can't wait!

Yes SMS will need to publish a patch containing the new API. I will also need to publish an updated version of my app which can make use of the new API. I do not know a time frame, that would be a question for Tim, as from what I gather he is effectively doing this on his own time if I'm not mistaken. Once the api spec is published then i can make whatever changes i need, and therefore be ready asap once a new build of project cars is published containing the api.

inthebagbud
05-10-2015, 12:30
@cjorgens79

If this comes off will you app be able to give console users leader board information as presently we have limited TT leader boards on the Xbox (not sure on PS4) due to limitations on the number of tables that MS allow SMS to use

cjorgens79
06-10-2015, 09:26
@cjorgens79

If this comes off will you app be able to give console users leader board information as presently we have limited TT leader boards on the Xbox (not sure on PS4) due to limitations on the number of tables that MS allow SMS to use

Unfortunately not, the api does not have this information, we only get a feed about the current session (race, prac, qual etc).

There is a website which has the leaderboards, not sure if it includes console players too though or just pc users
http://cars-stats-steam.wmdportal.com/

inthebagbud
06-10-2015, 12:11
Unfortunately not, the api does not have this information, we only get a feed about the current session (race, prac, qual etc).

There is a website which has the leaderboards, not sure if it includes console players too though or just pc users
http://cars-stats-steam.wmdportal.com/

Gutted that would have solved so may issues

The online leaderboards are only for PC as there is no way to get the data out from the consoles, that's why I was hoping the API would solve this

notanuva
06-10-2015, 14:34
[QUOTE=inthebagbud;1140551]Gutted that would have solved so may issues

The online leaderboards are only for PC as there is no way to get the data out from the consoles, that's why I was hoping the API would solve this[/QUOT

It would be good if us console players could get some thing like what bf4 has got for stats / leaderboards. http://bf4stats.com/

TrueNOS2
06-10-2015, 15:55
Yes SMS will need to publish a patch containing the new API. I will also need to publish an updated version of my app which can make use of the new API. I do not know a time frame, that would be a question for Tim, as from what I gather he is effectively doing this on his own time if I'm not mistaken. Once the api spec is published then i can make whatever changes i need, and therefore be ready asap once a new build of project cars is published containing the api.

OK Tim, are we ready for patch 5.0? :eagerness:

PureMalt77
06-10-2015, 16:36
I'm very excited about all this, but come on guys! Leave poor Tim alone. It will be ready when is ready!
Remember that he's doing this outside of his original work plan and is doing us a big favor!

Fil140
06-10-2015, 21:03
I'm very excited about all this, but come on guys! Leave poor Tim alone. It will be ready when is ready!
Remember that he's doing this outside of his original work plan and is doing us a big favor!

Sooo, what youre saying is Tim is lazy and he needs to get a move on?come on Tim you lazy boy.
Seriously,when do i buy a new tablet and mount though?

Mr.Smoke
06-10-2015, 21:20
Sooo, what youre saying is Tim is lazy and he needs to get a move on?come on Tim you lazy boy.
Seriously,when do i buy a new tablet and mount though?

Buy it now, that way you have it ready to go when the time comes.

azidahaka
08-10-2015, 13:09
Questions:

Could we use the eventual app as a button box too, or it would be impossible? Is the packet transfer mono-directional?

It would be cool to have a touch button box/telemetry all in one thing :)

Also does it show ride height and suspension travel?

Schnizz58
08-10-2015, 14:28
The data stream is one-way. I don't see ride height or suspension travel in the shared memory structure but I may be overlooking it.

mjemec11
10-10-2015, 07:57
So I guess this isn't ready for patch 5.0? I didn't find anything in the PC patch notes.

mr_belowski
10-10-2015, 10:25
how are you going to handle packet fragmentation? Are you going to keep the packets really small (500 bytes or so) to avoid them getting fragmented? Or are going to use a larger packet size and allow them to be fragmented? If they do get fragmented, won't that mean lots of data loss (lose 1 fragment and the entire packet is lost)? If you need to send, say, 5000 bytes of data for one 'update', and this is sent as a single UDP packet, it'll get fragmented into up to 10 individual packets by the network. Then if you have, say, 5% packet loss, you'd lose (on average) 50% of your overall packets.

Or am I talking nonsense? I just can't see how the data in the shared memory block can be transferred via UDP without major packet fragmentation. Or are you only sending a small subset of it? If it's a subset, are you leaving out the mParticipantData array?

oscarolim
10-10-2015, 14:50
The data is sent locally, I don't think it will be an issue unless you have a very congested network at home.

mr_belowski
10-10-2015, 15:21
hope you're right :)

Tim Mann
11-10-2015, 18:51
Apologies for not updating recently, I've been concentrating on my last couple of exams which has left me with no time at all on weekends and evenings (and a huge pile of washing) these should all be out of the way after next weekend. The required GUI option has been added and I've set up the UDP streaming, I need to work out the packet splitting stuff next.

azidahaka
11-10-2015, 21:31
Apologies for not updating recently, I've been concentrating on my last couple of exams which has left me with no time at all on weekends and evenings (and a huge pile of washing) these should all be out of the way after next weekend. The required GUI option has been added and I've set up the UDP streaming, I need to work out the packet splitting stuff next.

Great stuff! I presume it'll be something to be on console's 5.0 update that is to be?

Jussi Viljami Karjalainen
11-10-2015, 22:04
The data stream is one-way. I don't see ride height or suspension travel in the shared memory structure but I may be overlooking it.They haven't been in there so far and it makes me a bit sad, I could use those numbers to estimate downforce...

Jussi Viljami Karjalainen
11-10-2015, 22:06
Great stuff! I presume it'll be something to be on console's 5.0 update that is to be?The console 5.0 update is almost certainly already in the approval process pipeline, if the system isn't ready yet then it will pretty certainly not be in patch 5.0.

azidahaka
12-10-2015, 23:58
Since i do not have a tablet, what specs would i need to get for these apps to run well?

What should i be checking for the most?

TheReaper GT
13-10-2015, 00:03
Since i do not have a tablet, what specs would i need to get for these apps to run well?

What should i be checking for the most?

I don't think you are gonna need much, any android cell phone or tablet will do. I'm sure some ios and Windows phone apps will come to life too.

azidahaka
14-10-2015, 22:39
Would it be possible for one of the apps to act both as telemetry and as Bluethoot keyboard?

That way we could have telemetry+touch button box all in one! Would be GREAT with a tablet. (hope my english manages to explain what i meant :D )

TheReaper GT
14-10-2015, 22:40
Would it be possible for one of the apps to act both as telemetry and as Bluethoot keyboard?

That way we could have telemetry+touch button box all in one! Would be GREAT with a tablet. (hope my english manages to explain what i meant :D )

Don't think so.

Schnizz58
14-10-2015, 23:25
Would it be possible for one of the apps to act both as telemetry and as Bluethoot keyboard?

That way we could have telemetry+touch button box all in one! Would be GREAT with a tablet. (hope my english manages to explain what i meant :D )
The data stream is one-way. That's the only way the 1st parties would agree to do this. Otherwise it exposes a potential security risk.

azidahaka
15-10-2015, 06:22
You misunderstood i think, an app can use the datastream monodirectionally and act as a bluethooth keyboard too? The keyboard part would be recognized by ps4 as it already does. It's like coupling the 2 parts.

Liquid7394
15-10-2015, 12:56
You misunderstood i think, an app can use the datastream monodirectionally and act as a bluethooth keyboard too? The keyboard part would be recognized by ps4 as it already does. It's like coupling the 2 parts.
The app would have to be recognised as a bluetooth keyboard by the PS4.

Keithb23
15-10-2015, 15:32
Samsung devices have a mode called 'Multi-window'. If the app were written to support that, then a user could have their bluetooth keyboard app running and the udp app open in a multi-window. It might be possible to do the the opposite as well. If the tablet bluetooth keyboard app supports multi-window, then it might be possible to have the udp app running and the bluetooth keyboard app open in a multi-window. I haven't tried using multi-window with my Samsung phone or tablet, but I know it's supported by a number of apps. A comprehensive list is here (http://www.mobilemultitasking.com).

azidahaka
15-10-2015, 17:40
Samsung devices have a mode called 'Multi-window'. If the app were written to support that, then a user could have their bluetooth keyboard app running and the udp app open in a multi-window. It might be possible to do the the opposite as well. If the tablet bluetooth keyboard app supports multi-window, then it might be possible to have the udp app running and the bluetooth keyboard app open in a multi-window. I haven't tried using multi-window with my Samsung phone or tablet, but I know it's supported by a number of apps. A comprehensive list is here (http://www.mobilemultitasking.com).

This would look gorgeous!

mr_belowski
16-10-2015, 12:41
is there any reasonable confidence that MS or Sony won't change their minds about this some time in the future and just disable it? I'm concerned that add on developers might invest a lot of time creating add-ons or adapting existing add-ons to use the UDP data. Then in 6 months Sony realise there's a security hole in the PS4's network stack that can potentially be exploited when the console's sending UDP data to a multicast address. Or something. Or perhaps they just release a system update that randomly breaks this. Then app developers who've worked so hard are left with nothing. Customers might have paid for an app that can no longer be used.

Can me cynical, but MS and Sony haven't got the greatest of track records when it comes to honouring their pledges and supporting indie developers

azidahaka
16-10-2015, 14:23
is there any reasonable confidence that MS or Sony won't change their minds about this some time in the future and just disable it? I'm concerned that add on developers might invest a lot of time creating add-ons or adapting existing add-ons to use the UDP data. Then in 6 months Sony realise there's a security hole in the PS4's network stack that can potentially be exploited when the console's sending UDP data to a multicast address. Or something. Or perhaps they just release a system update that randomly breaks this. Then app developers who've worked so hard are left with nothing. Customers might have paid for an app that can no longer be used.

Can me cynical, but MS and Sony haven't got the greatest of track records when it comes to honouring their pledges and supporting indie developers

It's monodirectional, so i do not see how there could be security breaches.

Fre.Mo
17-10-2015, 10:38
Will it be technically possible with udp streaming to have on console some relevant wheel calibration tools from the game to have a linear response. PCars allows a very detailled wheel setting with a lot of parameters but on console we adjust them quite blindly and having the good feeling is not easy.

TheReaper GT
17-10-2015, 12:50
Will it be technically possible with udp streaming to have on console some relevant wheel calibration tools from the game to have a linear response. PCars allows a very detailled wheel setting with a lot of parameters but on console we adjust them quite blindly and having the good feeling is not easy.


It's monodirectional, so i do not see how there could be security breaches.

Here

STEELJOCKEY
18-10-2015, 01:14
Here's a strange question, but there is a reason for it

Can a set of headphones accept 2 simultaneous signals from 2 separate sources?

CPU M Rossi
18-10-2015, 01:35
Here's a strange question, but there is a reason for it

Can a set of headphones accept 2 simultaneous signals from 2 separate sources?
well there are splitters for the audio jacks for composite/component video which will take the left & right audio into one
thinking about it here is what I have came up with may be something out there *shrugs* but here is my thought
get a male to male cable then connect a headphone splitter then use two female to female cable to each audio source no clue if that will work but don't see why not

STEELJOCKEY
18-10-2015, 03:28
Ok, the reason why I'm asking is, Mr Belowski has made an amazing crew chief app for PC, and I'm sure putting that xbox is not an option when these fixes are made to allow telemetry apps access. If an appwas made for iPhone/pad/android devices that could read the data from pCars, I could still use my headphones connected through the controller for game sound and chat, and splice in the crew chief from outside device. + telemetry, this would be awesome on a console

TheReaper GT
18-10-2015, 03:32
Ok, the reason why I'm asking is, Mr Belowski has made an amazing crew chief app for PC, and I'm sure putting that xbox is not an option when these fixes are made to allow telemetry apps access. If an appwas made for iPhone/pad/android devices that could read the data from pCars, I could still use my headphones connected through the controller for game sound and chat, and splice in the crew chief from outside device. + telemetry, this would be awesome on a console

I think the split connection will hurt the already poor audio quality. Best option is to use a ear bud inside your headset.

STEELJOCKEY
18-10-2015, 04:32
Just a thought. If Mr Belowski can do an app for a device that can read info from pCars Ill work out a way to hear it

Liquid7394
18-10-2015, 11:24
Has the crew chief app even been confirmed for console?

mr_belowski
18-10-2015, 12:08
I intend to port it to use the udp data stream, if this data has what I need in it. This would run on the PC, streaming data from the Xbox or ps4. Not ideal but a good first step.

If that works I'll port it to android. At least that's the long term plan. Support for udp multicast reception on android is a bit patchy so that might complicate things a bit

inthebagbud
18-10-2015, 15:16
I intend to port it to use the udp data stream, if this data has what I need in it. This would run on the PC, streaming data from the Xbox or ps4. Not ideal but a good first step.

If that works I'll port it to android. At least that's the long term plan. Support for udp multicast reception on android is a bit patchy so that might complicate things a bit

Absolutely fantastic news, you sir are a credit to the unsung hero's who give their time to improve the experience of others.

Sms should make you an offer to incudes the race engineer as standard

STEELJOCKEY
18-10-2015, 18:04
Here here!

Any chance of an apple app?

mr_belowski
18-10-2015, 18:06
Don't think so - I got no iNuffin so nowt to test on

Synner40
19-10-2015, 15:25
Here here!

Any chance of an apple app?

I believe there is one iOS app,(app dev posted earlier in the thread)

my on,y wish it works on. iPad 2 and doesn't require iOS 9.

STEELJOCKEY
19-10-2015, 19:33
There's a few telemetry apps for i stuff, was really hoping for the crew chief, he is awesome on PC, would be great on console

RomKnight
20-10-2015, 10:19
Hoping this can push the suspension telemetry data to the API.

JohnSchoonsBeard
20-10-2015, 11:07
Apologies if this has been asked before.

Are any of these apps web enabled yet so a laptop PC could also be a screen? I'm playing on PS4 and I was thinking of using a laptop for race position info (handy when hosting) and my phone/tablet for car/telemetry info.

MikeyTT
20-10-2015, 17:57
Apologies if this has been asked before.

Are any of these apps web enabled yet so a laptop PC could also be a screen? I'm playing on PS4 and I was thinking of using a laptop for race position info (handy when hosting) and my phone/tablet for car/telemetry info.

That's the plan with my vrHive app. At present you can run multiple clients that are PC based, so you could have different views on each. That's how I run my setup. Main PC running the main dash page and my tablet running the racers view dash page. When I add support for Windows Phone then you'll be able to do exactly that.

TrueNOS2
20-10-2015, 18:54
Any progress made on this? It looks like we will have to wait for perhaps a Patch 6.0 implementation.

cjorgens79
21-10-2015, 11:45
Any progress made on this? It looks like we will have to wait for perhaps a Patch 6.0 implementation.

Tim said he has been extremely busy and has had no spare time, but he expects to be able to get back onto it around the end of next week.

SkyyJuice
22-10-2015, 23:49
Well I guess you cant say fairer than that. :-)

I know that I maybe skipping a tad fast here, but is there any thought of this app being implemented on PlayStation VR; And how does it work with the DK2 are there any problems ?

Tim Mann
23-10-2015, 21:46
I managed to do a few hours on it this evening. I've posted the first draft of the packet structure to cjorgens79 (as he kindly did the vast amount of work for me regarding looking up the data conversions). The structure is all set up and data is being filled quite happily on PS4 (It'll work the same on PC/XB1, it's just that I prefer the PS environment to work in). Once he's checked it over I'll work on the other packet types.

What I'll probably do is write out a test file that dumps all the packets out, I'll then share that somewhere together with all the struct details. App developers can then use this for initial testing.

TheReaper GT
23-10-2015, 21:48
Well I guess you cant say fairer than that. :-)

I know that I maybe skipping a tad fast here, but is there any thought of this app being implemented on PlayStation VR; And how does it work with the DK2 are there any problems ?

I don't get that, you have the whole car dash and hud on a vr environment.

TrueNOS2
24-10-2015, 14:53
I managed to do a few hours on it this evening. I've posted the first draft of the packet structure to cjorgens79 (as he kindly did the vast amount of work for me regarding looking up the data conversions). The structure is all set up and data is being filled quite happily on PS4 (It'll work the same on PC/XB1, it's just that I prefer the PS environment to work in). Once he's checked it over I'll work on the other packet types.

What I'll probably do is write out a test file that dumps all the packets out, I'll then share that somewhere together with all the struct details. App developers can then use this for initial testing.

:encouragement: Excellent! Thanks Tim and cjorgens79! I am really looking forward to this becoming a reality.

mr_belowski
26-10-2015, 11:26
Good news, I'm looking forward to getting my hands on this :)

Fil140
26-10-2015, 11:29
This is getting really exciting now, all i want is a motec style dash app to sit on my base dirctly behind the wheel rim

Tim Mann
26-10-2015, 21:04
220892220893

Fre.Mo
26-10-2015, 21:13
I can t wait seeing the apps on my tablet... Thanks for the continuous efforts improving the game experience.

azidahaka
26-10-2015, 21:27
Spotting cars and drivers in it :)

Schnizz58
26-10-2015, 21:33
Where would we be without Wireshark?

SUBGTRACER
28-10-2015, 00:02
can't wait ....... This will be great for Pcars

Elaine The Racer
28-10-2015, 02:25
Pardon me if this has been asked, but is iPhone / iPads getting this support/app? I've an old phone case going to suction it to my F1 rim TX base is all

*edit* I have SimRaceDash app on my phone will that work once everything has been finalised?

TheReaper GT
28-10-2015, 02:30
Pardon me if this has been asked, but is iPhone / iPads getting this support/app? I've an old phone case going to suction it to my F1 rim TX base is all

The data will be over the network to grab. Is possible for someone to write an iPhone app to use that data.

Elaine The Racer
28-10-2015, 02:31
The data will be over the network to grab. Is possible for someone to write an iPhone app to use that data.


SimRaceDash? Will that work?

TheReaper GT
28-10-2015, 02:43
SimRaceDash? Will that work?

Only the dev can say. Normally, on pc, those apps have a server counterpart that grab the data from the shared memory and sends it to the network to be grabbed by the client. With the new implementation, theoretically, the server side will no longer be needed, so the devs can make one app that work for all three platforms. In this very thread there are some devs mentioning that they will support the new days stream, I just don't recall which apps they made.

STEELJOCKEY
28-10-2015, 05:43
Crew chief for istuff, crew chief for istuff!

Can someone donate an old ithing to Mr Belowski so he can adapt his crew chief for us on ithings.

Hit like to vote NOW

2stains
28-10-2015, 10:08
[QUOTE=STEELJOCKEY;1158523]Crew chief for istuff, crew chief for istuff!

Can someone donate an old ithing to Mr Belowski so he can adapt his crew chief for us on ithings.

Hit like to vote NOW[/QUOTE you should donate your ithing to speed things up .

cjorgens79
28-10-2015, 10:33
Pardon me if this has been asked, but is iPhone / iPads getting this support/app? I've an old phone case going to suction it to my F1 rim TX base is all

*edit* I have SimRaceDash app on my phone will that work once everything has been finalised?

"pCars Dash" currently supports iOS and Android and will be updated to work with the new console api

mr_belowski
28-10-2015, 10:37
I really don't think Crew Chief on iThings is feasible chaps. It's a lot (big big lot) of dev work, it'll cost me proper money for the tools and access to the store, and the risks of Apple deciding it isn't suitable for the app store are simply too great.

I do intend to port it to android, but in the first instance I'll add the necessary bits and bobs to the PC version so it can read from the UDP data stream. This means you'll be able to use Crew Chief on your console, but the app will have to run on an old laptop or something. All this assumes the UDP data contains the things I'll need - I've not seen it yet :)

KkDrummer
28-10-2015, 11:31
I really don't think Crew Chief on iThings is feasible chaps. It's a lot (big big lot) of dev work, it'll cost me proper money for the tools and access to the store, and the risks of Apple deciding it isn't suitable for the app store are simply too great.

I do intend to port it to android, but in the first instance I'll add the necessary bits and bobs to the PC version so it can read from the UDP data stream. This means you'll be able to use Crew Chief on your console, but the app will have to run on an old laptop or something. All this assumes the UDP data contains the things I'll need - I've not seen it yet :)

My Windows 10 tablet is ready! thanks man!

Tim Mann
28-10-2015, 20:31
I spent ages nicely tabbing this out and it's all gone wonky on the post. This is close to the final layout. The port is 5606 on all platforms. If anyone wants a test udp stream as a file I can send you one based on the below layout (it's just a concatenated stream of packets).

struct sParticipantInfo
{
s16 sWorldPosition[3]; // 0
u16 sCurrentLapDistance; // 6
u8 sRacePosition; // 8
u8 sLapsCompleted; // 9
u8 sCurrentLap; // 10
u8 sSector; // 11
// 12
};

struct sParticipantInfoStrings
{
static const u32 sPacketSize = 1347;
u16 sBuildVersionNumber; // 0
u8 sPacketType; // 2
char sCarName[64]; // 3
char sCarClassName[64]; // 131
char sTrackLocation[64]; // 195
char sTrackVariation[64]; // 259
char sName[16][64]; // 323
// 1347
};

struct sParticipantInfoStringsAdditional
{
static const u32 sPacketSize = 1028;
u16 sBuildVersionNumber; // 0
u8 sPacketType; // 2
u8 sOffset; // 3
char sName[16][64]; // 4
// 1028
};

struct sTelemetryData
{
static const u32 sPacketSize = 941;
u16 sBuildVersionNumber; // 0
u8 sPacketType; // 2

// Game states
u8 sGameSessionState; // 3

// Participant info
s8 sViewedParticipantIndex; // 4
s8 sNumParticipants; // 5

// Unfiltered input
u8 sUnfilteredThrottle; // 6
u8 sUnfilteredBrake; // 7
s8 sUnfilteredSteering; // 8
u8 sUnfilteredClutch; // 9
u8 sRaceStateFlags; // 10

// Event information
u8 sLapsInEvent; // 11

// Timings
f32 sBestLapTime; // 12
f32 sLastLapTime; // 16
f32 sCurrentTime; // 20
f32 sSplitTimeAhead; // 24
f32 sSplitTimeBehind; // 28
f32 sSplitTime; // 32
f32 sEventTimeRemaining; // 36
f32 sPersonalFastestLapTime; // 40
f32 sWorldFastestLapTime; // 44
f32 sCurrentSector1Time; // 48
f32 sCurrentSector2Time; // 52
f32 sCurrentSector3Time; // 56
f32 sFastestSector1Time; // 60
f32 sFastestSector2Time; // 64
f32 sFastestSector3Time; // 68
f32 sPersonalFastestSector1Time; // 72
f32 sPersonalFastestSector2Time; // 76
f32 sPersonalFastestSector3Time; // 80
f32 sWorldFastestSector1Time; // 84
f32 sWorldFastestSector2Time; // 88
f32 sWorldFastestSector3Time; // 92

u16 sTrackLength; // 96

// Flags
u8 sHighestFlag; // 98

// Pit info
u8 sPitModeSchedule; // 99

// Car state
s16 sOilTempCelsius; // 100
u16 sOilPressureKPa; // 102
s16 sWaterTempCelsius; // 104
u16 sWaterPressureKpa; // 106
u16 sFuelPressureKpa; // 108
u8 sCarFlags; // 110
u8 sFuelCapacity; // 111
u8 sBrake; // 112
u8 sThrottle; // 113
u8 sClutch; // 114
s8 sSteering; // 115
f32 sFuelLevel; // 116
f32 sSpeed; // 120
u16 sRpm; // 124
u16 sMaxRpm; // 126
u8 sGearNumGears; // 128
s8 sLastOpponentCollisionIndex; // 129

u8 sLastOpponentCollisionMagnitude; // 130
u8 sBoostAmount; // 131

f32 sOdometerKM; // 132
f32 sOrientation[3]; // 136
f32 sLocalVelocity[3]; // 148
f32 sWorldVelocity[3]; // 160
f32 sAngularVelocity[3]; // 172
f32 sLocalAcceleration[3]; // 184
f32 sWorldAcceleration[3]; // 196
f32 sExtentsCentre[3]; // 208

// Wheels / Tyres
u8 sTyreFlags[4]; // 220
u8 sTerrain[4]; // 224
f32 sTyreY[4]; // 228
f32 sTyreRPS[4]; // 244
f32 sTyreSlipSpeed[4]; // 260
u8 sTyreTemp[4]; // 276
u8 sTyreGrip[4]; // 280
f32 sTyreHeightAboveGround[4]; // 284
f32 sTyreLateralStiffness[4]; // 300
u8 sTyreWear[4]; // 316
u8 sBrakeDamage[4]; // 320
u8 sSuspensionDamage[4]; // 324
s16 sBrakeTempCelsius[4]; // 328
u16 sTyreTreadTemp[4]; // 336
u16 sTyreLayerTemp[4]; // 344
u16 sTyreCarcassTemp[4]; // 352
u16 sTyreRimTemp[4]; // 360
u16 sTyreInternalAirTemp[4]; // 368


// Car damage
u8 sCrashState; // 376
u8 sAeroDamage; // 377
u8 sEngineDamage; // 378

// Weather
s8 sAmbientTemperature; // 379
s8 sTrackTemperature; // 380
u8 sRainDensity; // 381
s8 sWindSpeed; // 382
s8 sWindDirectionX; // 383
s8 sWindDirectionY; // 384
u8 sCloudBrightness; // 385

// Buttons

sParticipantInfo sParticipantInfo[46]; // 386
// 46*12=552
u16 sJoyPad; // 938
u8 sDPad; // 940
// 944 struct is padded to
};


mBuildVersionNumber=mTelemetryData.sBuildVersionNumber=(u16)pMemory->mBuildVersionNumber; // u32->u16
mTelemetryData.sPacketType=0; // Unique

// Game state
mTelemetryData.sGameSessionState=((u8)pMemory->mGameState)|(((u8)pMemory->mSessionState)<<4); // (enum 3 bits/enum 3 bits)->u8
mTelemetryData.sRaceStateFlags=((u8)pMemory->mRaceState) | // (enum 3 bits)->u8
(pMemory->mLapInvalidated?8:0)|(pMemory->mAntiLockActive?16:0)|(pMemory->mBoostActive?32:0); // (bool/bool/bool)->u8

// Participant info
mTelemetryData.sViewedParticipantIndex=(s8)pMemory->mViewedParticipantIndex; // s32->s8
mTelemetryData.sNumParticipants=(s8)pMemory->mNumParticipants; // s32->s8

// Unfiltered input
mTelemetryData.sUnfilteredThrottle=(u8)(Clamp(pMemory->mUnfilteredThrottle, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sUnfilteredBrake=(u8)(Clamp(pMemory->mUnfilteredBrake, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sUnfilteredSteering=(s8)(Clamp(pMemory->mUnfilteredSteering, -1.0f, 1.0f)*127.0f); // f32->s8
mTelemetryData.sUnfilteredClutch=(u8)(Clamp(pMemory->mUnfilteredClutch, 0.0f, 1.0f)*255.0f); // f32->u8

// Event information
mTelemetryData.sTrackLength=(u16)pMemory->mTrackLength; // f32->u16
mTelemetryData.sLapsInEvent=(u8)min(pMemory->mLapsInEvent,255); // u32->u8

// Timings
mTelemetryData.sBestLapTime=pMemory->mBestLapTime; // f32->f32
mTelemetryData.sLastLapTime=pMemory->mLastLapTime; // f32->f32
mTelemetryData.sCurrentTime=pMemory->mCurrentTime; // f32->f32
mTelemetryData.sSplitTimeAhead=pMemory->mSplitTimeAhead; // f32->f32
mTelemetryData.sSplitTimeBehind=pMemory->mSplitTimeBehind; // f32->f32
mTelemetryData.sSplitTime=pMemory->mSplitTime; // f32->f32
mTelemetryData.sEventTimeRemaining=pMemory->mEventTimeRemaining; // f32->f32
mTelemetryData.sPersonalFastestLapTime=pMemory->mPersonalFastestLapTime; // f32->f32
mTelemetryData.sWorldFastestLapTime=pMemory->mWorldFastestLapTime; // f32->f32
mTelemetryData.sCurrentSector1Time=pMemory->mCurrentSector1Time; // f32->f32
mTelemetryData.sCurrentSector2Time=pMemory->mCurrentSector2Time; // f32->f32
mTelemetryData.sCurrentSector3Time=pMemory->mCurrentSector3Time; // f32->f32
mTelemetryData.sFastestSector1Time=pMemory->mFastestSector1Time; // f32->f32
mTelemetryData.sFastestSector2Time=pMemory->mFastestSector2Time; // f32->f32
mTelemetryData.sFastestSector3Time=pMemory->mFastestSector3Time; // f32->f32
mTelemetryData.sPersonalFastestSector1Time=pMemory->mPersonalFastestSector1Time; // f32->f32
mTelemetryData.sPersonalFastestSector2Time=pMemory->mPersonalFastestSector2Time; // f32->f32
mTelemetryData.sPersonalFastestSector3Time=pMemory->mPersonalFastestSector3Time; // f32->f32
mTelemetryData.sWorldFastestSector1Time=pMemory->mWorldFastestSector1Time; // f32->f32
mTelemetryData.sWorldFastestSector2Time=pMemory->mWorldFastestSector2Time; // f32->f32
mTelemetryData.sWorldFastestSector3Time=pMemory->mWorldFastestSector3Time; // f32->f32

// Flags
mTelemetryData.sHighestFlag=((u8)pMemory->mHighestFlagColour) | (((u8)pMemory->mHighestFlagReason)<<4); // (enum 3 bits/enum 2 bits)

// Pit info
mTelemetryData.sPitModeSchedule=((u8)pMemory->mPitMode) | (((u8)pMemory->mPitSchedule)<<4); // (enum 3 bits/enum 2 bits)

// Car state
mTelemetryData.sCarFlags=(u8)pMemory->mCarFlags; // enum->u8
mTelemetryData.sOilTempCelsius=(s16)pMemory->mOilTempCelsius; // f32->s16
mTelemetryData.sOilPressureKPa=(u16)pMemory->mOilPressureKPa; // f32->u16
mTelemetryData.sWaterTempCelsius=(s16)pMemory->mWaterTempCelsius; // f32->s16
mTelemetryData.sWaterPressureKpa=(u16)pMemory->mWaterPressureKPa; // f32->u16
mTelemetryData.sFuelPressureKpa=(u16)pMemory->mFuelPressureKPa; // f32->u16
mTelemetryData.sFuelCapacity=(u8)pMemory->mFuelCapacity; // f32->u8
mTelemetryData.sBrake=(u8)(Clamp(pMemory->mBrake, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sFuelLevel=pMemory->mFuelLevel; // f32->f32
mTelemetryData.sSpeed=pMemory->mSpeed; // f32->f32
mTelemetryData.sRpm=(u16)pMemory->mRpm; // f32->u16
mTelemetryData.sMaxRpm=(u16)pMemory->mMaxRPM; // f32->u16
mTelemetryData.sThrottle=(u8)(Clamp(pMemory->mThrottle, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sClutch=(u8)(Clamp(pMemory->mClutch, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sSteering=(s8)(Clamp(pMemory->mSteering, -1.0f, 1.0f)*127.0f); // f32->s8
u8 gear=pMemory->mGear<0?0x0f:min((u8)(pMemory->mGear&0xff), 7);
u8 numGears=max((u8)(pMemory->mNumGears&0xff), 0);
mTelemetryData.sGearNumGears=(gear&0x0f)|((numGears&0x0f)<<4); // s32/s32->u8
mTelemetryData.sOdometerKM=pMemory->mOdometerKM; // f32->f32
mTelemetryData.sLastOpponentCollisionIndex=(s8)pMemory->mLastOpponentCollisionIndex; // s32->s8
mTelemetryData.sLastOpponentCollisionMagnitude=(u8)min(pMemory->mLastOpponentCollisionMagnitude, 255); // f32->u8
mTelemetryData.sBoostAmount=(u8)pMemory->mBoostAmount; // f32->u8
mTelemetryData.sOrientation[0]=pMemory->mOrientation[0]; // f32->f32
mTelemetryData.sOrientation[1]=pMemory->mOrientation[1]; // f32->f32
mTelemetryData.sOrientation[2]=pMemory->mOrientation[2]; // f32->f32
mTelemetryData.sLocalVelocity[0]=pMemory->mLocalVelocity[0]; // f32->f32
mTelemetryData.sLocalVelocity[1]=pMemory->mLocalVelocity[1]; // f32->f32
mTelemetryData.sLocalVelocity[2]=pMemory->mLocalVelocity[2]; // f32->f32
mTelemetryData.sWorldVelocity[0]=pMemory->mWorldVelocity[0]; // f32->f32
mTelemetryData.sWorldVelocity[1]=pMemory->mWorldVelocity[1]; // f32->f32
mTelemetryData.sWorldVelocity[2]=pMemory->mWorldVelocity[2]; // f32->f32
mTelemetryData.sAngularVelocity[0]=pMemory->mAngularVelocity[0]; // f32->f32
mTelemetryData.sAngularVelocity[1]=pMemory->mAngularVelocity[1]; // f32->f32
mTelemetryData.sAngularVelocity[2]=pMemory->mAngularVelocity[2]; // f32->f32
mTelemetryData.sLocalAcceleration[0]=pMemory->mLocalAcceleration[0]; // f32->f32
mTelemetryData.sLocalAcceleration[1]=pMemory->mLocalAcceleration[1]; // f32->f32
mTelemetryData.sLocalAcceleration[2]=pMemory->mLocalAcceleration[2]; // f32->f32
mTelemetryData.sWorldAcceleration[0]=pMemory->mWorldAcceleration[0]; // f32->f32
mTelemetryData.sWorldAcceleration[1]=pMemory->mWorldAcceleration[1]; // f32->f32
mTelemetryData.sWorldAcceleration[2]=pMemory->mWorldAcceleration[2]; // f32->f32
mTelemetryData.sExtentsCentre[0]=pMemory->mExtentsCentre[0]; // f32->f32
mTelemetryData.sExtentsCentre[1]=pMemory->mExtentsCentre[1]; // f32->f32
mTelemetryData.sExtentsCentre[2]=pMemory->mExtentsCentre[2]; // f32->f32

// Wheels / Tyres
u32 i;
for (i=0;i<4;i++)
{
mTelemetryData.sTyreFlags[i]=(u8)pMemory->mTyreFlags[i]; // (enum 3 bits)->u8
mTelemetryData.sTerrain[i]=(u8)pMemory->mTerrain[i]; // (enum 6 bits)->u8
mTelemetryData.sTyreY[i]=pMemory->mTyreY[i]; // f32->f32
mTelemetryData.sTyreRPS[i]=pMemory->mTyreRPS[i]; // f32->f32
mTelemetryData.sTyreSlipSpeed[i]=pMemory->mTyreSlipSpeed[i]; // f32->f32
mTelemetryData.sTyreTemp[i]=(u8)Clamp(pMemory->mTyreTemp[i], 0.0f, 255.0f); // f32->u8
mTelemetryData.sTyreGrip[i]=(u8)Clamp(pMemory->mTyreGrip[i], 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sTyreHeightAboveGround[i]=pMemory->mTyreHeightAboveGround[i]; // f32->f32
mTelemetryData.sTyreLateralStiffness[i]=pMemory->mTyreLateralStiffness[i]; // f32->f32
mTelemetryData.sTyreWear[i]=(u8)(Clamp(pMemory->mTyreWear[i], 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sBrakeDamage[i]=(u8)(Clamp(pMemory->mBrakeDamage[i], 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sSuspensionDamage[i]=(u8)(Clamp(pMemory->mSuspensionDamage[i], 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sBrakeTempCelsius[i]=(s16)pMemory->mBrakeTempCelsius[i]; // f32->s16
mTelemetryData.sTyreTreadTemp[i]=(u16)pMemory->mTyreTreadTemp[i]; // f32->u16
mTelemetryData.sTyreLayerTemp[i]=(u16)pMemory->mTyreLayerTemp[i]; // f32->u16
mTelemetryData.sTyreCarcassTemp[i]=(u16)pMemory->mTyreCarcassTemp[i]; // f32->u16
mTelemetryData.sTyreRimTemp[i]=(u16)pMemory->mTyreRimTemp[i]; // f32->u16
mTelemetryData.sTyreInternalAirTemp[i]=(u16)pMemory->mTyreInternalAirTemp[i]; // f32->u16
}

//Car damage
mTelemetryData.sCrashState=(u8)pMemory->mCrashState; // (enum 3 bits)->u8
mTelemetryData.sAeroDamage=(u8)(Clamp(pMemory->mAeroDamage, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sEngineDamage=(u8)(Clamp(pMemory->mEngineDamage, 0.0f, 1.0f)*255.0f); // f32->u8

// Weather
mTelemetryData.sAmbientTemperature=(s8)Clamp(pMemory->mAmbientTemperature, -127.0f, 127.0f); // f32->s8
mTelemetryData.sTrackTemperature=(s8)Clamp(pMemory->mTrackTemperature, -127.0f, 127.0f); // f32->s8
mTelemetryData.sRainDensity=(u8)(Clamp(pMemory->mRainDensity, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sWindSpeed=(u8)(Clamp(pMemory->mWindSpeed*0.5f, 0.0f, 255.0f)); // f32->u8
mTelemetryData.sWindDirectionX=(s8)Clamp(pMemory->mWindDirectionX*127.0f, -127.0f, 127.0f); // f32->s8
mTelemetryData.sWindDirectionY=(s8)Clamp(pMemory->mWindDirectionY*127.0f, -127.0f, 127.0f); // f32->s8
mTelemetryData.sCloudBrightness=(u8)Clamp(pMemory->mCloudBrightness, 0.0f, 255.0f); // f32->u8

for (i=0;i<(u32)Clamp(pMemory->mNumParticipants, 0, 46);i++)
{
mTelemetryData.sParticipantInfo[i].sWorldPosition[0]=(s16)Clamp(pMemory->mParticipantInfo[i].mWorldPosition[0], -32768.0f, 32767.0f); // f32->s16
mTelemetryData.sParticipantInfo[i].sWorldPosition[1]=(s16)Clamp(pMemory->mParticipantInfo[i].mWorldPosition[1], -32768.0f, 32767.0f); // f32->s16
mTelemetryData.sParticipantInfo[i].sWorldPosition[2]=(s16)Clamp(pMemory->mParticipantInfo[i].mWorldPosition[2], -32768.0f, 32767.0f); // f32->s16
mTelemetryData.sParticipantInfo[i].sCurrentLapDistance=(u16)min(pMemory->mParticipantInfo[i].mCurrentLapDistance, 65535.0f); // f32->u16
mTelemetryData.sParticipantInfo[i].sRacePosition=((u8)pMemory->mParticipantInfo[i].mRacePosition)|(pMemory->mParticipantInfo[i].mIsActive?128:0); // u32+bool->u8
mTelemetryData.sParticipantInfo[i].sLapsCompleted=(u8)min(pMemory->mParticipantInfo[i].mLapsCompleted, 255); // u32->u8
mTelemetryData.sParticipantInfo[i].sCurrentLap=(u8)min(pMemory->mParticipantInfo[i].mCurrentLap, 255); // u32->u8
mTelemetryData.sParticipantInfo[i].sSector=(u8)pMemory->mParticipantInfo[i].mCurrentSector; // (enum 3 bits)->u8
}

mTelemetryData.sJoyPad=(u16)JOYPAD BUTTON MASK
mTelemetryData.sDPad=(u8)JOYPAD DPAD MASK

// This packet below is sent less often
BStrcpy(mParticipantStrings.sCarName, 64, pMemory->mCarName);
BStrcpy(mParticipantStrings.sCarClassName, 64, pMemory->mCarClassName);
BStrcpy(mParticipantStrings.sTrackLocation, 64, pMemory->mTrackLocation);
BStrcpy(mParticipantStrings.sTrackVariation, 64, pMemory->mTrackVariation);
for (i=0;i<(u32)Clamp(pMemory->mNumParticipants, 0, 16);i++)
{
BStrcpy(mParticipantStrings.sName[i], 64, pMemory->mParticipantInfo[i].mName);
}
mParticipantStrings.sBuildVersionNumber=mBuildVersionNumber;
mParticipantStrings.sPacketType=1;



// These extra packets are sent if participants>16
for (groups of 16)
{
BStrcpy(mParticipantStringsAdditional.sName[i], 64, pMemory->mParticipantInfo[i].mName);
}
mParticipantStringsAdditional.sOffset=(u8)OFFSET IN 16's, so 1st packet of this type offset will be 16, 2nd 32 etc
mParticipantStringsAdditional.sBuildVersionNumber=mBuildVersionNumber;
mParticipantStringsAdditional.sPacketType=2;

TheReaper GT
28-10-2015, 20:34
^^ that's a lot of data, I like it :D:D

SUBGTRACER
28-10-2015, 20:37
Cant wait :)

inthebagbud
28-10-2015, 21:52
In that format means nothing to me but if sms and app developer's need any testers then count me in

SUBGTRACER
28-10-2015, 22:06
+ 1 Count me in .....would be the next upgrade for my rig :)

220992 The final piece to the puzzle ....... it will never be finished , I'm kidding myself.

azidahaka
29-10-2015, 06:20
I spotted there's no ride height/supensions data in the list, is that a limitation of the upstream, or something the game doesn't allow for at all?

Fre.Mo
29-10-2015, 08:24
+ 1 Count me in .....would be the next upgrade for my rig :)
The final piece to the puzzle ....... it will never be finished , I'm kidding myself.

Same here, already have the tablet mount...

Fre.Mo
29-10-2015, 08:36
Huge amount of data to deal with.
Is there also the On/Off status of the assists (abs, tc and sc)?


I spent ages nicely tabbing this out and it's all gone wonky on the post. This is close to the final layout. The port is 5606 on all platforms. If anyone wants a test udp stream as a file I can send you one based on the below layout (it's just a concatenated stream of packets).

struct sParticipantInfo
{
s16 sWorldPosition[3]; // 0
u16 sCurrentLapDistance; // 6
u8 sRacePosition; // 8
u8 sLapsCompleted; // 9
u8 sCurrentLap; // 10
u8 sSector; // 11
// 12
};

struct sParticipantInfoStrings
{
static const u32 sPacketSize = 1347;
u16 sBuildVersionNumber; // 0
u8 sPacketType; // 2
char sCarName[64]; // 3
char sCarClassName[64]; // 131
char sTrackLocation[64]; // 195
char sTrackVariation[64]; // 259
char sName[16][64]; // 323
// 1347
};

struct sParticipantInfoStringsAdditional
{
static const u32 sPacketSize = 1028;
u16 sBuildVersionNumber; // 0
u8 sPacketType; // 2
u8 sOffset; // 3
char sName[16][64]; // 4
// 1028
};

struct sTelemetryData
{
static const u32 sPacketSize = 941;
u16 sBuildVersionNumber; // 0
u8 sPacketType; // 2

// Game states
u8 sGameSessionState; // 3

// Participant info
s8 sViewedParticipantIndex; // 4
s8 sNumParticipants; // 5

// Unfiltered input
u8 sUnfilteredThrottle; // 6
u8 sUnfilteredBrake; // 7
s8 sUnfilteredSteering; // 8
u8 sUnfilteredClutch; // 9
u8 sRaceStateFlags; // 10

// Event information
u8 sLapsInEvent; // 11

// Timings
f32 sBestLapTime; // 12
f32 sLastLapTime; // 16
f32 sCurrentTime; // 20
f32 sSplitTimeAhead; // 24
f32 sSplitTimeBehind; // 28
f32 sSplitTime; // 32
f32 sEventTimeRemaining; // 36
f32 sPersonalFastestLapTime; // 40
f32 sWorldFastestLapTime; // 44
f32 sCurrentSector1Time; // 48
f32 sCurrentSector2Time; // 52
f32 sCurrentSector3Time; // 56
f32 sFastestSector1Time; // 60
f32 sFastestSector2Time; // 64
f32 sFastestSector3Time; // 68
f32 sPersonalFastestSector1Time; // 72
f32 sPersonalFastestSector2Time; // 76
f32 sPersonalFastestSector3Time; // 80
f32 sWorldFastestSector1Time; // 84
f32 sWorldFastestSector2Time; // 88
f32 sWorldFastestSector3Time; // 92

u16 sTrackLength; // 96

// Flags
u8 sHighestFlag; // 98

// Pit info
u8 sPitModeSchedule; // 99

// Car state
s16 sOilTempCelsius; // 100
u16 sOilPressureKPa; // 102
s16 sWaterTempCelsius; // 104
u16 sWaterPressureKpa; // 106
u16 sFuelPressureKpa; // 108
u8 sCarFlags; // 110
u8 sFuelCapacity; // 111
u8 sBrake; // 112
u8 sThrottle; // 113
u8 sClutch; // 114
s8 sSteering; // 115
f32 sFuelLevel; // 116
f32 sSpeed; // 120
u16 sRpm; // 124
u16 sMaxRpm; // 126
u8 sGearNumGears; // 128
s8 sLastOpponentCollisionIndex; // 129

u8 sLastOpponentCollisionMagnitude; // 130
u8 sBoostAmount; // 131

f32 sOdometerKM; // 132
f32 sOrientation[3]; // 136
f32 sLocalVelocity[3]; // 148
f32 sWorldVelocity[3]; // 160
f32 sAngularVelocity[3]; // 172
f32 sLocalAcceleration[3]; // 184
f32 sWorldAcceleration[3]; // 196
f32 sExtentsCentre[3]; // 208

// Wheels / Tyres
u8 sTyreFlags[4]; // 220
u8 sTerrain[4]; // 224
f32 sTyreY[4]; // 228
f32 sTyreRPS[4]; // 244
f32 sTyreSlipSpeed[4]; // 260
u8 sTyreTemp[4]; // 276
u8 sTyreGrip[4]; // 280
f32 sTyreHeightAboveGround[4]; // 284
f32 sTyreLateralStiffness[4]; // 300
u8 sTyreWear[4]; // 316
u8 sBrakeDamage[4]; // 320
u8 sSuspensionDamage[4]; // 324
s16 sBrakeTempCelsius[4]; // 328
u16 sTyreTreadTemp[4]; // 336
u16 sTyreLayerTemp[4]; // 344
u16 sTyreCarcassTemp[4]; // 352
u16 sTyreRimTemp[4]; // 360
u16 sTyreInternalAirTemp[4]; // 368


// Car damage
u8 sCrashState; // 376
u8 sAeroDamage; // 377
u8 sEngineDamage; // 378

// Weather
s8 sAmbientTemperature; // 379
s8 sTrackTemperature; // 380
u8 sRainDensity; // 381
s8 sWindSpeed; // 382
s8 sWindDirectionX; // 383
s8 sWindDirectionY; // 384
u8 sCloudBrightness; // 385

// Buttons

sParticipantInfo sParticipantInfo[46]; // 386
// 46*12=552
u16 sJoyPad; // 938
u8 sDPad; // 940
// 944 struct is padded to
};


mBuildVersionNumber=mTelemetryData.sBuildVersionNumber=(u16)pMemory->mBuildVersionNumber; // u32->u16
mTelemetryData.sPacketType=0; // Unique

// Game state
mTelemetryData.sGameSessionState=((u8)pMemory->mGameState)|(((u8)pMemory->mSessionState)<<4); // (enum 3 bits/enum 3 bits)->u8
mTelemetryData.sRaceStateFlags=((u8)pMemory->mRaceState) | // (enum 3 bits)->u8
(pMemory->mLapInvalidated?8:0)|(pMemory->mAntiLockActive?16:0)|(pMemory->mBoostActive?32:0); // (bool/bool/bool)->u8

// Participant info
mTelemetryData.sViewedParticipantIndex=(s8)pMemory->mViewedParticipantIndex; // s32->s8
mTelemetryData.sNumParticipants=(s8)pMemory->mNumParticipants; // s32->s8

// Unfiltered input
mTelemetryData.sUnfilteredThrottle=(u8)(Clamp(pMemory->mUnfilteredThrottle, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sUnfilteredBrake=(u8)(Clamp(pMemory->mUnfilteredBrake, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sUnfilteredSteering=(s8)(Clamp(pMemory->mUnfilteredSteering, -1.0f, 1.0f)*127.0f); // f32->s8
mTelemetryData.sUnfilteredClutch=(u8)(Clamp(pMemory->mUnfilteredClutch, 0.0f, 1.0f)*255.0f); // f32->u8

// Event information
mTelemetryData.sTrackLength=(u16)pMemory->mTrackLength; // f32->u16
mTelemetryData.sLapsInEvent=(u8)min(pMemory->mLapsInEvent,255); // u32->u8

// Timings
mTelemetryData.sBestLapTime=pMemory->mBestLapTime; // f32->f32
mTelemetryData.sLastLapTime=pMemory->mLastLapTime; // f32->f32
mTelemetryData.sCurrentTime=pMemory->mCurrentTime; // f32->f32
mTelemetryData.sSplitTimeAhead=pMemory->mSplitTimeAhead; // f32->f32
mTelemetryData.sSplitTimeBehind=pMemory->mSplitTimeBehind; // f32->f32
mTelemetryData.sSplitTime=pMemory->mSplitTime; // f32->f32
mTelemetryData.sEventTimeRemaining=pMemory->mEventTimeRemaining; // f32->f32
mTelemetryData.sPersonalFastestLapTime=pMemory->mPersonalFastestLapTime; // f32->f32
mTelemetryData.sWorldFastestLapTime=pMemory->mWorldFastestLapTime; // f32->f32
mTelemetryData.sCurrentSector1Time=pMemory->mCurrentSector1Time; // f32->f32
mTelemetryData.sCurrentSector2Time=pMemory->mCurrentSector2Time; // f32->f32
mTelemetryData.sCurrentSector3Time=pMemory->mCurrentSector3Time; // f32->f32
mTelemetryData.sFastestSector1Time=pMemory->mFastestSector1Time; // f32->f32
mTelemetryData.sFastestSector2Time=pMemory->mFastestSector2Time; // f32->f32
mTelemetryData.sFastestSector3Time=pMemory->mFastestSector3Time; // f32->f32
mTelemetryData.sPersonalFastestSector1Time=pMemory->mPersonalFastestSector1Time; // f32->f32
mTelemetryData.sPersonalFastestSector2Time=pMemory->mPersonalFastestSector2Time; // f32->f32
mTelemetryData.sPersonalFastestSector3Time=pMemory->mPersonalFastestSector3Time; // f32->f32
mTelemetryData.sWorldFastestSector1Time=pMemory->mWorldFastestSector1Time; // f32->f32
mTelemetryData.sWorldFastestSector2Time=pMemory->mWorldFastestSector2Time; // f32->f32
mTelemetryData.sWorldFastestSector3Time=pMemory->mWorldFastestSector3Time; // f32->f32

// Flags
mTelemetryData.sHighestFlag=((u8)pMemory->mHighestFlagColour) | (((u8)pMemory->mHighestFlagReason)<<4); // (enum 3 bits/enum 2 bits)

// Pit info
mTelemetryData.sPitModeSchedule=((u8)pMemory->mPitMode) | (((u8)pMemory->mPitSchedule)<<4); // (enum 3 bits/enum 2 bits)

// Car state
mTelemetryData.sCarFlags=(u8)pMemory->mCarFlags; // enum->u8
mTelemetryData.sOilTempCelsius=(s16)pMemory->mOilTempCelsius; // f32->s16
mTelemetryData.sOilPressureKPa=(u16)pMemory->mOilPressureKPa; // f32->u16
mTelemetryData.sWaterTempCelsius=(s16)pMemory->mWaterTempCelsius; // f32->s16
mTelemetryData.sWaterPressureKpa=(u16)pMemory->mWaterPressureKPa; // f32->u16
mTelemetryData.sFuelPressureKpa=(u16)pMemory->mFuelPressureKPa; // f32->u16
mTelemetryData.sFuelCapacity=(u8)pMemory->mFuelCapacity; // f32->u8
mTelemetryData.sBrake=(u8)(Clamp(pMemory->mBrake, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sFuelLevel=pMemory->mFuelLevel; // f32->f32
mTelemetryData.sSpeed=pMemory->mSpeed; // f32->f32
mTelemetryData.sRpm=(u16)pMemory->mRpm; // f32->u16
mTelemetryData.sMaxRpm=(u16)pMemory->mMaxRPM; // f32->u16
mTelemetryData.sThrottle=(u8)(Clamp(pMemory->mThrottle, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sClutch=(u8)(Clamp(pMemory->mClutch, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sSteering=(s8)(Clamp(pMemory->mSteering, -1.0f, 1.0f)*127.0f); // f32->s8
u8 gear=pMemory->mGear<0?0x0f:min((u8)(pMemory->mGear&0xff), 7);
u8 numGears=max((u8)(pMemory->mNumGears&0xff), 0);
mTelemetryData.sGearNumGears=(gear&0x0f)|((numGears&0x0f)<<4); // s32/s32->u8
mTelemetryData.sOdometerKM=pMemory->mOdometerKM; // f32->f32
mTelemetryData.sLastOpponentCollisionIndex=(s8)pMemory->mLastOpponentCollisionIndex; // s32->s8
mTelemetryData.sLastOpponentCollisionMagnitude=(u8)min(pMemory->mLastOpponentCollisionMagnitude, 255); // f32->u8
mTelemetryData.sBoostAmount=(u8)pMemory->mBoostAmount; // f32->u8
mTelemetryData.sOrientation[0]=pMemory->mOrientation[0]; // f32->f32
mTelemetryData.sOrientation[1]=pMemory->mOrientation[1]; // f32->f32
mTelemetryData.sOrientation[2]=pMemory->mOrientation[2]; // f32->f32
mTelemetryData.sLocalVelocity[0]=pMemory->mLocalVelocity[0]; // f32->f32
mTelemetryData.sLocalVelocity[1]=pMemory->mLocalVelocity[1]; // f32->f32
mTelemetryData.sLocalVelocity[2]=pMemory->mLocalVelocity[2]; // f32->f32
mTelemetryData.sWorldVelocity[0]=pMemory->mWorldVelocity[0]; // f32->f32
mTelemetryData.sWorldVelocity[1]=pMemory->mWorldVelocity[1]; // f32->f32
mTelemetryData.sWorldVelocity[2]=pMemory->mWorldVelocity[2]; // f32->f32
mTelemetryData.sAngularVelocity[0]=pMemory->mAngularVelocity[0]; // f32->f32
mTelemetryData.sAngularVelocity[1]=pMemory->mAngularVelocity[1]; // f32->f32
mTelemetryData.sAngularVelocity[2]=pMemory->mAngularVelocity[2]; // f32->f32
mTelemetryData.sLocalAcceleration[0]=pMemory->mLocalAcceleration[0]; // f32->f32
mTelemetryData.sLocalAcceleration[1]=pMemory->mLocalAcceleration[1]; // f32->f32
mTelemetryData.sLocalAcceleration[2]=pMemory->mLocalAcceleration[2]; // f32->f32
mTelemetryData.sWorldAcceleration[0]=pMemory->mWorldAcceleration[0]; // f32->f32
mTelemetryData.sWorldAcceleration[1]=pMemory->mWorldAcceleration[1]; // f32->f32
mTelemetryData.sWorldAcceleration[2]=pMemory->mWorldAcceleration[2]; // f32->f32
mTelemetryData.sExtentsCentre[0]=pMemory->mExtentsCentre[0]; // f32->f32
mTelemetryData.sExtentsCentre[1]=pMemory->mExtentsCentre[1]; // f32->f32
mTelemetryData.sExtentsCentre[2]=pMemory->mExtentsCentre[2]; // f32->f32

// Wheels / Tyres
u32 i;
for (i=0;i<4;i++)
{
mTelemetryData.sTyreFlags[i]=(u8)pMemory->mTyreFlags[i]; // (enum 3 bits)->u8
mTelemetryData.sTerrain[i]=(u8)pMemory->mTerrain[i]; // (enum 6 bits)->u8
mTelemetryData.sTyreY[i]=pMemory->mTyreY[i]; // f32->f32
mTelemetryData.sTyreRPS[i]=pMemory->mTyreRPS[i]; // f32->f32
mTelemetryData.sTyreSlipSpeed[i]=pMemory->mTyreSlipSpeed[i]; // f32->f32
mTelemetryData.sTyreTemp[i]=(u8)Clamp(pMemory->mTyreTemp[i], 0.0f, 255.0f); // f32->u8
mTelemetryData.sTyreGrip[i]=(u8)Clamp(pMemory->mTyreGrip[i], 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sTyreHeightAboveGround[i]=pMemory->mTyreHeightAboveGround[i]; // f32->f32
mTelemetryData.sTyreLateralStiffness[i]=pMemory->mTyreLateralStiffness[i]; // f32->f32
mTelemetryData.sTyreWear[i]=(u8)(Clamp(pMemory->mTyreWear[i], 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sBrakeDamage[i]=(u8)(Clamp(pMemory->mBrakeDamage[i], 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sSuspensionDamage[i]=(u8)(Clamp(pMemory->mSuspensionDamage[i], 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sBrakeTempCelsius[i]=(s16)pMemory->mBrakeTempCelsius[i]; // f32->s16
mTelemetryData.sTyreTreadTemp[i]=(u16)pMemory->mTyreTreadTemp[i]; // f32->u16
mTelemetryData.sTyreLayerTemp[i]=(u16)pMemory->mTyreLayerTemp[i]; // f32->u16
mTelemetryData.sTyreCarcassTemp[i]=(u16)pMemory->mTyreCarcassTemp[i]; // f32->u16
mTelemetryData.sTyreRimTemp[i]=(u16)pMemory->mTyreRimTemp[i]; // f32->u16
mTelemetryData.sTyreInternalAirTemp[i]=(u16)pMemory->mTyreInternalAirTemp[i]; // f32->u16
}

//Car damage
mTelemetryData.sCrashState=(u8)pMemory->mCrashState; // (enum 3 bits)->u8
mTelemetryData.sAeroDamage=(u8)(Clamp(pMemory->mAeroDamage, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sEngineDamage=(u8)(Clamp(pMemory->mEngineDamage, 0.0f, 1.0f)*255.0f); // f32->u8

// Weather
mTelemetryData.sAmbientTemperature=(s8)Clamp(pMemory->mAmbientTemperature, -127.0f, 127.0f); // f32->s8
mTelemetryData.sTrackTemperature=(s8)Clamp(pMemory->mTrackTemperature, -127.0f, 127.0f); // f32->s8
mTelemetryData.sRainDensity=(u8)(Clamp(pMemory->mRainDensity, 0.0f, 1.0f)*255.0f); // f32->u8
mTelemetryData.sWindSpeed=(u8)(Clamp(pMemory->mWindSpeed*0.5f, 0.0f, 255.0f)); // f32->u8
mTelemetryData.sWindDirectionX=(s8)Clamp(pMemory->mWindDirectionX*127.0f, -127.0f, 127.0f); // f32->s8
mTelemetryData.sWindDirectionY=(s8)Clamp(pMemory->mWindDirectionY*127.0f, -127.0f, 127.0f); // f32->s8
mTelemetryData.sCloudBrightness=(u8)Clamp(pMemory->mCloudBrightness, 0.0f, 255.0f); // f32->u8

for (i=0;i<(u32)Clamp(pMemory->mNumParticipants, 0, 46);i++)
{
mTelemetryData.sParticipantInfo[i].sWorldPosition[0]=(s16)Clamp(pMemory->mParticipantInfo[i].mWorldPosition[0], -32768.0f, 32767.0f); // f32->s16
mTelemetryData.sParticipantInfo[i].sWorldPosition[1]=(s16)Clamp(pMemory->mParticipantInfo[i].mWorldPosition[1], -32768.0f, 32767.0f); // f32->s16
mTelemetryData.sParticipantInfo[i].sWorldPosition[2]=(s16)Clamp(pMemory->mParticipantInfo[i].mWorldPosition[2], -32768.0f, 32767.0f); // f32->s16
mTelemetryData.sParticipantInfo[i].sCurrentLapDistance=(u16)min(pMemory->mParticipantInfo[i].mCurrentLapDistance, 65535.0f); // f32->u16
mTelemetryData.sParticipantInfo[i].sRacePosition=((u8)pMemory->mParticipantInfo[i].mRacePosition)|(pMemory->mParticipantInfo[i].mIsActive?127:0); // u32+bool->u8
mTelemetryData.sParticipantInfo[i].sLapsCompleted=(u8)min(pMemory->mParticipantInfo[i].mLapsCompleted, 255); // u32->u8
mTelemetryData.sParticipantInfo[i].sCurrentLap=(u8)min(pMemory->mParticipantInfo[i].mCurrentLap, 255); // u32->u8
mTelemetryData.sParticipantInfo[i].sSector=(u8)pMemory->mParticipantInfo[i].mCurrentSector; // (enum 3 bits)->u8
}

mTelemetryData.sJoyPad=(u16)JOYPAD BUTTON MASK
mTelemetryData.sDPad=(u8)JOYPAD DPAD MASK

// This packet below is sent less often
BStrcpy(mParticipantStrings.sCarName, 64, pMemory->mCarName);
BStrcpy(mParticipantStrings.sCarClassName, 64, pMemory->mCarClassName);
BStrcpy(mParticipantStrings.sTrackLocation, 64, pMemory->mTrackLocation);
BStrcpy(mParticipantStrings.sTrackVariation, 64, pMemory->mTrackVariation);
for (i=0;i<(u32)Clamp(pMemory->mNumParticipants, 0, 16);i++)
{
BStrcpy(mParticipantStrings.sName[i], 64, pMemory->mParticipantInfo[i].mName);
}
mParticipantStrings.sBuildVersionNumber=mBuildVersionNumber;


// These extra packets are sent if participants>16
for (groups of 16)
{
BStrcpy(mParticipantStringsAdditional.sName[i], 64, pMemory->mParticipantInfo[i].mName);
}
mParticipantStringsAdditional.sOffset=(u8)OFFSET IN 16's, so 1st packet of this type offset will be 16, 2nd 32 etc
mParticipantStringsAdditional.sBuildVersionNumber=mBuildVersionNumber;

R74NN
29-10-2015, 09:49
From the quick look, the data seem to be exactly the same as current Shared Memory API, so nothing new and the important fields are still missing.

mr_belowski
29-10-2015, 10:22
It's a decent start though - presumably it's populated from the same code that drives the existing shared memory block.

Disclaimer: I've only skimmed over this so apologies if these questions are bollocks...

Is there going to be any ordering / creation time information included in these packets? As they can arrive in any order it'll be hard for the client to know whether a given packet should be discarded because a more recent version of that packet has been received.

does

for (i=0;i<(u32)Clamp(pMemory->mNumParticipants, 0, 46);i++)

mean you're only sending the first 46 opponents' data? Or should that be 64?


Are you sending one of these:
struct sParticipantInfoStrings
{
static const u32 sPacketSize = 1347;
u16 sBuildVersionNumber; // 0
u8 sPacketType; // 2
char sCarName[64]; // 3
char sCarClassName[64]; // 131
char sTrackLocation[64]; // 195
char sTrackVariation[64]; // 259
char sName[16][64]; // 323
// 1347
};


per opponent? Or is that just for the player? With the current shared memory block, there's no car name / car class data for opponents

Tim Mann
29-10-2015, 10:34
It's a decent start though - presumably it's populated from the same code that drives the existing shared memory block.

Disclaimer: I've only skimmed over this so apologies if these questions are bollocks...

Is there going to be any ordering / creation time information included in these packets? As they can arrive in any order it'll be hard for the client to know whether a given packet should be discarded because a more recent version of that packet has been received.

does

for (i=0;i<(u32)Clamp(pMemory->mNumParticipants, 0, 46);i++)

mean you're only sending the first 46 opponents' data? Or should that be 64?


Are you sending one of these:
struct sParticipantInfoStrings
{
static const u32 sPacketSize = 1347;
u16 sBuildVersionNumber; // 0
u8 sPacketType; // 2
char sCarName[64]; // 3
char sCarClassName[64]; // 131
char sTrackLocation[64]; // 195
char sTrackVariation[64]; // 259
char sName[16][64]; // 323
// 1347
};


per opponent? Or is that just for the player? With the current shared memory block, there's no car name / car class data for opponents

Car name and class is player only. Everything is based on the original memory struct.

46 as original was correct, its 45AI (max console) + player.

MikeyTT
29-10-2015, 10:36
I spent ages nicely tabbing this out and it's all gone wonky on the post. This is close to the final layout. The port is 5606 on all platforms. If anyone wants a test udp stream as a file I can send you one based on the below layout (it's just a concatenated stream of packets).

I'd like a copy of the data you have so far please. Will it have the variance of over 16 participants in? and will it have the "less often sent" car/track info too?

In the current Shared Memory API data, this is in a fixed format for every read, which makes consuming the data really easy, certainly for C#. I presume for the UDP stream this will change to a base set of values, then based on the packet type will be either 941 bytes or the larger 1028 and 1347 and include the additional info?

Finally is there any view on the content of the data? I know for a while now on the PC side we've been wanting to extend the data reach, but there has been little concrete info on what's planned. I was hoping that with the PS/XB data stream that some of this would have changed, but unfortunately not. Could you update me/us on what's planned in general for the data formats now? Thanks...

Tim Mann
29-10-2015, 10:44
I'd like a copy of the data you have so far please. Will it have the variance of over 16 participants in? and will it have the "less often sent" car/track info too?

In the current Shared Memory API data, this is in a fixed format for every read, which makes consuming the data really easy, certainly for C#. I presume for the UDP stream this will change to a base set of values, then based on the packet type will be either 941 bytes or the larger 1028 and 1347 and include the additional info?

Finally is there any view on the content of the data? I know for a while now on the PC side we've been wanting to extend the data reach, but there has been little concrete info on what's planned. I was hoping that with the PS/XB data stream that some of this would have changed, but unfortunately not. Could you update me/us on what's planned in general for the data formats now? Thanks...

Your assumptions about packets are correct. The UDP stream file has the correct interleave of packets. Please DM me an email address and I will forward the file.

I've only got the data based on the existing shared memory api, the only additions have been the joypad buttons. The expanding of the existing structure is out of my hands.

mr_belowski
29-10-2015, 10:46
Can I have that file too please?

azidahaka
29-10-2015, 12:08
Your assumptions about packets are correct. The UDP stream file has the correct interleave of packets. Please DM me an email address and I will forward the file.

I've only got the data based on the existing shared memory api, the only additions have been the joypad buttons. The expanding of the existing structure is out of my hands.
I'm not a tech guy but i think this means we can't get extra informations like those of ride height, suspension travel and such correct?

mr_belowski
29-10-2015, 12:19
Not sure what's in that dump Tim - is the highlighted section the ethernet header of the first packet? If so, I don't see any obvious IP or UDP header

221004

Tim Mann
29-10-2015, 12:22
It's just concatenated structs, there's no headers in there. Read the first 3 bytes, first two are the version number taken from the shared mem struct, third byte is the packet type, so you can determine the size from there, either 0/1/2.

Tim Mann
29-10-2015, 12:46
Sorry, big mistake in this, it was 46 as it was maximum number of AI on console + player. It's 55 on PC, so I'll see if I can expand the struct to incorporate that (the confusion comes as the actual 'max participants' in the shared API is 64).

I do have room to do the full 56, so I'll expand it to that. But if you are using the test file, please use the structure as is further up with the 46 max.

Race position was also coming out wrong, this has now been fixed (thanks to cjorgens79 for testing this).

mr_belowski
29-10-2015, 12:51
should mWorldPosition really be s16? It's a 32bit float in the shared memory

mr_belowski
29-10-2015, 13:37
Started to get some traction on this now that the data dump format is clearer :)

I've not got the string stuff mapping from the raw data properly, but the basic telemetry mapping from that dump to a C# struct is working at my end. I'll park it for now and look at it in more detail later / tomorrow - no doubt I'll have a ton of questions, but the main one at the moment is those worldPosition values - am I looking at the wrong data here? Surely these need to be f32 to make them useful?

Tim Mann
29-10-2015, 14:55
It'll give the position to within a meter, how accurate do you need it? Or only for the player?

mr_belowski
29-10-2015, 14:59
for the spotter 1 metre precision isn't really enough. Wouldn't a 32bit float make more sense here? By my crappy maths, that packet would increase from 941 to 1217 bytes - if I've got that right, that's still small enough isn't it?

Tim Mann
29-10-2015, 15:02
1397 (with the change to 56 participants).

The alternative is to divide it down by a factor of 4, so 0.25 precision, then it would be limited to +/-8Km.
Or do some bit twiddling to add precision, how accurate do you want it?

Anyone else want to chip in?

mr_belowski
29-10-2015, 15:05
Can I chip in again? :)

Are all the race position values in that stream file 127?

Tim Mann
29-10-2015, 15:20
Yes, that was a bug, fixed now (I or'd in 127 instead of 128 masking out the actual positions).

Fre.Mo
29-10-2015, 15:36
From the quick look, the data seem to be exactly the same as current Shared Memory API, so nothing new and the important fields are still missing.

What are these missing important fields?

Schnizz58
29-10-2015, 15:37
What are these missing important fields?
Missing fields are by definition important. :D

donpost
29-10-2015, 15:43
What are these missing important fields?

I'm guessing its the ride height and/or suspension position information.

Jussi Viljami Karjalainen
29-10-2015, 15:54
Out of those two, I'd much rather have suspension travel (up to 0.01 cm accuracy if possible, 1 mm resolution isn't quite enough in my experience), it'd enable us to do suspension histograms and downforce approximations etc.

mr_belowski
29-10-2015, 15:54
other stuff too, like the car & class of each opponent, the tyre each car is currently using (this is missing even for the player's car), mandatory pitstop info like pit window open & close lap, tyre pressures (even though there's a wealth of temperature information), usable weather data, and probably more.

But having said all that, the current data coverage is generally pretty good

MikeyTT
29-10-2015, 17:00
1397 (with the change to 56 participants).

The alternative is to divide it down by a factor of 4, so 0.25 precision, then it would be limited to +/-8Km.
Or do some bit twiddling to add precision, how accurate do you want it?

Anyone else want to chip in?

I was going to chip in but I read that as, the precision would go from a meter to +/- 8Km, which is obviously worse, so I don't really deserve to chip in on that ;)

Personally I'm not that fussed, and if we're size bound then whatever the least amount is would be better, as that gives us some headroom for any new variables. I'm still hopeful that we'll get more in the future. To support what MrB wants then if bit twiddling is possible and it increases precision, but keeps the size down, then I would vote for that (even though I would have to research how to get that back into C# world).

mr_belowski
29-10-2015, 17:08
For the spotter, +/- 0.1 metres would be my preference, but it'd probably work with +/- 0.25, maybe it'd be noicable, maybe not.

Would be happy to accommodate a bit of bit magic to improve to precision here. Alternatively I only need precise positions for cars within a 10 metre radius of the player.

I'll have a think to see if I can suggest a more practical alternative

mr_belowski
29-10-2015, 17:20
Also I only need x and y (in the existing implementation elements 0 and 2 in the world position array)

Tim Mann
29-10-2015, 17:40
Also I only need x and y (in the existing implementation elements 0 and 2 in the world position array)

Yes X/Z (Y in our world is up/down). I could divide by 4 so that would give 0.25 and then sector only needs 3 bits, so could hijack two lots of 2 and that would give 0.25/4, then you don't have to use those if you don't want to.

mr_belowski
29-10-2015, 17:54
Can we add another byte to the participant data. X and Z could be Floor'ed instead of rounded. The first 4 bits would give you the number of 1/16 ths to add to X, the second the number to add to Z. That'd give you precision down to 7cm (ish)

Or something :)

mr_belowski
29-10-2015, 18:08
Actually, sod that, 25cm accuracy is going to be enough isn't it :)

That hijacked sector number will need some stern warnings on it

Tim Mann
29-10-2015, 19:20
Actually, sod that, 25cm accuracy is going to be enough isn't it :)

That hijacked sector number will need some stern warnings on it

If .25 is going to be enough then I'd leave it how it is and add the extra accuracy (down to .25) into those extra bits.

cjorgens79
30-10-2015, 00:25
1397 (with the change to 56 participants).

The alternative is to divide it down by a factor of 4, so 0.25 precision, then it would be limited to +/-8Km.
Or do some bit twiddling to add precision, how accurate do you want it?

Anyone else want to chip in?

To clarify,
It would be 1397 bytes with 56 participants AND making X/Y/Z 32bit floats.
It would be 1061 bytes with 56 participants but leaving X/Y/Z as 16 bit signed.

Depends whether or not you would consider 103 bytes as enough head room or not for future expansion.

Do you know what the actual maximum working range of X/Z is in Project Cars? I think a few of the tracks got to some pretty high numbers, nords, cali hwy, azure coast.. multiplying by 4 would mean the working maximum X/Z range in game must not exceed +/- 8192

Fre.Mo
30-10-2015, 08:12
I'm guessing its the ride height and/or suspension position information.

Indeed, it is very important since it is really hard to follow these informations on the hud when driving on bumpy track.
Will these data be recorded by the apps in order to analyze theim at posteriori?

R74NN
30-10-2015, 08:21
Indeed, it is very important since it is really hard to follow these informations on the hud when driving on bumpy track.
Will these data be recorded by the apps in order to analyze theim at posteriori?

Nope, because there are no such a data provided to applications.

MikeyTT
30-10-2015, 09:44
If anyone is looking to simulate the sending of the data over UDP, I put together a quick app that will take the file that Tim provided and send it out as a broadcasted UDP stream.

It's a really noddy program (and I'm sure breaks every programming standard known), but it will simulate the PS/XB console data stream (or should do). I've used VS 2015 Community Edition, so let me know if you have issues opening the project up.

I've stuck it on my OneDrive if you want it: https://onedrive.live.com/redir?resid=F4E1176A98D98E1!207686&authkey=!AMPjD29D_yQYbDE&ithint=file%2czip

Then on the client end you just need something like this:


....
UdpClient udpClient = new UdpClient(5606);
IPEndPoint ipEP = new IPEndPoint(IPAddress.Any, 5606);
...
var udpData = udpClient.Receive(ref ipEP );
....

Fil140
30-10-2015, 23:30
+ 1 Count me in .....would be the next upgrade for my rig :)

220992 The final piece to the puzzle ....... it will never be finished , I'm kidding myself.

Same here brother

Fil140
30-10-2015, 23:41
So are we going to find dash apps are easy to build and release then?

STEELJOCKEY
31-10-2015, 03:43
Could I run 2 apps simultaneously on an android device, will both apps be able to read the data from the console at the same time?

falcon2081
31-10-2015, 04:22
Could I run 2 apps simultaneously on an android device, will both apps be able to read the data from the console at the same time?

Should be able to. You can already on PC as I run the Telemetry and CrewChief without issues.

STEELJOCKEY
31-10-2015, 06:31
That would be good, can't wait

SkyyJuice
31-10-2015, 11:23
This is the good stuff that I have been waiting for, hopefully this gets releasd for just before xmas, ooowweee

Rudolph523
02-11-2015, 21:51
can someone say wich apps will probably work with pcars on consoles? that way i can look wich app or apps i want to use.

TheReaper GT
02-11-2015, 22:01
can someone say wich apps will probably work with pcars on consoles? that way i can look wich app or apps i want to use.

It depends on the devs position. Any app can take advantage of the data stream but the dev need to make the adjustments to do so... I really think all devs are goint to do it so they don't need to make a server app anymore and that way reach a bigger public..

SUBGTRACER
03-11-2015, 00:01
Is there a expected time frame for this?

STEELJOCKEY
03-11-2015, 04:37
Not before patch 6 I think, as from what I'm reading some things need to be added in to allow access to the data. Is this correct?

Davey-Gravy
03-11-2015, 11:14
It's my first post, but I've been reading this forum, and this thread (and previous related threads) in particular for a while. I race PCARS on a PS4 and would love a second screen app to use so these developments sound promising.

There seems to be a lack of demand for an iPad version for the consoles - I'm not sure if anyone has said they'll write one yet unless I've missed it? I'm an iOS dev so could make one myself if need be...

Just wondering if it's worthwhile really.

David

jimmyb_84
03-11-2015, 11:43
It's my first post, but I've been reading this forum, and this thread (and previous related threads) in particular for a while. I race PCARS on a PS4 and would love a second screen app to use so these developments sound promising.

There seems to be a lack of demand for an iPad version for the consoles - I'm not sure if anyone has said they'll write one yet unless I've missed it? I'm an iOS dev so could make one myself if need be...

Just wondering if it's worthwhile really.

David

I'm not sure if anyone has asked before but a Mac application would be ace! even more useful if the app stored timing data in csv format

transfix
03-11-2015, 11:45
It's my first post, but I've been reading this forum, and this thread (and previous related threads) in particular for a while. I race PCARS on a PS4 and would love a second screen app to use so these developments sound promising.

There seems to be a lack of demand for an iPad version for the consoles - I'm not sure if anyone has said they'll write one yet unless I've missed it? I'm an iOS dev so could make one myself if need be...

Just wondering if it's worthwhile really.

David

Hey David,

There is definitely demand for an iPad/iPhone version. I know PCars Dash said they would update the app to support the new API. If you could develop an app I'm sure it would be very appreciated my many users.

Thanks for chiming in!

cjorgens79
03-11-2015, 11:45
It's my first post, but I've been reading this forum, and this thread (and previous related threads) in particular for a while. I race PCARS on a PS4 and would love a second screen app to use so these developments sound promising.

There seems to be a lack of demand for an iPad version for the consoles - I'm not sure if anyone has said they'll write one yet unless I've missed it? I'm an iOS dev so could make one myself if need be...

Just wondering if it's worthwhile really.

David

My "pCars Dash" app runs on iOS, Android and WP7, I'm sure there probably are a few more that do too. Check the apps page on the main project cars website as it shows which platforms the 3rd party apps support. And yes it is being updated to support the console api.

SUBGTRACER
03-11-2015, 12:31
My "pCars Dash" app runs on iOS, Android and WP7, I'm sure there probably are a few more that do too. Check the apps page on the main project cars website as it shows which platforms the 3rd party apps support. And yes it is being updated to support the console api.
Awsome news gentlemen, exciting times for consoles .... Thank you !

Davey-Gravy
03-11-2015, 13:01
Awsome news gentlemen, exciting times for consoles .... Thank you !

Indeed, this is good news as ultimately I'm after an iPad version for my PS4 with the least effort!

I'll probably have a play around anyway with the data structures to see what's what and perhaps see how feasible OSX/iPad would be for me. I'd be starting from a long way back as I don't have an existing app to port over and time spent coding is time not spent racing!

Thanks for the responses.

mr_belowski
03-11-2015, 13:11
No iOS plan for my stuff - I have no apple devices and no iOS coding experience at all.

Davey - before you throw yourself into app development, consider what it'll do to your enjoyment of your favourite racing games. I use to love PCars and RaceRoom, now whenever I play them I'm listening for bugs and testing stuff. Whilst it's fun, it's not as fun as just racing :(

Umer Ahmad
03-11-2015, 13:21
You should try moderating the forum ;)

TrueNOS2
03-11-2015, 13:44
You should try moderating the forum ;)

Everything's good in "moderation". ;)

Tim + cjorgens79 + patch 6.0 = :triumphant:

I've been campaigning for this from the first week of release of Project Cars. It came a long way from "[Not Possible]" to [IN-PROGRESS]! Can't wait.

Davey-Gravy
03-11-2015, 13:51
Davey - before you throw yourself into app development, consider what it'll do to your enjoyment of your favourite racing games. I use to love PCars and RaceRoom, now whenever I play them I'm listening for bugs and testing stuff. Whilst it's fun, it's not as fun as just racing :(

Very wise words!

Fil140
03-11-2015, 17:23
So, does anybody know whos apps are coming to console and wich ones yet, are there any defos,it looks like pcarscdash app is a yes,what about the motec style apps?

mr_belowski
03-11-2015, 17:28
Puts hand up. Obviously not tested it yet but crew chief 3.8.0 includes the necessary stuff to take its data from the udp network feed. But whether it actually works is anyone's guess :)

inthebagbud
03-11-2015, 17:38
Puts hand up. Obviously not tested it yet but crew chief 3.8.0 includes the necessary stuff to take its data from the udp network feed. But whether it actually works is anyone's guess :)

Companion apps + Xbox new dashboard + patch 6 = :eagerness::dog::victorious:

other answers on a post card fellows

STEELJOCKEY
03-11-2015, 18:24
Maybe Davey-Gravy could adapt mr_belowski's CrewChief onto the i-stuff, as there are a few other telemetry apps already for this format, but CrewChief would be a bonus, save us i-nerds from having to buy and learn android stuff

mr_belowski
03-11-2015, 18:31
I'd be happy to discuss this kind of thing. In the mean time the app can always be run on an old laptop or something, getting data from the console

Fil140
03-11-2015, 21:01
Hey, another question,will the device need to be hardwired to the console or will it run off wifi, if both then wivh is better and why? Thanks.

Schnizz58
03-11-2015, 21:12
Hey, another question,will the device need to be hardwired to the console or will it run off wifi, if both then wivh is better and why? Thanks.

Should run on any LAN, including wireless. Which is better sorta depends on your definition of "better". Wired is more reliable but less convenient.

MikeyTT
03-11-2015, 21:35
So, does anybody know whos apps are coming to console and wich ones yet, are there any defos,it looks like pcarscdash app is a yes,what about the motec style apps?

My vrHive (http://forum.projectcarsgame.com/showthread.php?33881-vrHive-Dashes-Telemetry-Live-Data-Arduino-Client-Server-etc) app will be converted to work. In fact I'm almost there with the updates. Just a few data conversions to battle and I'll be ready for a live test.

ports
03-11-2015, 22:12
My vrHive (http://forum.projectcarsgame.com/showthread.php?33881-vrHive-Dashes-Telemetry-Live-Data-Arduino-Client-Server-etc) app will be converted to work. In fact I'm almost there with the updates. Just a few data conversions to battle and I'll be ready for a live test.

That's great news MikeyTT can't wait to try your App out :)

SUBGTRACER
03-11-2015, 22:54
The question has been asked previously " can I use 2 items " e.g Ipad and a Samsung phone together at the same time as I would like have the phone between the wheel for rev counter and the ipad next to my rig for telemetry.

Is that possible ? as I would like to make that brackets prior to release.

221384

Schnizz58
03-11-2015, 22:58
Yes, that's possible. It's a broadcast stream so any number of devices can receive it.

SUBGTRACER
03-11-2015, 23:15
Thank you Schizz , that's just brilliant , SMS Tim and the app guys Im sure the console community is going to run with this JUST F*&%N Brilliant !!!!!!!!!

Schnizz58
03-11-2015, 23:22
Yep, I can't wait. Really, really big props to Tim Mann. He didn't have to do anything. He could have just said, "Hey sorry guys, consoles just don't support that." But he didn't. He took it upon himself to come up with an idea, get it approved by the 1st parties and implement it. That's above and beyond the call of duty and he deserves some recognition for that.

Also, let's not forget about the guys writing the apps that will use the stream. They deserve a lot of credit too.

Fil140
03-11-2015, 23:34
Thanks schnizz and mikey, i just need to find a nice sized and shaped tablet to mount behind the wheel now

Fil140
03-11-2015, 23:39
Yep, I can't wait. Really, really big props to Tim Mann. He didn't have to do anything. He could have just said, "Hey sorry guys, consoles just don't support that." But he didn't. He took it upon himself to come up with an idea, get it approved by the 1st parties and implement it. That's above and beyond the call of duty and he deserves some recognition for that.

Also, let's not forget about the guys writing the apps that will use the stream. They deserve a lot of credit too.

I wish there was some way that we as a community of often overlooked console racers could find a way to truly say thankyou to tim and the app guys? Any ideas any1?

Fil140
03-11-2015, 23:42
We could all chuck 2 in a paypal account to tims email address so he could have a drink on us?

SUBGTRACER
03-11-2015, 23:44
I wish there was some way that we as a community of often overlooked console racers could find a way to truly say thankyou to tim and the app guys? Any ideas any1?

That's a nice thought actually. You guys chip in for a ticket Australia for Tim and the app guys and I will supply the beer when they get here.

Fil140
03-11-2015, 23:50
Does any1 haves timms email address, all we do is send an email payment through paypal, im sure theres enough if us for a good bottle of scotch

SUBGTRACER
03-11-2015, 23:50
I'm in

KkDrummer
04-11-2015, 08:47
I think some devs have paypal accounts for donations. I am pretty sure they will let us know....

Fong74
04-11-2015, 08:53
Im in too :cool:

cjorgens79
04-11-2015, 10:41
Just a point in relation to people getting a hold of tablets to be used for the companion apps, because the UDP stream will be transmitted to a broadcast address (as far as i am aware), there will be a small number of devices and possibly legacy wifi hardware that will NOT work with this. From my experience and from feedback from other pCars Dash users, I've only really encountered this issue with cheap android devices, i have a piece of crap chinese cheapy android tablet for testing that will not receive broadcast messages, but works perfectly fine if the UDP messages are targeted directly to its address. I believe this is a known issue with some Android devices (older versions or crappy wifi chipsets perhaps, i dont know the exact criterea) so just be careful when choosing a tablet. I've never heard of any occurances of this issue at all with any Apple devices, and from memory i dont recall any issues with the the better quality (mainstream brand) Android devices either so keep that in mind.

mr_belowski
04-11-2015, 10:43
This is a very good point. It's not just old crap hardware either - I think there were some fairly recent Samsung Galaxy phones that people had difficulty with receiving UDP multicast packets

azidahaka
04-11-2015, 11:48
Just a point in relation to people getting a hold of tablets to be used for the companion apps, because the UDP stream will be transmitted to a broadcast address (as far as i am aware), there will be a small number of devices and possibly legacy wifi hardware that will NOT work with this. From my experience and from feedback from other pCars Dash users, I've only really encountered this issue with cheap android devices, i have a piece of crap chinese cheapy android tablet for testing that will not receive broadcast messages, but works perfectly fine if the UDP messages are targeted directly to its address. I believe this is a known issue with some Android devices (older versions or crappy wifi chipsets perhaps, i dont know the exact criterea) so just be careful when choosing a tablet. I've never heard of any occurances of this issue at all with any Apple devices, and from memory i dont recall any issues with the the better quality (mainstream brand) Android devices either so keep that in mind.
Troubling! I plan on getting a super cheap chinese Tablet just for this purpouse...

Any suggestion on how to choose one? I had one under my radar that was Like 35euro shipped...

inthebagbud
04-11-2015, 12:12
Troubling! I plan on getting a super cheap chinese Tablet just for this purpouse...

Any suggestion on how to choose one? I had one under my radar that was Like 35euro shipped...

There will be plenty of users with different devices so maybe wait until its actually in the wild to see what feedback there is

cjorgens79
04-11-2015, 12:50
Troubling! I plan on getting a super cheap chinese Tablet just for this purpouse...

Any suggestion on how to choose one? I had one under my radar that was Like 35euro shipped...

Unfortunately not, i dont know what it is specifically with the units that is the cause of the problem. It may be certain versions of android or certain wifi chipsets, i really dont know. If you know someone who already has a cheap android tablet you could try it on their device first, or perhaps wait and see if anyone else on here has that unit and can confirm whether or not it works. If it turns out that alot more Android devices than first thought have this issue, perhaps Tim will be kind enough to add a setting to the api in the UI to allow the user to override the broadcast address on the console to target a specific IP instead which would get around the problem.

KkDrummer
04-11-2015, 13:05
You can get Windows 10 tablets at a very cheap price: check this one out for example:

http://www.windowscentral.com/e-fun-nextbook-flexx-9-windows-10-2-1-tablet-139

mr_belowski
04-11-2015, 13:54
blimey that's a bit of a bargain. If everyone here bought one it'd save me a sh!tload of work porting to android :)

ports
04-11-2015, 14:00
I've got that tablet for the price it runs great.

Jussi Viljami Karjalainen
04-11-2015, 14:09
Yeah, as "proper" laptops or PCs those of course fall down and hard, but limit them to the simpler things you'd normally do with small tablets and they can work really darn well. =)

TheReaper GT
04-11-2015, 14:19
Anyone knows of there's an motec app that runs on Windows?
There's one that have Cosworth Omega skin?

Jussi Viljami Karjalainen
04-11-2015, 14:32
There are several apps that can handle dashboard type stuff, including a MOTEC like layout.

TheReaper GT
04-11-2015, 14:33
There are several apps that can handle dashboard type stuff, including a MOTEC like layout.

But for Windows? I found a android and ios...

Jussi Viljami Karjalainen
04-11-2015, 14:44
But for Windows? I found a android and ios...Yeah, for Windows as well (I don't follow other platforms). I can't find the exact one I used during development, that one had a MOTEC style layout built into it, but for example the pCARS Telemetry program (not the Profiler one, though I think that can manage it as well) has many different dashboard options built straight in, and you can make your own ones for it as well, though admittedly you do need to know how to work with lua scripts.

TheReaper GT
04-11-2015, 16:41
Yeah, for Windows as well (I don't follow other platforms). I can't find the exact one I used during development, that one had a MOTEC style layout built into it, but for example the pCARS Telemetry program (not the Profiler one, though I think that can manage it as well) has many different dashboard options built straight in, and you can make your own ones for it as well, though admittedly you do need to know how to work with lua scripts.

Thanks Jussim. Gonna have a look at this one..

azidahaka
04-11-2015, 16:54
You can get Windows 10 tablets at a very cheap price: check this one out for example:

http://www.windowscentral.com/e-fun-nextbook-flexx-9-windows-10-2-1-tablet-139

that is not cheap enough for "poorfags" like me T_T

I was looking at this:

http://www.ebay.it/itm/Tablet-Android-7-WiFi-Cobra-Wazird-TB-7-HD-Android-4-1-1-/151709541029?hash=item235297e2a5

On a second tought maybe a fire hd 7" from amazon would work well if the apps would be available as apk or on aptoide?

Keithb23
04-11-2015, 23:57
Android is really the best platform for 2nd screens apps imho, because the apps are so easily published. It was amazing to see how many different apps sprung up almost literally overnight as soon as the api for the pc was released. I think you will find the same thing once the new UDP streaming is released. Many developers of the current apps already have plans to add UDP to their server apps so there will be a lot of choices out there for someone who wants a second screen app. A 7" Android tablet is the ideal size as it closely replicates the size of many of the data display dashes currently available for real race cars. Many of those manufacturers have gone to a square or rectangular color screen format on their higher end product line.

VDash (http://www.vdash.pro/) is an app that is currently supported through the api and pc via a server app. There are links to a few of the dashes in my signature if you are interested in what you could potentially expect to have on an Android tablet through the UDP companion app, and there are lots more available in the 'Expansion' section of the web site. Flynny75 is the author of the app and I am pretty sure he has plans to add UDP streaming to his server as soon as it is available. Once the server side is in place, you just have to buy the app, install the dashes, and away you go.

Here are a few examples of dashes I have created for VDash and are free to download. With the exception of a couple, all the dashes have multiple pages displaying the available information provided by the API. Timing, Position, Lap Number, Pressures/Temperatures, Wheel/Tire info, Fuel, and so on, just like a real Motec or AIM display.

221433

221434

221435

221436

221437

221438

221439

221440

SUBGTRACER
05-11-2015, 00:15
Works of art Keith ..........

TheReaper GT
05-11-2015, 00:27
That's what want. That Omega screen without the ginetta logo and I'm sold :D

Keithb23
05-11-2015, 01:33
Thanks, guys. The logo is easily removed from the dash. I can upload a version without the logo anytime. :)

Pappa_Stig
05-11-2015, 01:34
Yep, I can't wait. Really, really big props to Tim Mann. He didn't have to do anything. He could have just said, "Hey sorry guys, consoles just don't support that." But he didn't. He took it upon himself to come up with an idea, get it approved by the 1st parties and implement it. That's above and beyond the call of duty and he deserves some recognition for that.

Also, let's not forget about the guys writing the apps that will use the stream. They deserve a lot of credit too.

Hear, hear!

I'm also in for the donation idea. The man deserves more than a beer or two for this. He's shown us console peasants some love, so I think it's a great idea to reciprocate that.

TheReaper GT
05-11-2015, 01:41
Thanks, guys. The logo is easily removed from the dash. I can upload a version without the logo anytime. :)

Great, I've just sent an email to the vdash dev to be sure if it will be compatible with the udp stream, just waiting for a positive response to buy it.