Coder Social home page Coder Social logo

vdrift / vdrift Goto Github PK

View Code? Open in Web Editor NEW
349.0 349.0 93.0 21.21 MB

VDrift source code

Home Page: http://vdrift.net/

License: GNU General Public License v3.0

Python 1.25% Lua 0.47% C++ 91.27% C 6.26% Makefile 0.22% Shell 0.29% Elixir 0.03% Euphoria 0.20%

vdrift's Introduction

VDrift - A Car Racing Simulator for Multiple Platforms

VDrift is a cross-platform, open source driving simulation made with drift racing in mind. It is released under the GNU General Public License (GPL) v3. It is currently available for FreeBSD, Linux, Mac OS X and Windows.

Mission Statement

The goals of the VDrift project are:

  • to be a high-quality, open source racing simulation featuring enjoyable and challenging gameplay;
  • to take advantage of modern computing hardware to accurately simulate vehicle physics in rich and immersive racing environments; and
  • to provide a platform for creative experimentation to a community of developers and artists.

Getting Started

General

Installation

Configuration

Playing

Files

Development

Cars

Tracks

vdrift's People

Contributors

aaronorosen avatar aaronorosen2 avatar antoniovazquezblanco avatar bengt avatar bmwiedemann avatar cheezecake avatar cryham avatar davidgumberg avatar isghe avatar joevenzon avatar larsmans avatar lastique avatar lheckemann avatar logzero avatar mailaender avatar matthiascoppens avatar ony avatar sajty avatar susnux avatar thelusiv avatar timo6 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vdrift's Issues

Cars roll forward

Can't remember how much of my fixes survived the reverts.

This is most probably due to suspension forces being applied along the suspension upright. There has been a forum thread regarding this somewhere.

Car forward acceleration, velocity, distance logging patch.

From e5d4628ccd381c0e2b3ad501cd987afd3e5dcea5 Mon Sep 17 00:00:00 2001
From: logzero 
Date: Thu, 14 Jul 2011 13:53:46 +0200
Subject: [PATCH 2/2] Car forward acceleration, velocity, distance logging.

---
 include/car.h         |   11 +++++-
 include/cardynamics.h |    7 +--
 src/cardynamics.cpp   |   24 ++++--------
 src/game.cpp          |  103 +++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 124 insertions(+), 21 deletions(-)

diff --git a/include/car.h b/include/car.h
index 8bf2419..ee3020d 100644
--- a/include/car.h
+++ b/include/car.h
@@ -77,7 +77,11 @@ public:
 
    void GetEngineSoundList(std::list  & outputlist);
 
-   // interpolated
+   const CARDYNAMICS& GetDynamics() const
+   {
+       return dynamics;
+   }
+
    const MATHVECTOR  GetWheelPosition(const WHEEL_POSITION wpos) const
    {
        return ToMathVector(dynamics.GetWheelPosition(wpos));
@@ -209,6 +213,11 @@ public:
        dynamics.DebugPrint(out, p1, p2, p3, p4);
    }
 
+   void SetSimulationStepCB(void (*cb)(const CARDYNAMICS&))
+   {
+       dynamics.SetStepCB(cb);
+   }
+
    bool Serialize(joeserialize::Serializer & s);
 
 /// AI interface
diff --git a/include/cardynamics.h b/include/cardynamics.h
index b348cc7..4e7755a 100644
--- a/include/cardynamics.h
+++ b/include/cardynamics.h
@@ -134,11 +134,11 @@ public:
 
    btScalar GetFeedback() const;
 
-   void UpdateTelemetry(btScalar dt);
-
    // print debug info to the given ostream.  set p1, p2, etc if debug info part 1, and/or part 2, etc is desired
    void DebugPrint(std::ostream & out, bool p1, bool p2, bool p3, bool p4) const;
 
+   void SetStepCB(void (*simcb)(const CARDYNAMICS& cd));
+
    bool Serialize(joeserialize::Serializer & s);
 
 protected:
@@ -194,10 +194,9 @@ protected:
    btAlignedObjectArray wheel_orientation;
    btAlignedObjectArray wheel_contact;
    std::vector > suspension;
-
    btAlignedObjectArray aerodynamics;
-   std::list telemetry;
 
+   void (*step_callback)(const CARDYNAMICS&);
    btScalar maxangle;
    btScalar feedback;
    bool damage;
diff --git a/src/cardynamics.cpp b/src/cardynamics.cpp
index 5589c5b..0a176eb 100644
--- a/src/cardynamics.cpp
+++ b/src/cardynamics.cpp
@@ -377,6 +377,7 @@ CARDYNAMICS::CARDYNAMICS() :
    remaining_shift_time(0),
    abs(false),
    tcs(false),
+   step_callback(0),
    maxangle(0),
    damage(false)
 {
@@ -635,12 +636,6 @@ bool CARDYNAMICS::Load(
    // place car on track
    AlignWithGround();
 
-   // initialize telemetry
-   telemetry.clear();
-   //telemetry.push_back(CARTELEMETRY("brakes"));
-   //telemetry.push_back(CARTELEMETRY("suspension"));
-   //etc
-
    return true;
 }
 
@@ -981,14 +976,6 @@ btScalar CARDYNAMICS::GetFeedback() const
    return feedback;
 }
 
-void CARDYNAMICS::UpdateTelemetry(btScalar dt)
-{
-   for (std::list::iterator i = telemetry.begin(); i != telemetry.end(); ++i)
-   {
-       i->Update(dt);
-   }
-}
-
 std::ostream & operator << (std::ostream & os, const btVector3 & v)
 {
    os << v[0] << ", " << v[1] << ", " << v[2];
@@ -1109,6 +1096,11 @@ void CARDYNAMICS::DebugPrint ( std::ostream & out, bool p1, bool p2, bool p3, bo
    }
 }
 
