projectCARS  Topic is solved solved with post #21949

Re: projectCARS

Postby sirnoname » Fri 22. Mar 2013, 08:57

If so they should be 1,5 decreasing and increasing but the graph of driving a circle tells me they are mostly zero. Only around 90° they get to 1.5 (pi/2) as a spike.
If a answer is correct or did help you for a solution, please use the solve button.
User avatar
sirnoname
Site Admin
 
Posts: 1751
Images: 45
Joined: Thu 1. Sep 2011, 22:02
Location: Munich, Germany
Has thanked: 35 times
Been thanked: 122 times

Re: projectCARS

Postby yokoyoko » Fri 22. Mar 2013, 09:10

Can someone ask them for a euler transformation code to get car oriented accelerations or velocities (same code).


Has already someone asked in their forum/thread? If so, where?
User avatar
yokoyoko
 
Posts: 392
Images: 28
Joined: Tue 7. Aug 2012, 03:16
Location: Germany / Bad Eilsen
Has thanked: 33 times
Been thanked: 12 times

Re: projectCARS

Postby sirnoname » Fri 22. Mar 2013, 09:38

The values below longetudenal, lateral are the three euler values, for now marked as "nothing".
You can log them to a file with the logger. Drive a circle. Take them to excel and device them by 100000 to get the euler back.
Then you can try formulas to get the degree or radians back ...
If a answer is correct or did help you for a solution, please use the solve button.
User avatar
sirnoname
Site Admin
 
Posts: 1751
Images: 45
Joined: Thu 1. Sep 2011, 22:02
Location: Munich, Germany
Has thanked: 35 times
Been thanked: 122 times

Re: AW: projectCARS

Postby minikase » Fri 22. Mar 2013, 09:59

I dont understand what you are talking about....so one of you experts should ask in their forum.
There is only the one thread: SDK/API.
The best will be, if dev to dev will talk in a direct way.
minikase
X-Sim Supporter
 
Posts: 23
Joined: Tue 20. Mar 2012, 14:57
Has thanked: 0 time
Been thanked: 0 time

Re: projectCARS

Postby sirnoname » Fri 22. Mar 2013, 10:27

As you can see there are only big supporters.
And only the biggest get answers ;)
Thats the part of the community to ask for code samples for the needed car oriented output.
If a answer is correct or did help you for a solution, please use the solve button.
User avatar
sirnoname
Site Admin
 
Posts: 1751
Images: 45
Joined: Thu 1. Sep 2011, 22:02
Location: Munich, Germany
Has thanked: 35 times
Been thanked: 122 times

Re: projectCARS

Postby minikase » Fri 22. Mar 2013, 11:15

The biggest one would be the chief dev of X-Sim3 ;)

Community OK, but it must be someone, who understands all the details of the needed values and can not only asked for them, but discuss the details with Paul Hudak, the dev of the API. Sorry, but I cant that.

To the whole x.sim.de-community:
The following seems to be a complete(?) dump of the outgoing data. Mark the wrong with colour and comment whats wrong with it, please.
Add missing but needed values, please.

