Account
GpDrivingSim Info
Software Info
Speed dreams main website | http://www.speed-dreams.org |
Speed dreams wiki | http://sourceforge.net/apps/trac/speed-dreams/wiki/WikiStart |
Wikipedia info | http://en.wikipedia.org/wiki/Speed_Dreams |
Torcs software where Speed Deams was derived from | http://www3.uji.es/~martiv/index_torcs.html |
TCSE: Torcs Car Setup Editor | http://www.berniw.org/trb/index.php?page=downloads |
Linux software packages | speed-dreams, speed-dreams-robots-base, speed-dreams-devel |
How to build a car videos | http://rootgamer.com/video/video-tutorial-build-car-torcs |
Files Info
Cars | /usr/share/games/speed-dreams-2/cars |
Tracks | /usr/share/games/speed-dreams-2/tracks |
Category files | /usr/share/games/speed-dreams-2/categories |
Config files | /usr/share/games/speed-dreams-2/config |
Menu | /usr/share/games/speed-dreams-2/data/menu |
3D Objects | /usr/share/games/speed-dreams-2/data/objects |
Sounds | /usr/share/games/speed-dreams-2/data/sound |
Textures | /usr/share/games/speed-dreams-2/data/textures |
Drivers | /usr/share/games/speed-dreams-2/drivers |
Adding a car
This assumes a car name of "rr9".
- Add a car category Greenpower
- Add car directory in /usr/share/games/speed-dreams-2/cars
- Add car files to this (can copy an existing car)
- Rename all files to be based on the cars name "rr9*.*"
- Edit "rr9.xml" and change "params name" as needed and the graphics file name "*.acc" to "rr9.acc"
- Change the physics parameters in "rr9.xml" as needed.
- Change the 3D design and other files as needed. (Note that rr9.acc names some of the other graphics files needed)
Files
rr9.xml | The overal configuration file |
rr9-preview.jpg | A picture for the car selector |
rr9.acc | Overal 3D design for the car |
rr9.png | Texture bits for the car |
wheel.rgb | Wheels texture |
shadow.rgb | Shadow on the ground below the car |
rr9.wav | Sound car makes |
Creating 3D model
Basic process:
- Start with a 3D drawing (could be in STL or other formats).
- Needs to be scaled to metres and car should have its front to the right (X+) direction. Can use admesh to scale, rotate and offset car.
- Run blender and delete the default cube object.
- import the 3D design.
- Can rotate and scale etc (click TL rotate. Angle can be typed in ("180<Enter>").
- Save blender file. ("car.blend")
- Create a UV map. Go to "Edit Mode". u -> "Smart UV Project" -> "Ok".
- Open UV View (drag TR corner to left and use BR "Editor Type" button to set "UV/Image Editor").
- Create an image: Image -> NewImage. Use "car.png" as name.
- Save image file. Image -> Save Image. (Note you will have to save the image after all changes <Alt>S).
- Add a material. RH Menu, Select Materials (sphere). Then "New".
- Add a texture. Select textures (red/while checkboard). Then "New". Set Type to "Image or movie".
- Under Image choose "Open" and select "car.png"
- Under mapping set mapping to UV in RH panel.
- Paint the car. Go to 3D view and select "Texture Paint" mode.
- Paint car as needed using tools in LH menus.
- Save the blender and image files (CRTL-S, <Alt>S (in UV Editor window)).
- Export as an AC3D file "car.ac"
- Create Speed Deams ACC file with the command "make".
To actually paint the car using blender see the following:
- http://wiki.blender.org/index.php/Doc:2.6/Manual/Textures/Painting
- http://rootgamer.com/video/video-tutorial-build-car-torcs
You can use a brush to "spray" the car to bet the basic colour.
To add graphics a graphics picture file can be loaded as a texture. This can then "stenciled" over the car.
- First load the picture as a texture using the texture controls in the RH panel (red/while checkboard).
- In the LH panel select the texture and set the "Brush Mapping" to "stencil".
- Set the brush to be "TexDraw"
- When the mouse cursor is in the 3D display window the texture will be visable. Move it by draging with the RH button over the car. Use the RH button with CTRL to resize and RH mouse button with shift to rotate.
- You can then use the brush to "spray" stencil the image onto the car.
You may have to reduce the vertex count in the orginal design file. You can do this using blenders "Decimate" modifier.
- Go to Object mode.
- Select modifiers in the RH panel.
- Add a "decimate" modifier
- Set the ration as needed (0.5 ?) and click on "Apply".
- Save the file and export to ac format.
Adding Robot drivers for cars
You need to edit /usr/share/games/speed-dreams-2/drivers/simplix and add entries for the appropriate cars.
Adding a track
The basic process for a track named gptest2 is:
- Use "trackeditor" to create the basic track layout/ This allows the shape, gradients and basic graphics to be defined.
- Given the track information create the speed-dreams track data using sd2-trackgen
- Edit manually to add local info and starting grid etc.
- Edit to add 3D extras.
To use trackeditor:
- run trackeditor.sh
- Create a named track in /usr/share/games/speed-dreams-2/tracks/road (path)
- Edit the track
- Can add pits if wanted.
- Save the track
- Can edit the file to add the "Local Info" and "Starting Grid" sections.
To use sd2-trackgen:
Note the sd2-trackgen program works with files in the /usr/share/games/speed-dreams-2/tracks directory.
- sd2-trackgen -c road -n gptest2 -E 0
RR9 Info
Motor graphs | http://www.greenpower.beamweb.co.uk/files/TechnicalInfo/GreenpowerF24PerformanceGraph.pdf |
Car simulator | http://portal.beam.ltd.uk/greensim/wwwgreensimcss.py |
Car Simulation Parameters
These are set in the cars *.xml file. The main parameters of interest are listed below.
Car.mass | 150 | The all up weight of the car in kg |
Car.GC height | 0.15 | The centre of gravity heigh in metres |
Car.front-rear weight repartition | 0.6 | The front to rear position of the CofG |
Aerodynamics.cx | 0.26 | Air drag coefficient |
Aerodynamics.front area | 0.33 | Cars frontal area |
Engine.data points.1.Tq | 13.5 | Motors torque at 0 rpm |
Gearbox.gears.1.ratio | 3.5 | Drive gearing ratio |
Steer.steer lock | 21 | The steering lock in degrees |
Brake System.max pressure | ? | Braking max force |
*Wheel.ypos | -.03 | Wheel y positions |
*wheel.mu | 0.8 | Tyres coefficiennt of friction |
*wheel.ride height | 60 | Cars track to bottom clearance |
Front Axle.xpos | 0.75 | Front axle xpos |
Rear Axle.xpos | -0.5 | Rear axle xpos |
Bonnet.zpos | 0.3 | Bonnet camera height |
Driver.zpos | 0.5 | Driver camera height |
To change relative performance of cars:
- Modify Aerodynamics.cx
- Modify Car.mass
- Modify Gearbox.gears.1.ratio
To speed up simulation:
- Increase Engine.data points.1.Tq
- Reduce Gearbox.gears.1.ratio
To make the car less roll stable
- Increase GC height
Car Data
Body | |
Length | 2.8m |
Width | 0.6m |
Height | |
Axle height | |
CofG | |
Wheels | |
Diameter | 416mm |
Tyre Width | 25mm |
Coeficient of friction | 0.8 |
Physics | |
Frontal Area | 0.26 m^2 |
Aerodynamic factor Cd | 0.33 |
Rolling Drag | 0.006 |
Mass | 123Kg |
Engine/Gears | |
RPM | 0 - 2100 RPM |
Torque | 3.5 - 0 Nm |
Gear Ratio | 2.4 |
Brakes | |
Notes on using Blender
- The middle mouse button (Or both buttons pressed if you have only two buttons) moves the drawing view. Used with the CTRL or SHIFT keys restricts the movement to the X/Y or zoom in/out. The mouse Wheel also works.
- The right hand button selects things.
- A Box selection can be made using the "b" key followed by clicking and dragging with the LHB.
- All items can be selected or not selected by using the "a" key.
- The Left hand button is used to move, scale, rotate etc. This also has a "gestures" mode which I have not tried.
- The "View" menu item allows the view to move to the front, side and top. Note for our use the "front" will be the side of the car. The Numeric keypad keys also allow the view to be changed (7 - Plan, 1 - Side, 3 - Rear).
- I find it easiest to have a single view window opened. The Windows can be split or joined by clicking the "triangle" in the top right of the window.
- The system can be in Object mode or Edit mode, selected using the "TAB" key or the mode combo box.
- When in Object mode the object can be manipulated as a whole. The G key moves, S key scales etc. If you press "G X" the the movement will only be in the X direction etc. After pressing G, GX, GY etc you can use the mouse to drag the object or type in a dimension in meters.
- When in Edit mode you can manipulate the vertices, edges or faces of the object. Again you can select one or more items and then move, scale or otherwise transform them.
- Pressing "Space" will bring up a menu of operations. Pressing "w" will bring up another special menu. These include extrusion etc.
- Objects can be grouped together to form complex single objects such as a wheel with a tyre. Select the objects and then use the "Join" command "CTRL-J" available from the "Object" menu acceseesd using "Space". Note that if an oject is selected and another object is added to the design, it will automatically become joined to the selected object.
- A wheel can be constructed with a torus and two cones as done in the Rotary Racer RR3 design.
- You can import objects from another design file. Use the "Append or Link" button on the "File" menu.
- When moving, scaling or rotating a value can be entered by simply typing in the number. Note that 1.0 is 1meter.
- You can add bits by using the "Add/Mesh" or "Add/Surface" menu entries. Note that if an object is selected when an object is added to the design, it will automatically become joined to the selected object.
- The "n" key brings up a box defining the diemtions and name of the object. The objects size and position can be changed.