Popular Content

Showing most liked content since 02/16/2017 in all areas

  1. 9 likes
    New Terrain Splatmap Material (Based Off BABYLON.TerrainMaterial)... Supports up to 4 splatmaps using up to 12 textures for terrain painting. The new splatmapMateral.ts will be added to the the babylon Materials Library soon but check out how i am using it for native terrain support using the U3D BabylonJS Toolkit. Of course you DONT NEED the toolkit to use the new BABYLON.SplatmapMaterial... I am just using it in the toolkit by default. U3D - BabylonJS Toolkit: Terrain Splatmap Material Overview Hey @Deltakosh , @Sebavan , @davrous , @RaananW , @Dad72 , @MrVR ... Hey guys please check this out... I am pretty proud of this... Its my FIRST venture into the low level shader parts (using the terrainMaterial.ts as a guide)... But i think it turned out beautifully
  2. 8 likes
    Hello, I have created a full terrain editor for the community. It is easy to use and can be improved by your contributions. With this editor you can: - Create a new terrain - Sizes terrain of: 64*64, 128*128, 256*256, 512*512 and 1024*1024 - Delete terrain loaded - ScreenShot of terrain - Up and down vertex (Key CTRL for down) (Thanks to @Deltakosh with WorldMonger) - Creating plane vertex - Create holes (Key ALT for filling a holes) (Thanks to @jahow) - Create ramps (Thanks to @Gijs ) - Smooth meshes - Paint the terrain with an 8 textures diffuse. (Create one splatmap) (Thanks to @joshcamas for paint on canvas and @NasimiAsl with ShaderBuilder for the splatmap) - Assign textures for paint with save and load setting. (dblClick on slot for change texture) - Export the terrain with textures splatmap and texture painted in a zip with file html and setting. - Register your work - Load a terrain recorded. - Moving the camera in "edit mode" with the keyboard spacebar and the keyboard keys ZQSD (FR) or QWSD (ENG) I think to add it to the extension of Babylon soon. I hope that will useful. Repository GIT : https://github.com/dad72/TerrainEditor Test of editor online: http://www.babylon.actifgames.com/TerrainEditor/index.php
  3. 7 likes
    Galaxy with 360.000 star http://www.babylonjs-playground.com/#1QC9DP#96
  4. 3 likes
    My first version of a game inspired from a hardware game "Magic Mirror (M.C. Escher)" : Mirror-Cubes Because the game itself isn't so easy to play, you can use some hidden buttons (1-5) to complete the level... Technically the game is almost finished but I'm very interested about your opinion, suggestion and so on to complete the "gaming" part. BTW, its time for me to thank Mr. Deltakosh in place of all guys bringing their effort to this forum, Best Regards javalang Forgotton to say: best viewed with Google-Chrome
  5. 3 likes
    I'm happy to see that my tutorial about raycasts is now online, thx to Deltakosh and RaananW : http://doc.babylonjs.com/tutorials/raycasts So now the questions about that on the forum will be lighten and people can have directly the answers on the Documentation. _____ I have some other ideas for improving existing tutorials. I don't know if I'll do it or someone else : - Collision system : precisions on ellipsoid dimensions, talk about oncollide (new features to add : draw ellipsoid, onGrounded variable and slope factor maybe) - Animating bones : talking about the new features of 2.5 rotating bones, blending, playing animation only on certain bones (new features to add : importing multiples animation from different action and timeline in Blender ?)
  6. 3 likes
    Hi and welcome! Firstly, BJS is a pretty mature library and the devs are quite active about adding missing features - so probably better to do forum searches and whatnot before you consider starting and maintaining a fork. As for main loop timing, yes, you can ignore the default way (engine.runRenderLoop) and do engine.beginFrame() scene.render() engine.endFrame() according to any timing you like. I'm not sure it's actually necessary for your purposes though, since the default behavior drives itself from requestAnimationFrame, which is what you'd probably want to do anyway. Physics is a different matter. As far as I know BJS currently assumes that physics and rendering happen at the same rate - so it ticks the physics engine once per render, and then updates all necessary mesh positions without any interpolation. To decouple them, I think your best be would be to ignore BJS's built-in physics handling and manage your own physics world separately. In this case you'd want to just tick your physics engine at whatever interval, and then add a scene.beforeRender() handler that moves necessary meshes to interpolated positions. (This is what I do in my project, since I'm not using one of BJS's default engines.)
  7. 3 likes
    @adam set and get pivot points now added to guide Using pivots page http://babylonjsguide.github.io/advanced/Pivots
  8. 2 likes
    and new version http://www.babylonjs-playground.com/#1F17BQ#37 http://www.babylonjs-playground.com/#1F17BQ#43
  9. 2 likes
    @Deltakosh I agree with you though, so I have updated that post: https://blog.scarlet6.com/babylon/ The post was meant to be more about my own mistakes, not problems that Babylon has hah
  10. 2 likes
    You can use a custom font loader : https://github.com/bramstein/fontfaceobserver Example : http://www.babylonjs-playground.com/#2AVSFH#107
  11. 2 likes
    So, JS is telling you that you're trying to access a property on an object that is undefined. Since the property you're trying to access is x, take a look at the code on line 76 and see what objects are supposed to have an x property. Try logging these to the console or commenting things out until the error goes away. This will tell you what the problem is, then you can go about seeing why the object is undefined.
  12. 2 likes
  13. 2 likes
    I laughed at the expression. I did not want to be mean at all. And thank you for the kind words, there are pretty rare this time
  14. 2 likes
    What??? WebGL is definitely not from Apple! It has started as an experiment inside Mozilla: https://en.wikipedia.org/wiki/WebGL and now WebGL and WebGL 2 are driven by the Khronos group where most of the major browsers vendors are: https://www.khronos.org/ where Mozilla is still leading a lot the game. Apple has done a terrible job in implementing WebGL (like a lot of recent web technologies such as IndexedDB) and it's probably why they want also to ship their own stuff like WebGPU. Before suggesting creating a new standard, it would be cool if they first implement properly stuff everybody is using today. David
  15. 2 likes
    Hi! I have finished my first HTML5 game and I must say it doesn't look that bad! Please, take a minute to try it and rate it on Kongregate: http://www.kongregate.com/games/camaleonyco/poing You can also play it fullscreen and on mobile devices on my website: http://teleponk.com/Poing/ I plan to make more games like this, little tributes to the arcade classics from my childhood. So, even if your feedback doesn't help to improve this game, it certainly will help me with my future projects. A little background: When the Flash Game market collapsed I knew I had to quit game development. Until then, I was making a living mostly from Flash Games. Some of my most popular games are Moby Dick I and II, Days of Monsters, Clarence Saves The Day and Wild King. I tried the AppStore and PlayStore with a couple of projects (Bunny Cannon, Ketopix), but they didn't perform as well as I needed in order to become a Mobile Game developer. However, a colleague told me that there is money in HTML5 gaming if you become proficient. He is very prolific, releasing a couple of games every month, and it seems like he is doing alright. I was used to spend several months making my games, but I was tired of that and the idea of making quick games was very appealing. I tried several frameworks/toolsets/engines, but decided to use Phaser because it looks like it has the fewer caveats. Coming from ActionScript, making games with JavaScript is a lot easier than I expected. I started with a very simple project, but I can see how easy it would be to work on bigger games. Anyway, I don't expect to become rich making small games, but I hope can still pay the rent with my them. Please let me know what do you think about it. Sorry for my English!
  16. 2 likes
    Hiya SR! First, that error has been seen in CannonJS, too. Even though it is annoying, I think it can be ignored, for now. No impact to physics operations have been seen so far, caused by that error report. BUT... it could be related to the ORDER that the physics impostors are added to parent/children. You should probably read this thread. It does some talking about the ORDER of impostor-adding.... when dealing-with parent/child compounding. This badly built Oimo document might be of some help, too.... for advanced OIMO learning/hacking. (I don't wish that on anyone) ("native" calls are scary!) And... lastly, we have seen SOME indications that... it is un-wise to scale a mesh that will be used as a physics parent. By using the meshBuilder system of creating basic mesh, you can set some mesh size/scale dimensions... without needing to use .scaling. Scaling, rotation, and position are handed-down from parent to children, and this is how it could be related to the "order of adding impostors". I'm no expert, and docs are introductory level, so far (but thank goodness and Raanan for those, too). Perhaps you can help us with advanced physics docs, in the future? Don't forget playground searching, too. Hope this helps.
  17. 2 likes
    Hi @Wingnut, after spent more time for Babylon. I very like it, and I really want to expert about babylon. Thank you for your help me. All my question, you answer very early. It is my result project. I hope you like it. https://www.youtube.com/watch?v=nLBjRR22KeE
  18. 2 likes
    make deep fake reflect http://www.babylonjs-playground.com/#1F17BQ#5 http://www.babylonjs-playground.com/#1F17BQ#6
  19. 2 likes
    http://www.babylonjs-playground.com/#1F17BQ#2 http://www.babylonjs-playground.com/#1F17BQ#3 http://www.babylonjs-playground.com/#1F17BQ#1 for make real diamond reflection i have idea ( make different cube map and reflect that wait for me )
  20. 2 likes
  21. 2 likes
    thanks all. I finally just got the diamond's parameters and plug them manually in babylon.js http://www.babylonjs-playground.com/#1H7L5C#39 But the glass shader it is not behaving like a glass, but more like a mirror. While this looks ok on a sphere and create the feeling of a glass sphere, is does not look ok here. There is no transparency so you can see inside. Alpha is not the answer here. Also there is no way as far as I know to let the light in and bounce inside. Is this possible with babylon.js? I know in blender I can do it and the diamond will look very realistic. It is called glass bsdf shader. Is there any similar work done in babylon.js?
  22. 2 likes
    I have updated the editor which now uses splatmap with 8 possible textures. Test of editor : http://www.babylon.actifgames.com/TerrainEditor/index.php Other updates coming soon.
  23. 2 likes
    Theoretically speaking 1. Don't let browser to register more than one click (like ecommerce industry does for payment button) This won't stop determined ones but at least you'll know their bad intention ( Gaming 101 - "If there's an exploit, it will be exploited" ) 2. If possible consider using something like memcached/Redis to store a simple IsAttacked value and/or timestamp. Actually it would also be helpful for scheduling. 3. Not sure if mySQL supports such thing, if it does either lock that record or check before updating. 4. Implement a simple query to detect discrepenancies just in case. A player can get 100 XP a day but one of them got 200? Probably cheating somehow
  24. 2 likes
    I would suggest using PIXI.Application instead of manually creating the renderer and stage, unless you have a specific reason not to. http://pixijs.download/release/docs/PIXI.Application.html That will also create a PIXI.ticker.Ticker object which will be used automatically to render the stage every frame at a rate decided by the browser (usually 60 fps). You can then simply add your objects to the stage and they will be rendered every frame. Just change your objects' positions and they will appear where they should. If you want to move your objects smoothly, you will need to move them by a small amount each frame until they reach their destination. I recommend reading about game loops/update functions if you want a better understanding of how this works. Here's a very well-written resource for exactly that (and much more): http://gameprogrammingpatterns.com/game-loop.html http://gameprogrammingpatterns.com/update-method.html The update method chapter is what's particularly relevant here, but the game loop one is worth reading even though PIXI.Application (and the browser) mostly handles it. Edit: Oh, and to answer your question: No you shouldn't have to do that. Something more fundamental is wrong which is why I wrote what I did.
  25. 2 likes
    Definitely worth a shot, there is a lot of USA traffic. One of our games managed to get 500.000 plays up there, probably more is possible. They have friendly "management" that will help to get your game on there, and even give you tips. Though the audience there enjoy the REAL free to play games... so if your game have a lot in-game purchases they will rate it kinda low. They also like to share their opinion about the game.
  26. 2 likes
    Don't worry about it, we've all been there at some stage!
  27. 2 likes
    "sigh" .that hurts , after spending half ofthe day figuring out what the issue is..and now I find out it';s just a html element :] .. arrrrghh... . Anyways ,thanks @themoonrat ..that saved my day ( literally )
  28. 2 likes
    Ok, I wrote it down. I'll implement camera2d and proxies as a plugin without needing all that 3d stuff
  29. 2 likes
    Hello everyone! I've recently released v0.2.0-beta for you all to check out. It comes with several new features: Premade tilesets Built in tileset slope mappings for Ninja Physics and Arcade Slopes tilesets Debug rendering for tile polygons (tilemapLayer.debug = true) Offset tilemap layer support (though this has always been janky in Phaser) Circular physics body support Tile collision flag support Grab a copy here. Check out the demo! The demo has been updated with Phaser CE 2.7.3 and Arcade Slopes v0.2.0-beta. It lets you change the player's shape & size and witness the debug rendering.
  30. 2 likes
    Thanks for the comments. I still find it confusing that I have to choose one of the meshes to be the parent just to get a compound impostor. Is there a non-mesh grouping object I could use as the parent instead of a mesh with an impostor attached? Also, it is confusing that the parenting system requires an exact sequence in setting the physicsImpostor on the parent and child (i.e., child must be set first). Shouldn’t it not matter and you be able to recompose arbitrary groups of meshes into/out of compound impostor groupings? The parent/child of BabylonJS without physics is a lot less constrained than when using physics. But if you start using impostors and expecting things to work when you parent things, suddenly you have to follow rules such as the sequence you set impostors. It seems like the type system/API makes it easy to do things that won’t work with the new way ;-). Maybe some of these issues could be resolved with documentation updates.
  31. 1 like
    Try adding photonstorm/phaser/blob/master/v2/build/creature.js after your phaser script.
  32. 1 like
    @Temechon sry the board trolled me, I wanted to select you by hitting return, that posted an almost empty message only containing your name
  33. 1 like
    Take a look at some game examples made with Phaser. You should put your loop inside update since that's called every frame. Inside create init your variables. How you actually manage to implement this specific game it's a matter of preference and figuring out what it works. Start simple - when the game starts have it only allowing you to roll 5 dice. Than take a look at the code and figure out how to change states and let the computer roll the dice. And so on, and so on.
  34. 1 like
    Using the arrow function will guaranty you that you can use "this" inside the function, otherwise "this" is the window object, which is not what you expect/want.
  35. 1 like
  36. 1 like
  37. 1 like
    Thanks scheffgames! I don't know what Phaser is.. I did this in NodeJS and plain Javascript (jQuery) (And the userstuff, deckbuild, store, etc is actually in PHP/MySQL/Ajax)
  38. 1 like
    ldd, how does it look now? I think it's better when the background change is shorter. phreaknation, I think that discovery is a part of the fun in a game. especially if it's not too painful.. don't you think?
  39. 1 like
    http://www.babylonjs-playground.com/#E6OZX#89 hi you can use SetUniform for define your new texture or any new uniform and with .material.setTexture you can set your wanted texture (any kind of texture ) and for use This material in Shader Builder use .Map function sample .SetUniform('dyTexture1','sampler2D') .Map({ index: 'dyTexture1',bias : 2.}) .Reference(1) ... .BuildMaterial(scene); // set dynamic texture var textureGround = new BABYLON.DynamicTexture("DynamicTexture", 1024, scene, true); ground.material.setTexture('dyTexture1',textureGround);
  40. 1 like
  41. 1 like
    Ahhh, I see what you're asking now. And it looks like the answer is: https://github.com/schteppe/cannon.js/issues/224 In short, Cannon uses the length of the world gravity vector to approximate the maximum friction force, so you'll probably need to set your scene's gravity to a common-sense value, and then apply counter-forces when you want to negate it.
  42. 1 like
    @Hans - Yes, this can become more complex than necessary - but you can orient your camera and or scene gravity to create the appearance of X or Z negative mass. So if yourphysics simulations are relatively uniform throught your scene and in time, then you can often achieve the behaviors you require by setting scene.gravity to create a negative mass for all objects - which can be changed conditionally in time as well. In addition, you can set proceedural animation for each mesh in an array or for seperate arrays and conditions which will work in addition to any impulses you might be including in your simulation. A typical example is to create a condition which if you mesh is moving at a velocity less than your desired velocity in any specific vector, then add a value to the object's own mesh.position.z or mesh.position.x and this will translate your mesh in the direction of whatever vector you desire - and your impulses will still behave as expected simultaniously with an addition to the object's own position independant of the impulse (subjectively). Many devs haven't yet discovered that you can add values to a mesh's own position to create movement for the mesh in addition to any physics impulses already in play on the mesh's imposter - which allows you to either change direction (position) of movement, or to set a speed limit on collisions - and many other possibilities for animation. So there are many solutions to your what might be percieved s a problem, but these can all be overcome. And I've learned from working on projects with @Pryme8 that it is better to set your own object's movement, velocity, etc. - or change in position - and to avoid using impulses altogether in your physics simultations. However, both of these methods to translate your mesh through world space are valid - seperately and together. It simply takes a little experimentation to create the desired movement for your specific scene or instance. However, in my experience, I now find far more control in avoiding the use of impulses, and to conditionally set the change in position, acceleration, and velocity for any mesh in a physics simultation using my choice of physics engine; maintaining every other aspect of the physics simulation - as this allows me far more flexability in any simulation and scene. And I personally find cannon.js to be easier to use in these circumstances. However, Oimo.js is great, but a bit more complex to navigate in such conditions. DB
  43. 1 like
    not sure to understand what you try to achieve ... here's a box textured on a single face : http://www.babylonjs-playground.com/#OTFI8#2 (not sure your texture can be downloaded in the PG also) The same with different colors and textures per face : http://www.babylonjs-playground.com/#OTFI8#3 The vertex color is mixed to the texture color, so if you want to keep the textured face with its original color, just set this color to white.
  44. 1 like
  45. 1 like
    Hi there! If you're looking for a team with real HTML5 experience -- who knows how to make the game properly work on all handheld browsers, tablets, as well as PCs -- let's talk! We built some of the top HTML5 games on sites like Yahoo Games, Games.com, iWin, and others. You can see some of our HTML work in this video (HTML5 at the 2 minute mark): https://www.youtube.com/watch?v=SZ4Yvcaj4wk Or check our site: http://www.doublecoconut.com/ I hope you'll consider us! Best, -David CEO Double Coconut http://www.doublecoconut.com
  46. 1 like
    Hello, if you are going with the cos and sin equations (those two equations are actually equations of circle) then just narrow the angle. Instead of from 0 to 2 * Pi you can use a different angle interval to randomize from. You can even use 3 * Pi, there is a period of 2 * Pi so anything above will reproduce the values periodically, but you can use that periodicity to your advantage. The equation graphically is a circle with radius and angle which starts at the righter most part of the circle (angle goes anticlockwise!), so if you want your particles to aim directly in the top direction you can just either set your velocityX = 0 and velocity Y = someNumber or use the circle equations and set the angle to Pi / 2 (that's 90°): x = radius * cos(Pi / 2) = 0, y = radius * sin(Pi / 2) = radius * 1 = radius. So if you want any other direction just use different angles. From your picture it seems that you want these extremes (first one is NEGATIVE!): < - Pi / 2; 3 * Pi / 2 > (< and > means that both values are INCLUDED!). If you are using standard web interpretation where point [0, 0] is at the top left corner of your window (in math it's usually bottom left in high school) then you will need to do a slight adjustments because your circle is reversed (y values increase towards bottom of your screen not towards top as you know math) I will leave these to you it's fun ;-). Don't forget you can even adjust equations with different sign ;-). You can simply google circle equations and you will get a lot of example with pictures. Anyway angle needs to be in radians, so to make that easier for you 0 degrees = 0 radians, 360 degrees = 2 * Pi. That should make your calculations easier, either that or just use google, it will calculate your values for you if you just input them in the search bar and ask for conversion.
  47. 1 like
    Hello, you could do something like this for example. Your start is the center, radius is velocity magnitude (speed) and dx and dy are your velocities, randomize angle from 0 to 2 * Pi. dx = radius * cos(angle) dy = radius * sin(angle) Or mathematically the exactly same solution with pythagorean theorem: velocity ^ 2 = vx ^2 + vy ^ 2 Velocity is your constant which you set (same for all particles if you want them to move with the same rate), randomly set vs or vy and calculate the other one. Leading you to velocity = constant vx = some RANDOM number (velocity ^ 2 - vx ^ 2) ^ 0.5 = |vy| (absolute value) randomly pick plus or minus as a sign for vy and you are good to go. And let me know if it works I don't have enough time to make sure I didn't miss something right now :-).
  48. 1 like
    Thanks a lot guys! Sounds like you have good plans for the physics (just don't add the SPH, it's probably too experimental at this point). Exposing the CANNON.Body was probably a very good move initially. I don't really like the collide event... I added beginContact and endContact recently, you should probably use those You @Wingnut make me blush haha ! A vehicle helper/class in BJS would be cool, yeah, I agree. It's a shortcut that takes you from a simple car mesh to an almost fully fledged racing game (lol). In Goo Create I made a script that you can simply put on an entity with a rigid body component. I think it works quite well, both game play wise and workflow wise. You put the script and can also add mesh entities for each wheel to be animated, and then you're done. Not sure if it's any help to you guys, but I can at least provide a link: Create Scene with the Vehicle Script, Live Demo.
  49. 1 like
    Hi, I've done something like that and it seems to work all right so far: function _fileComplete(progress, cacheKey, success, totalLoaded, totalFiles) { if (success) this.loadTexture(cacheKey);}function dynamicLoadImage(game, x, y, url, fallback, key) { if (typeof key === 'undefined') key = 'dynamicLoad_' + url; if (game.cache.checkImageKey(key)) { return game.add.image(x, y, key); } else { var image = game.add.image(x, y, fallback); var loader = new Phaser.Loader(game); loader.image(key, url); loader.onFileComplete.addOnce(_fileComplete, image); loader.start(); return image; }}
  50. 1 like
    inside your game's preload() you use game.load.script() like below: function preload(){ game.load.script('player.js', 'lib/game/sprites/player.js');}then here's the player.js file (Player is an extension of Phaser.Sprite): game.load.spritesheet('playersheet', 'media/player01.png', 64, 64);Player = function(game, x, y){ Phaser.Sprite.call(this, game, x, y, 'playersheet'); this.anAttribute = 'whatever'; this.anotherAttribute = 20;}Player.prototype = Object.create(Phaser.Sprite.prototype);Player.prototype.constructor = Player;(for convenience i include relevant asset loading inside the respective code file, like in line 1 of player.js. you don't have to do this obviously)