Search the Community

Showing results for tags 'performance'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 250 results

  1. kazoo

    Performance Tips

    What are some general performance tips that you would have for newcomers to Pixi? Also what should we really take care of if we want to avoid memory leaks, performance issues, etc. I currently destroy all graphics objects, sprites and textures that I use. I also take care of the stage and the renderer. Also I store references to dynamically created objects in arrays and then clear them afterwards when I need to. However I still see small memory leaks here and there. I use chrome dev tools to identify the leaks.. Also, consider this scenario. I have two pages, and on both of them I have a Pixi canvas with some stuff being drawn. When switching from page 1 to page 2, the whole page 2 throttles, until the Pixi canvas is loaded, although this is just a guess for now. However when I remove the Pixi canvas the page loads, fast, normal.. I am just asking this vaguely, since I haven't looked at what might be causing the issue yet, but I want to have some more input before I start. I do draw around 100+ different graphics elements on the second page.. Are there any ways to improve this loading, rendering time of the second canvas? Also I am running this on a 3rd party device, and that's why I need to be very conservative with memory and performance. When running on PC, I do not see performance issues, however the device is also really powerful, so I would not say this is a hardware limitation.
  2. Hi All, I've had a brief search of the forum and found some posts on mobile physics performance tweaks etc (and tried the suggestions), but haven't found a post regarding this specific issue. I'm using the Intel XDK (replaced phaser.js with 2.5). When testing through the emulator (and on 2 android devices) I find that gravity appears to act differently on some devices. I'm just making a basic touch to jump side scroller. The gravity seems extreme on some devices (HTC droid incredible, Lenovo K900, Motorola droid 2, motorola razr i, nook color and samsung galaxy s), i.e. when the player jumps he only manages to get about a tile high. On all the other emulators in the xdk it seems to work as expected (kinematic equations suggest a jump height of about 5 tiles y and 2.5 tiles x), all the apple phones work fine including the 3gs, the nexus devices are fine, the lenovo idea pad is fine, the microsoft ones are fine, and the galaxy tab 2 is fine. Frame rate seems to be about the same on all the emulators. Setting a desired fps of 60, 45, 30 had no effect. Using Phaser.Canvas made the game a bit quicker on the mobile device but the gravity was still playing up. Wondering if anyone has any idea what could be causing it or what to do to fix? I've attached the files to the post. main.js: var SideScroller = SideScroller || {}; var innerWidth = window.innerWidth; var innerHeight = window.innerHeight; var gameRatio = innerWidth/innerHeight; = new Phaser.Game(Math.ceil(320*gameRatio), 320, Phaser.AUTO, '');'Boot', SideScroller.Boot);'Preload', SideScroller.Preload);'Game', SideScroller.Game);'Boot'); Boot.js: var SideScroller = SideScroller || {}; SideScroller.Boot = function(){}; //setting game configuration and loading the assets for the loading screen SideScroller.Boot.prototype = { preload: function() { //assets we'll use in the loading screen this.load.image('preloadbar', 'asset/images/preloader-bar.png'); }, create: function() { this.input.maxPointers = 1; //loading screen will have a white background = '#487c9a'; this.scale.forceOrientation(true, false); //scaling options this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; //have the game centered horizontally this.scale.pageAlignHorizontally = true; this.scale.pageAlignVertically = true; //screen size will be set automatically // this.scale.setScreenSize(true); // Apparently speeds things up... = true; //physics system; = 30; this.state.start('Preload'); } }; Game.js var SideScroller = SideScroller || {}; SideScroller.Game = function(){}; SideScroller.Game.prototype = { preload: function() { = true; }, create: function() { console.log(gameRatio); ='level1'); //the first parameter is the tileset name as specified in Tiled, the second is the key to the asset'tileset1', 'gameTiles'); //create layers this.groundLayer ='Ground'); //collision on blockedLayer, 300, true, 'Ground'); //resizes the game world to match the layer dimensions this.groundLayer.resizeWorld(); //create player this.player =, 250, 'player', 1); this.player.anchor.setTo(1,0.5); //add animation: this.player.animations.add('right', [0, 1, 2, 3, 4], 20, true); //enable physics on the player; //player gravity this.player.body.gravity.y = 4000; //the camera will follow the player in the world, 0, 3200, 320);; //move player with cursor keys this.cursors =; //create tap listener: this.input.onTap.add(this.onTap, this); }, update: function() { //collision, this.groundLayer, this.playerHitGround, null, this); if(this.player.body.blocked.down){"right"); //only respond to keys and keep the speed if the player is alive if(this.player.alive) { this.player.body.velocity.x = 200; if(this.cursors.up.isDown) { this.playerJump(); } } //restart the game if reaching the edge if(this.player.x >= {'Game'); } } }, playerHitGround: function(player, groundLayer) { //if hits on the right side, die if(player.body.blocked.right) { //set to dead (this doesn't affect rendering) this.player.alive = false; //stop moving to the right this.player.body.velocity.x = 0; //change sprite image this.player.loadTexture('playerDead'); //go to gameover after a few miliseconds, this.gameOver, this); } }, //onTap function onTap: function(pointer) { if(!this.player.alive) { return; } this.playerJump(); }, gameOver: function() {'Game'); }, playerJump: function() { if(this.player.body.blocked.down) { this.player.body.velocity.y -= 400; //this.player.body.acceleration.x = -50; this.player.animations.stop(); this.player.frame = 5; } }, render: function() { || '--', 20, 70, "#00ff00", "40px Courier");, 40, 24); } };
  3. mcolman

    large texture atlas performance

    Hi, just noticed my game has suddenly dropped fps quite dramatically (only on Chrome). I found when I reduce my texture atlas from 4096 x 4096 to 4096 x 2048 my frame rate is back up to 60. I'm a bit confused by this. My framerate only drops when I transition to a new screen which draws a few new sprites, but these sprites are still from the same texture atlas, so there is no additional memory used. The rapid drop of frame rate that continues to fall seems to be a symptom of texture thrashing, but my understanding of texture trashing is that it's caused by running out of texture memory and continually swapping textures on the gpu to draw the image. But in my case I'm not adding additional textures to trigger the frame rate decrease... I'm using the CANVAS renderer. Anyone have ideas? Cheers,
  4. Hi there, Im having some issues with performance when i render thousands of sprites. Currently having issues with loading around 20k sprites, but eventually plan on having more (maybe even up to 60k) around the map. I did some research and found this is a somewhat common issue but cannot get a clear and concise answer. I ran some chrome profiles on my game to see whats holding me back: here are my results. To be honest, I don't really understand what that information means other than 20k sprites is too much. (I have a fairly decent computer and its slightly choppy at 20k trees, at say 60k its very choppy) Also, when I say choppy, I mean like it looks choppy, my movement is still fine (to make the point that its not like the game loop thats lagging). Essentially I have 20k trees being placed around a very large map that's being rendered with a tileSprite. However, it's not the map size that is holding me back since the performance I get is very dependent on the number of tree sprites. The tree's have no physics enabled on them and are just rendered and placed in a group then never touched again. Here is a snippet from my create function and how i render the trees. for(var i = 0; i<20000; i++){ treeX = Math.round(Math.random()*(mapSize-1)); treeY = Math.round(Math.random()*(mapSize-1)); temp = position(treeX, treeY); createTree = game.add.sprite(temp[0],temp[1], 'tree2'); treeGroup.add(createTree); } The position function I called in the loop just gets the pixel location of the tree's based on a tile, as shown below: var position = function(col, row){ column = (33*col+1); rowFin = (33*row+1); return [column, rowFin]; }; Any ideas as to how i can beef up my performance? Any way I could not render the tree's until they are in view? (Kill then revive when seen?) Any tips are greatly appreciated! Side note (if its useful), right now all I have is the tileSprite background, 20k trees, and movable player sprite. Edit: Would creating a chunk system be a good idea? If so anyone have any idea where to start with the best way to make one?
  5. andreyko

    Phaser tweens perfomance on mobile

    Hi guys, In one of the methods of game object class I have following code which executed on object click: var tween1 = game.add.tween(this.sprite.scale).to({x: 0}, 100, Phaser.Easing.Elastic.Linear); var tween2 = game.add.tween(this.sprite.scale).to({x: 1}, 100, Phaser.Easing.Elastic.Linear); var tween3 = game.add.tween(this.shadow.scale).to({x: 0}, 100, Phaser.Easing.Elastic.Linear); var tween4 = game.add.tween(this.shadow.scale).to({x: 1}, 100, Phaser.Easing.Elastic.Linear); tween1.chain(tween2); tween3.chain(tween4); tween1.onComplete.add(function() { me.sprite.loadTexture('fruit-' + me.index); }); tween4.onComplete.add(function() { me.closed = false; me.level.onOpenBoxAnimEnd.dispatch(me); }); tween1.start(); tween3.start(); When having 4 of these object in the scene it performs nice, but 30 objects cause performance to be very low (notice that only one object is animated, not all 4 or 30). So maybe I'm doing smth generally wrong? Tested on 8-cores 1.7 HHz CPU.
  6. Hey guys, long time no see, eh? How are you all doing? I started digging up some old game ideas and playing around. I ended up with one where I create a field of hexagons as the game world. Unfortunately I am having performance problems when creating bigger maps and zooming out to show the whole map. Here is an example of what I am trying to do: Any idea how I could improve performance for this kind of game world?
  7. Hi, Players in my game leave trail. When update is called I'll make the trail image based on the current player position and add it to the trail group: let trailImg = state.make.image(playerX, playerY, 'trail'); this.trailGroup.add(trailImg); The game world might be big and after a while this group holds few thousand trail images. This leads to performance problems. The methods which take really long to execute are Phaser.Group.preUpdate, PIXI.WebGLSpriteBatch.render and PIXI.DisplayObjectContainer.updateTransform. How should I handle this?
  8. That's mah fork: This branch is also known as dev-experimental-geometry and pixi v4.1. It is the bleeding edge, and only about 5% of it was discussed as PRs in main pixi.js (like ) Demos: Best demo is outdated, though it will be converted to pixiv4 soon: (use mouse and QE) Changes: 1. 3d Transforms. We have them now. 2. Static transforms: enabled by default, new Transform2d(true), dont have to recalculate whats already calculated, increases performance for most-static 2d and 3d scenes. 3. Camera: lookPosition, lookRotation and lookEuler - camera looks at specific point 4. Camera: zIndex, zOrder - YES, THE PAIN IS GONE! Regardless of how will you group your sprite into containers, they will be sorted for rendering and interaction 5. Proxies - experimental, special for, I dont guarantee their work in other projects yet. Contributions: 1. This fork will have fast iterations, the only relatively stable thing will be API that specified in demos 2. Binaries are stored in pixi-bin and not pixi.js sources3. PR's should be made into 'master' and not some 'dev' nonsence Current projects: 1. conversion to pixi 2. Poker game with 3d cards. UPD. Babylon goes 2D according to this: Well, now PIXI strikes back!
  9. Hello, I've tried to code a FlappyBird-clone in phaser but i have performance issues on mobile devices. When I run the game everything works fine but when the player falls (because of the gravity), it doesn't seem "smooth" anymore and the game lags. I've run the game on a LG G3 and a Sony Xperia Z. thanks in advance var game = new Phaser.Game(288, 512, Phaser.WEBGL); var mainState = { preload: function() { game.load.image('flappy' ,'img/flappy.png'); game.load.image('bg' ,'img/bg.png'); game.load.image('btn' ,'img/btn.png'); game.load.image('ground' ,'img/ground.png'); }, create: function() { game.scale.scaleMode = Phaser.ScaleManager.EXACT_FIT; game.scale.pageAlignHorizontally = true; game.scale.pageAlignVertically = true; game.physics.startSystem(Phaser.Physics.ARCADE); = game.add.sprite(0, 0, 'bg'); this.ground = game.add.sprite(0, game.height - 112, 'ground'); game.physics.arcade.enableBody(this.ground); this.ground.body.immovable = true; this.player = game.add.sprite(,, 'flappy'); this.player.anchor.set(0.5); game.physics.arcade.enableBody(this.player); this.player.body.bounce.set(0.2); this.player.body.gravity.y = 500; game.input.onTap.add(this.jump, this); }, update: function() { game.physics.arcade.collide(this.player, this.ground); }, jump: function() { this.player.body.velocity.y = -200; } }; game.state.add('main', mainState); game.state.start('main');
  10. Hi, so first thing i'm new to this, 3d modelisation and babylon.js so i'm kinda of a huge noob, but anyway. I started to work on this demo It seems like i get very bad performance from firefox compared to chrome. Do you have an idea why ? you can try the demo on the playground or i hosted the demo on my website : Thx !
  11. Hello dear Forum, i have a Question regarding dynamic Asset Loading in Babylon.js. I was not able to find Information about this topic in the Documentation or the Forum (don´t slay me if I missed something ). So basically what I want to be able to achieve is: 1. User clicks a HTML-Button (for Example "Load Model") // Button should be outside of the Canvas if possible 2. Button calls Function with modelName as Parameter 3. Function checks if Model with modelName exists in some Kind of Library 4. If so, the Model gets Downloaded 5. Model gets rendered So, as far as i was able to find out, it is totally possible to pass Information from a HTML-Element to the Babylon Engine. But is it possible to download something at runtime (CORS is considered) that has never before been used inside the Project. The reason for this is that I want the Game to handle almost the whole "What shall i display?, Where shall i display it?, Which Components does the Object have" - Functionality dynamically without defining too much of it inside the Project. I hope I was able to give you an insight into what I want to achieve. Regards, Markus
  12. bQvle

    Great performance in V4

    Just want to put out our experience. (since there was a post with a different experience). We are developing a browser multiplayer game. and in v3 it was barely playable on regular laptops and office-pc's without "resonable" graphics cards. V4 actually doubled the performance of those lower-end devices, so when they would be running 30-40 fps, they are now pulling 80 fps which is more than the requred 60 to get the soft feel. I read that you improved the performance on mobile devices, and i wished it would have the same effect on lower end pc's. and it did! This is really important to us, because our game is probertly going to be played mostly from school computers, laptops etc. so thank you!. But, there's still alot of bugs, and I will keep reporting them on github, when i find simpler ways to reproduce them.
  13. In short, I've just recently updated the html5 app I'm working on to use the newest version of Pixi (v4) recently. It looked nice & all and it basically didn't break anything. (Well, except for a ColorMatrixFilter because v4 for some reason has a padding attribute set as default to 4.) Anyway, I was really happy with the new promises such as WebGL renderer mobile optimizations and I quickly compiled my project (using to an Android apk to test. Well saying that it ran slower is an understatement. Gameplay parts where the previous Pixi v3 provided an estimated 50-60 fps, this struggled to get 20-30. I made some other changes to the code so I wasn't sure if it was the update's fault at first, but I quickly reverted to v3 and regained the old and much better performance. Some info: - I'm probably not using any SpriteBatches - I'm initializing the renderer as this: renderer = new PIXI.WebGLRenderer(window.innerWidth, window.innerHeight); - I'm drawing a lot of Sprites with different sizes at the same time, maybe 100 at max - A lot of the above Sprites are visibility/alpha toggled many times during gameplay, but I do not store them outside the render area - I'm using manual scaling on a lot of Sprites individually, I just rarely scale a container Well, that's all I could think of right now. The strange thing is that v4 actually seemed to run faster on desktop (Firefox).
  14. How could BabylonJs possibly be faster ? or Why is BabylonJs slower than what it could be ? What needs to be done. Any area we can help to make this engine faster ? Give us concrete directions so that we can help. I know BabelJs itself is not slow. It does nothing by itself. However, I would like also to know: what are the best practices to take full advantage of BabylonJs speed. This demo is really slow : Why is it so slow, and what can we learn from it ?
  15. Hi guys I'm working on a game developed with phaser.JS (and phonegap), and i'm facing a surprising problem. FPS is pretty good (it's between 55 and 60) but the avatar moves are not smooth. So i guess it's caused by the use of phaser feature. You can see the problem on the video here : Have you ever met this problem ? Do you have some idea to improve that ? Thanks for your time ! Dorian
  16. Hi everyone ! Remember "Macromedia Flash" ? It is a dead technology that used to allow total freedom at the expense of HUGE computation. It has been abandoned... As much as I loved the possibilities at the time, fact is, running a somewhat simple game within your browser would require all the power and memory your computer could give, no matter how powerful, and in my humble opinion, I'm happy it has been discontinued, I HATED the way my -powerful then- MacbookPro would start to spin its fans at full speed, full noise, full heat. Now I'm a beginner in trying to master BABYLON.JS, and in my first experiments, I notice the fans of my brand new super-spec MacbookPro behave sorta the same way, soon after loading my scene, the fans start to turn fast and loud, Babylon.js pushes the computer to high temperature. And I don't want my beloved Babylon.js framework to end up like Flash !!! lol Checking demos on the official babylon.js site, I notice some of them render well without making the fans turn on (ex : but others demand too much (ex : ###So, trying to make it short, what is the good way to go in order to keep the CPU usage low ? (like in the Sponza demo)### -Textures: -What is the recommended size ? -How much CPU does it take to use bump, specular, etc... on top of the Diffuse one ? -Lights: -Is there dynamic lighting on an optimized scene ? Of which kind ? how many ? How to bake static lighting ? -Programming: -Is there a way to writing javascript code that would be better than another ? -example: Is calling "scene.getMeshByName("")" more demanding than just "mesh" ? -how does the "scene.registerBeforeRender()"should be handled ? -example: Is it a problem if calling "for (var i=0;i<scene.meshes.length;i++)" or "for (i=0;i<scene.textures.length;i++)" multiple times rather than just one time ? -Is there a way to handle/optimize memory ? Well this is just a few questions this topic can bring up ... I hope people participate with questions and answers, we can decipher the magic behind perfect programming together !
  17. staff0rd

    Base CPU usage when idle

    When I open this phaser example on Chrome, Windows 10 on a Surface Pro 3 (i7, 8GB RAM), my CPU usage jumps from about 2% to about 25% and stays there. This leads me to believe that running phaser will at a minimum use 20-25% of my CPU, and that's before I add anything like animations and sounds, physics, and anything in an update() method. Running this PIXI example shows CPU pegged at about 11%. I understand that Phaser is providing much more than just rendering, but I can't help think that when it's using at a minimum double the CPU of the renderer when idle that something is off. Is this what everyone else is finding? Is this just the cost of using Phaser? There are other threads that have optimization tips regarding limiting the amount of tweens and sprite reuse and physics etc, but are there any tips folks can share for optimizing when none of extra features are being used such as in the phaser example above?
  18. At work, we've had an outsourced team create a game for us; they chose Phaser even though neither of us had any previous experience, but for the most part that seems to have been a good choice - complete, good docs and examples etc. But there is this one issue: on first play of animations, they freeze up. The team tried to solve it in what I think is a reasonable way - pre-play all the animations once during a loading screen. However, doing this is somehow so taxing that even simple CSS animations also freeze (multiple browsers, devices, operating systems) creating a jarring effect for the player. It also takes so much time - up to 5 seconds even on desktop computers - that just having a black screen also feels bad on many devices. The thing is that it's not even that many animations, maybe 25-30 in all and most of them not that complicated. On one super powered graphics machine the freeze is down to less than half a second, but the machine itself does not even register it, meaning it's not (probably) a CPU issue or so, but something blocking maybe? I've tried to search google, stackoverflow and these forums but I don't really find anyone else having this problem, which leads me to suspect that we are simply doing something wrong. The team is new to Phaser and I have myself not even written any games in it, though I can read the code. And frankly, them being outsourced makes them tend to declare things being "unfixable" a bit early at times... I could post some code, but basically it's doing "world.create()" adding all the animations, and doing "play()". Instead I would like to ask if there is a common/best practice or, otherwise if this is so weird that our animations must be broken from the start or any other reason you could think of. What exactly is Phaser doing on first play, is it unpacking the image to memory or something? Is this something that could be partly or wholly done beforehand in a build? Would be very thankful for any clues - and I do apologize for the somewhat messy question, it's kinda hard asking third party questions. Thanks!
  19. I'm currently looking into JavaScript frameworks for a simple cross platform 2d game and mainly concerned about mobile. While investigating PhaserJS I've noticed performance issues when moving sprites although it shows consistent 60 fps in the browser. The movement is not consistent, not fluid, feels choppy. Tested on Chrome (48), Firefox (44) and MS Edge most of the time it was choppy with occasional smoothness. My specs are: 4th generation i7, 16gb ram, GPU HD 8800m. What's the issue here, can it be solved or JavaScript frameworks are not ready for mobile development and better to go native to achieve smooth 60 fps sprite movement? Please see the demo here: The code from the example above: // This example uses the Phaser 2.2.2 framework // Copyright © 2014 John Watson // Licensed under the terms of the MIT License var GameState = function(game) { }; // Load images and sounds GameState.prototype.preload = function() {'bullet', '/assets/gfx/bullet.png'); }; // Setup the example GameState.prototype.create = function() { // Set stage background color = 0x4488cc; // Define constants this.SHOT_DELAY = 100; // milliseconds (10 bullets/second) this.BULLET_SPEED = 500; // pixels/second this.NUMBER_OF_BULLETS = 1; // Create an object representing our gun this.gun =,, 'bullet'); // Set the pivot point to the center of the gun this.gun.anchor.setTo(0.5, 0.5); // Create an object pool of bullets this.bulletPool =; for(var i = 0; i < this.NUMBER_OF_BULLETS; i++) { // Create each bullet and add it to the group. var bullet =, 0, 'bullet'); this.bulletPool.add(bullet); // Set its pivot point to the center of the bullet bullet.anchor.setTo(0.5, 0.5); // Enable physics on the bullet, Phaser.Physics.ARCADE); // Set its initial state to "dead". bullet.kill(); } }; GameState.prototype.shootBullet = function() { // Enforce a short delay between shots by recording // the time that each bullet is shot and testing if // the amount of time since the last shot is more than // the required delay. if (this.lastBulletShotAt === undefined) this.lastBulletShotAt = 0; if ( - this.lastBulletShotAt < this.SHOT_DELAY) return; this.lastBulletShotAt =; // Get a dead bullet from the pool var bullet = this.bulletPool.getFirstDead(); // If there aren't any bullets available then don't shoot if (bullet === null || bullet === undefined) return; // Revive the bullet // This makes the bullet "alive" bullet.revive(); // Bullets should kill themselves when they leave the world. // Phaser takes care of this for me by setting this flag // but you can do it yourself by killing the bullet if // its x,y coordinates are outside of the world. bullet.checkWorldBounds = true; bullet.outOfBoundsKill = true; // Set the bullet position to the gun position. bullet.reset(this.gun.x, this.gun.y); // Shoot it bullet.body.velocity.x = this.BULLET_SPEED; bullet.body.velocity.y = 0; }; // The update() method is called every frame GameState.prototype.update = function() { // Shoot a bullet if ( { this.shootBullet(); } }; var game = new Phaser.Game(848, 450, Phaser.AUTO, 'game'); game.state.add('game', GameState, true);
  20. Hi all, I have picked back up a project I started a while back and have run into some issues. I decided to upgrade from 2.2.2 to 2.4.4 assuming that all of the effort and improvements will be a benefit. I learned that the scaling API had changed a little, so I fixed my code to use the appropriate methods, discarding the deprecated ones. That eliminated the exceptions I was seeing. Unfortunately, though the game now runs, I have found that my FPS has dropped from around 55-60 to 5-15. I can toggle between these two versions of Phaser 2 and instantly see the difference in FPS. Everything else about the game looks the same and nothing is being reported in the logs. The only clue I have is that the drop in FPS occurs when the tilemap is scrolling. My game uses the following APIs/functionality: Tilemaps (made in Tiled), collisions set using, 4);Audio (mp3)Tried out both Canvas and WebGL rendering (no perceptible difference)Arcade physicsI'd greatly appreciate any tips/gotchas I should be watching for. Is there some flag I should be setting to correct the scolling problems? Thanks!
  21. Hi there, I have a problem with game mechanics on mobile devices. Mechanics connected with timers. For example, I have a physics character (using p2 physics), which fly up during some time, then falling down. So the problem is my character fly on different heights on different devices. I think it's a problem with performance and game fps. I've tried to connect mechanics with game.time.fps - but it's don't help. Maybe anybody have some ideas what is going on? This is the part of code for example: function fly() { if ( < force + 50/*I've tried to add fps here, but no effect*/) { = -2; } else if ( > force - 50) { = 2; } } var timer1 =; timer1.repeat(myTime, 3, fly); timer1.start(); I use phaser 2.4.4
  22. s4m_ur4i

    desired FPS, affect performance ?

    Hello, not getting it out of the doc. when I set: game.time.advancedTiming = true; game.time.desiredFps = 50; My Game runs with 50 FPS (instead of 60). That's what I intended to do. Just because I do not need more FPS. So does this REALLY affect performance? When doing much calculation and drawing, is lagging reduced by 50FPS (desired) then 60? kind regards
  23. Hello everyone, I have made a little test by putting a stage and a graphic via pixi.js, now I have applied the tiltshift filter (which is more than awesome to have!). The performance hit is down to 40 frames on latest MBP fully upgraded. in latest Chrome available and node-webkit as well. This makes the further developement , using the filter, and pixiJS - impossible. So is it known to be slow using just one filter? or is it this filter specially... really need it, considering changing to native then webGL. here is the example code: (just for testing) // create an new instance of a pixi stage var stage = new PIXI.Stage(0x66FF99); // create a renderer instance. var renderer = PIXI.autoDetectRenderer(1280, 720); // add the renderer view element to the DOM document.body.appendChild(renderer.view); // create a texture from an image path var texture = PIXI.Texture.fromImage("assets/test2.png"); var texture2 = PIXI.Texture.fromImage("assets/test.png"); // create a new Sprite using the texture var bunny = new PIXI.Sprite(texture); var test = new PIXI.Sprite(texture2); // center the sprites anchor point bunny.anchor.x = 0.5; bunny.anchor.y = 0.5; bunny.width = 2076; bunny.height = 1318; bunny.position.x = 800; bunny.position.y = 100; test.x = 500; test.y = 500; test.width = 200; tiltshiftmode = new PIXI.filters.TiltShiftFilter(); tiltshiftmode.blurnumber = 120; tiltshiftmode.gradientBlur = 1400; //tiltshiftmode.start = 0; //tiltshiftmode.end = 720; tiltshiftmode.padding = 20; var World = new PIXI.Container(); stage.addChild(World); World.addChild(bunny); World.addChild(test); stage.filters = [tiltshiftmode]; document.addEventListener('keydown', onKeyDown); function onKeyDown(key) { key.preventDefault(); // W Key is 87 // Up arrow is 87 if (key.keyCode === 87 || key.keyCode === 38) { World.y += 14; } // S Key is 83 // Down arrow is 40 if (key.keyCode === 83 || key.keyCode === 40) { World.y -= 14; } // A Key is 65 // Left arrow is 37 if (key.keyCode === 65 || key.keyCode === 37) { World.x += 14; } // D Key is 68 // Right arrow is 39 if (key.keyCode === 68 || key.keyCode === 39) { World.x -= 14; } } //stage.filters = [tiltshiftmode]; requestAnimationFrame( animate ); function animate() { stats.begin(); stats.end(); // just for fun, lets rotate mr rabbit a little test.rotation += 0.05; // render the stage renderer.render(stage); requestAnimationFrame( animate ); } regards, Sam
  24. Gazanfer

    Yet another bunnymark

    I was looking for a good bunnymark example in phaser, but couldn't find a decent one, so I wrote one myself: There are two versions: Basic: all sprites have same scale, angle, rotation Custom: all sprites have random scale, angle, rotation Two versions have the same code, but just different options set. - Click on the game to create bunnies. (Well, technically phaser-dudes) - There are options in preload to customize it. - All sprites are respawned from their original spawn point after they slow down. It was good practice for me, but now I don't know what to do with it, so I'm just putting this here, in case anyone has a use for it. Also all feedback is welcome.
  25. Hi everyone! First things first, a disclaimer: I'm French, I read a lot in english but I rarely have the opportunity to write or speak in English, so forgive me for that . I'm a beginner in the world of gamedev and Phaser in particular. I've already tried EaselJS (CreateJS) a couple years ago for a little game prototype I made using hand-made tilemap (based on a simple two dimentional array). I wanted to try something more robust this time, I searched across the Web for a good gamedev framework and stumble upon Phaser. It seemed to me the best tool to go, so here I am! It's my first time using Tiled for creating my tilemaps. I've use the excellent roguelike tileset from KenneyNL (kudos to him! ). I've set up a simple sample map (to try a few Tiled features), followed several tilemaps examples provided on phaser's website. You can check the layers I'm using : Note that the collision layer contains only a tile (a red/brown dot) that I'm currently using as a visual marker (there's no collision implemented yet). My tileset is 16x16. The map is 200x200 tiles. I'm exporting it as JSON, layers data as CSV. I'm also using states (which is really a cool feature that I was missing with EaselJS). I've set up a jsfiddle hosting a stripped version of my source code with a few comments to explain the logic. There's also a fiddle with the JSON file of the tilemap if it can help. I'm using a deadzone for my camera, and added a visual representation of this deadzone. Everything is correctly loading, the map and all the layers are displayed accordingly, with the visual deadzone and my character (I'm on Ubuntu 14.04 x64 with a GTX 660 and using the latest Google Chrome version). Everything looks fine, I can move my character within the camera's deadzone while the camera is not moving (which is what I was looking for). I haven't set up a FPS debug but I feel that the framerate is stable and should be around 60fps. It all feel smooth, not shattered at all. So far so good. But the issue is coming when the deadzone is reached and that the camera begin moving to follow the player (e.g. when I'm moving far right), as follows : At this point, I feel a huge framerate drop! Any movement feels shattered, jerky. But as soon as the character gets back in the deadzone and the camera is moving no more, everything goes back normal. I've tried with another map of 100x100 and 50x500 tiles, with just one layer and a tileset of 4 sprites, and the results were the same... I think I'm missing something, or I must have done something wrong. I cannot believe that the problem would come from Phaser not correctly supporting tilemaps! My goal is to build a very simple stripped-down version of a Harvest Moon-like prototype, just for fun, for my pleasure. So I really need to work with tilemaps. I'm sad that a cannot acheive this with Phaser . Sam Vieten (SamTheMighty on these forums) gave me some advice on Twitter, about using a plugin (englercj/phaser-tiled) to optimize tilemaps implementation of Phaser. Is it really necessary to use this plugin? It's a bit of a shame if Phaser cannot handle tilemaps alone ... Anyway, thanks for you help!