---------------------------------------------------------------------
mVersion = 1
GameState = INGAME_PAUSED
SessionState = TIME_ATTACK
mPlayerName = 'Player'
mCarName = 'Ariel Atom 300 Supercharged'
mCarClassName = 'TrackDay2'
mTrackName = 'Anhalt GP'
mUnfilteredThrottle = 0.000000
mUnfilteredBrake = 0.000000
mUnfilteredSteering = -0.008200
mUnfilteredClutch = 0.000000
mBestLapTime = -1.000000
mLastLapTime = -1.000000
mCurrentTime = -1.000000
mBestSector1Time = -1.000000
mCurrentSector1Time = -1.000000
mBestSector2Time = -1.000000
mCurrentSector2Time = -1.000000
mSplitTime = 0.000000
mEventTimeRemaining = -1.000000
mLapsInEvent = 0
mLapsCompleted = 0
mCurrentLap = 1
mCurrentPosition = 1
mNumberOfCars = 1
mCurrentSector = SECTOR2
mCarFlags LIGHT ENG_ON ENG_WARN LIMITER ABS HBRAKE
mCarFlags = no yes no no no no
mOilTempCelsius = 48.568119
mOilPressureKPa = 175.281586
mWaterTempCelsius = 42.275459
mWaterPressureKPa = 91.072975
mFuelPressureKPa = 58.500000
mFuelLevel = 0.777768
mFuelCapacity = 36.000000 l
mSpeed = 5.299896 m/sec
mRpm = 2597.959473
mMaxRPM = 8600.000000
mBrake = 0.000000
mThrottle = 0.025346
mClutch = 0.000000
mSteering = -0.008200
mGear = 1
mWorldPosition = -10.039679, 4.178274, -88.255379
mOrientation = -0.093756, -0.115474, 0.000000
mVelocity = -5.297115, 0.161724, 0.000000
mAngularVelocity = 0.071650, 0.060609, 0.000000
mAcceleration = 2.149631, -0.251866, 0.000000
mExtentsCentre = -0.005458, 0.631380, -0.226780
mTyreFlags ATTACHED INFLATED GROUNDED
mTyreFlags FL = yes yes yes
mTyreFlags FR = yes yes yes
mTyreFlags RL = yes yes yes
mTyreFlags RR = yes yes yes
mTerrain = RUMBLE_STRIPS, GRASS, RUMBLE_STRIPS, ROAD
mTyreY = 0.032658, 0.033409, 0.048003, 0.049872
mTyreRPS = -18.188000, -18.254160, -17.478458, -17.479822
mTyreSlipSpeed = 0.128051, 0.074562, 0.170636, 0.169795
mTyreSpeed = 0.000000, 0.000000, 0.000000, 0.000000
mTyreTemp = 83.273018, 83.352638, 84.059654, 84.408150
mTyreGrip = 0.733058, 0.688781, 0.559147, 0.508664
mTyreHeightAboveGround = -0.015102, -0.002373, -0.015881, -0.010330
mTyreLateralStiffness = 166666.671875, 166666.671875, 166666.671875, 166666.671875
mTyreWear = 0.000000, 0.000000, 0.000000, 0.000000
mBrakeDamage = 0.000000, 0.000000, 0.000000, 0.000000
mSuspensionDamage = 0.000000, 0.000000, 0.000000, 0.000000
mCrashState = DAMAGE_NONE
mAeroDamage = 0.000000
mEngineDamage = 0.000255
mAmbientTemperature = 26.976673
mTrackTemperature = 38.465012
mRainDensity = 0.000000
mWindSpeed = 10.488337
mWindDirectionX = 0.707107
mWindDirectionY = -0.707107
mCloudBrightness = 3.568585
-----------------------------------------------------------------------------------------------------------------------
minikase
X-Sim Supporter
 
Posts: 23
Joined: Tue 20. Mar 2012, 14:57
Has thanked: 0 time
Been thanked: 0 time

Re: projectCARS

Postby sirnoname » Fri 22. Mar 2013, 12:04

Ok, I did that post.
But please join this thread and make some interests quote there that they get response and make more attention about this needed part.
If a answer is correct or did help you for a solution, please use the solve button.
User avatar
sirnoname
Site Admin
 
Posts: 1751
Images: 45
Joined: Thu 1. Sep 2011, 22:02
Location: Munich, Germany
Has thanked: 35 times
Been thanked: 122 times

Re: projectCARS

Postby minikase » Fri 22. Mar 2013, 12:43

The chief dev Andy G. answered fast, the change is as fast checked in and will come today with a new build für Teammember and higher. THX Sir!

Here is the changelog:
CL 276960

[Aries] Fixups for shared memory data