+void CARDYNAMICS::SetStepCB(void (*cb)(const CARDYNAMICS& d))
+{
+   step_callback = cb;
+}
+
 static bool serialize(joeserialize::Serializer & s, btQuaternion & q)
 {
    _SERIALIZE_(s, q[0]);
@@ -1630,10 +1622,10 @@ void CARDYNAMICS::updateAction(btCollisionWorld * collisionWorld, btScalar dt)
    const float tacho_factor = 0.1;
    tacho_rpm = engine.GetRPM() * tacho_factor + tacho_rpm * (1.0 - tacho_factor);
 
-   UpdateTelemetry(dt);
-
    linear_velocity = body->getLinearVelocity();
    angular_velocity = body->getAngularVelocity();
+
+   if (step_callback) step_callback(*this);
 }
 
 void CARDYNAMICS::UpdateWheelContacts()
diff --git a/src/game.cpp b/src/game.cpp
index fed86c3..338a9f6 100755
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -62,6 +62,91 @@
 
 #define USE_STATIC_OPTIMIZATION_FOR_TRACK
 
+// logging hack
+class MotionStateLogger
+{
+public:
+   MotionStateLogger() :
+       _ticks(0),
+       _ticks_acc(0),
+       _distance(0),
+       _velocity(0)
+   {
+       // ctor
+   }
+
+   void init()
+   {
+       if (_out.good()) _out.close();
+       _out.open("log.txt");
+       _out << "Time,Acc,Vel,Dist\n";
+       _out << std::fixed << std::setprecision(4);
+       _ticks = 0;
+       _ticks_acc = 0;
+       _distance = 0;
+       _velocity = 0;
+   }
+
+   void step(const CARDYNAMICS& dynamics)
+   {
+       ++_ticks_acc;
+       if (_ticks_acc == _samplerate)
+       {
+           btQuaternion rot = dynamics.GetOrientation().inverse();
+           btVector3 velocity = quatRotate(rot, dynamics.GetVelocity());
+           btScalar dv = velocity[1] - _velocity;
+           _velocity = velocity[1];
+           _distance += _velocity / _freq;
+           _ticks += _ticks_acc;
+           _ticks_acc = 0;
+           _out << _ticks * _timestep << "," << dv * _freq << "," << _velocity << "," << _distance << "\n";
+       }
+   }
+
+   static void setSamplingFrequency(float freq, float timestep)
+   {
+       if (freq < 1 || freq > 1 / timestep) freq = 1 / timestep;
+       float samplerate = 1.0 / (timestep * freq);
+       _samplerate = samplerate;
+       _timestep = timestep;
+       _freq = 1.0 / (_timestep * (float)_samplerate);
+       _enable = true;
+   }
+
+   static void initDefaultInstance()
+   {
+       _default_logger.init();
+   }
+
+   static void stepDefaultInstance(const CARDYNAMICS& dynamics)
+   {
+       _default_logger.step(dynamics);
+   }
+
+   static bool isEnabled()
+   {
+       return _enable;
+   }
+
+private:
+   static MotionStateLogger _default_logger;
+   static unsigned _samplerate;
+   static float _timestep;
+   static float _freq;
+   static bool _enable;
+   std::ofstream _out;
+   unsigned long _ticks;
+   unsigned _ticks_acc;
+   btScalar _distance;
+   btScalar _velocity;
+};
+
+MotionStateLogger MotionStateLogger::_default_logger;
+unsigned MotionStateLogger::_samplerate(9);
+float MotionStateLogger::_timestep(1/90.0);
+float MotionStateLogger::_freq(1/10.0);
+bool MotionStateLogger::_enable(false);
+
 template 
 static std::string toString (const T &t) {
    std::ostringstream os;
@@ -572,6 +657,14 @@ bool GAME::ParseArguments(std::list  & args)
        renderconfigfile = argmap["-render"];
    }
 
+   arghelp["-motion-log FREQUENCY"] = "Log player car frame forward acceleration, velocity and distance.";
+   if (!argmap["-motion-log"].empty())
+   {
+       unsigned frequency;
+       std::stringstream s(argmap["-motion-log"]);
+       s >> frequency;
+       MotionStateLogger::setSamplingFrequency(frequency, TickPeriod());
+   }
 
    arghelp["-help"] = "Display command-line help.";
    if (argmap.find("-help") != argmap.end() || argmap.find("-h") != argmap.end() || argmap.find("--help") != argmap.end() || argmap.find("-?") != argmap.end())
@@ -808,6 +901,9 @@ void GAME::AdvanceGameLogic()
                collision.update(TickPeriod());
                PROFILER.endBlock("physics");
 
+               // logging hack
+               MotionStateLogger::stepDefaultInstance(cars.begin()->GetDynamics());
+
                PROFILER.beginBlock("car-update");
                for (std::list ::iterator i = cars.begin(); i != cars.end(); ++i)
                {
@@ -1777,6 +1873,13 @@ bool GAME::NewGame(bool playreplay, bool addopponents, int num_laps)
        return false;
    }
 
