Raggar

Members
  • Content count

    198
  • Joined

  • Last visited

About Raggar

  • Rank
    Advanced Member

Recent Profile Visitors

983 profile views
  1. You could take a look at how Lance-gg does it: https://github.com/lance-gg/lance By how much is the position 'off' compared to the predicted state of the client? I'm using pretty much the same code as yours for a project of mine(currently on hold). I'm sending the deltas to the server, but since both loops run (optimally) at 60Hz, this shouldn't be the issue, and both deltas should constantly be the same. You usually never really see the correction in multiplayer games. Only the occasional rubber-banding.
  2. The prototyping is strong in that one And yeah, I believe it has pieces of code from all around the place I would advice against moving the physics body using units, and instead use proper velocities. This was an old test of mine, but I still use pretty much the same way of doing it myself. The reason why is, that it is the only way (At least that I know of, after countless tests) of getting smooth, predictable movement for multiplayer projects. You can't step ahead or instantly reapply inputs using Cannon, and Cannon is not deterministic when it comes to different browsers and architectures. This is far from perfect, but it's the best at least for me. Enough hijacking of the thread Using velocities instead is trivial and takes seconds to implement. I'm not quite sure what he is after, though. I have a hard time wrapping my head around it.
  3. I was actually researching this yesterday. It's one of those things I like to keep up with every few months. Personally, I'll stick to Javascript and current engines. I'm also pretty sure that the time it would take me to properly learn a new language like C/C++, could otherwise be spent learning general Javascript optimization pipelines. I'm not convinced, although I still think the technology is fascinating. Maybe one day.
  4. I don't recall the exact issue. As far as I remember, I had issues with the general latency settings and how they affected Chrome. I quickly changed to Netbalancer, and have used that ever since. As well as TC for packet drops. Got tired of dropping them manually.
  5. I'm using Netbalancer on Windows when adding custom latency. Never got Clumsy to work properly for some reason.
  6. Check the pivot point of the 6th mesh. It should be in the exact same spot as the 5 previous models. Sometimes you'll have to reset the transforms in Edit > Transform toolbox.
  7. Hmm. I found out that my main issue was due to my own restitution and contact settings. I made a heightmap out of a model, and it seems to run pretty well: https://www.babylonjs-playground.com/#1PX171#30 But if I make the ground either > 500/500 or < 500/500 it behaves strange. I'll do a Node test shortly, to see if this also works server-side. Edit: So far, so good.
  8. It's a limitation of the Cannon.js physics library, unfortunately. You'll either have to improve the library yourself, or wait for another library, as the coder behind Cannon.js seems to be pursuing other projects. https://twitter.com/schteppe
  9. A bit more weirdness. When creating a heightfield based on an actual heightmap, like the example above, the height is a bit off based on the boundingBox. This doesn't happen when using a model. https://www.babylonjs-playground.com/#1PX171#28 This example runs pretty well, and the elevations seem spot on and don't interfere with the vehicle like a model does. When I change faces or vertices of a model, even the Slightest change in height brings the vehicle to a full stop.
  10. Haven't tested on Node yet, but so far my 3Ds Max model is working. 20/20 segments. 400/400 size. No scaling done in Babylon. And positioning just got a whole of a lot easier. I believe I read that you found the impostor to be positioned in the corner of the mesh used to create the shape. I can confirm this. body.position.x = -275.46000480651855; body.position.z = 275.46000480651855; 275.46000480651855 being the extentSize of the boundingBox. Maybe the impostor system takes care of this itself?
  11. I did shamelessly steal the code from the heightmapImpostor I think I'll create a very simple and basic grid of 20x20 polygons in 3Ds Max, align it, and then see if I can make some small bumps to figure out the effect. I prefer an actual model for more precision in map making.
  12. That is because the cylinderImpostor is automatically created using 16 segments, instead of taking into account the tesellation of the mesh itself. https://github.com/BabylonJS/Babylon.js/blob/master/src/Physics/Plugins/babylon.cannonJSPlugin.ts#L239 I was mistaken. The meshImpostor is a trimesh, which, if nothing has changed,, only collides with spheres and planes. You might have to go native on this one. Natively, you could specify the shape of the Trimesh: http://schteppe.github.io/cannon.js/docs/classes/Trimesh.html Or a ConvexPolyhedron: http://schteppe.github.io/cannon.js/docs/classes/ConvexPolyhedron.html Or, as already mentioned, create a cylinder with 3 segments: http://schteppe.github.io/cannon.js/docs/classes/Cylinder.html The radiusTop and radiusBottom will define the width and depth, and the height will define the length of the triangle. I think this would be the most performant way of doing it. EDIT: This isn't quite right, but it's a starting point: http://www.babylonjs-playground.com/#LEWTG2#1
  13. Unfortunately, I'm not experienced with the impostor-system, but I know it is indeed possible with native Cannon, so I'd assume it is possible using the impostor-system as well. Look at this example: https://schteppe.github.io/cannon.js/demos/shapes.html How is your prism supposed to look like? The shape closest to the upper left cornor is a ConvexPolyhedron, Same thing, I figure, as the meshImpostor. Try turning the scene upside-down. Is this the shape you want? Or are you thinking of a more traditional triangle, you know, like the roof of a very basic house? If it's the latter, you might as well make a cylinder shape. In the scene you see 2 cylinders. Both have 10 segments. If you create a Cannon shape with only 3 segments, that will make a 3-dimensional triangle. 3 is the lowest amount of segments a cylinder is allowed to have in Cannon.
  14. When you create a Cannon sphere shape, the function takes a single value, the radius. This value is then used to create the sphere. You won't be able to, as far as I know, assign different values for width, depth and height. At least not without changing the Cannon library itself.
  15. Weird. I've done quite a bit of testing heightmaps with Cannon. And one thing that happened every time, was the physics body falling through the heightmap, either at the very beginning or at least shortly after the first contact. Keep in mind that this problem was with the raycastVehicle, and only while running the sim on Node. I just stole your matrix from 61, and applied it to one of my older test projects, and oddly enough, I haven't had a fall-through yet, neither on Node or Babylon. although, according to some posts on SO and issues on GH, it might happen eventually. It would be damn awesome not having to create manual static bodies to form the ground, if I could instead be using a heightmap. Hmm. Maybe it's the denser geometry and significantly more faces? I'll have to test this. This is of course my own issue, not entirely related to this. But still I still have issues aligning the Cannon heightmap to the meshes created with Babylon. I feel like I'm blindly trying to solve a puzzle. Weirdness is going on. https://www.babylonjs-playground.com/#1PX171#26