The More Advanced Vehicles Project demonstrates vehicle simulation using the jMonkeyEngine (JME) game engine and provides a library to support driving simulations.
It contains 5 subprojects:
- MavLibrary: the MaVehicles library
- MavDemo1: a demo application with a Lemur-based GUI
- MavDemo2: a demo application with a Nifty-based GUI
- HelloMav: a very simple application using the MaVehicles library
- MavCommon: examples of vehicles, worlds, skies, etcetera
- Important features
- How to download and run the MavDemo1 application
- How to build and run More Advanced Vehicles from source
- Controls
- How to add the MaVehicles library to an existing project
- Wish list
- Licensing
- Conventions
- External links
- Acknowledgments
- 4 example worlds, 8 example vehicles, and 4 example skies
- vehicle customization:
- engine
- brakes
- automatic transmission
- wheels
- tires with Pacejka model for friction (only the latitudinal forces are applied)
- suspensions
- speedometer units
- passengers
- graphical user interfaces:
- buttons and animated menus
- compass
- speedometer
- tachometer
- steering-wheel indicator
- automatic-transmission mode indicator
- edit vehicle parameters
- camera selection
- special effects:
- skid marks
- tire smoke
- engine/horn sounds
- Install a 64-bit Java, if you don't already have one. (MavDemo1 no longer supports 32-bit Java.)
- Point the
JAVA_HOME
environment variable to your JDK installation: (In other words, set it to the path of a directory/folder containing a "bin" that contains a Java executable. That path might look something like "C:\Program Files\Eclipse Adoptium\jdk-17.0.3.7-hotspot" or "/usr/lib/jvm/java-17-openjdk-amd64/" or "/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home" .)
- using Bash or Zsh:
export JAVA_HOME="
path to installation"
- using Fish:
set -g JAVA_HOME "
path to installation"
- using Windows Command Prompt:
set JAVA_HOME="
path to installation"
- using PowerShell:
$env:JAVA_HOME = '
path to installation'
- Install the latest MavDemo1 release from GitHub:
- Browse to https://github.com/stephengold/jme-vehicles/releases/tag/project-1.6.0
- Follow the "MavDemo1.zip" link.
- Save the ZIP file.
- Extract the contents of the saved ZIP file.
cd
to the extracted "MavDemo1" directory/folder that contains "bin" and "lib".- Run the Maud startup script:
- using Bash or Fish or or Zsh:
./bin/MavDemo1
- using Windows Command Prompt:
./bin/MavDemo1.bat
- using PowerShell:
.\bin\MavDemo1.bat
The demo runs in a 1280x720 window. After a brief loading animation, the Main Menu appears in the upper-left corner of the window.
- Navigate menus by clicking with the left mouse button (LMB).
- If you have a wheel mouse, use the wheel to change the field of view.
- Install a 64-bit Java Development Kit (JDK), if you don't already have one.
- Point the
JAVA_HOME
environment variable to your JDK installation: (In other words, set it to the path of a directory/folder containing a "bin" that contains a Java executable. That path might look something like "C:\Program Files\Eclipse Adoptium\jdk-17.0.3.7-hotspot" or "/usr/lib/jvm/java-17-openjdk-amd64/" or "/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home" .)
- using Bash or Zsh:
export JAVA_HOME="
path to installation"
- using Fish:
set -g JAVA_HOME "
path to installation"
- using Windows Command Prompt:
set JAVA_HOME="
path to installation"
- using PowerShell:
$env:JAVA_HOME = '
path to installation'
- Download and extract the More Advanced Vehicles source code from GitHub:
- using Git:
git clone https://github.com/stephengold/jme-vehicles.git
cd jme-vehicles
git checkout -b latest project-1.6.0
- using a web browser:
- browse to the latest release
- follow the "Source code (zip)" link
- save the ZIP file
- extract the contents of the saved ZIP file
cd
to the extracted directory/folder
- Run the Gradle wrapper:
- using Bash or Fish or PowerShell or Zsh:
./gradlew build
- using Windows Command Prompt:
.\gradlew build
After a successful build, Maven artifacts will be found in "MavLibrary/build/libs".
You can install the artifacts to your local Maven repository:
- using Bash or Fish or PowerShell or Zsh:
./gradlew install
- using Windows Command Prompt:
.\gradlew install
You can run the MavDemo1 application:
- using Bash or Fish or PowerShell or Zsh:
./gradlew :MavDemo1:run
- using Windows Command Prompt:
.\gradlew :MavDemo1:run
You can run the MavDemo2 application:
- using Bash or Fish or PowerShell or Zsh:
./gradlew :MavDemo2:run
- using Windows Command Prompt:
.\gradlew :MavDemo2:run
You can run the HelloMav application:
- using Bash or Fish or PowerShell or Zsh:
./gradlew :HelloMav:run
- using Windows Command Prompt:
.\gradlew :HelloMav:run
You can restore the project to a pristine state:
- using Bash or Fish or PowerShell or Zsh:
./gradlew clean
- using Windows Command Prompt:
.\gradlew clean
During the JmePower loading animation:
- Pause : pause the animation
- Tab : cancel the animation
General controls:
- Numpad9 or wheel up : zoom in (narrow the field of view)
- Numpad3 or wheel down : zoom out (widen the field of view)
- Numpad6 : reset the field of view (to 90 degrees vertical angle)
- "." or Pause : toggle the physics simulation paused/running
- "/" : toggle physics debug visualization on/off
- F6 : toggle the detailed profile of per-frame CPU/GPU time
- F12 : capture a screenshot to the current working directory
- C : print details about the default
Camera
(viewpoint) to standard output - O : print details about the
BulletAppState
(physics) to standard output - P : print details about the
RenderManager
(graphics) to standard output
When the physics simulation is paused:
- "," : single-step the physics simulation
When driving:
- F5 : toggle viewpoints between dash camera and chase camera
- Y : toggle the engine on/off
- W : accelerate forward
- S : apply the main brakes
- Space : apply the parking brake
- E : toggle the automatic transmission forward/reverse
- A : steer left
- D : steer right
- H : sound the horn
- R : reset the vehicle to a stable state
- Esc : return to the Main Menu
Additional controls when the chase camera or orbit camera is active:
- Numpad7 : dolly forward (toward the vehicle)
- Numpad1 : dolly back (away from the vehicle)
- Numpad8 or drag upward with MMB : orbit upward (to look down on the vehicle)
- Numpad2 or drag downward with MMB : orbit downward (to look up at the vehicle)
- Numpad5 or RMB : reset the viewpoint's position relative to the vehicle
Additional controls when the orbit camera is active:
- Drag left with MMB : orbit leftward
- Drag right with MMB : orbit rightward
During the JmePower loading animation:
- Pause : pause the animation
- Tab : cancel the animation
General controls:
- Esc : quit the application
- Numpad9 or wheel up : zoom in (narrow the field of view)
- Numpad3 or wheel down : zoom out (widen the field of view)
- Numpad6 : reset the field of view (to 90 degrees vertical angle)
- "." or F7 or Pause : toggle the physics simulation paused/running
- "/" : toggle physics debug visualization on/off
- F5 : cycle through various viewpoints
- F6 : toggle the basic graphical profile of update time versus render time
- F11 : toggle video recording on/off
- F12 : capture a screenshot to the sandbox directory
- C : print details about the default
Camera
(viewpoint) to standard output - O : print details about the
BulletAppState
(physics) to standard output - P : print details about the
RenderManager
(graphics) to standard output - I : print details about the
StateManager
to standard output - Y : toggle the engine running/off
- S : apply the main brakes
- X : apply the parking brake
- A : steer left
- D : steer right
- E : toggle the automatic transmission forward/reverse
- H : sound the horn
- Backslash : add a prop at the mouse pointer
- R : reset the vehicle to a stable state
- F1 : edit the hotkey bindings
- F2 : edit the video settings
- F4 : cycle through various performance displays
Additional controls when the physics simulation is paused:
- "," : single-step the physics simulation
Additional controls when the engine is running:
- W : accelerate forward
Additional controls when the chase camera or orbit camera is active:
- Numpad7 : dolly forward (toward the vehicle)
- Numpad1 : dolly back (away from the vehicle)
- Numpad8 or Q or drag upward with MMB : orbit upward (to look down on the vehicle)
- Numpad2 or Z or drag downward with MMB : orbit downward (to look up at the vehicle)
- Numpad5 or RMB : reset the viewpoint's position relative to the vehicle
Additional controls when the orbit camera is active:
- RightArrow or drag left with MMB : orbit leftward
- Leftarrow or Drag right with MMB : orbit rightward
- W : accelerate forward
- A : steer left
- D : steer right
- Wheel up : zoom in (narrow the field of view)
- Wheel down : zoom out (widen the field of view)
- Esc : exit the application
The MaVehicles library comes pre-built as a single JVM library that depends on Minie. However, the Minie dependency is intentionally omitted from the MaVehicles POM so developers can specify which Minie library should be used.
For projects built using Maven or Gradle, it is not sufficient to specify the dependency on the MaVehicles Library. You must also explicitly specify the Minie dependency. The following examples specify "+big4", but "+debug" or the default Minie library should also work.
Add to the project’s "build.gradle" file:
repositories {
mavenCentral()
}
dependencies {
implementation 'com.github.stephengold:MaVehicles:0.7.1'
implementation 'com.github.stephengold:Minie:8.0.0+big4'
}
For some older versions of Gradle,
it's necessary to replace implementation
with compile
.
Add to the project’s "pom.xml" file:
<repositories>
<repository>
<id>mvnrepository</id>
<url>https://repo1.maven.org/maven2/</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.stephengold</groupId>
<artifactId>MaVehicles</artifactId>
<version>0.7.1</version>
</dependency>
<dependency>
<groupId>com.github.stephengold</groupId>
<artifactId>Minie</artifactId>
<version>8.0.0+big4</version>
</dependency>
More Advanced Vehicles is a work in progress. Some ideas for future development:
- More alternatives for:
- Worlds, such as: 3-D maze, block world, drag strip, parking garage, parking lot, showroom, and urban grid
- Surface conditions, such as: wet pavement, dirt, sand, snow, and grass
- Propulsion, such as: draft animals, jets, human power, propellers, and sails
- Skies, such as TehLeo's SevenSky
- User interface, such as: joystick and NiftyGUI
- Vehicle dynamics, such as that used in Murph9's RallyGame
- Vehicle types, such as: buses, tanks, golf carts, rolling chairs, tractors, rail locomotives, palanquins, rickshaws, aerial trams, bulldozers, snowmobiles, snowplows, speedboats, airplanes, boats, and helicopters
- Viewpoints, such as: FlyCam, front view, side view, and plan view
- More obstacles:
- AI-controlled vehicles
- Animated non-vehicles, such as: gates, drawbridges, deer, and pedestrians
- More vehicle equipment:
- Anti-lock braking
- Artificial horizon
- Brake lights and turn signals
- Clock/stopwatch/timer
- Cruise control
- Door/hood/trunk animation
- Fuel gauge
- Headlamps
- Manual transmission with clutch
- Maps
- Mirrors and backup assist
- Nitrous oxide
- Odometer
- Oil-temperature gauge
- Operable doors, hood, and trunk
- Passengers and cargo
- Sirens
- Speed limiter
- Starter motor
- Steering-yoke animation
- Traction indicator
- Trailers
- Weaponry
- Windshield wipers
- More scenarios:
- Crazy taxi
- Demolition derby
- Night driving
- Performance tests, such as: braking distance, turning radius, and zero-to-60
- Player-vs-player over a network
- Pursuit and evasion
- Time trial
- Career mode
- More details:
- Scoring for stunts
- Simulate damage, brake wear, and tire wear
- Sound effects for crashes, squealing tires, and wind
See also the project's issue tracker.
The source code has a BSD 3-Clause license.
Resources/assets/media:
- The Droid Serif font has an Apache License, Version 2.0.
- The Opel GT Retopo model has a CC Attribution-NonCommercial-ShareAlike license.
- The MakeHuman 1.2.0 textures have a CC0 license.
- The Hand Gloves textures have a CC0 license.
- The Elvs Racing Fire suit Male1 textures have a CC Attribution license.
- The HoverTank model has a BSD 3-Clause license.
- The Classic Motorcycle model has a CC Attribution license.
- The Ford Ranger model has a CC Attribution license.
- The Nissan GT-R model has a CC Attribution-NonCommercial-ShareAlike license.
- The HCR2 Buggy model has a CC Attribution license.
- The HCR2 Rotator model has a CC Attribution license.
- The Modern Hatchback - Low Poly model model has a CC Attribution license.
- The Barrier & Traffic Cone models have a CC Attribution license.
- The Race Track model has an Unlicense license.
- The terrain textures have a BSD 3-Clause license.
- The Vehicle Playground model has a CC0 license.
- The marble_01 textures have a CC0 license.
- The Quarry 03 texture has a CC0 license.
- The Car-door Exit Button texture has a CC0 license.
- The Lunar libration with phase Oct 2007 texture has a PD-self license.
- The Georg textures (here and here) were generated procedurally using the Georg Project, which has a BSD 3-Clause license.
Package names begin with com.jayfella.jme.vehicle
Both the source code and the pre-built libraries are compatible with JDK 8.
The world (and physics-space) coordinate system is right-handed:
- the
+X
axis points toward the northern horizon - the
+Y
axis points up (toward the zenith) - the
+Z
axis points toward the eastern horizon
The world (and physics-space) units of distance are meters.
- October 2021 Introducing the Classic Motorcycle
- January 2021 walkthru video
- the More Advanced Vehicles page at the JmonkeyStore
Like most projects, More Advanced Vehicles builds on the work of many who have gone before. I therefore acknowledge the following artists and software developers:
- James Khan (aka "jayfella") initiated the Advanced Vehicles Project, on which this project is based.
- Paul Speed (aka "pspeed42") created the Lemur libraries.
- Adam T. Ryder (aka "ATryder") created the jME-TTF library.
- Ryan McDonough created the PBRTerrain library.
- Rémy Bouquet (aka "Nehon") created the "Jaime" and "Enhanced HoverTank" models.
- Adi Barda (aka "adi.barda") created the racetrack model and helped shape the MaVehicles library.
- Rob Tuytel created the "marble_01" textures.
- Sergej Majboroda created the "Quarry 03" texture.
- Tom Ruen created the "Lunar libration with phase Oct 2007" animation.
- the creators of (and contributors to) the following software:
- the Blender 3-D animation suite
- the Checkstyle tool
- the Firefox web browser
- the Git revision-control system and GitK commit viewer
- the GitKraken client
- the Gradle build tool
- the Java compiler, standard doclet, and runtime environment
- jMonkeyEngine and the jME3 Software Development Kit
- the Linux Mint operating system
- LWJGL, the Lightweight Java Game Library
- the MakeHuman 3-D character creation tool
- the Markdown document-conversion tool
- the Meld visual merge tool
- Microsoft Windows
- the NetBeans integrated development environment
- the Nifty graphical user-interface library
- This work is based on "Opel GT Retopo" (https://sketchfab.com/3d-models/opel-gt-retopo-badcab3c8a3d42359c8416db8a7427fe) by Thomas Glenn Thorne (https://www.tgthorne.com/contact) licensed under CC-BY-NC-SA (https://creativecommons.org/licenses/by-nc-sa/4.0/).
- This work is based on "Ford Ranger" (https://sketchfab.com/3d-models/ford-ranger-dade78dc96e34f1a8cbcf14dd47d84de) by mauro.zampaoli (https://sketchfab.com/mauro.zampaoli) licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/).
- This work is based on "Nissan GT-R" (https://sketchfab.com/3d-models/nissan-gt-r-5f5781614c6f4ff4b7cb1d3cff9d931c) by iSteven (https://sketchfab.com/Steven007) licensed under CC-BY-NC-SA (https://creativecommons.org/licenses/by-nc-sa/4.0/).
- This work is based on "HCR2 Buggy" (https://sketchfab.com/3d-models/hcr2-buggy-a65fe5c27464448cbce7fe61c49159ef) by oakar258 (https://sketchfab.com/oakar258) licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/).
- This work is based on "HCR2 Rotator" (https://sketchfab.com/3d-models/hcr2-rotator-f03e95525b4c48cfb659064a76d8cd53) by oakar258 (https://sketchfab.com/oakar258) licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/).
- This work is based on "Modern Hatchback - Low Poly model" (https://sketchfab.com/3d-models/modern-hatchback-low-poly-model-055ff8a21b8d4d279debca089e2fafcd) by Daniel Zhabotinsky (https://sketchfab.com/DanielZhabotinsky) licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/).
- This work is based on "Barrier & Traffic Cone Pack" (https://skfb.ly/6n8ST) by Sabri Ayeş (https://sketchfab.com/sabriayes) licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/).
- This work is based on "Elvs Racing Fire suit Male1" (http://www.makehumancommunity.org/clothes/elvs_racing_fire_suit_male1.html) by Elvaerwyn licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/).
- This work is based on "Classic Motorcycle" (https://skfb.ly/6WVHS) by Mora (https://sketchfab.com/Fopen) licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/).
I am grateful to GitHub, Sonatype, Imgur, JFrog, and YouTube for providing free hosting for this project and many other open-source projects.
I'm also grateful to my dear Holly, for keeping me sane.
If I've misattributed anything or left anyone out, please let me know, so I can correct the situation: [email protected]