HL Rally 2 Predicted Vehicle Physics Source
About Predicted Vehicle Physics
The code featured here creates a client side havok physics object for the client vehicle and attempts to replicate the simulations performed on the server. The code works perfectly except for the fact that the client and server vehicles get out of sync with each other. This means that the client vehicle will eventually end up at a different position to that of the server.
License and Usage
The following files may be used with modification. They are provided as is with no warranty.
Developer Information
In the unmodified source sdk, there is a file called fourwheelvehiclephysics.cpp. This file contains methods which interface with the vphysics dll and handle certain aspects of the vehicles physics. This file needs to be shared between the client and server dlls.
Certain files were renamed because it was too confusing when it was all integrated throughout the source sdk. There may be references to the folder "hlrally2" and other HL Rally dependencies which may need to be removed. It might be wise to do a visual diff between the original files and the new files.
These files will not work just by simply including them into your project. This is because there are references to other files not included here. You will have to remove these references and selectively merge the changes into your source.
Download Source
There are three main .cpp & .h files that are required. These are:
- The client jeep entity
- Originally c_vehicle_jeep.cpp / h
- Download c_entitypropvehiclejeep.cpp
- Download c_entitypropvehiclejeep.h
- The shared vehicle physics
- Originally fourwheelvehiclephysics.cpp
- Download vehiclephysics.cpp
- Download vehiclephysics.h
- The server jeep entity
- Originally vehicle_jeep.cpp / h
- Download entitypropvehiclerally.cpp
- Download entitypropvehiclerally.h
Contact
If you would like some support with this, feel free to contact me.