Jump to content

Search the Community

Showing results for tags 'memory management'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 6 results

  1. Hello there, first post! I'd like to ask one thing that was on my mind for a very long time throughout the course of my online multiplayer game's development. Imagine there is a large mansion and each distinct location/room of that mansion is a large JPG background image (2048x2048 or even 4096x4096 depending on room size, or along those dimensions), basically using a similar principle like what some games used prerendered backgrounds/illustrations for locations. I want to know if there are any serious issues with this approach memory-wise, and I'd like to know how I could optimize these gigantic maps, how to go about loading/unloading them, because for now I just use a variable in which I store a PIXI.Sprite for the background which changes its texture when entering another map. I also use the .from method rather than preloading. I haven't done any crazy tests except trying to load 14 different backgrounds of 4096x4096 size at once and display them on the stage just to test things for fun, to which I got 1500MB or so memory in Chrome task manager for the GPU process, but essentially I'd like to know whether there is something I should be aware of regarding any overhead from this. Characters/entities are done with skeletal animation, but I don't think it's really that relevant. To be clear, I want to make sure if I should free memory in some way when changing locations, and when I should free it, considering there will be probably dozens of rooms/locations of images of large sizes. Any help/insights are welcome.
  2. wkd-aine

    FireFox Lag

    Hi, I am working on a game where the hero runs through different levels and collects rewards, and have got it working really smoothly for Chrome on Mac, however when testing on FireFox on Mac or Windows it goes really laggy. At its most simple, the game uses a tilemap (70 x 15), which also handles the objects, the objects are split into various classes, and there are two background images (originally for parallax, but this has been disabled while we try and resolve the lagginess). The hero and a couple of other sprite objects have animations, but again these have been temporarily disabled, even with all of this there is still significant lag when running and jumping, its a reasonably large game so not really sure what code would be helpful without causing more confusion. I've tried several different approaches now, with no success. I have tried changing the 'renderer' for the game, the best result so far is CANVAS, not sure if it makes any difference but the physics library is P2, and I am only pre-loading the assets required for the current level. I have tried killing sprites, setting their visiblity to false, only dumping out a subset of objects, and none of it seems to affect anything. I have done some investigation, and the 'requestAnimationFrame' function seems to get called alot but the garbage cleaner not so much. I had a look at pixi.js and there is an issue from which looks to be similar but not the same. Has anyone else had this issue, know where I should investigate next? Many thanks, Áine
  3. In Firefox the following code seems to eat memory very fast. You can try directly from http://phaser.io/examples In Windows Task Manager I can see memory constantly grows. var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update }); function preload() { game.load.image('mushroom', 'assets/sprites/mushroom2.png'); } function create() { var sprite = game.add.sprite(200, 200, 'mushroom'); sprite.tint = Math.random() * 0xffffff; } function update() { game.state.restart(); } To be honest I'm not so skilled about garbage collection and how Firefox deals with memory, but I'd expect memory to be cleaned every time the state is restarted. So, is there anything wrong with this code? Thanks is advance, Luca
  4. Hi, I have a phaser game and i'm using cocoon js to port it to android and IOS. unfortunately in IOS, since I am loading many images, it leads to a memory low warning and the app crashes. How do i delete the textures from the memory? Is there any way to clear the memory? I have tried cache.removeImage, cache.destroy and textureImage.destroy but doesnt seem to help much. Any help would be greatly appreciated. Thanks
  5. Hello! i'm creating a bullet-hell type game in phaser. When alot of bullet sprites are being created ingame (~10 sprites/second, size = 5x5 px), i get consistent lagspikes, and graphic bugs caused by the lag... Is this normal? Anything i can do to increase performance? Here's the code to create bullet sprites: ...this.bulletGroup = game.add.group();this.bulletGroup.enableBody = true;this.bulletGroup.physicsBodyType = Phaser.Physics.ARCADE;this.bulletList = []...this.timeCheck = game.time.now; this.shoot = function(bulletSpeed, bulletRate, bulletTexture){ if (game.time.now > this.timeCheck + bulletRate) { var bullet = this.bulletGroup.create(this.sprite.x, this.sprite.y, bulletTexture); bullet.anchor.setTo(0.5,0.5); game.physics.arcade.moveToXY(bullet, player.sprite.x, player.sprite.y, bulletSpeed); this.bulletList.push(bullet); this.timeCheck = game.time.now; }}; this.shoot_update = function(type, phase){ for(var i = 0; i < this.bulletList.length; i++){ this.bulletList[i].body.x += Math.sin(phase*0.1)*5; }};// this.shoot and this.shoot_update are called in update()
  6. Hello, I finish making a simple game today with Phaser: http://spacerobot-html5.bitballoon.com/ I found that in some desktop or mobile device, the game lag a little bit after I press 'PLAY AGAIN' button. I think this is because I have to clear out some variables but I'm not sure how to do this in Phaser. So my question is: Does anyone has good tips for memory management / clear out variables data in Phaser? Most elements I used in my game is group, sprite, text, and sound.
  • Create New...