-Euler mOrientation values corrected
-Fixed comments for (mBestLapTime & mLastLapTime) from milliseconds to seconds
-Renamed mVelocity to mWorldVelocity
-Created mLocalVelocity
-Renamed mAcceleration to mWorldAcceleration
-Created mLocalAcceleration
-Added type GAME_EXITED to GameState (Type#1)- (as the MMF persists as long as there is a handle to it)
minikase
X-Sim Supporter
 
Posts: 23
Joined: Tue 20. Mar 2012, 14:57
Has thanked: 0 time
Been thanked: 0 time

Re: projectCARS

Postby sirnoname » Fri 22. Mar 2013, 13:00

uff, yes, the development is on calls. This means very dynamically with often updates. We need someone who feed me with that updates, thats the point I said that the community must help. I cannot follow this hidden bug trackers.
I still have no glue which version will carry this new structure.
If a answer is correct or did help you for a solution, please use the solve button.
User avatar
sirnoname
Site Admin
 
Posts: 1751
Images: 45
Joined: Thu 1. Sep 2011, 22:02
Location: Munich, Germany
Has thanked: 35 times
Been thanked: 122 times

Re: projectCARS

Postby prodigy » Fri 22. Mar 2013, 13:30

I follow the Pcars forum daily, as I see Minikase too, so we can update this thread when something new is released.

Here you can download new shared_memory file V2
http://forum.wmdportal.com/showthread.p ... red-Memory

or

Code: Select all
/*************************************************************************************************
  Description:
    Storage structure for storing and updating shared memory

    Copyright (c) MWL. All rights reserved.
*************************************************************************************************/

#ifndef _SHARED_MEMORY_HPP_
#define _SHARED_MEMORY_HPP_

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// NOTES:
//
//  -The shared memory variables will be updated once per graphics frame.
//
//  -Each variable comes with a UNIT, RANGE, and UNSET description where applicable.
//     UNITS - Is the numeric form which a variable is stored in (e.g. KPH, Celsius)
//     RANGE - Is the min-max ranges for a variable
//     UNSET - Is the initialised/default/invalid value, depending on the variables usage
//
//  -Constant/unchanging values are included in the data, such as 'maxRPM', 'fuelCapacity' - this is done to allow percentage calculations.
//
//  -Also included are 7 unique enumerated types, to be used against the mentioned flag/state variables
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


// *** Types ***

// Header version number to test against
enum
{
  SHARED_MEMORY_VERSION = 2
};

// Maximum allowed length of string
enum
{
  STRING_LENGTH_MAX = 256
};

// Tyres
enum
{
  TYRE_FRONT_LEFT = 0,
  TYRE_FRONT_RIGHT,
  TYRE_REAR_LEFT,
  TYRE_REAR_RIGHT,
  //--------------
  TYRE_MAX
};

// Vector
enum
{
  VEC_X = 0,
  VEC_Y,
  VEC_Z,
  //-------------
  VEC_MAX
};

// (Type#1) GameState (to be used with 'mGameState')
enum
{
  GAME_EXITED = 0,
  GAME_FRONT_END,
  GAME_INGAME_PLAYING,
  GAME_INGAME_PAUSED,
  //-------------
  GAME_MAX
};

// (Type#2) Session state (to be used with 'mSessionState')
enum
{
  SESSION_INVALID = 0,
  SESSION_PRACTICE,
  SESSION_TEST,
  SESSION_QUALIFY,
  SESSION_RACE,
  SESSION_TIME_ATTACK,
  //-------------
  SESSION_MAX
};

// (Type#3) Terrain Materials (to be used with 'mTerrain')
enum
{
  TERRAIN_ROAD = 0,
  TERRAIN_LOW_GRIP_ROAD,
  TERRAIN_BUMPY_ROAD1,
  TERRAIN_BUMPY_ROAD2,
  TERRAIN_BUMPY_ROAD3,
  TERRAIN_MARBLES,
  TERRAIN_GRASSY_BERMS,
  TERRAIN_GRASS,
  TERRAIN_GRAVEL,
  TERRAIN_BUMPY_GRAVEL,
  TERRAIN_RUMBLE_STRIPS,
  TERRAIN_DRAINS,
  TERRAIN_TYREWALLS,
  TERRAIN_CEMENTWALLS,
  TERRAIN_GUARDRAILS,
  TERRAIN_SAND,
  TERRAIN_BUMPY_SAND,
  TERRAIN_DIRT,
  TERRAIN_BUMPY_DIRT,
  TERRAIN_DIRT_ROAD,
  TERRAIN_BUMPY_DIRT_ROAD,
  TERRAIN_PAVEMENT,
  TERRAIN_DIRT_BANK,
  TERRAIN_WOOD,
  TERRAIN_DRY_VERGE,
  TERRAIN_EXIT_RUMBLE_STRIPS,
  TERRAIN_GRASSCRETE,
  TERRAIN_LONG_GRASS,
  TERRAIN_SLOPE_GRASS,
  TERRAIN_COBBLES,
  TERRAIN_SAND_ROAD,
  TERRAIN_BAKED_CLAY,
  TERRAIN_ASTROTURF,
  TERRAIN_SNOWHALF,
  TERRAIN_SNOWFULL,
  //-------------
  TERRAIN_MAX
};

// (Type#4) Crash Damage State  (to be used with 'mCrashState')
enum
{
  CRASH_DAMAGE_NONE = 0,
  CRASH_DAMAGE_OFFTRACK,
  CRASH_DAMAGE_LARGE_PROP,
  CRASH_DAMAGE_SPINNING,
  CRASH_DAMAGE_ROLLING,
  //-------------
  CRASH_MAX
};

 // (Type#5) Current Sector (to be used with 'mCurrentSector')
enum
{
  SECTOR_INVALID = 0,
  SECTOR_START,
  SECTOR_SECTOR1,
  SECTOR_SECTOR2,
  SECTOR_FINISH,
  SECTOR_STOP,
  //-------------
  SECTOR_MAX
};

// (Type#6) 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),
};