+   // logger hack
+   if (MotionStateLogger::isEnabled())
+   {
+       MotionStateLogger::initDefaultInstance();
+       cars.begin()->SetSimulationStepCB(&MotionStateLogger::stepDefaultInstance);
+   }
+
    // Load AI cars.
    if (addopponents)
    {
-- 
1.7.4.msysgit.0

Error in dynamicsworld.cpp

Error when building on mac:
/Applications/VDrift/Dev/vdrift/tools/osx/../../src/dynamicsworld.cpp: In member function 'virtual btScalar MyRayResultCallback::addSingleResult(btCollisionWorld::LocalRayResult&, bool)':
/Applications/VDrift/Dev/vdrift/tools/osx/../../src/dynamicsworld.cpp:47: error: 'struct btCollisionWorld::LocalShapeInfo' has no member named 'm_shape'

Gaming platforms deployment

Does anyone of you have an xbox360 or maybe an ps2 or ps3? It would be nice to be able to play vdrift on them. As far as I know playstation development is expensive but xbox one can be done freely.

Content Tracker

VDrift should have a system keeping track of the installed content to gather data about the actually installed content.
With this information a minimal data set with the most popular content could be created to minimize the initial download size while maintaining a positive first impression.

Content Tracker Server

A central server should be setup to automate gathering the information.
The central server should store the name and the sha1 hash to keep track of different versions of content .
The central server should implement a web service accepting requests to store this information.
The central server should should store the data sets with timestamps to allow for trends to be calculated.

Client

The VDrift Core should be extended to send the information to the server.
The VDrift Core should ask the user for permission to do this, once on the first start when this feature is available.
The VDrift Core should inform the user about what the usage data is needed for, where it is stored, how it is stored and who can access it.
The VDrift Core should save the choice in an configuration variable that is changeable, if the user changes his mind, later.

Proof of Concept

A rudimentary proof of concept, which demonstrates the viability of hashing all content can be found under https://github.com/bigben87/VDriftDataHasher.

Mixing code and headers

For a long time you've been separating header and source code files, but at the moment you're mixing them in some directories, my proposal is to mix them under the src directory so that the source tree will become minimal. What do you think?

Unable to load circuit

GNU gdb 6.3.50-20050815 (Apple version gdb-1705) (Fri Jul 1 10:50:06 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".
tty /dev/ttys001
[Switching to process 1379 thread 0x0]
INFO: Multi-processor system detected. Run with -multithreaded argument to enable multithreading (EXPERIMENTAL).
INFO: Starting VDrift: 2011-08-03, Version: revision????, O/S: Mac OS
INFO: Home directory: /Users/antoniovazquezblanco
INFO: Settings file: /Users/antoniovazquezblanco/Library/Preferences/VDrift/VDrift.config
INFO: Data directory: data
DATA_DIR: /Users/antoniovazquezblanco/Library/Developer/Xcode/DerivedData/vdrift-duphatenjxuqanfnmfxlgjhbahwh/Build/Products/Debug/data
INFO: Temporary directory: /Users/antoniovazquezblanco/Library/Preferences/VDrift/tmp
INFO: Log file: /Users/antoniovazquezblanco/Library/Preferences/VDrift/log.txt
INFO: SDL initialization successful
INFO: SDL video query was successful
INFO: Disabling antialiasing
INFO: Display change was successful: 1152x720x16 24z fullscreen=0
INFO: GL Renderer: NVIDIA GeForce 320M OpenGL Engine
INFO: GL Vendor: NVIDIA Corporation
INFO: GL Version: 2.1 NVIDIA-7.2.9
INFO: Initialized GLEW 1.6.0
ERROR: Graphics card or driver does not support required GL_VERSION_3_3
ERROR: Initialization of GL3 failed; that's OK, falling back to GL 1 or 2
INFO: Video card information:
Vendor: NVIDIA Corporation
Renderer: NVIDIA GeForce 320M OpenGL Engine
Version: 2.1 NVIDIA-7.2.9
Maximum texture size: 8192
Maximum varying floats: 60
Using GLEW 1.6.0
INFO: Maximum color attachments: 8
INFO: Maximum draw buffers (1 required): 8
INFO: Texture units: 8 full, 16 partial
INFO: Loaded shader package simple
INFO: Loaded shader package simple, variant simple_premult
INFO: Loaded shader package simple, variant simple_gamma_premult
INFO: Loaded shader package simple, variant simple_gamma
INFO: Loaded shader package simple, variant simplecar
INFO: Loaded shader package logluminance
INFO: Loaded shader package logluminance, variant logluminance_tiny
INFO: Loaded shader package tonemap
INFO: ----- Start Shader Link Log for data/shaders/gbufferfill/vertex.glsl and data/shaders/gbufferfill/fragment.glsl -----
INFO: WARNING: Output of vertex shader 'V' not read by fragment shader

INFO: ----- End Shader Link Log -----
INFO: Loaded shader package gbufferfill
INFO: ----- Start Shader Link Log for data/shaders/gbufferfill/vertex.glsl and data/shaders/gbufferfill/fragment.glsl -----
INFO: WARNING: Output of vertex shader 'V' not read by fragment shader

INFO: ----- End Shader Link Log -----
INFO: Loaded shader package gbufferfill, variant gbufferfillcar
INFO: ----- Start Shader Link Log for data/shaders/lightaccumulate/vertex.glsl and data/shaders/lightaccumulate/fragment.glsl -----
INFO: WARNING: Output of vertex shader 'tu0coord' not read by fragment shader

INFO: ----- End Shader Link Log -----
INFO: Loaded shader package lightaccumulate, variant lightaccumulate_initial
INFO: ----- Start Shader Link Log for data/shaders/lightaccumulate/vertex.glsl and data/shaders/lightaccumulate/fragment.glsl -----
INFO: WARNING: Output of vertex shader 'tu0coord' not read by fragment shader

INFO: ----- End Shader Link Log -----
INFO: Loaded shader package lightaccumulate, variant lightaccumulate_omni
INFO: Loaded shader package depthgen
INFO: Loaded shader package depthgen, variant depthgennoalpha
INFO: Loaded shader package distancefield
INFO: Loaded shader package deferredskybox
INFO: Loaded shader package deferredskyboxblend
INFO: Loaded shader package softparticle
INFO: Loaded shader package ppdepthadjust
INFO: Loaded shader package ppdepthadjust, variant ppcopy
INFO: Loaded shader package ppdepthadjust, variant ppcopy_gamma
INFO: Loaded shader package deferredshadows
INFO: ----- Start Shader Link Log for data/shaders/ssao/vertex.glsl and data/shaders/ssao/fragment.glsl -----
INFO: WARNING: Output of vertex shader 'eyespace_view_direction' not read by fragment shader

INFO: ----- End Shader Link Log -----
INFO: Loaded shader package ssao
INFO: Loaded shader package ssao_blur
INFO: Loaded shader package deferredaa
INFO: Successfully enabled shaders
INFO: Initialized render output: full_scene_depth (FBO)
INFO: Initialized render output: full_scene_color (FBO)
INFO: Initialized render output: full_scene_tonemapped (FBO)
INFO: Initialized render output: normal_xy (FBO)
INFO: Initialized render output: material_properties (FBO)
INFO: Initialized render output: diffuse_albedo (FBO)
INFO: Initialized render output: log_luminance (FBO)
INFO: Initialized render output: log_luminance_tiny (FBO)
INFO: Maximum anisotropy: 16
INFO: 0 joysticks found.
INFO: Loading car controls from: /Users/antoniovazquezblanco/Library/Preferences/VDrift/controls.config
INFO: Sound initialization information:
INFO: Obtained audio device:
Frequency: 44100
Format: 32784
Bits per sample: 16
Channels: 2
Silence: 0
Samples: 2048
Size: 8192
Sound initialization successful
INFO: Loaded fonts successfully
INFO: Loaded GUI successfully
INFO: Loading track from path: data/tracks/imola2005
INFO: Loaded surfaces file, 11 surfaces.
INFO: Track timing sectors: 2
INFO: Car loading was successful: 3S/3S.car
INFO: Loading track from path: data/tracks/indianhill
INFO: Loaded surfaces file, 1 surfaces.
INFO: Track timing sectors: 1
ERROR: Error loading track (deferred): indianhill
ERROR: Error during track loading: indianhill
INFO: Loading track from path: data/tracks/indianhill
INFO: Loaded surfaces file, 1 surfaces.
INFO: Track timing sectors: 1
ERROR: Error loading track (deferred): indianhill
ERROR: Error during track loading: indianhill
INFO: Loading track from path: data/tracks/indianhill
INFO: Loaded surfaces file, 1 surfaces.
INFO: Track timing sectors: 1
ERROR: Error loading track (deferred): indianhill
ERROR: Error during track loading: indianhill
INFO: Loading track from path: data/tracks/indianhill
INFO: Loaded surfaces file, 1 surfaces.
INFO: Track timing sectors: 1
ERROR: Error loading track (deferred): indianhill
ERROR: Error during track loading: indianhill
INFO: Loading track from path: data/tracks/indianhill
INFO: Loaded surfaces file, 1 surfaces.
INFO: Track timing sectors: 1
ERROR: Error loading track (deferred): indianhill
ERROR: Error during track loading: indianhill
INFO: Loading track from path: data/tracks/indianhill
INFO: Loaded surfaces file, 1 surfaces.
INFO: Track timing sectors: 1
ERROR: Error loading track (deferred): indianhill
ERROR: Error during track loading: indianhill
INFO: Loading track from path: data/tracks/indianhill
INFO: Loaded surfaces file, 1 surfaces.
INFO: Track timing sectors: 1
ERROR: Error loading track (deferred): indianhill
ERROR: Error during track loading: indianhill
INFO: Loading track from path: data/tracks/indianhill
INFO: Loaded surfaces file, 1 surfaces.
INFO: Track timing sectors: 1
ERROR: Error loading track (deferred): indianhill
ERROR: Error during track loading: indianhill
INFO: Loading track from path: data/tracks/indianhill
INFO: Loaded surfaces file, 1 surfaces.
INFO: Track timing sectors: 1
ERROR: Error loading track (deferred): indianhill
ERROR: Error during track loading: indianhill
INFO: Loading track from path: data/tracks/indianhill
INFO: Loaded surfaces file, 1 surfaces.
INFO: Track timing sectors: 1
ERROR: Error loading track (deferred): indianhill
ERROR: Error during track loading: indianhill
INFO: Loading track from path: data/tracks/indianhill
INFO: Loaded surfaces file, 1 surfaces.
INFO: Track timing sectors: 1
ERROR: Error loading track (deferred): indianhill
ERROR: Error during track loading: indianhill
INFO: Loading track from path: data/tracks/indianhill
INFO: Loaded surfaces file, 1 surfaces.
INFO: Track timing sectors: 1
ERROR: Error loading track (deferred): indianhill
ERROR: Error during track loading: indianhill
INFO: Loading track from path: data/tracks/indianhill
INFO: Loaded surfaces file, 1 surfaces.
INFO: Track timing sectors: 1
ERROR: Error loading track (deferred): indianhill
ERROR: Error during track loading: indianhill

Add .desktop file

Add a .desktop file to comply with freedesktop.org standards. This takes the work off distribution maintainers.

My suggested vdrift.desktop

Crash

#0 0x080dc3ed in DynamicsWorld::reset (this=0xbfffbac0) at src/dynamicsworld.cpp:216
#1 0x080dc3c9 in DynamicsWorld::reset (this=0xbfffbac0, t=...) at src/dynamicsworld.cpp:210
#2 0x0823094b in TRACK::DeferredLoad (this=0xbfffbfe4, textures=..., models=..., world=..., info_output=..., error_output=..., trackpath=..., trackdir=..., texturedir=...,

texsize=..., sharedobjectpath=..., anisotropy=16, reverse=false, dynamicobjects=true, dynamicshadows=true, agressivecombine=false) at src/track.cpp:54

#3 0x080fdbf4 in GAME::LoadTrack (this=0xbfff9b28, trackname=...) at src/game.cpp:2070
#4 0x080fb9a2 in GAME::NewGame (this=0xbfff9b28, playreplay=false, addopponents=false, num_laps=0) at src/game.cpp:1772
#5 0x080f7580 in GAME::ProcessGUIAction (this=0xbfff9b28, action=...) at src/game.cpp:1296
#6 0x080f67ba in GAME::ProcessGUIInputs (this=0xbfff9b28) at src/game.cpp:1149
#7 0x080f4a85 in GAME::AdvanceGameLogic (this=0xbfff9b28) at src/game.cpp:784
#8 0x080f4971 in GAME::Tick (this=0xbfff9b28, deltat=0.00800000038) at src/game.cpp:766
#9 0x080f480b in GAME::MainLoop (this=0xbfff9b28) at src/game.cpp:726
#10 0x080f01d2 in GAME::Start (this=0xbfff9b28, args=...) at src/game.cpp:272
#11 0x081e31ec in main (argc=1, argv=0xbffff464) at src/main.cpp:84

Compiling problem.

This is my compiling output under Ubuntu linux fully updated after following your instructions:

antonio@antonio-pc:~/Proyectos/vdrift$ scons
scons: Reading SConscript files ...
Checking for C++ header file asio.hpp... (cached) yes
Checking for C++ header file boost/bind.hpp... (cached) yes
Checking for C++ header file GL/gl.h... (cached) yes
Checking for C++ header file GL/glu.h... (cached) yes
Checking for C++ header file SDL/SDL.h... (cached) yes
Checking for C++ header file SDL/SDL_image.h... (cached) yes
Checking for C++ header file SDL/SDL_rotozoom.h... (cached) yes
Checking for C++ header file vorbis/vorbisfile.h... (cached) yes
Checking for C++ header file GL/glew.h... (cached) yes
Checking for C++ header file curl/curl.h... (cached) yes
Checking for C++ header file bullet/btBulletCollisionCommon.h... (cached) yes
Checking for C++ header file archive.h... (cached) yes
Checking for glDeleteSamplers(0, NULL) in C library GLEW... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
CPP build/aabb.o
CPP build/aabb_space_partitioning.o
CPP build/ai.o
CPP build/archiveutils.o
CPP build/autoupdate.o
CPP build/bezier.o
CPP build/camera_chase.o
CPP build/camera_fixed.o
CPP build/camera_free.o
CPP build/camera_mount.o
CPP build/camera_orbit.o
CPP build/camera_simplemount.o
CPP build/camera_system.o
CPP build/car.o
CPP build/carcontrolmap_local.o
CPP build/cardifferential.o
CPP build/cardynamics.o
CPP build/carengine.o
CPP build/carsuspension.o
CPP build/cartire.o
CPP build/cfg/inf.o
CPP build/cfg/ini.o
CPP build/cfg/ptree.o
CPP build/cfg/xml.o
CPP build/config.o
CPP build/containeralgorithm.o
CPP build/contentmanager.o
CPP build/crashdetection.o
CPP build/downloadable.o
CPP build/drawable.o
src/drawable.cpp: En la función miembro ‘RenderModelExternal& DRAWABLE::generateRenderModelData(GLWrapper&, StringIdMap&)’:
src/drawable.cpp:73:18: aviso: se define la variable ‘depthOffsetId’ pero no se usa [-Wunused-but-set-variable]
CPP build/dynamicsworld.o
CPP build/endian_utility.o
CPP build/eventsystem.o
CPP build/fbobject.o
CPP build/fbtexture.o
CPP build/font.o
CPP build/forcefeedback.o
CPP build/fracturebody.o
CPP build/game.o
CPP build/gl3v/glenums.o
In file included from src/gl3v/glenums.cpp:28:0:
src/gl3v/glenums.def: En el constructor ‘GLEnums::GLEnums()’:
src/gl3v/glenums.def:34:1: error: ‘GL_RGB10_A2UI’ no se declaró en este ámbito
src/gl3v/glenums.def:170:1: error: ‘GL_SRC1_COLOR’ no se declaró en este ámbito
src/gl3v/glenums.def:171:1: error: ‘GL_ONE_MINUS_SRC1_COLOR’ no se declaró en este ámbito
src/gl3v/glenums.def:173:1: error: ‘GL_ONE_MINUS_SRC1_ALPHA’ no se declaró en este ámbito
scons: *** [build/gl3v/glenums.o] Error 1
scons: building terminated because of errors.

What's the missing header?

Premake: xcode

To add the required frameworks to xcode, the premake4.lua currently has:
libdirs { "vdrift-mac/Frameworks" } link {"Archive.framework", ...}
However this sets the build setting "Library Search Paths" to vdrift-mac/Frameworks, not "Framework Search Paths" so xcode doesn't find the frameworks. I have tried doing the following
link {"vdrift-mac/Frameworks/Archive.framework"}
but this doesn't work. Does anyone know how to fix this? I can't see anything on the premake site.

Update menu not showing

INFO: Multi-processor system detected. Run with -multithreaded argument to enable multithreading (EXPERIMENTAL).
INFO: Starting VDrift: development-full, Version: exportado, O/S: Unix
INFO: Home directory: /home/antonio
INFO: Settings file: /home/antonio/.vdrift/VDrift.config
INFO: Data directory: data
DATA_DIR: /usr/local/share/games/vdrift/data
INFO: Temporary directory: /home/antonio/.vdrift/tmp
INFO: Log file: /home/antonio/.vdrift/log.txt
INFO: Enabling antialiasing: 4X
INFO: Display change was successful: 1152x864x32 24z fullscreen=0
INFO: GL Renderer: GeForce 9600 GT/PCI/SSE2/3DNOW!
INFO: GL Vendor: NVIDIA Corporation
INFO: GL Version: 3.3.0 NVIDIA 280.13
INFO: Initialized GLEW 1.6.0
INFO: Loading data/shaders/gl3/vdrift1.rhr...
INFO: Loaded data/shaders/gl3/vdrift1.rhr
INFO: GL3 initialization successful
INFO: 0 joysticks found.
INFO: Loading car controls from: /home/antonio/.vdrift/controls.config
INFO: Sound initialization information:
INFO: Obtained audio device:
Frequency: 44100
Format: 32784
Bits per sample: 16
Channels: 2
Silence: 0
Samples: 1024
Size: 4096
Sound initialization successful
INFO: Loaded fonts successfully
INFO: Loaded GUI successfully
ERROR: Unhandled GUI event: Updates
INFO: Got quit message from GUI. Shutting down...
INFO: Shutting down...
INFO: Exiting

Debug build GL3 OpenGL error when braking

Win7x64/VS2010 debug build. Car XS, track paulricard88.

Game will abort when hitting the brakes, must be triggered by brake lights code.

INFO: GL Renderer: ATI Radeon HD 4800 Series
INFO: GL Vendor: ATI Technologies Inc.
INFO: GL Version: 3.3.11079 Compatibility Profile Context
INFO: Initialized GLEW 1.5.7
INFO: Loading data/shaders/gl3/vdrift1.rhr...
INFO: Loaded data/shaders/gl3/vdrift1.rhr
INFO: GL3 initialization successful
...
ERROR: OpenGL error "Invalid operation." during: void __thiscall GLWrapper::drawGeometry(unsigned int,unsigned int):f:\vdrift\vdrift\src\gl3v\glwrapper.cpp:152

backtrace:
vdrift.exe!GLWrapper::checkForOpenGLErrors(const char * function, const char * file, int line) Line 654 + 0x20 Bytes C++
vdrift.exe!GLWrapper::drawGeometry(unsigned int vao, unsigned int elementCount) Line 153 C++
vdrift.exe!RenderModelExternal::draw(GLWrapper & gl) Line 41 C++
vdrift.exe!RenderModelExternalDrawable::draw(GLWrapper & gl) Line 11 + 0xc Bytes C++
vdrift.exe!RenderPass::render(GLWrapper & gl, unsigned int w, unsigned int h, StringIdMap & stringMap, const std::vector<std::vector<RenderModelExternal *,std::allocator<RenderModelExternal *> > const *,std::allocator<std::vector<RenderModelExternal *,std::allocator<RenderModelExternal *> > const *> > & externalModels, const std::tr1::unordered_map<StringId,RenderTextureEntry,StringId::hash,std::equal_to,std::allocator<std::pair<StringId const ,RenderTextureEntry> > > & sharedTextures, std::basic_ostream<char,std::char_traits > & errorOutput) Line 506 + 0x19 Bytes C++
vdrift.exe!Renderer::render(unsigned int w, unsigned int h, StringIdMap & stringMap, const std::map<StringId,std::map<StringId,std::vector<RenderModelExternal *,std::allocator<RenderModelExternal *> > *,std::less,std::allocator<std::pair<StringId const ,std::vector<RenderModelExternal *,std::allocator<RenderModelExternal *> > *> > >,std::less,std::allocator<std::pair<StringId const ,std::map<StringId,std::vector<RenderModelExternal *,std::allocator<RenderModelExternal *> > *,std::less,std::allocator<std::pair<StringId const ,std::vector<RenderModelExternal *,std::allocator<RenderModelExternal *> > *> > > > > > & externalModels, std::basic_ostream<char,std::char_traits > & errorOutput) Line 159 + 0x30 Bytes C++
vdrift.exe!GRAPHICS_GL3V::DrawScene(std::basic_ostream<char,std::char_traits > & error_output) Line 546 C++
vdrift.exe!GAME::BeginDraw() Line 685 + 0x22 Bytes C++
vdrift.exe!GAME::MainLoop() Line 717 C++

Cars downloading

Why don't you let anybody download a car even if they don't have an old version of it? Why not a car and track management system that let's you download new cars and tracks? Thanks.

ABS makes car unstable under braking

Accelerate with the XS to about 200kph and hit brakes with ABS enabled. The car will break loose which makes ABS completely unusable for fast driving(steering under braking).

Unused parameters

I've temporary disabled -Wno-unusedparameters in compile and added -pedantic in my SConscript for looking fo warnings and bugs but what I've found is that almost every function returns unused parameters warning. Why is it this way? Is it for future development or was it caused by an evolution of the code? Should this params be deleted? Tell me if you wan't me to clean all this warnings up. Thanks.

Assigning special keys will erase controls.config contents.

This has been on the old tracker too. Assigning a special key(shift, ctrl, etc) will wipe off controls.config completely. The game won't recover on a restart. To get the default mappings back controls.config in user directory has to be deleted.

Scons building under Ubuntu

scons
scons: Reading SConscript files ...
KeyError: 'LDFLAGS':
File "/home/antonio/Proyectos/vdrift/SConstruct", line 140:
env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
File "/usr/lib/python2.7/UserDict.py", line 23:
raise KeyError(key)

Crash in Ubuntu

antonio@antonio-pc:~/Proyectos/vdrift$ gdb build/vdrift
GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
Para las instrucciones de informe de errores, vea:
http://www.gnu.org/software/gdb/bugs/...
Leyendo símbolos desde /home/antonio/Proyectos/vdrift/build/vdrift...hecho.
(gdb) run
Starting program: /home/antonio/Proyectos/vdrift/build/vdrift
/home/antonio/Proyectos/vdrift/build/vdrift: Symbol `_ZTV10btBoxShape' has different size in shared object, consider re-linking
[Depuración de hilo usando libthread_db enabled]
INFO: Multi-processor system detected. Run with -multithreaded argument to enable multithreading (EXPERIMENTAL).
INFO: Starting VDrift: development-full, Version: exportado, O/S: Unix
INFO: Home directory: /home/antonio
INFO: Settings file: /home/antonio/.vdrift/VDrift.config
INFO: Data directory: data
DATA_DIR: /usr/local/share/games/vdrift/data
INFO: Temporary directory: /home/antonio/.vdrift/tmp
INFO: Log file: /home/antonio/.vdrift/log.txt
[Nuevo Thread 0x318cb70 (LWP 11485)]
[Thread 0x318cb70 (LWP 11485) terminado]
INFO: Enabling antialiasing: 4X
INFO: Display change was successful: 1152x720x32 24z fullscreen=0
INFO: GL Renderer: GeForce 9600 GT/PCI/SSE2/3DNOW!
INFO: GL Vendor: NVIDIA Corporation
INFO: GL Version: 3.3.0 NVIDIA 270.41.06
INFO: Initialized GLEW 1.6.0
INFO: Loading data/shaders/gl3/vdrift1.rhr...
INFO: Loaded data/shaders/gl3/vdrift1.rhr
INFO: GL3 initialization successful
INFO: 0 joysticks found.
INFO: Loading car controls from: /home/antonio/.vdrift/controls.config
INFO: Update status file /home/antonio/.vdrift/updates.config will be created
[Nuevo Thread 0x318cb70 (LWP 11486)]
INFO: Sound initialization information:
INFO: Obtained audio device:
Frequency: 44100
Format: 32784
Bits per sample: 16
Channels: 2
Silence: 0
Samples: 1024
Size: 4096
Sound initialization successful
INFO: Loaded fonts successfully
INFO: Loaded GUI successfully

Program received signal SIGSEGV, Segmentation fault.
0x080e9789 in DynamicsWorld::reset (this=0xbfffba90) at src/dynamicsworld.cpp:216
216 getBroadphase()->resetPool(getDispatcher());
(gdb) bt
#0 0x080e9789 in DynamicsWorld::reset (this=0xbfffba90) at src/dynamicsworld.cpp:216
#1 0x080e9765 in DynamicsWorld::reset (this=0xbfffba90, t=...) at src/dynamicsworld.cpp:210
#2 0x082323dc in TRACK::DeferredLoad (this=0xbfffbfb4, content=..., world=..., info_output=..., error_output=..., trackpath=..., trackdir=..., texturedir=...,

sharedobjectpath=..., anisotropy=16, reverse=false, dynamicobjects=true, dynamicshadows=true, agressivecombine=false) at src/track.cpp:42

#3 0x0810af26 in GAME::LoadTrack (this=0xbfff9af0, trackname=...) at src/game.cpp:2050
#4 0x08108da8 in GAME::NewGame (this=0xbfff9af0, playreplay=false, addopponents=false, num_laps=0) at src/game.cpp:1755
#5 0x0810495c in GAME::ProcessGUIAction (this=0xbfff9af0, action=...) at src/game.cpp:1279
#6 0x08103b96 in GAME::ProcessGUIInputs (this=0xbfff9af0) at src/game.cpp:1132
#7 0x08101e51 in GAME::AdvanceGameLogic (this=0xbfff9af0) at src/game.cpp:767
#8 0x08101d3d in GAME::Tick (this=0xbfff9af0, deltat=0.00800000038) at src/game.cpp:749
#9 0x08101bd7 in GAME::MainLoop (this=0xbfff9af0) at src/game.cpp:709
#10 0x080fd741 in GAME::Start (this=0xbfff9af0, args=...) at src/game.cpp:260
#11 0x081eb728 in main (argc=1, argv=0xbffff434) at src/main.cpp:84

(gdb)

Just any time I try to start a new race. Bullet v2.79.

Premake build configuration

I've played a bit with premake4 http://industriousone.com/what-premake as a possible replacement for scons/codeblocks/xcode.

Tested on win32 with codeblocks and msvc. It has worked flawlessly. Will test on linux/ubuntu next. I need some help with macosx.

It works analogous to cmake generating make/project files but has a very clean syntax:

solution "VDrift"
    configurations {"Debug", "Release"}

    configuration "Release"
        defines {"NDEBUG"}
        flags {"OptimizeSpeed"}

    configuration "Debug"
        defines {"DEBUG"}
        flags {"ExtraWarnings", "Symbols"}

    project "vdrift"
        kind "ConsoleApp"
        language "C++"
        location "."
        targetdir "."
        includedirs {"include", "src"}
        links {"SDL_image", "SDL_gfx", "vorbisfile", "curl", "archive"}
        files {"include/**.h", "src/**.cpp"}
        -- excludes { "foo.h", "bar.c" }

-- windows
if os.is("windows") then
        flags("StaticRuntime")
        includedirs {"win32/include", "win32/bullet"}
        libdirs {"win32/lib"}
        links {"opengl32", "glu32", "glew32", "SDLmain", "SDL", "wsock32", "ws2_32"}
        if _ACTION == "codeblocks" then links {"mingw32"} end
        files {"win32/bullet/**.h", "win32/bullet/**.cpp"}
        postbuildcommands {"xcopy /d /y ..\\win32\\lib\\*.dll ..\\"}

-- macosx
elseif os.is("macosx") then
        links {SDL.framework"}

-- posix
else
        libdirs {"/usr/X11R6/lib"}
        links {"GL", "GLU", "GLEW"}
end

libarchive

libarchive (http://code.google.com/p/libarchive/) is now a dependency (see http://vdrift.net/Forum/viewtopic.php?t=1471) and needs adding to the mac build. However I can't find a native framework, and trying to build one gives the error:
"In file included from /Users/timothyfurlong/Downloads/libarchive/archive_check_magic.c:26:
/Users/timothyfurlong/Downloads/libarchive/archive_platform.h:52:2: error: #error Oops: No config.h and no pre-built configuration in archive_platform.h."

Bullet

As bullet isn't included in this release I've tried to svn check their repo as you did before but scons failed:

scons: Reading SConscript files ...
Checking for C++ header file asio.hpp... yes
Checking for C++ header file boost/bind.hpp... yes
Checking for C++ header file GL/gl.h... yes
Checking for C++ header file GL/glu.h... yes
Checking for C++ header file SDL/SDL.h... yes
Checking for C++ header file SDL/SDL_image.h... yes
Checking for C++ header file SDL/SDL_rotozoom.h... yes
Checking for C++ header file vorbis/vorbisfile.h... yes
Checking for C++ header file GL/glew.h... yes
Checking for C++ header file curl/curl.h... yes
Package bullet was not found in the pkg-config search path.
Perhaps you should add the directory containing `bullet.pc'
to the PKG_CONFIG_PATH environment variable
No package 'bullet' found
OSError: 'pkg-config bullet --libs --cflags' exited 1:
File "/home/antonio/Proyectos/vdrift/SConstruct", line 574:
SConscript('src/SConscript', variant_dir='build', duplicate = 0)
File "/usr/lib/scons/SCons/Script/SConscript.py", line 614:
return method(_args, *_kw)
File "/usr/lib/scons/SCons/Script/SConscript.py", line 551:
return _SConscript(self.fs, _files, *_subst_kw)
File "/usr/lib/scons/SCons/Script/SConscript.py", line 260:
exec file in call_stack[-1].globals
File "/home/antonio/Proyectos/vdrift/src/SConscript", line 346:
local_env.ParseConfig('pkg-config bullet --libs --cflags')
File "/usr/lib/scons/SCons/Environment.py", line 1460:
return function(self, self.backtick(command))
File "/usr/lib/scons/SCons/Environment.py", line 593:
raise OSError("'%s' exited %d" % (command, status))

Don't know how to fix it. Thanks.

Damage mode tunneling issues

With damage enabled the F1-02 will get stuck in walls on wheel vs wall collisions(wheel collision shape tunnels through the wall mesh).

Complex workaround:

  • Modify track meshes to have a minimum width to prevent tunneling.
  • Use extra box collision shapes to prevent tunneling.

Alternatives:

  • Investigate if switching to single sided collision mesh resolves the problem.
  • Modify car collision shape to avoid gaps between children shapes(wheels) and main body. The issue affects mainly open wheel cars?

Tracks fixing for release

Test if AI cars can finish:

  • A1-Ring
  • Albert Park
  • Bahrain
  • Barcelona (3 starting points)
  • Carade 70
  • Fuji
  • Magny-Cours
  • Monza '88
  • Ring 2007
  • Sepang
  • Spa 2008
  • Virginia

Problems:

  • Australian countryside: 1 out of 3 AI finished the race. Failure could be caused by the low friction between ground and tires.
  • Brands Hatch: 2 out of 3 finished. One wasn't able to go back to the cirtuit after an accident between AIs.
  • Circuit de Pau: 0 out of 3 finished. There are objects inferring in racing line.
  • Garage: 4 start points to close, no racing line...
  • Imola: Starting points aren't well positioned. One point missing.
  • Indian Hill: Bad starting points.
  • Monaco: No 4 starting points and bad starting point for the user.
  • Monaco '88: Bad starting points.
  • Monza: Very conflictive racing line (I can't see it but AI cars seem to see it).
  • Nuerburgring Nordscheife: Bad starting points (cars are ok but don't accelerate).
  • Singapore: My start point is bad.
  • Spa-Francochamps: There's a problem with the first curve.
  • Weekend drive: None of the cars were able to finish.

Done:

  • Detroit.
  • Dijon-Prenois 1981
  • Estoril '88
  • Hockenheim 2002
  • Hungaroring 2006
  • Interlagos
  • Jarama
  • Jerez '88
  • Kyalami
  • Laguna seca
  • Le Mans
  • Montreal
  • Mosport
  • Paul Ricard '88
  • Road Atlanta
  • Rouen-Les-Essarts
  • Ruudscogen
  • Suzuka 2005
  • Zandvoort

Tire contact force applied at wheel center

Tire friction force acts at tire contact patch, should be applied there not at wheel center.

Blockers:
Will affect car handling(body roll, up to roll-over). Cars will require pervasive center of mass and suspension adjustments, suspension implementation improvements. Suspension simulation doesn't deal/breaks with high roll angles(car rolling onto side).

Graphics autosetting tool.

I've been thinking on all that people that install this game and bull on it because it's got very bad graphics and it was caused by a misconfiguration of the graphics as they didn't know what to enable or disable in the advanced graphic settings. I already knew that you could check for antialiasing and other settings but the problem is that other settings as textures sizes or detail levels where difficult to check. After thinking on that I've concluded that you can check for the number of frames per second and determine if you're forcing the machine so that you can set the level of details to use. By asking the user ti run this tool the first time it opens the game he would have the graphics configured and half of that people that have made a bad critic about vdrift may change their opinion. This will also attract more users! What do you think?

Update wiki

Now that we have moved to git the wiki (wiki.vdrift.net) needs updating.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.