Raggar

Members
  • Content Count

    347
  • Joined

  • Last visited

  • Days Won

    1

Reputation Activity

  1. Like
    Raggar got a reaction from QuintusHegie in Play same sound multiple times without additional webrequests?   
    I use the AssetsManager to load all my sounds, and put them into an array at predictable indexes. This way, I can clone the sounds and attach them to all players.
     
     
     
    /////Task var gunshotSound3 = assetsManager.addBinaryFileTask("soundTask3", "sounds/gs3.ogg"); /////onSuccess callback gunshotSound3.onSuccess = function (task){ var gs3 = new BABYLON.Sound("gunshotSound3", task.data, scene, null, { loop: false, autoplay: false, spatialSound: true }); sounds[2] = gs3; gs3.setVolume(0.6); } /////Player creation function player(gunIndex, ..., ..., ...){ ///gunIndex = 2; ... ...... ... ... this.gunSound = sounds[gunIndex].clone("gunSound"); this.gunSound.attachToMesh(this.mesh); } /////Gunshot sound needed player.gunSound.play(); /////New weapon etc. player.gunSound.dispose(); player.gunSound = null; player.gunSound = sounds[x].clone("gunSound");  
  2. Like
    Raggar got a reaction from timetocode in Play same sound multiple times without additional webrequests?   
    I use the AssetsManager to load all my sounds, and put them into an array at predictable indexes. This way, I can clone the sounds and attach them to all players.
     
     
     
    /////Task var gunshotSound3 = assetsManager.addBinaryFileTask("soundTask3", "sounds/gs3.ogg"); /////onSuccess callback gunshotSound3.onSuccess = function (task){ var gs3 = new BABYLON.Sound("gunshotSound3", task.data, scene, null, { loop: false, autoplay: false, spatialSound: true }); sounds[2] = gs3; gs3.setVolume(0.6); } /////Player creation function player(gunIndex, ..., ..., ...){ ///gunIndex = 2; ... ...... ... ... this.gunSound = sounds[gunIndex].clone("gunSound"); this.gunSound.attachToMesh(this.mesh); } /////Gunshot sound needed player.gunSound.play(); /////New weapon etc. player.gunSound.dispose(); player.gunSound = null; player.gunSound = sounds[x].clone("gunSound");  
  3. Like
    Raggar got a reaction from webdva in Handling player movment on the server instead of client?   
    I was gonna post the same link as @CtlAltDel, as the demo seems to have this covered: http://www.gabrielgambetta.com/fpm_live.html
    So far some people have had luck using P2.js for collision detection and other physics stuff server-side using Node.js.
    I even thought about using it for a 3D game, to calculate the players' collisions with each other and the world. The reason for this is, that I haven't found a proper way to run a 3D world/physics server-side using Node.js yet. I'm just pretty sure it's not possible to calculate collisions on the Y axis (Z in 2D I think).
  4. Like
    Raggar got a reaction from Wingnut in Demo with Ammo.js Physics Engine   
    To my knowledge, cosserat rods are not supported out-of-the-box in Bullet Physics/AmmoJS. However, it seems like someone tried implementing it at some point:https://pybullet.org/Bullet/phpBB3/viewtopic.php?t=11242
    Here's an Elastic Rod implementation as well: https://pybullet.org/Bullet/phpBB3/viewtopic.php?f=4&t=10993&p=36852
    But these are all new concepts to me.
    If you want vehicle micro-destruction, Bullet provides you everything from the contact pairs, points, normals, applied impulses etc. So a vehicle-bone-rig would be cool with some swapping of models as well. You can create your vehicle body out of smaller shapes and use hinges on doors etc. Or you can simply use a model as cosmetics. You'll most likely use a compound body anyway, since it's the easiest way to create an artificially lowered center of mass. Would be cool to see a game like that.
  5. Like
    Raggar got a reaction from Wingnut in Demo with Ammo.js Physics Engine   
    I recently ported the physics engine of an "old-ish" BabylonJS project of mine from CannonJS to AmmoJS. I did this as CannonJS is no longer maintained, has buggy convex collisions and a limited concave implementation. AmmoJS can be compiled to WASM as well, which is no doubt the way things are moving when it comes to physics. Chrome even just started their trial for WASM threads. I'm using a worker, though, as my game requires every bit of juice it can possibly get. I won't have time to help with the plugin, and you know.... What is TypeScript? .. But I really think AmmoJS should be included as a plugin, as well as the playground, as it is a beast. Just make sure to re-use quaternions, vectors, transforms etc. as AmmoJS otherwise leaks and builds up memory pretty fast. I think a proper implementation will be far superior to what BabylonJS  already supports.
  6. Like
    Raggar got a reaction from Wingnut in Demo with Ammo.js Physics Engine   
    Heightfields are generally more performant, but lacks features that concave shapes have.
    If you are creating a giant island-map, you'll want the extra performance of the heightfield, if all of the map is to be used for collision detection and dynamics.
    If you, however, want to create a racing track, a heightfield could result in A LOT of unused geometry in your physics shape. In this case a concave shape would be more performant, and allow for such features as holes in the ground, which heightfields do not. Generally, if you want dynamic concave shapes, you are way better off converting to/generating a compound body of convex shapes.
    It all really depends on your project, and there's no reason not to use both heightfield, concave, convex and primitive shapes all at once. You'll squeeze out some extra performance if you groups all static shape types together as well, making big compound bodies out of all static concave shapes, making compound bodies out of all static convex shapes, etc, etc. <- Same thing with CannonJS.
  7. Like
    Raggar got a reaction from jsunandmax in 3ds Max 2018 bones/skin problems   
    I can't open your max file since I'm outdated at the 2015 version.
    Deleting the cloth fixed the artifacts for me, but another thing did as well.
    Can you confirm this works for you, too?:
    - Select the cloth mesh
    - In the skin modifier, remove all but the weighted bones, leaving you only with the backflap_.......... frontflap_... bones.
  8. Like
    Raggar reacted to Dad72 in Web Game Editor (MMORPG)   
    Hello,
    I made a complete redesign of Web Game Editor  which now no longer uses the tabbed system. Instead, I wanted to do something more modern and more original. I recreated a system in the Windows 10 style with a customizable desktop, movable icons that can open editors and others.
    In the previous version I loaded all the engines for each editor which made 8 in total. In this version I only load 1 engine when opening an editor. If you open a second editor, a second engine is loaded. and if we close an editor, the engine is removed.
    When multiple windows are open, they are in the taskbar and each window can be minimized and reopened as does Windows 10.
    I also made a "menu start" the "W" at the bottom. which allows you to create projects, change the language, update, start the game to test it and somethings else.
    I am rather satisfied with this redesign. I intend to release this version 3.0 this Friday, November 14th. I'll make an announcement that it will be ready.
    Here is an image of this redesign in the Windows 10 style :

     
    I hope that you will like. Do not hesitate to tell me what you think of this originality. It's something I've never seen before and I find the idea pretty cool. But I am interested also by your point of view to you.
     
  9. Like
    Raggar reacted to Deltakosh in Inspector v2.0   
    Hey team!!!
    I'm so happy to start sharing what I was working on for some times:
    https://medium.com/@babylonjs/dev-log-creating-the-new-inspector-b15c50900205
    I hope you like it as much as I like working on it
    This is the repo issue associated with it: https://github.com/BabylonJS/Babylon.js/issues/5415
     
    I plan to merge it to master probably this Monday 

     
  10. Like
    Raggar got a reaction from ssaket in Rotating cloned imported mesh   
    https://playground.babylonjs.com/indexStable.html#PN1NNI#98
    In the exporter - at least the one for Max, models are exported with the rotationQuaternion property set. When this is the case, .rotation is not used.
    Either null out the rotationQuaternion, or rotate the model/clone using one of the methods that supports quaternion rotations.
  11. Like
    Raggar got a reaction from Damian Pastorini in Handling player movment on the server instead of client?   
    This is something both Phaser and Babylon need. A proper open source authoritative server with at least working physics.
    I've seen this being discussed various places, with implementation in Java, C++, Python etc. But so far, I haven't seen any actual code examples.
    I'm certain this would boost popularity of both frameworks, but at the same time, it's no small task. Community project, anyone?
  12. Haha
    Raggar got a reaction from dbawel in I Love This Forum   
    Ask him when we'll see him aboard the Orville
  13. Like
    Raggar reacted to Sam82 in BabylonCpp - A port of Babylon.js to C++   
    Hi Babylon.js community,
    It is my pleasure to announce BabylonCpp, a port of Babylon.js to C++, facilitating the creation of lightweight, cross-platform 3D games and applications with native performance. This port is a manual translation from the thousands and thousands of lines of Babylon.js TypeScript code into C/C++.
    Some history
    In 2015, I was looking for an interesting pet project. Due to my interest in 3D and modern C++, I stumbled upon Babylon 3D (C#/native port). I used this project as a starting point for mine and started updating the code with the latest code of Babylon.js. In beginning of 2017 - after a long time of porting, frustration and testing - I decided to publish the code on GitHub. Since then I kept updating the code and adding examples on daily basis.
    The Good
    TypeScript makes it really easy to port to C/C++ compared to JavaScript. For most parts, it is basically copying the code, updating to the proper syntax and updating the header.
    To get a good overview of the current state of the project I refer to the screenshots on the samples page. Not really a surprise, but if you look at the samples code you will see that the API looks very similar to the one of Babylon.js. Not all functionality is supported yet, but this a work in progress.
    I am really pleased with the performance of Babylon.js and the speedup of BabylonCpp. I am aware that I am comparing apples and oranges but I can give you some numbers. On my Intel NUC NUC7i5BNHX1 (Intel Iris Plus Graphics 640 GPU) I am getting the following numbers for the relatively simple Grid material example for a resolution 1680x1050 on Fedora 28:
    Babylon.js engine (v3.3.0-rc.3), Firefox 62.0: +/- 15% fluctuating CPU load, 270 MB RAM usage, fluctuating fps between 45-60 fps BabylonCpp (library size is 7.6 MB): constant 2% CPU load, 16 MB RAM usage, constant frame rate of 60 fps Some possible use cases of BabylonCpp include:
    Native apps development on iOS, Android Using the library as a WebAssembly module Using the library in existing desktop applications or integrating third-party libraries (i.e. Recast & Detour, Bullet Physics engine, etc.) Technical exploration (i.e. testing functionality that is in OpenGL and not yet in WebGL, supporting Vulkan API) The bad
    Most of the time goes into keeping up with all the Babylon.js code changes. Every month I take a snapshot of the latest code and port the changes into my version. As a result, the code is always very up-to-date but code on which people are still working or that might be thrown away in later versions is also integrated. An alternative I am going to follow for Babylon.js 3.3 is sticking with the stable version and focus mainly on features and stability. Porting will be done in a branches and less frequently.
    Not all code can be easily ported. For instance, C++ does not have reflection. There are third-party libraries available to support this, but this means introducing a new dependency.
    ...and the Ugly
    Linux is my main development platform. The code compiles on Windows (MSVC 2017) and OS X but is not really tested and buggy. On Linux I am also getting different behaviour between the debug and the release version. So the library is for moment only really usable on Linux in debug mode...
    Looking forward to hear what you think about the project or where you want to use it. If you have some suggestions for improvement or want to contribute or help resolving some of the issues described above feel free to contact me any time or let them know in this forum, it certainly would help a lot!
    Cheers,
    Sam
  14. Like
    Raggar reacted to Dad72 in Web Game Editor (MMORPG Editor)   
    Hello,
    I announce the release of Web Game Editor. More info here: http://www.html5gamedevs.com/topic/39884-web-game-editor-mmorpg/
    Link of the site:=> http://www.web-game-editor.actifgames.com/
    To download the editor you must be registered on the site. Feel free to consult the manual and tutorials videos or ask questions on the forum. You welcome.
    I hope you like this new version. There is still work to be done, but this version is more accomplished than the previous ones. Be sure that I will make every effort to make this editor as functional as possible with regular updates.
    Have fun.
    Some pictures:


  15. Like
    Raggar reacted to jerome in Web Assembly   
    Hi guys,
    Here's my first real WASM test : http://jerome.bousquie.fr/BJS/test/SPSWasm/spsWasm.html
    Caution before clicking on the link : it's a very big SPS with 40K solid particles, this could freeze your browser. I'll report more precisely about this experiment here :
    About WASM itself :
    I generated the WASM bytecode from some code ported from TS to AS, AssemblyScript . If the logic is quite simple to port from TS to AS (because the syntax is almost the same, just add strong types like "f32", "u32" instead of "number"), the shared memory access (shared between the JS main program and the WASM module) is really complex and painful. Indeed, WASM knows only very basic numeric types only : i32, u32, f32, f64, etc and nothing about more complex structures like strings, arrays, objects. It's really low level and we have to deal with pointers and offset to pick/store the data at the byte level directly in the memory.
    Note also that there's no garbage collector. This means that creating any "object" (array, instance of a class, each time we type the word "new", etc) in our logic will require to manually free the dynamically allocated memory to prevent memory leaks. Moreover WASM doesn't provide any math library, so no trigonometry at all (sine, cosine, tan, everything required for 3D computations actually), so we have to implement by ourselves, say, the function sine.
    In brief, for a developer coming from a productive high level language, despite the help of the easy syntax of AS, it's a jump back in the past because the way to code it right looks more like some the C or the assembly way. Indeed, the first version of this code, very TS-like, very twice slower than this more low-leveled published version.
    You can get the AS source here : http://jerome.bousquie.fr/BJS/test/SPSWasm/index.ts    [EDITED]
    That's said, what about the gain ?
    Here are different versions and the FPS in my Chrome :
    Legacy SPS   - 8 fps : http://jerome.bousquie.fr/BJS/test/spsReference.html 
    Reference Buffer SPS - 7 fps :  http://jerome.bousquie.fr/BJS/test/spsBuffer.html  fun to see that now the legacy SPS what has been optimized is faster than the lighter buffered one
    WASM SPS -  31 fps : http://jerome.bousquie.fr/BJS/test/SPSWasm/spsWasm.html  it's the port of the Buffer SPS in AS
    perfs gain = x 4.42    ... not that bad, finally
  16. Like
    Raggar got a reaction from Gijs in Create ramp for ground   
    If only I could remember what I did to fix the positioning.
    I ended up using a ribbon instead of a ground. This way, I create the ramp shape based on 4 clicks/picks. One for each corner.
    http://www.babylonjs-playground.com/#GQ83J#10
    Click 4 times to create the ramp.
  17. Like
    Raggar got a reaction from Dad72 in Create ramp for ground   
    If only I could remember what I did to fix the positioning.
    I ended up using a ribbon instead of a ground. This way, I create the ramp shape based on 4 clicks/picks. One for each corner.
    http://www.babylonjs-playground.com/#GQ83J#10
    Click 4 times to create the ramp.
  18. Thanks
    Raggar got a reaction from asperger in High quality glowing sphere?   
    The glowLayer works fine with created meshes.
    http://playground.babylonjs.com/#IEW571
  19. Like
    Raggar reacted to Eric Matyas in Super-Affordable Custom Music for Your Games   
    Hi everyone,

    I just wanted to let you know that I've been creating custom tracks for developers in addition to the free ones that I post daily on my website, soundimage.org.

    In keeping with my goal, which is to make good-sounding music available to anyone, I've been trying very hard to keep costs low for indie developers and artists...and so far, most of them have actually been surprised at how affordable custom music can be. If you need something special created for your project, feel free to email me...my email address is at the bottom of my homepage.

    All the best,

    Eric
  20. Like
    Raggar reacted to brianzinn in more GUI Controls (ie: Menu)   
    Just messing around seeing how to make a dialog control like:
    https://getbootstrap.com/docs/4.0/components/modal/
    Came up with:
    https://www.babylonjs-playground.com/#Q81PBV#1
    I didn't spend much time on it, but something I would like to add is to get normal for camera.getForwardRay() and .cross or whatever to put the dialog in front of the camera.  I'm not using full screen as I want it available in VR.  In fact, my idea is full screen is only for showing non-interactive UI if VR is enabled (like HUD).  Not sure if something like this is useful as a helper method like BABYLON.GUI.Control.AddHeader, but maybe will save somebody a little bit of time than making their own dialog from scratch.
    I added kinda an old TV off animation, but would be easy to add lots of transition options as well.
  21. Like
    Raggar got a reaction from jerome in DroneZ   
    https://raggar.co/dronez/
    [WASD]+Mouse
    I needed a break from my multiplayer game, so I spent a little over a week making a little mini-game.
    Created using BabylonJS and CannonJS.
    No objectives. Just shoot the enemy AAs and drones.
    - Tested on Chrome and Firefox @ Windows
    - There's a bug resulting on some AAs being invincible.
    - Much of the code could be rewritten and optimized.
    I actually made a tank as well as a jet, so I might revive this project at some point. I have a little 2-day mini-project in mind first, though.
     
  22. Thanks
    Raggar got a reaction from dbawel in Fastest way to display fps   
    You have to create an HTML element and assign it an ID of "fpsLabel".
    <div id="fpsLabel"></>
  23. Like
    Raggar reacted to Dad72 in Complete TerrainEditor & LevelEditor for Babylon.js   
    The Babylon field editor has gone into version 2.0 and is more stable. Many corrections, optimizations and improvements have been made. The interface has also undergone some small modifications with some patches.
    What you can do with the TerrainEditor :
    Create a new terrain with 5 sizes to choose from or load a recording. Rename or copy a loaded terrain or delete one. Create mountains or dig lakes, rivers. Smooth the terrain to soften your mountains or rivers. Raise trays rather than mountains. Paint up to 8 different diffuse textures for maximum terrain customization. (Thanks @Luaacro for the mixMaterial) Create ramps on the highlands or mountains to access your characters. Create holes in the ground to enter the basement, cellar / cellar ... Export the land in babylon format with all the textures used. An example file and html test is exported with. Export file meshes separate added in the terrain. Import and add meshes in the terrain Edit meshes with Inspector of properties Add water areas in the scene Add collision boxs in the terrain Add sound and music areas in the terrain Add portals in the terrain Each tool can be controlled to have more or less radius of your brush. You can choose the type of brush to have different shapes to paint textures.
    The brush is visible by a red allo on the floor following your mouse. Its radius defines what the brush will paint with precision.
    For texture paints, you can control the hardness and scale in addition to the radius of the brush. When raising mountains, you can control the maximum height limit of your mountains or the minimum limit if you dig.
    A grid allows you to see the sea level and is set to coordinate 0,0,0. This is useful when digging your rivers and lakes.
    You can save your work at any time and resume it on another day. When your field seems finished, you can export it for use in any project using the Babylon engine. Just take the hardware code of the export of the html file.
    I do not think that a publisher's documentation is necessary, but if you think you need it, leave me a message and I'll do one. But I think the editor is very easy to use.
    I hope this comprehensive field editor will help you. Do not hesitate to tell me if you have problems and tell me what you think, the improvements to make ...
    The publisher is open-source. You can download it on this repository The editor integrates a mini server to start it:
    https://bitbucket.org/JSbabylon/terraineditor/downloads/
    Enjoy.
    Some screenshots:


     
  24. Like
    Raggar reacted to NasimiAsl in geometry Builder product design   
    full design bu GeometryBuilder |  size :GB model size  =  50 kb with html  -  main .obj model size = 65 MB 

    https://demos.5kb.me/Revival/index4.html
  25. Like
    Raggar reacted to RaananW in [SOLVED] MeshImpostor not working with imported .gltf file   
    hi @vtange,
    seems like I found the problem and fixed it. I am still in the process of running tests, and your mesh really helped a lot in understanding what's going on. Your mesh has all of the "problems" I needed in order to find a working solution:
    1. parent with awesomely weird transformation (negative z scaling, Math.PI on y)
    2. Your mesh is not centered. At all  Wonderful!
    3. Your mesh is downscaled. 0.025 times to be exact.
    4. It is relatively complex! Which is good for testing.
    Here is the current working state :

    You will notice the collisions are working correctly. There are walls that are not seen due to back face culling, but you know the model better than me
    I will PR "soonish". I want to make sure everything is working, as this is a rather big change in the way I am calculating the initial physics bodies.