// (Type#7) Tyre Flags (to be used with 'mTyreFlags')
enum
{
  TYRE_ATTACHED         = (1<<0),
  TYRE_INFLATED         = (1<<1),
  TYRE_IS_ON_GROUND     = (1<<2),
};


// *** Shared Memory ***

typedef struct
{
  // Version Number
  unsigned int mVersion;                           // [ RANGE = 0->... ]

  // Session type
  unsigned int mGameState;                         // [ enum (Type#1) Game state ]
  unsigned int mSessionState;                      // [ enum (Type#2) Session state ]

  // Unfiltered Input
  float mUnfilteredThrottle;                       // [ RANGE = 0.0f->1.0f ]
  float mUnfilteredBrake;                          // [ RANGE = 0.0f->1.0f ]
  float mUnfilteredSteering;                       // [ RANGE = -1.0f->1.0f ]
  float mUnfilteredClutch;                         // [ RANGE = 0.0f->1.0f ]

  // One Time Session
  char mPlayerName[STRING_LENGTH_MAX];             // [ string ]
  char mCarName[STRING_LENGTH_MAX];                // [ string ]
  char mCarClassName[STRING_LENGTH_MAX];           // [ string ]
  char mTrackName[STRING_LENGTH_MAX];              // [ string ]

  // Timing & Scoring
  float mBestLapTime;                              // [ UNITS = seconds ]   [ RANGE = 0.0f->... ]   [ UNSET = -1.0f ]
  float mLastLapTime;                              // [ UNITS = seconds ]   [ RANGE = 0.0f->... ]   [ UNSET = 0.0f ]
  float mCurrentTime;                              // [ UNITS = seconds ]   [ RANGE = 0.0f->... ]   [ UNSET = 0.0f ]
  float mBestSector1Time;                          // [ UNITS = seconds ]   [ RANGE = 0.0f->... ]   [ UNSET = -1.0f ]
  float mCurrentSector1Time;                       // [ UNITS = seconds ]   [ RANGE = 0.0f->... ]   [ UNSET = -1.0f ]
  float mBestSector2Time;                          // [ UNITS = seconds ]   [ RANGE = 0.0f->... ]   [ UNSET = -1.0f ]
  float mCurrentSector2Time;                       // [ UNITS = seconds ]   [ RANGE = 0.0f->... ]   [ UNSET = -1.0f ]
  float mSplitTime;                                // [ UNITS = seconds ]   [ RANGE = 0.0f->... ]   [ UNSET = 0.0f ]
  float mEventTimeRemaining;                       // [ UNITS = milli-seconds ]   [ RANGE = 0.0f->... ]   [ UNSET = -1.0f ]

  // Race Info
  unsigned int mLapsInEvent;                       // [ RANGE = 0->... ]   [ UNSET = 0 ]
  unsigned int mLapsCompleted;                     // [ RANGE = 0->... ]   [ UNSET = 0 ]
  unsigned int mCurrentLap;                        // [ RANGE = 0->... ]   [ UNSET = 0 ]
  unsigned int mCurrentPosition;                   // [ RANGE = 1->... ]   [ UNSET = 0 ]
  unsigned int mNumberOfCars;                      // [ RANGE = 1->... ]   [ UNSET = 0 ]
  unsigned int mCurrentSector;                     // [ enum (Type#5) Current Sector ]

  // Car State
  unsigned int mCarFlags;                          // [ enum (Type#6) Car Flags ]
  float mOilTempCelsius;                           // [ UNITS = Celsius ]   [ UNSET = 0.0f ]
  float mOilPressureKPa;                           // [ UNITS = Kilopascal ]   [ RANGE = 0.0f->... ]   [ UNSET = 0.0f ]
  float mWaterTempCelsius;                         // [ UNITS = Celsius ]   [ UNSET = 0.0f ]
  float mWaterPressureKPa;                         // [ UNITS = Kilopascal ]   [ RANGE = 0.0f->... ]   [ UNSET = 0.0f ]
  float mFuelPressureKPa;                          // [ UNITS = Kilopascal ]   [ RANGE = 0.0f->... ]   [ UNSET = 0.0f ]
  float mFuelLevel;                                // [ RANGE = 0.0f->1.0f ]
  float mFuelCapacity;                             // [ UNITS = Liters ]   [ RANGE = 0.0f->1.0f ]   [ UNSET = 0.0f ]
  float mSpeed;                                    // [ UNITS = Metres per-second ]   [ RANGE = 0.0f->... ]
  float mRpm;                                      // [ UNITS = Revolutions per minute ]   [ RANGE = 0.0f->... ]   [ UNSET = 0.0f ]
  float mMaxRPM;                                   // [ UNITS = Revolutions per minute ]   [ RANGE = 0.0f->... ]   [ UNSET = 0.0f ]
  float mBrake;                                    // [ RANGE = 0.0f->1.0f ]
  float mThrottle;                                 // [ RANGE = 0.0f->1.0f ]
  float mClutch;                                   // [ RANGE = 0.0f->1.0f ]
  float mSteering;                                 // [ RANGE = -1.0f->1.0f ]
  int mGear;                                       // [ RANGE = -1 (Reverse)  0 (Neutral)  1 (Gear 1)  2 (Gear 2)  etc... ]   [ UNSET = 0 (Neutral) ]

  // Motion & Device Related
  float mWorldPosition[VEC_MAX];                   // [ UNITS = World Space  X  Y  Z ]
  float mOrientation[VEC_MAX];                     // [ UNITS = Euler Angles ]
  float mLocalVelocity[VEC_MAX];                   // [ UNITS = Metres per-second ]
  float mWorldVelocity[VEC_MAX];                   // [ UNITS = Metres per-second ]
  float mAngularVelocity[VEC_MAX];                 // [ UNITS = Radians per-second ]
  float mLocalAcceleration[VEC_MAX];               // [ UNITS = Metres per-second ]
  float mWorldAcceleration[VEC_MAX];               // [ UNITS = Metres per-second ]
  float mExtentsCentre[VEC_MAX];                   // [ UNITS = Local Space  X  Y  Z ]

  // Wheels / Tyres
  unsigned int mTyreFlags[TYRE_MAX];               // [ enum (Type#7) Tyre Flags ]
  unsigned int mTerrain[TYRE_MAX];                 // [ enum (Type#3) Terrain Materials ]
  float mTyreY[TYRE_MAX];                          // [ UNITS = Local Space  Y ]
  float mTyreRPS[TYRE_MAX];                        // [ UNITS = Revolutions per second ]
  float mTyreSlipSpeed[TYRE_MAX];                  // [ UNITS = Metres per-second ]
  float mTyreSpeed[TYRE_MAX];                      // [ UNITS = Metres per-second ]
  float mTyreTemp[TYRE_MAX];                       // [ UNITS = Celsius ]   [ UNSET = 0.0f ]
  float mTyreGrip[TYRE_MAX];                       // [ RANGE = 0.0f->1.0f ]
  float mTyreHeightAboveGround[TYRE_MAX];          // [ UNITS = Local Space  Y ]
  float mTyreLateralStiffness[TYRE_MAX];           // [ UNITS = Lateral stiffness coefficient used in tyre deformation ]
  float mTyreWear[TYRE_MAX];                       // [ RANGE = 0.0f->1.0f ]
  float mBrakeDamage[TYRE_MAX];                    // [ RANGE = 0.0f->1.0f ]
  float mSuspensionDamage[TYRE_MAX];               // [ RANGE = 0.0f->1.0f ]

  // Car Damage
  unsigned int mCrashState;                        // [ enum (Type#4) Crash Damage State ]
  float mAeroDamage;                               // [ RANGE = 0.0f->1.0f ]
  float mEngineDamage;                             // [ RANGE = 0.0f->1.0f ]

  // Weather
  float mAmbientTemperature;                       // [ UNITS = Celsius ]   [ UNSET = 25.0f ]
  float mTrackTemperature;                         // [ UNITS = Celsius ]   [ UNSET = 30.0f ]
  float mRainDensity;                              // [ UNITS = How much rain will fall ]   [ RANGE = 0.0f->1.0f ]
  float mWindSpeed;                                // [ RANGE = 0.0f->100.0f ]   [ UNSET = 2.0f ]
  float mWindDirectionX;                           // [ UNITS = Normalised Vector X ]
  float mWindDirectionY;                           // [ UNITS = Normalised Vector Y ]
  float mCloudBrightness;                          // [ RANGE = 0.0f->... ]
} SharedMemory;


#endif  // _SHARED_MEMORY_HPP_
User avatar
prodigy
X-Sim Supporter
 
Posts: 274
Images: 42
Joined: Tue 16. Oct 2012, 12:32
Location: Pula, Croatia
Has thanked: 20 times
Been thanked: 21 times

PreviousNext

Return to Project CARS

Who is online

Users browsing this forum: No registered users and 1 guest