Search the Community
Showing results for tags 'laggy'.
-
I use sprite sheets to take care all the animations in a web game. I have some really big sprite sheet with a size of 14450x5406 and the game will be so laggy when I'm trying to render this into the stage. Since it is a response time vary application which require a no-lag performance, I decided to split those sprite sheets into multiple sprite sheet such that each of them with a size of 2048x2048 after I've read some post as below: The performance is better than before in the first play of the animation. Let say if the application will 100% chance become laggy in the previous, it's just 50% now. However even the animation is smooth in the first play, It'd become laggy if I gonna render it again after 2-3 minutes(It's still smooth if I'm rendering it again immediately) . So splitting the large sprite sheet into multiple sprite sheets may helps a little bit on laggy issue but still the problem exists and I couldn't know the reason. I play all these huge size animations right after another animations(small size): By laggy I am meaning that the Chrome is like totally freezing. I read some posts and some of them said that it's because GPU can't rendering anything while uploading texture into GPU. So I've posted another question in the past: So I prepared all the animation sprite in a loading screen and turned off the GC with the following code: But the same thing is happens. The Chrome is freezes every time when playing the animation with sprite sheet of large size(freezes happens on entering onComplete), not on the small one. I would like to know any possible reasons and suggestions about this issue. If this cannot be solved in programming level, could I resolve this in hardware way? like buying a better graphic card with more video memory?
-
Hey, I'm bulding a Towerdefensgame and my minions are moving very laggy. Im using tweens. Always if a tween is complete the next tween will be added. The Problem is, that the way of the minion always can be changed, so I have to set the new tween always if the minion reached the new field. Also the first wave is more "smooth" than the other waves.. Phaser-Version: v2.6.1 Game-Demo: http://darkfluppi.de/td/ Code for moving the minions: function moveDatMinion(minion) { if (!minion.data.moving) { minion.data.moving = true; var diff = { x: (minion.width / 2), y: (minion.height / 2) }; if (minion.data.fieldsSlowed > 0) { minion.data.fieldsSlowed--; } else { minion.data.minionSpeed = minion.data.minionFixSpeed; minion.data.slowed = false; } var pos = { x: Math.floor(getPosition(minion.position.x - 32)), y: Math.floor(getPosition(minion.position.y - 32)) }; var posCoord = { x: minion.position.x - 32, y: minion.position.y - 32 }; if (!(pos.x === 11 && pos.y === 5) && minion.alive) { var way = { u: 999, d: 999, l: 999, r: 999 }; var goto; if ((pos.x - 1) > -1) { way.l = fieldDistances[pos.x - 1][pos.y]; } if ((pos.x + 1) < 12) { way.r = fieldDistances[pos.x + 1][pos.y]; } if ((pos.y - 1) > -1) { way.u = fieldDistances[pos.x][pos.y - 1]; } if ((pos.y + 1) < 12) { way.d = fieldDistances[pos.x][pos.y + 1]; } if (way.u >= 0 && way.d >= 0 && way.l >= 0 && way.r >= 0) { var min = Math.min(way.u, way.d, way.r, way.l); if (min === way.u) { goto = { x: (posCoord.x) + minionOffset.x, y: (posCoord.y - 64) + minionOffset.y }; } else if (min === way.d) { goto = { x: (posCoord.x) + minionOffset.x, y: (posCoord.y + 64) + minionOffset.y }; } else if (min === way.r) { goto = { x: (posCoord.x + 64) + minionOffset.x, y: (posCoord.y) + minionOffset.y }; } else if (min === way.l) { goto = { x: (posCoord.x - 64) + minionOffset.x, y: (posCoord.y) + minionOffset.y }; } } if (!minion.data.tween) { minion.data.tween = game.add.tween(minion).to(goto, (minion.data.minionSpeed / speedUp), 'Linear', true, 0); } else { var nextTween = game.add.tween(minion).to(goto, (minion.data.minionSpeed / speedUp), 'Linear', true, 0); minion.data.tween.chain(nextTween); minion.data.tween = nextTween; } // minion.animations.play('walk'); minion.data.tween.onComplete.add(function () { // minion.data.tween.stop(); minion.data.moving = false; moveDatMinion(minion); }, this); minionOnField[getPosition(goto.x - 32)][getPosition(goto.y - 32)] = 1; if (minion.data.lastPos) { minionOnField[minion.data.lastPos.x][minion.data.lastPos.y] = 0; } minion.data.lastPos = pos; console.log(pos); console.log(goto); } else { stopTweensFor(minion); } } } Does someone has any ideas for a more smooth "walkanimations"? Greetings
-
I really liked Phaser and wanted to use it for game development but I find it to be impossible because of this issue. I'm using Chrome primarily and even with the most basic examples using just body.velocity to move a sprite around it is choppy at times. I can't figure out when and why it is choppy, but basically 30% of the time or so, the sprite is just moving choppily even at 60FPS. The issue also seems to be replicable when I switch back and forth between the tab the game is on and another random tab. I also encountered another issue where the game would just run at 30FPS for no reason and then suddenly start running at 60FPS. I would love to use Phaser but these issues make me want to consider a traditional desktop environment, are there anyone else with these issues that might have a fix? I know about the "forceSingleUpdate" fix but I don't want any users to suffer potential physics calculation issues. I would also like to note that my computer shouldn't be the issue, but my specs are: i5-2500k @ 4.6Ghz, 2x Radeon HD 6970 (4GB VRAM total), 8GB DRAM. Running on Windows 7 on an Intel 128GB SSD.
- 6 replies
-
- body.velocity
- 30fps
-
(and 5 more)
Tagged with: