Search Results

Search found 510 results on 21 pages for 'fps'.

Page 5/21 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to handle the different frame rate on different devices?

    - by Fenwick
    I am not quite sure how frame per second works on a web page. I have a Canvas game that involves in moving an image from point A to B, and measuring the time elapsed. The code can be as simple as: var timeStamp = Date.now(); function update(){ obj.y += obj.speed; text = "Time: "+ (Date.now() - timeStamp) + "ms"; } The function update() is called every frame. The problem is that the time elapsed is different from device to device. It is pretty short on my PC, but get longer on my iPad, and is much longer on my cell phone. I thought it is because the FPS is smaller on mobile devices, so instead of calling update() every frame, I call it every 1ms by using a setInterval. But this does not solve the problem. In my understanding, the function for setInterval is invoked based on the increment in system time, other than frame rate, so it should fix the problem. Am I missing anything here? If the setInterval function is called based on FPS, is there any way to get around with the FPS difference across devices? On a side note, I have sort of a "water simulator" on the same canvas. It involves in redrawing about 60 objects which can be 600x600 pixels for every frame, so it could be a frame rate killer. I am using Phaser.js but not really using much of its functionalities, if that helps.

    Read the article

  • XDCAM HD 422 frame setting

    - by sebastian
    I have a question that you can hopefully answer me. I am trying to write a ffmpeg script that transcodes my clips in XDCAM HD 422 1080p24, and it works fine as long as the original file has 24 fps, but is there a way that I can set an option which says "even if the original file has 25 fps I will transcode it in 24 fps". I have tried it, like I said it works fine as long as the original clip has 24 frames, but as soon as the original clip has another framerate, he can not convert it to 24 frames. I have tried using -r 24 which normally settles the framerate, but here it doesn't work. I am using the -vtag xd5c

    Read the article

  • Which is the way to pass parameters in a drawableGameComponent in XNA 4.0?

    - by cad
    I have a small demo and I want to create a class that draws messages in screen like fps rate. I am reading a XNA book and they comment about GameComponents. I have created a class that inherits DrawableGameComponent public class ScreenMessagesComponent : Microsoft.Xna.Framework.DrawableGameComponent I override some methods like Initialize or LoadContent. But when I want to override draw I have a problem, I would like to pass some parameters to it. Overrided method does not allow me to pass parameters. public override void Draw(GameTime gameTime) { StringBuilder buffer = new StringBuilder(); buffer.AppendFormat("FPS: {0}\n", framesPerSecond); // Where get framesPerSecond from??? spriteBatch.DrawString(spriteFont, buffer.ToString(), fontPos, Color.Yellow); base.Draw(gameTime); } If I create a method with parameters, then I cannot override it and will not be automatically called: public void Draw(SpriteBatch spriteBatch, int framesPerSecond) { StringBuilder buffer = new StringBuilder(); buffer.AppendFormat("FPS: {0}\n", framesPerSecond); spriteBatch.DrawString(spriteFont, buffer.ToString(), fontPos, Color.Yellow); base.Draw(gameTime); } So my questions are: Is there a mechanism to pass parameter to a drawableGameComponent? What is the best practice? In general is a good practice to use GameComponents?

    Read the article

  • Converting from mp4 to Xvid avi using avconv?

    - by Ricardo Gladwell
    I normally use avidemux to convert mp4s to Xvid AVI for my Philips Streamium SLM5500. Normally I select MPEG-4 ASP (Xvid) at Two Pass with an average bitrate f 1500kb/s for video and AC3 (lav) audio and it converts correctly. However, I'm trying to using avconv so I can automate the process with a script, but when I do this the video stutters and stops playing part way through. I have a suspicion its something to do with a faulty audio conversion. The commands I'm using are as follows: avconv -y -i video.mp4 -pass 1 -vtag xvid -c:a ac3 -b:a 128k -b:v 1500k -f avi /dev/null avconv -y -i video.mp4 -pass 2 -vtag xvid -c:a ac3 -b:a 128k -b:v 1500k -f avi video.avi There is a bewildering array of arguments for avconv. Is there something I'm doing wrong? Is there a way I can script avidemux from a headless server? Please see command line output: $ avconv -y -i video.mp4 -pass 1 -vtag xvid -an -b:v 1500k -f avi /dev/null avconv version 0.8.5-6:0.8.5-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers built on Jan 24 2013 14:49:20 with gcc 4.7.2 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4': Metadata: major_brand : isom minor_version : 1 compatible_brands: isomavc1 creation_time : 2013-02-04 13:53:38 Duration: 00:44:09.16, start: 0.000000, bitrate: 669 kb/s Stream #0.0(und): Video: h264 (High), yuv420p, 720x404 [PAR 1:1 DAR 180:101], 538 kb/s, 25 fps, 25 tbr, 100 tbn, 50 tbc Metadata: creation_time : 2013-02-04 13:53:38 Stream #0.1(und): Audio: ac3, 44100 Hz, stereo, s16, 127 kb/s Metadata: creation_time : 2013-02-04 13:53:42 [buffer @ 0x7f4c40] w:720 h:404 pixfmt:yuv420p Output #0, avi, to '/dev/null': Metadata: major_brand : isom minor_version : 1 compatible_brands: isomavc1 creation_time : 2013-02-04 13:53:38 ISFT : Lavf53.21.1 Stream #0.0(und): Video: mpeg4, yuv420p, 720x404 [PAR 1:1 DAR 180:101], q=2-31, pass 1, 1500 kb/s, 25 tbn, 25 tbc Metadata: creation_time : 2013-02-04 13:53:38 Stream mapping: Stream #0:0 -> #0:0 (h264 -> mpeg4) Press ctrl-c to stop encoding frame=66227 fps=328 q=2.0 Lsize= 0kB time=2649.16 bitrate= 0.0kbits/s video:401602kB audio:0kB global headers:0kB muxing overhead -100.000000% $ avconv -y -i video.mp4 -pass 2 -vtag xvid -c:a ac3 -b:a 128k -b:v 1500k -f avi video.avi avconv version 0.8.5-6:0.8.5-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers built on Jan 24 2013 14:49:20 with gcc 4.7.2 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4': Metadata: major_brand : isom minor_version : 1 compatible_brands: isomavc1 creation_time : 2013-02-04 13:53:38 Duration: 00:44:09.16, start: 0.000000, bitrate: 669 kb/s Stream #0.0(und): Video: h264 (High), yuv420p, 720x404 [PAR 1:1 DAR 180:101], 538 kb/s, 25 fps, 25 tbr, 100 tbn, 50 tbc Metadata: creation_time : 2013-02-04 13:53:38 Stream #0.1(und): Audio: ac3, 44100 Hz, stereo, s16, 127 kb/s Metadata: creation_time : 2013-02-04 13:53:42 [buffer @ 0x12b4f00] w:720 h:404 pixfmt:yuv420p Incompatible sample format 's16' for codec 'ac3', auto-selecting format 'flt' [mpeg4 @ 0x12b3ec0] [lavc rc] Using all of requested bitrate is not necessary for this video with these parameters. Output #0, avi, to 'video.avi': Metadata: major_brand : isom minor_version : 1 compatible_brands: isomavc1 creation_time : 2013-02-04 13:53:38 ISFT : Lavf53.21.1 Stream #0.0(und): Video: mpeg4, yuv420p, 720x404 [PAR 1:1 DAR 180:101], q=2-31, pass 2, 1500 kb/s, 25 tbn, 25 tbc Metadata: creation_time : 2013-02-04 13:53:38 Stream #0.1(und): Audio: ac3, 44100 Hz, stereo, flt, 128 kb/s Metadata: creation_time : 2013-02-04 13:53:42 Stream mapping: Stream #0:0 -> #0:0 (h264 -> mpeg4) Stream #0:1 -> #0:1 (ac3 -> ac3) Press ctrl-c to stop encoding Input stream #0:1 frame changed from rate:44100 fmt:s16 ch:2 to rate:44100 fmt:flt ch:2 frame=66227 fps=284 q=2.2 Lsize= 458486kB time=2649.13 bitrate=1417.8kbits/s video:413716kB audio:41393kB global headers:0kB muxing overhead 0.741969%

    Read the article

  • Multithreading 2D gravity calculations

    - by Postman
    I'm building a space exploration game and I've currently started working on gravity ( In C# with XNA). The gravity still needs tweaking, but before I can do that, I need to address some performance issues with my physics calculations. This is using 100 objects, normally rendering 1000 of them with no physics calculations gets well over 300 FPS (which is my FPS cap), but any more than 10 or so objects brings the game (and the single thread it runs on) to its knees when doing physics calculations. I checked my thread usage and the first thread was killing itself from all the work, so I figured I just needed to do the physics calculation on another thread. However when I try to run the Gravity.cs class's Update method on another thread, even if Gravity's Update method has nothing in it, the game is still down to 2 FPS. Gravity.cs public void Update() { foreach (KeyValuePair<string, Entity> e in entityEngine.Entities) { Vector2 Force = new Vector2(); foreach (KeyValuePair<string, Entity> e2 in entityEngine.Entities) { if (e2.Key != e.Key) { float distance = Vector2.Distance(entityEngine.Entities[e.Key].Position, entityEngine.Entities[e2.Key].Position); if (distance > (entityEngine.Entities[e.Key].Texture.Width / 2 + entityEngine.Entities[e2.Key].Texture.Width / 2)) { double angle = Math.Atan2(entityEngine.Entities[e2.Key].Position.Y - entityEngine.Entities[e.Key].Position.Y, entityEngine.Entities[e2.Key].Position.X - entityEngine.Entities[e.Key].Position.X); float mult = 0.1f * (entityEngine.Entities[e.Key].Mass * entityEngine.Entities[e2.Key].Mass) / distance * distance; Vector2 VecForce = new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle)); VecForce.Normalize(); Force = Vector2.Add(Force, VecForce * mult); } } } entityEngine.Entities[e.Key].Position += Force; } } Yeah, I know. It's a nested foreach loop, but I don't know how else to do the gravity calculation, and this seems to work, it's just so intensive that it needs its own thread. (Even if someone knows a super efficient way to do these calculations, I'd still like to know how I COULD do it on multiple threads instead) EntityEngine.cs (manages an instance of Gravity.cs) public class EntityEngine { public Dictionary<string, Entity> Entities = new Dictionary<string, Entity>(); public Gravity gravity; private Thread T; public EntityEngine() { gravity = new Gravity(this); } public void Update() { foreach (KeyValuePair<string, Entity> e in Entities) { Entities[e.Key].Update(); } T = new Thread(new ThreadStart(gravity.Update)); T.IsBackground = true; T.Start(); } } EntityEngine is created in Game1.cs, and its Update() method is called within Game1.cs. I need my physics calculation in Gravity.cs to run every time the game updates, in a separate thread so that the calculation doesn't slow the game down to horribly low (0-2) FPS. How would I go about making this threading work? (any suggestions for an improved Planetary Gravity system are welcome if anyone has them) I'm also not looking for a lesson in why I shouldn't use threading or the dangers of using it incorrectly, I'm looking for a straight answer on how to do it. I've already spent an hour googling this very question with little results that I understood or were helpful. I don't mean to come off rude, but it always seems hard as a programming noob to get a straight meaningful answer, I usually rather get an answer so complex I'd easily be able to solve my issue if I understood it, or someone saying why I shouldn't do what I want to do and offering no alternatives (that are helpful). Thank you for the help!

    Read the article

  • SDL Bullet Movement

    - by Code Assasssin
    I'm currently working on my first space shooter, and I'm in the process of making my ship shoot some bullets/lasers. Unfortunately, I'm having a hard time getting the bullets to fly vertically. I'm a total noob when it comes to this so you might have a hard time understanding my code :/ // Position Bullet Function projectilex = x + 17; projectiley = y + -20; if(keystates[SDLK_SPACE]) { alive = true; } And here's my show function if(alive) { if(frame == 2) { frame = 0; } apply_surface(projectilex,projectiley,ShootStuff,screen,&lazers[frame]); frame++; projectiley + 1; } I'm trying to get the bullet to fly vertically... and I have no clue how to do that. I've tried messing with the y coordinate but that makes things worse. The laser/bullet just follows the ship :( How would I get it to fire at the starting position and keep going in a vertical line without it following the ship? int main( int argc, char* args[] ) { Player p; Timer fps; bool quit = false; if( init() == false ) { return 1; } //Load the files if( load_files() == false ) { return 1; } clip[ 0 ].x = 0; clip[ 0 ].y = 0; clip[ 0 ].w = 30; clip[ 0 ].h = 36; clip[ 1 ].x = 31; clip[ 1 ].y = 0; clip[ 1 ].w = 39; clip[ 1 ].h = 36; clip[ 2 ].x = 71; clip[ 2 ].y = 0; clip[ 2 ].w = 29; clip[ 2 ].h = 36; lazers [ 0 ].x = 0; lazers [ 0 ].y = 0; lazers [ 0 ].w = 3; lazers [ 0 ].h = 9; lazers [ 1 ].x = 5; lazers [ 1 ].y = 0; lazers [ 1 ].w = 3; lazers [ 1 ].h = 7; while( quit == false ) { fps.start(); //While there's an event to handle while( SDL_PollEvent( &event ) ) { p.handle_input(); //If a key was pressed //If the user has Xed out the window if( event.type == SDL_QUIT ) { //Quit the program quit = true; } } //Scroll background bgX -= 8; //If the background has gone too far if( bgX <= -GameBackground->w ) { //Reset the offset bgX = 0; } p.move(); apply_surface( bgX, bgY,GameBackground, screen ); apply_surface( bgX + GameBackground->w, bgY, GameBackground, screen ); apply_surface(0,0, FullHealthBar,screen); p.shoot(); p.show(); //Apply the message //Update the screen if( SDL_Flip( screen ) == -1 ) { return 1; } SDL_Flip(GameBackground); if( fps.get_ticks() < 1000 / FRAMES_PER_SECOND ) { SDL_Delay( ( 1000 / FRAMES_PER_SECOND ) - fps.get_ticks() ); } } //Clean up clean_up(); return 0; }

    Read the article

  • Optimizing transition/movement smoothness for a 2D flash game.

    - by Tom
    Update 6: Fenomenas suggested me to re-create everything as simple as possible. I had my doubts that this would make any difference as the algorithm remains the same, and performance did not seem to be the issue. Anyway, it was the only suggestion I got so here it is: 30 FPS: http://www.feedpostal.com/test/simple/30/SimpleMovement.html 40 FPS: http://www.feedpostal.com/test/simple/40/SimpleMovement.html 60 FPS: http://www.feedpostal.com/test/simple/60/SimpleMovement.html 100 FPS: http://www.feedpostal.com/test/simple/100/SimpleMovement.html The code: package { import flash.display.Sprite; import flash.events.Event; import flash.events.KeyboardEvent; import flash.utils.getTimer; [SWF(width="800", height="600", frameRate="40", backgroundColor="#000000")] public class SimpleMovement extends Sprite { private static const TURNING_SPEED:uint = 180; private static const MOVEMENT_SPEED:uint = 400; private static const RADIAN_DIVIDE:Number = Math.PI/180; private var playerObject:Sprite; private var shipContainer:Sprite; private var moving:Boolean = false; private var turningMode:uint = 0; private var movementTimestamp:Number = getTimer(); private var turningTimestamp:Number = movementTimestamp; public function SimpleMovement() { //step 1: create player object playerObject = new Sprite(); playerObject.graphics.lineStyle(1, 0x000000); playerObject.graphics.beginFill(0x6D7B8D); playerObject.graphics.drawRect(0, 0, 25, 50); //make it rotate around the center playerObject.x = 0 - playerObject.width / 2; playerObject.y = 0 - playerObject.height / 2; shipContainer = new Sprite(); shipContainer.addChild(playerObject); shipContainer.x = 100; shipContainer.y = 100; shipContainer.rotation = 180; addChild(shipContainer); //step 2: install keyboard hook when stage is ready addEventListener(Event.ADDED_TO_STAGE, stageReady, false, 0, true); //step 3: install rendering update poll addEventListener(Event.ENTER_FRAME, updatePoller, false, 0, true); } private function updatePoller(event:Event):void { var newTime:Number = getTimer(); //turning if (turningMode != 0) { var turningDeltaTime:Number = newTime - turningTimestamp; turningTimestamp = newTime; var rotation:Number = TURNING_SPEED * turningDeltaTime / 1000; if (turningMode == 1) shipContainer.rotation -= rotation; else shipContainer.rotation += rotation; } //movement if (moving) { var movementDeltaTime:Number = newTime - movementTimestamp; movementTimestamp = newTime; var distance:Number = MOVEMENT_SPEED * movementDeltaTime / 1000; var rAngle:Number = shipContainer.rotation * RADIAN_DIVIDE; //convert degrees to radian shipContainer.x += distance * Math.sin(rAngle); shipContainer.y -= distance * Math.cos(rAngle); } } private function stageReady(event:Event):void { //install keyboard hook stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown, false, 0, true); stage.addEventListener(KeyboardEvent.KEY_UP, keyUp, false, 0, true); } private final function keyDown(event:KeyboardEvent):void { if ((event.keyCode == 87) && (!moving)) //87 = W { movementTimestamp = getTimer(); moving = true; } if ((event.keyCode == 65) && (turningMode != 1)) //65 = A { turningTimestamp = getTimer(); turningMode = 1; } else if ((event.keyCode == 68) && (turningMode != 2)) //68 = D { turningTimestamp = getTimer(); turningMode = 2; } } private final function keyUp(event:KeyboardEvent):void { if ((event.keyCode == 87) && (moving)) moving = false; //87 = W if (((event.keyCode == 65) || (event.keyCode == 68)) && (turningMode != 0)) turningMode = 0; //65 = A, 68 = D } } } The results were as I expected. Absolutely no improvement. I really hope that someone has another suggestion as this thing needs fixing. Also, I doubt it's my system as I have a pretty good one (8GB RAM, Q9550 QuadCore intel, ATI Radeon 4870 512MB). Also, everyone else I asked so far had the same issue with my client. Update 5: another example of a smooth flash game just to demonstrate that my movement definitely is different! See http://www.spel.nl/game/bumpercraft.html Update 4: I traced the time before rendering (EVENT.RENDER) and right after rendering (EVENT.ENTER_FRAME), the results: rendering took: 14 ms rendering took: 14 ms rendering took: 12 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 14 ms rendering took: 12 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 14 ms rendering took: 12 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 14 ms rendering took: 14 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 24 ms rendering took: 18 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 232 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms rendering took: 14 ms rendering took: 16 ms rendering took: 12 ms rendering took: 14 ms rendering took: 12 ms The range is 12-16 ms. During these differences, the shocking/warping/flickering movement was already going on. There is also 1 peak of 232ms, at this time there was a relatively big warp. This is however not the biggest problme, the biggest problem are the continuous small warps during normal movement. Does this give anyone a clue? Update 3: After testing, I know that the following factors are not causing my problem: Bitmap's quality - changed with photoshop to an uglier 8 colours optimized graphic, no improvement at all. Constant rotation of image while turning - disabled it, no improvement at all Browser rendering - tried to use the flash player standalone, no improvement at all I am 100% convinced that the problem lies in either my code or in my algorithm. Please, help me out. It has been almost two weeks (1 week that I asked this question on SO) now and I still have to get my golden answer. Update 1: see bottom for full flex project source and a live demo demonstrating my problem. I'm working on a 2d flash game. Player ships are created as an object: ships[id] = new GameShip(); When movement and rotation information is available, this is being directed to the corresponding ship: ships[id].setMovementMode(1); //move forward Now, within this GameShip object movement works using the "Event.ENTER_FRAME" event: addEventListener(Event.ENTER_FRAME, movementHandler); The following function is then being run: private final function movementHandler(event:Event):void { var newTimeStamp:uint = UtilLib.getTimeStamp(); //set current timeStamp var distance:Number = (newTimeStamp - movementTimeStamp) / 1000 * movementSpeed; //speed = x pixels forward every 1 second movementTimeStamp = newTimeStamp; //update old timeStamp var diagonalChange:Array = getDiagonalChange(movementAngle, distance); //the diagonal position update based on angle and distance charX += diagonalChange[0]; charY += diagonalChange[1]; if (shipContainer) { //when the container is ready to be worked with shipContainer.x = charX; shipContainer.y = charY; } } private final function getDiagonalChange(angle:Number, distance:Number):Array { var rAngle:Number = angle * Math.PI/180; //convert degrees to radian return [Math.sin(rAngle) * distance, (Math.cos(rAngle) * distance) * -1]; } When the object is no longer moving, the event listener will be removed. The same method is being used for rotation. Everything works almost perfect. I've set the project's target FPS to 100 and created a FPS counter. According to the FPS counter, the average FPS in firefox is around 100, while the top is 1000 and the bottom is 22. I think that the bottom and top FPSs are only happening during the initialization of the client (startup). The problem is that the ship appears to be almost perfectly smooth, while it should be just that without the "almost" part. It's almost as if the ship is "flickering" very very fast, you can't actually see it but it's hard to focus on the object while it's moving with your eyes. Also, every now and then, there seems to be a bit of a framerate spike, as if the client is skipping a couple of frames, you then see it quickly warp. It is very difficult to explain what the real problem is, but in general it's that the movement is not perfectly smooth. So, do you have any suggestions on how to make the movement or transition of objects perfectly smooth? Update 1: I re-created the client to demonstrate my problem. Please check it out. The client: http://feedpostal.com/test/MovementTest.html The Actionscript Project (full source): http://feedpostal.com/test/MovementTest.rar An example of a smooth flash game (not created by me): http://www.gamesforwork.com/games/swf/Mission%20Racing_august_10th_2009.swf It took me a pretty long time to recreate this client side version, I hope this will help with solving the problem. Please note: yes, it is actually pretty smooth. But it is definitely not smooth enough.

    Read the article

  • Using large transparent pictures as texture atlases

    - by azlisum
    i'm new to android programming and i'm trying to create a relatively big 2D game. I have to use lots of images and objects in my game so I decided to use OpenGL ES. I have several texture atlases, all of them saved as png's because of the transparency. I also know, but i'm not sure why, that I have to use images, which height and width is multiple of two. I test my game on an old HTC Hero running Android 2.3.3. When my picture atlases are 512x512 each, my game has a frame rate of between 50 to 60 fps. When I use 1024x1024 non transparent png, there is no problem - the FPS is again between 50 to 60 fps. But when i decide to use a 1024x1024 transperent PNG's my frame rate drops to 4,5 fps. Could this be a problem related to the age of the device i'm using for testing? These are the OpenGL functions I use each loop to draw batches: gl.glEnable(GL10.GL_TEXTURE_2D); gl.glEnable(GL10.GL_BLEND); gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); //drawing happens here gl.glDisable(GL10.GL_BLEND); Thanks in advance :)

    Read the article

  • reencode several videos with virtualdub?

    - by acidzombie24
    I have about 50 small videos (and a few large videos). I want to convert them all with the SAME settings. Its basically change audio to X with Y bitrate, change video to xvid. and do full processing on the video and audio. Then force the FPS to 15 since every program i tried (including virtualdub) thinks it 0.3 FPS. How do i apply all of these settings to all of my files?

    Read the article

  • h264 RTP timestamp

    - by user269090
    Hi Guys, I have a confusion about the timestamp of h264 RTP packet. I know the wall clock rate of video is 90KHz which I defined in the SIP SDP. The frame rate of my encoder is not exactly 30 FPS, it is variable. It varies from 15 FPS to 30 FPS on the fly. So, I cannot use any fixed timestamp. Could any one tell me the timestamp of the following encoded packet. After 0 milisecond encoded RTP timestamp = 0 (Let the starting timestamp 0) After 50 milisecond encoded RTP timestamp = ? After 40 milisecond encoded RTP timestamp = ? After 33 milisecond encoded RTP timestamp = ? What is the formula when the encoded frame rate is variable? Thank you in advance.

    Read the article

  • Functional Programming - Lots of emphasis on recursion, why?

    - by peakit
    I am getting introduced to Functional Programming [FP] (using Scala). One thing that is coming out from my initial learnings is that FPs rely heavily on recursion. And also it seems like, in pure FPs the only way to do iterative stuff is by writing recursive functions. And because of the heavy usage of recursion seems the next thing that FPs had to worry about were StackoverflowExceptions typically due to long winding recursive calls. This was tackled by introducing some optimizations (tail recursion related optimizations in maintenance of stackframes and @tailrec annotation from Scala v2.8 onwards) Can someone please enlighten me why recursion is so important to functional programming paradigm? Is there something in the specifications of functional programming languages which gets "violated" if we do stuff iteratively? If yes, then I am keen to know that as well. PS: Note that I am newbie to functional programming so feel free to point me to existing resources if they explain/answer my question. Also I do understand that Scala in particular provides support for doing iterative stuff as well.

    Read the article

  • Flixel Game Over Screen

    - by Jamie Read
    I am new to game development but familiar with programming languages. I have started using Flixel and have a working Breakout game with score and lives. I am just stuck on how I can create a new screen/game over screen if a player runs out of lives. I would like the process to be like following: Check IF lives are equal to 0 Pause the game and display a new screen (probably transparent) that says 'Game Over' When a user clicks or hits ENTER restart the level Here is the function I currently have to update the lives: private function loseLive(_ball:FlxObject, _bottomWall:FlxObject):void { // check for game over if (lives_count == 0) { } else { FlxG:lives_count -= 1; lives.text = 'Lives: ' + lives_count.toString() } } Here is my main game.as: package { import org.flixel.*; public class Game extends FlxGame { private const resolution:FlxPoint = new FlxPoint(640, 480); private const zoom:uint = 2; private const fps:uint = 60; public function Game() { super(resolution.x / zoom, resolution.y / zoom, PlayState, zoom); FlxG.flashFramerate = fps; } } }

    Read the article

  • Achieving more fluent movement

    - by Robin92
    I'm working on my first OpenGL 2D game and I've just locked the framerate of my game. However, the way objects move is far from satisfying: they tend to lag, which is shown in this video. I've thought how more fluent animation can be achieved and started getting segmentation faults due to accessing the same object by two different threads. I've tried the following threads' setting: Drawing, creating new objects Moving player, moving objects, deleting objects Currently my application uses this setting: Drawing, creating new objects, moving objects, deleting object Moving player Any ideas would be appreciated. EDIT: I've tried increasing the FPS limit but lags are noticeable even at 200 fps.

    Read the article

  • What is the rationale behind snazzy Window Managers/Composers?

    - by Emanuele
    This is more of a generic question, based on trying out Window Managers like Awesome, Mate and others. To me looks like that other Window Managers like Gnome3 and/or Unity are heavy and pointless. I do understand that having all the composed UIs is more pleasant for the eye, but apart that, what are the other major benefits? To make an example, when I run the game Heroes of Newerth (using nVidia drivers) under: Unity : the FPS drops sharply Gnome3 : FPS is ok, but X and other processes use 15~20% of CPU and quite some additional memory Awesome : FPS is ok, and other processes use very little memory and CPU Below some numbers regarding what I'm saying (please note my system is 64 bit, AMD Phenom II X4, 8 GB RAM, nd nVidia 470 GTX, SSD disk). All data is sorted by mem usage (watch -d -n 10 "ps -e -o pcpu,pmem,pid,user,cmd --sort=-pmem | head -20"); again note that CPU time of ./hon-x86_64 might be different due to the fact I can't take the snapshot of the system during exactly same time. Awesome: %CPU %MEM PID USER CMD 91.8 21.6 3579 ema ./hon-x86_64 2.4 0.9 3223 root /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch 1.6 0.4 2600 ema /usr/lib/erlang/erts-5.8.5/bin/beam.smp -Bd -K true -A 4 -- -root /usr/lib/erlang -progname erl -- -home /home/ema -- -noshell -noinp 0.3 0.2 3602 ema gnome-terminal 0.0 0.2 2698 ema /usr/bin/python /usr/lib/desktopcouch/desktopcouch-service Gnome3: %CPU %MEM PID USER CMD 82.7 21.0 5528 ema ./hon-x86_64 17.7 1.7 5315 ema /usr/bin/gnome-shell 5.8 1.2 5062 root /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch 1.0 0.4 5657 ema /usr/bin/python /usr/lib/ubuntuone-client/ubuntuone-syncdaemon 0.7 0.3 5331 ema nautilus -n 1.6 0.3 2600 ema /usr/lib/erlang/erts-5.8.5/bin/beam.smp -Bd -K true -A 4 -- -root /usr/lib/erlang -progname erl -- -home /home/ema -- - 0.9 0.2 5451 ema gnome-terminal 0.1 0.2 5400 ema /usr/bin/python /usr/lib/desktopcouch/desktopcouch-service Unity 3D: %CPU %MEM PID USER CMD 87.2 21.1 6554 ema ./hon-x86_64 10.7 2.6 6105 ema compiz 17.8 1.1 5842 root /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch 1.3 0.9 6672 root /usr/bin/python /usr/sbin/aptd 0.4 0.4 6606 ema /usr/bin/python /usr/lib/ubuntuone-client/ubuntuone-syncdaemon 0.5 0.3 6115 ema nautilus -n 1.5 0.3 2600 ema /usr/lib/erlang/erts-5.8.5/bin/beam.smp -Bd -K true -A 4 -- -root /usr/lib/erlang -progname erl -- -home /home/ema -- -noshell -noinput -sasl errl 0.3 0.2 6180 ema /usr/lib/unity/unity-panel-service So my point is, what's the rationale behind going towards such heavy WMs/Composers?

    Read the article

  • DOT implementation

    - by Denis Ermolin
    I have some DOT(damage over time) implementation problems. My game runs on 30 FPS speed. Current implementation is: let's say hero cast spell which make 1 damage per second. So on every frame i do (pseudo code): damage_done = getRandomDamage() * delta_time; I accumulate damage and when it becomes more then 0 then subtract rounded damage from current health and so on. With 30 FPS and 1 DPS it will be 1/33 = 0.05... We know that floats a not precise enough to sum 30 circulating decimals and have exact 1 in the end. But HP is discrete value and that's why 1 DPS will not have 1 damage after 1 second because value will be 0.9999..... It's not so big deal when you have 100000 DPS - +/- 1 damage will not be noticeable. But if i have 1, 5 DPS? How modern RPG's implemented DOT's?

    Read the article

  • Java is very slow on my laptop

    - by Ryan McClure
    I have 1.6.0_30 JRE on my 11.10 install. I have 3 GB of RAM and an Intel Core2 Duo CPU T6600 @ 2.20GHz × 2. Whenever I use my Java to play a game, the Java runs at about 4-5 FPS. When I used Windows, I found that I could get around 40 FPS. I'm not too terribly worried about this, but are there settings that I can tweak that I don't know about? If not, why is it that JRE Java can't do as much on Ubuntu as it can on Windows? Also, this may be related but I'm not too sure--My fan runs very fast when running a Java application. Is there a correlation?

    Read the article

  • Extremely Hybrid Game requirements

    - by tugrul büyükisik
    What system specifications would a game need if it was: Total players per planet: ~20000 Total players per team:~1M Total players per map(small volume of space or small surface over a planet): ~2000 Total players: ~10M(world has more players than this amount i think) Two of the players are commanders of opposite quadrants(from HUD of a strategy game). Lots of players use space-crafts as a captain(like 3d fps and rts). Many many players control consoles in those space-crafts as under command of captains.(fps ) Some players are still in stone-age trying to reinvent wheel in some planet. Players design and construct any vehicles they have. With good physics engine Has puzzles inside. Everyone get experience by doing stuff(RPG). Commerce, income or totally different resource-based group(like starcraft) Player classes(primitive: cunning and strong, wrapped: healthy, wealthy) Arcade top-down style firing with ships when people get bored very low chance of miraculous things.(mediclorians, wormholes, bugs) Different game-modes: persistent(living world), resetted periodically(a new chance for noobs), instant(pre-built space + hack&slash) I suspect this would need 128GB ram and 2048 cores.

    Read the article

  • What are the factors that determine the default frequency of a shader call?

    - by user827992
    After i have been played for some days with various vertex and fragments shaders seems clear to me that this programs are called by the GPU at every and each rendering cycle, the problem is that I can't really quantify this frequency and I can't tell if is based on some default values or not because I don't have a big collection of hardware right now to do extensive tests. For what i know the answer could be really trivial like "it's the same of the refresh rate of your monitor", but i would like some good answers on that to be clear on this. For instance looks really odd to me that all the techniques used to control the amount of FPS that i have seen until now uses a call for the OpenGL function glutGet(GLUT_ELAPSED_TIME) to retrieve a value in ms about when the rendering started but I have to relies on the CPU to do the math. Why I can't set an FPS value in OpenGL if OpenGL clearly has a counter and a timer/clock? PS I'm referring to OpenGL 3.0+

    Read the article

  • Ubuntu Gnome 14.04 - 100% CPU usage alternating between cores

    - by AwDeOh
    I've noticed my Ubuntu Gnome 14.04 has been getting a bit sluggish lately - things like Gnome Shell overview animation are jerky where they were lightning fast, Elder Scrolls Online is stuttering and dropping to low FPS where I previously had a solid 50-60 fps. Out of interest I looked at the CPU History, and when running nothing but the system monitor, I was getting this: That was 15 minutes ago. The 100% load seemed to be alternating between the cores. PC specs: i3 2130 processor. 8gb DDR3 RAM. ASUS P8-Z77M motherboard. Samsung 128gb SSD I've been trying to reproduce the problem, and while I'm not getting the 100% any more at idle, the system monitor is showing an average load of about 20-30%, that's with just Chrome and the System Monitor open. Oddly, if I touch nothing, it'll average out to about 20% - if I start moving the mouse around and do some typing, it's closer to 40%. Is this normal? Any help appreciated, I wouldn't even know where to start here..

    Read the article

  • Optimus Bumblebee Performance

    - by Chance
    After installing Ubuntu 12.04 and Bumblebee, I tested out the performance of the Nvidia card using Minecraft and a few other games. I've noticed it to be way slower than it was on Windows 7. Is this normal? I'm using the GT 630m. From what I've read online, nobody has said it to be slower than Windows. I'm just really curious because I want to use Linux so much more than Windows, but if I don't get the same performance I feel really picky. The Nvidia card is still faster than my Intel graphics on Ubuntu, but it's not as fast as it was for my on Windows. I get 60 - 80 fps on Minecraft on windows, while I get 28 - 48 fps on Ubuntu. Any Ideas why? Thanks so much!

    Read the article

  • Farseer Physics: Ways to create a Body?

    - by EdgarT
    I want to create something similar to this using farsser and Kinect: https://vimeo.com/33500649 This is my implementation until now: http://www.youtube.com/watch?v=GlIvJRhco4U I have the outline vertices and the triangulation of the user. And following the Texture to Polygonmsample i used this line to create the shape, where farseerObject is a list of vertices of the triangles: _compound = BodyFactory.CreateCompoundPolygon(World, farseerObject, 1f, BodyType.Dynamic); But I have to update the body each frame (like 30 fps) and this is very slow. I get just 2 or 3 fps. There's another (faster) way to create the Body from a list of triangles or the contour vertices?

    Read the article

  • does unused vertices in a 3D object affect performance?

    - by Gajet
    For my game I need to generate a mesh dynamically. now I'm wondering does it have a noticeable affect in fps if I allocate more vertices than what I'm actually using or not? and does it matter if I'm using DirectX or OpenGL? edit final output will be a w*h cell grid, but for technical issues it's much more easier for me to allocate (w+1)*(h+1) vertices. sure I'll only use w*h vertices in indexing, and I know there is some memory wasting there, but I want to know if it also affect fps or not? (note that mesh is only generated once in each time you play the game)

    Read the article

  • Do unused vertices in a 3D object affect performance?

    - by Gajet
    For my game I need to generate a mesh dynamically. Now I'm wondering does it have a noticeable affect in FPS if I allocate more vertices than what I'm actually using or not? and does it matter if I'm using DirectX or OpenGL? Edit Final output will be a w*h cell grid, but for technical issues it's much easier for me to allocate (w+1)*(h+1) vertices. Sure I'll only use w*h vertices in indexing, and I know there is some memory wasting there, but I want to know if it also affect FPS or not? (Note that mesh is only generated once in each time you play the game)

    Read the article

  • Chrome 22 disponible : une version dédiée aux jeux 3D en ligne, API Pointer Lock et améliorations pour Windows 8 et écrans Retina

    Chrome 22 disponible : une version destinée aux FPS et jeux 3D en ligne Support de l'API « Pointer Lock » et améliorations pour Windows 8 et écrans Retina Google ne cesse d'améliorer son navigateur qui devient une véritable plateforme polyvalente. La firme met à jour son navigateur Web Chrome afin qu'il soit plus exploitable par les adeptes et développeurs de FPS (jeux de tirs subjectifs) et de jeux 3D en ligne. [IMG]http://ftp-developpez.com/gordon-fowler/Chrome%20Logo.png[/IMG] Google vient de sortir une nouvelle version "majeure" et stable de Chrome, 22 au compteur. Celle-ci inclut désormais le support pour l'API JavaScript « Pointer...

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >