Search the Community
Showing results for tags 'crowd simulation emscripten'.
-
Hi, For the short story , I'm really interested about 'IA' for games, so I'm familiar with IA concepts and in this case about 'collision avoidance'. So here is a demo of a cool algorithm (first write in c++ by University of North Carolina, RVO ) managing IA agents (multiple characters moving with a kind of IA), converted to JS with Emscripten to reach typescript/JS. One year ago, I made a try to convert this algorithm from c++ to pure typescript/js, but with bad performances (I made a post in this forum). I talked with @lo.th #oimo.js 's guy ; and he said me : do you know Emscripten. This can compiled c++ to Js with high end perfs. So I made a try, and that 's right perfs are really good compared to my first typescript/js port ! I have already worked with this kind of library with alchemy/Flascc from Adobe, converting c++ to as3(rip). Few words about Emscripten ( http://kripken.github.io/emscripten-site/ ). It 's a really cool open source project.. You can read that on their homepage : « Emscripten is an LLVM-based project that compiles C and C++ into highly-optimizable JavaScript in asm.js format. This lets you run C and C++ on the web at near-native speed, without plugins. ». You can read that on their homepage. So here is a really alpha preview, the demo counts 11 differents scenes. For each I try to explain what's the purpose (black div on the left). If you want to play with agents, selecting, moving, changing goals, it's in the last case, scene 11. I test this demo with chrome and ie (faster with chrome). Maybe some guys from the forum could test it with spartan (feedback would be appreciated ! ). Here is the a pseudo code for the first scene -typescript : private case1(): void { // number of agents Main.n = 128; this.meshes = this.basis.createAgentsMesh(Main.n); // ini Crowd Simu this.crowd = new BABYLON.CrowdPlugin(this.scene); for (var i = 0; i < Main.n; i++) { this.crowd.addAgent(this.meshes[i],0); this.crowd.addAgentGoal(i, new BABYLON.Vector2(-this.meshes[i].position.x, -this.meshes[i].position.z)); } }public loop(): void { this.crowd.run(); }So this library could be usefull to manage characters behaviors with babylon.js. Maybe a plugin for babylon ? The demo : http://visualiser.fr/babylon/crowd/ I need to clean up few things before publishing this. It works with babylonjs 1.14, I need to fix a strange behavior with the 2.0 alpha.. Sam