Try   HackMD


About

Potential platforms:

  • Substrata
  • Oncyber
  • VRchat
  • Hyperfy
  • Resonite

There have been discussions about interoperable physics and vehicles since March 2023 in the Open Metaverse Interoperability glTF extensions group. We have been looking different vehicle systems, physics engines, and getting a list of known devs to help us derive a common subset of attributes that we can utilize cross-platform.

Hyperfy is a pure web tech (threejs/webgl/web3) metaverse platform recently shipped a cars app that allows for custom vehicles. You can copy and paste signal data to automatically configure a vehicle from the editor (tab to open).

Here's an example of hyperfy.io vehicle signal data:

{
  "prefab": "remco tuner",
  "size": [
    1.1,
    1.6,
    1.7
  ],
  "centerOfMass": [
    0,
    0.3,
    0
  ],
  "drag": 0.45,
  "angularDrag": 3,
  "accelAmount": 6,
  "decelAmount": 3,
  "brakeAmount": 5,
  "speedMax": 30,
  "powerCurve": "0,1,0,0|1,1,0,0",
  "turnSpeed": 9,
  "turnMax": 35,
  "turnCurve": "0,1,0,0|1,0.349,0,0",
  "antiRoll": 50,
  "forwardSlip": 5,
  "mode": "RWD",
  "engineSound": true,
  "frontZ": -0.7,
  "frontY": 0.4,
  "frontWidth": 1,
  "frontSpringLength": 0.45,
  "frontSpringStrength": 20,
  "frontSpringDamper": 3,
  "frontTireRadius": 0.2,
  "frontGripCurve": "0,0.600,0,0|0.525,0.451,-0.478,-0.647|1,0.274,0,0",
  "frontBrake": false,
  "frontBrakeGrip": 0.2,
  "backZ": 0.7,
  "backY": 0.45,
  "backWidth": 1.1,
  "backSpringLength": 0.45,
  "backSpringStrength": 30,
  "backSpringDamper": 4,
  "backTireRadius": 0.2,
  "backGripCurve": "0,0.580,0,0|0.548,0.411,-0.462,-0.749|1,0.226,0,0",
  "backBrake": true,
  "backBrakeGrip": 0.2,
  "seat1Enabled": true,
  "seat1Position": [
    -0.25,
    0.4,
    0.1
  ],
  "seat1RotationY": 0,
  "seat2Enabled": true,
  "seat2Position": [
    -0.05,
    -0.1,
    -0.2
  ],
  "seat2RotationY": 0,
  "seat3Enabled": false,
  "seat3Position": [
    0,
    0,
    0
  ],
  "seat3RotationY": 0,
  "seat4Enabled": false,
  "seat4Position": [
    0,
    0,
    0
  ],
  "seat4RotationY": 0,
  "src": {
    "name": "2.glb",
    "url": "ipfs://bafybeierrrs7p34oalbeuur6lwf5npwu4m6ucqlc46ibl3amk7xnwozoou/2.glb"
  }
}

Test Project

Project: https://www.scatter.art/remco-tuners-3d?tab=mint

vehicle_url

Note: It's been suggested to rename vehicle_url to hyper_car or something of that sort, similar to how OMI group names their glTF extensions OMI_audio or OMI_physics while it goes through the standards development process until it gets ratified.

Example proposed updated NFT Metadata, added vehicle_url with link out to JSON for the file.

{    "name": "RemCo Tuners 3D 0",
    "description": "RemCo Tuners 3D Collection of 77 - 1/1 driveable micro cars. Metaverse Ready, by RemCo Tuners and Alsara2k",
    "image": "ipfs://bafybeidfbsf4q4azpz4c4ercrb4tzla7zw6ckc4fjzgifetyq3esjja47m/1.gif",
    "animation_url": "https://bafybeia3767mrnofkr3a4nqlywu4jxg6trjga4tt5jtsfvjlxihnlmrmpa.ipfs.w3s.link/ipfs/bafybeia3767mrnofkr3a4nqlywu4jxg6trjga4tt5jtsfvjlxihnlmrmpa/0.glb",
    "vehicle_url": "https://bafybeia22vd75oxb4o4ajr5rhspifm6ummjosasyihl6zmkpgt5vr77s5u.ipfs.w3s.link/vehicle.json"
}

Can copy / paste this data via the cars app where signals are in Hyperfy editor. In the future, this can be integrated into the backpack app for owners of the NFT.

I generated new NFT and vehicle json files for us to test this way of implementing interoperable vehicles. Later we can test if vehicle_url works, and if others would be willing to adopt it.


glTF Extension Proposal

What if the vehicle data was embedded in the glTF file, as to not be separate from a NFT? This way, it can work better out of the box with non-crypto platforms as well.

In the metaverse, there's a format called glTF that's used to describe 3D models and scenes. It's like a common language that different apps and platforms speak to understand these 3D models. Now, imagine that we want these 3D models to do more cool stuff and be better understood by different apps. That's where glTF extensions come in. They are like add-ons that extend the basic glTF format to give the models extra abilities or special features. These extensions make it easier for different apps and platforms to share and use the 3D models, making the metaverse more open and friendly, just like how you can use your favorite apps on different devices because they all follow similar standards.

Web Game Dev examples

I do but the car physics is almost more similar to an FPS than a racing game. https://slowroads.io/ has great driving stuff, don't know if the creator is here, otherwise they have an own discord. You can check out my code here https://github.com/kbrecordzz/notacarclub/blob/main/functions.js, in the functions cars_control() and cars_physics(). My car is just a single point and I don't do physics on the wheels etc, but I have code for acceleration, friction, gravity and decreasing/increasing speed if you're uphill/downhill.

@Isaac Mason has also done some work on a raycast vehicle controller with Rapier

https://sketches.isaacmason.com/sketch/rapier/raycast-vehicle

Asad extracted car physics from Bruno Simon's portfolio and put it in a standalone three.js and Cannon example here but also made it multiplayer.

Code: https://github.com/asadm/playroom-docs/tree/main/examples/carsonroof Demo: https://carsonroof.joinplayroom.com/ Multiplayer SDK: https://docs.joinplayroom.com/

Game: https://www.exiles.gg/ Video: https://youtu.be/OWgYXnjoTPs