Search the Community

Showing results for tags 'fps'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

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

Found 90 results

  1. Hi, In my pretty beefy game (lots going on) i get 55-60 frames on my computer with a 60hz monitor. However, when I launch it on another computer (much more power than mine, and with a 144hz monitor) I only get 30-40 frames? Its affecting my game because the update cycle is slower than it should be. When I run a jfiddle on those computers just drawing the fps, they receive their monitors refresh rate as the fps almost perfectly. The chrome is up to date and am using auto/phaser.WEBGL mode. Suggestions?
  2. Hey everyone, So Im new to game development, although Im a full stack JS dev for general sites and apps. I started getting into canvas animation and now Im here trying to learn some game animation stuff. My question is this: Do you generally do just about all animation in the game loop with requestAnimationFrame()? Or can you simply have renderer.render(stage) called in the game loop while outside of it you use GSAP or some other tweening mechanic to change the positioning props on objects/sprites? Iv tried it and it works, I just would like to know if its dumb or nonperformant. I also tried using my regular js tweening library to call `renderer.render(stage);` in its update callback and it looks the same (im just doing a simple animation generating snow-like particles that float down). I know that the supported game loop in PIXI has stuff for velocity and whatever but I really like my animation library's (http://animejs.com/) easing and elasticity options. Will calling renderer.render(stage) in the game loop while tweening outside the loop still be 60FPS? Or do I need to be updating in the game loop? If I have to do it in the game loop, does anyone have any tips/references for easing and all of that? Because I dont want to have to write my own easing functions to update in the game loop (and I suspect most people arent), and rather use an animation API for that. Im also brand new to PIXI and maybe it has its own easing and whatever that works inside the game loop. Cheers
  3. PLEASE DELETE: I apologise to the PixiJS gang. It is not the frightenly fast Pixi that is causing the low fps, it is the sound. My sound works in Chrome, Edge, Internet Explorer, but not Firefox. It slows the whole system to a snail's pace in Firefox only. If anyone knows a good sound library which can play sound on keybutton press immediately with no delay or gaps, please let me know. I am working on a game which is nowhere near completion yet, so I cannot give you a running example, however, I can say what I am doing. I have 5 cropped sections over the screen, each showing a different representation of the scene. Eg the user's main view, a mini-map showing the user's relation to others, etc There are several text areas giving the user important info. About 50 bits of text which need to be aligned, due to them needing to be in columns. I only have about 30 images in each scene that are moving. In the wonderful chrome I am getting 60fps. In edge I am getting 45fps, but it has the known keyboard input issue which might put some users off using edge. However in Firefox I am getting a terrible 6fps. Has anyone experienced such a thing before? Is there something in Firefox that needs to be turned on or something? UPDATE: I have literally removed most things except the very base animation (24 small 25x25 pixel sprites and 2 large 2000x2000 background sprites) and I am still only getting 10fps on firefox. There must be a firefox setting that is not right on my machine, or I am setting things up incorrectly somehow that firefox does not like.
  4. Hi, I am trying to make a game for mobile, how can I test my game in terms of its performance, I am trying on devices but it takes my time a lot, testing the game every time. And one other question is what do you think about the phaser's future? I mean, nowadays I read about some performance issues when running phaser games on mobile. Should I choose any other programming language to make mobile games? I like phaser but if it will not good for mobile, I will have to pass any other programming language like java, instead of javascript.
  5. hyyy guys, is it possible to get the same Fps on mobile as PC using BJS engine
  6. Hi, I want to display my webcam content on my scene. In order to do this, I tried to create a layer set in background on which I apply a video texture. I passed a video DOM element to this texture. This video has a stream for source that is obtained from the getUserMedia promise. It works but rapidly the FPS drop and I don't know why. Maybe the size of the video is too large, maybe I provided the wrong parameters to the texture. I don't have any idea but it causes an issue. Here is a PG for testing : https://www.babylonjs-playground.com/#FF3BPV Thanks,
  7. Sup guys, I'm back and once again working on my side project now that school is out. I recently rewrote some of my server sided code, specifically the pieces that handle anti-cheat. One problem I ran into is my anti speed hack mechanism. Prior to my rewrite (which was more of a cleanup) the way I handled movement on the server was I allowed the client to move however it liked. It would then send its new position (after ever frame) to the server. The server would then check to see how far the client moved (based on its last position which is saved on the server) and made sure that the client didn't move more than a certain amount of pixels each frame. If it moved legally, then it's "last" position would be updated with the new position the client provided and the client legitimately moved. If it moved too fast, the clients old position is kept as its server position, ensuring that sure the client isn't speed hacking (at least on the server side, can't stop the client from moving anywhere really). Anyway, that's how the system works, and it works great, until I ran into the problem of different frame rates (at least I think that's what's causing the issue). After the rewrite of this system, clients are moving too fast to the server, and I think it could be because of slower fps'? Like Ill move right, but now instead of moving say 5 pixels per frame like the pre-rewrite code would detect, im getting 6, and 8 and 15 and other higher random numbers, as if the server was missing some calls. Regardless of the cause, I was wondering, how do people usually handle movement on servers. Am I going about this correctly? Any suggestions? What other ways can I verify a player isn't teleportating or speed hacking? Thanks.
  8. Hi, Just to report that on the example given in the documentation: http://www.babylonjs-playground.com/#OWCCR#8 Increasing the number of primitive slows down the fps, but when reducing that number fps stays low even after dispose(). I don't know it if was reported before, and I did not remember this behavior last time I checked this example... @Nockawa
  9. Hi All, I've done mostly top-down and sidescroller games in the past, so I thought I'd experiment with something different. I made a wild west themed FPS using a raycasting engine called gladiator and assets from sparklinlabs. Click here to play the game. The game is still very much a work in progress. I would love some ideas on how to make the game better. Let me know if it's too easy or difficult. If the levels are too long or short, etc. Also, if you'd be interested in designing a level, let me know. It's fairly straight forward using this wall pack in Tiled. Cheers, DarkwallLKE
  10. hi guys I found out low frame rate slow down physics update too. (in arcade & p2 physics) for instance, in same gravity settings, results are different depending on frame rate. (body hits the ground more faster in the higher frame rate environment) I don't know much about game engine or framework, but I think it is more appropriate that physics updates by elapsed time, not by frame count. I came to think Phaser is really well made framework after looking into examples on official websites, and I don't think Phaser creator didn't think about this issue. I googled about this issue, but couldn't find any answers that suit on me. (probably because of my poor english) I would be appreciated if you give me any clue.
  11. Hi guys, my game was working fine, fluently, etc and I was expanding it. It's platform, where a lot of bullets are flying, also many spikes hang from the upper platforms. Now, when I add more spikes and more bullets, when the turrets shot them, the game drastically slows. Is too many object there? And what can I do to make it faster again? Creating spikes: function create_spikes ( x , y , number, angle, vertical) { for (i=0; i < number; ++k, i++) { if ( vertical != 'yes' ) { spikes[k] = game.add.sprite((x+i)*16, y*16, 'kolec'); } else spikes[k] = game.add.sprite(x*16, (y+i)*16, 'kolec'); game.physics.enable(spikes[k], Phaser.Physics.ARCADE); spikes.enableBody = true; if ( angle==180 ) spikes[k].body.setSize(12, 8, -14, -16); else spikes[k].body.setSize(12, 8, 4, 8); spikes[k].body.allowGravity = false; spikes[k].angle=angle; } } //ENEMY BULLETS ebullets = game.add.group(); ebullets.enableBody = true; ebullets.physicsBodyType = Phaser.Physics.ARCADE; game.physics.enable(ebullets, Phaser.Physics.ARCADE); ebullets.createMultiple(50, 'enemy_bullet'); ebullets.setAll('checkWorldBounds', true); ebullets.setAll('outOfBoundsKill', true); //ENEMY SHOOTING function enemy_shooting (enemy,type,direction) { if ( type == 'mortar' && enemy.alive==true) { nextFire = game.time.now + fireRate; var ebullet = ebullets.getFirstDead(); ebullet.reset(enemy.body.x-20, enemy.body.y-20); ebullet.body.velocity.y=-200; if ( player.body.x <= enemy.body.x ) ebullet.body.velocity.x=-200; else ebullet.body.velocity.x=200; }
  12. For the life of me, I can't find a setting which adjusts camera movements with current frame rate (automatically adjusting speed, inertia, turn rate). Camera which either warps or bogs down depending on where you look at is simply unacceptable in any application, let alone games. Maybe it's too obvious but in any case I need some help here.
  13. Hello all! I'm currently working on a website that has a Babylon.js scene as it's background, and also includes a game created with Babylon.js. I'm trying to keep the scene as simple as possible - I'm only using planes and their clones - and I'm testing on a 2013 ASUS laptop where I'm getting constant 60FPS. But of course, there are users out there with lower graphics performance, and I'm trying to find a way to test and handle that. In my current setup, I monitor the FPS in the first ten seconds, and if it averages under 45FPS, I call scene.dispose(); and set a cookie so the scene won't be loaded next time. Is there a better way to do this? Thanks in advance! BTW, here a video of the submarine-themed game in progress :
  14. Running the instance Demo both from the babylonjs.com website and locally: I see potential FPS in debug overlay showing ~60 FPS. Actual FPS is ~15 FPS. I tested this in both Chrome and Firefox on both Linux and OSX. I tried removing various parts of the code. Reducing instance count to 10, removing collision tests from all objects. The FPS rises somewhat but the problem persists. I tried checking out the v2.5.0 tag in case something in latest was causing the problem. The problem persists. I think this may be due to BabylonJS depending soley on requestAnimationFrame for update/draw logic (which creates several problems actually, but I created a separate post to address that). I assume there must be something wrong in the update logic, but I am new to BabylonJS. Is anyone else seeing a low FPS number on the babylon website? See attached screenshot where render and frame are only 5ms and 8ms (potential FPS is 128) yet FPS is only 40!
  15. I'm new to BabylonJS but one of the first things I notice is that almost all of the demos run slow (20-30 FPS is typical) on the same machine that is running three.js stuff fast. It seems like update/draw is not being called as often as it could be, as according to the debug overlay update and draw frame time is only 10ms in these same demos (so potential FPS is 100). Additionally I think BabylonJS suffers from timing flaws that other JS engines do, see this article: https://www.isaacsukin.com/news/2015/01/detailed-explanation-javascript-game-loops-and-timing In three.js I am using Mainloop.js to control update/draw timing logic. I think I would like to do the same in babylon.js, unless I am missing something. To expand further, physics should ideally be at a 30hz update rate in my game, but draw calls and other update logic should be at 60hz. Also update logic should be called at a very consistent 60hz, where draw can vary a bit from 40-60fps without real harm. (Draw lag spikes are permissible but update lag spikes should be dealt with by calling update twice to catch up and make game logic and especially physics have predictable behavior and equal time per step.) Is there a way without forking Babylon to override the update/draw timing logic? I notice the functions beginFrame() and endFrame() are public. Can I just call beginFrame, do my render calls, and then call endFrame? Will this break anything? What should "do my render calls" look like? Again I would prefer to not modify babylon.js itself, and instead just override its behavior because I don't want to maintain a fork.
  16. for better loading speed, i used texture packer to change multiple sprites to some json atlas. sometime, fps drop from 45-50 to 2-3, especially when use tween or when user other object as modal popup in states. The "sprites" version working fine with 45-50 fps. It happened on "canvas" render mode, the "opengl" render mode is fine with 25-30fps. But i need to use canvas mode for capture screenshot button (canvas2image), and it give better fps (45-50 when uses pure sprites). Does anyone have a solution for this, please help. p/s: sorry for my bad english!
  17. I have placed hundreds of static sprites in my game and all goes well. But when I try to add 30 animated sprites (AI players) in the game, the FPS drops from 60 to 30. If I add even more it becomes very slow and unplayable. I have profiled my program on Chrome and found that this method CanvasSpriteRenderer.prototype.render is using too many CPU resources. Is there a way to reduce the CPU consumption and make my game smooth again?
  18. Hi Guys, I have multiple game states and one of them is kind of slow on mobile, while it works just fine on desktop. I ran a js profile to find out what could be the potential cause of this and attached it as a reference here. I know this image does probably not give away enough in order to make any clear predictions on what the issue for my fps drop is, but maybe the pattern of the times spent for the functions to execute yields something I could make use of. I commented out most of my update functions of that state to see whether the issue is hiding in there, but no success. The imagery and text I am rendering is also smaller and less than on my working states. I also tried to destroy and null all objects of the previous state. There might be still a couple I haven't captured. This is what I null: this.game = null; this.add = null; this.make = null; this.input = null; this.state = null; this.stage = null; this.time = null; this.world = null; Any suggestion what could go wrong?
  19. Hey. What do you think is the best option ? I know there won't be probably a "best" option but what would you guys choose? Babylon seems more complex than playcanvas but that might bring some more advantages to the table as well idk...
  20. Hey guys, first post, started using Babylon Friday, so I may be a little green. I'm done waiting for Unity3D's webgl porting to not be a steaming pile. Really liking everything so far, but I could use some advice on moving forward with an FPS camera. I extended it from the BABYLON.FreeCamera. Nailed down most of it, but realized that the built-in collision the camera uses has no real concept of friction. It's going to be a bit of a problem when I intended on having moving floor platforms. They just slide right out from under you as-is. I'd rather not start from scratch or fall back on TargetCamera because of all the input groundwork that FreeCamera provides. My best guess for moving forward is to dig in and start overriding the collision functions of FreeCamera like _collideWithWorld(), _updatePosition(), etc. and replace them with Oimo compatible logic. I just want to get the problem out there before I go down that rabbit hole. Is this a horrible idea? Or maybe I'm just missing something incredibly obvious about the built-in physics? Thanks in advance for any advice.
  21. Hello, I don't know if this is something that could be merged into github but we had some projects (and therefore customers) that were highly loaded with objects, thus a bit slow in rendering. The camera inertia was then to long lasting to control the camera if you know what I mean. This is what I've changed to handle this: // Inertia var engineDelta = Math.min(this.getEngine().deltaTime,100), inertiaFactor = Math.min(1,16.66666 / engineDelta); if (this.inertialAlphaOffset !== 0 || this.inertialBetaOffset !== 0 || this.inertialRadiusOffset !== 0) { this.alpha += (this.beta <= 0 ? -this.inertialAlphaOffset : this.inertialAlphaOffset) / inertiaFactor; this.beta += this.inertialBetaOffset / inertiaFactor; this.radius -= this.inertialRadiusOffset / inertiaFactor; this.inertialAlphaOffset *= this.inertia * inertiaFactor; this.inertialBetaOffset *= this.inertia * inertiaFactor; this.inertialRadiusOffset *= this.inertia * inertiaFactor; if (Math.abs(this.inertialAlphaOffset) < BABYLON.Engine.Epsilon) this.inertialAlphaOffset = 0; if (Math.abs(this.inertialBetaOffset) < BABYLON.Engine.Epsilon) this.inertialBetaOffset = 0; if (Math.abs(this.inertialRadiusOffset) < BABYLON.Engine.Epsilon) this.inertialRadiusOffset = 0; } // Panning inertia if (this.inertialPanningX !== 0 || this.inertialPanningY !== 0) { if (!this._localDirection) { this._localDirection = BABYLON.Vector3.Zero(); this._transformedDirection = BABYLON.Vector3.Zero(); } this.inertialPanningX *= this.inertia * inertiaFactor; this.inertialPanningY *= this.inertia * inertiaFactor; if (Math.abs(this.inertialPanningX) < BABYLON.Engine.Epsilon) this.inertialPanningX = 0; if (Math.abs(this.inertialPanningY) < BABYLON.Engine.Epsilon) this.inertialPanningY = 0; this._localDirection.copyFromFloats(this.inertialPanningX / inertiaFactor, this.inertialPanningY / inertiaFactor, 0); this._viewMatrix.invertToRef(this._cameraTransformMatrix); BABYLON.Vector3.TransformNormalToRef(this._localDirection, this._cameraTransformMatrix, this._transformedDirection); this.target.addInPlace(this._transformedDirection); } It rotates by the given inertia amount depending on the time that proceeded during the renderings. The var engineDelta = Math.min(this.getEngine().deltaTime,100) is to avoid big camera jumps on frames that last longer than 100ms. In our project the render loop doesn't run continuesly. If someone likes to test this and/or push it into babylon I would be glad to have contributed a small thing :-) If not it's also completely okay as it's only needed in our project(s)! ;-) Best regards Kevin
  22. Hi guys, I'm having a specific issue and I'm looking for some help. I have a big image which I hide at game start. Later on I revive this image to display it. The very first time I do this, it provokes a big jitter, but further attempts provoke no lag at all. So I think it has to do with the fact that at game start the image has never been rendered, and once I render it for the first time, some kind of 'render-loading' might happen and provoke the jitter. For the time being I create the sprite, add it to the game, and then immediately kill it (so that the player doesn't see it). So it's never been rendered (hence the jitter later on). Is there a way for me for do the same thing AND load the texture to the renderer as well, preventing the jitter happening later? Sorry if it makes little sense, I don't know canvas rendering enough to point exactly why the jitter happens. But I assume the images must be somehow transferred from the cache to the renderer, or something like that. Is there any way to force it (and still not display the image)? (Just to confirm my hint, If I do render the image at start, even briefly, and kill it, the next revive won't jitter at all. Also, all I do is use game.add.sprite(), kill() and revive(), if it helps). Thanks a lot!
  23. I've been trying to work out how to set the frame rate for a MovieClip animation. I assume this is where the animationSpeed property comes in, but the API documentation is rather vague: What does this mean in terms of frames per second? If I want an animation to play at, say, 15 FPS, what value should the animationSpeed property be?
  24. Hi, I am having an issue with latest version of BabylonJS (beta version), when loading a page with clean cache the FPS displayed by getFPS stays at 60 fps during 58 frames (seems a constant), meaning that the sceneOptimizers can't get triggered if the FPS is too low (timer gets to 0 before being able to run the optimizer).
  25. Hi All, In my game i am having a emitter which execute when user tap on the object. The emitter is slow in low level android phones. So I am planning to check the fps. If fps < 30 then don't show the emitter ELSE show the emitter. I am going to use the below line in create function so that Phaser will calculate the fps. me.game.time.advancedTiming = true; Will it reduce the performance of the game, because only when the advancedTiming property is set to true Phaser starts calculating fps, which is an additional work for Phaser. Thanks for your help. Joseph