I have separate manifest files for each level of my game. So when user is playing on Level #1, files for Level#2 are being preloaded at the same time using LoadQueue (PreloadJS).
I've noticed some strange behaviour. Stage FPS is set to 24. But FPS raises (it can be noticed visually) while its preloading next files. It comes to normal FPS when files are preloaded..
How do I fix it? FPS raises at least 1.5x times.
EDIT: I'm using Ticker (RAF activated) and its set to 24 frames per second. Also each sprite has its own 'framerate' property. In most cases its set to 24 as well, but sometimes it has 16 (every 3 frame has been cut and hence framerate set to 16).
EDIT2: Here is an example to check the issue. There are 2 manifest files (for Level1 and Level2). Level1 starts while level2 is being loaded in the background. You can notice that the sprite in Level1 played on higher FPS. It gets to normal FPS when Level2 loading is completed.
It's better to download it and test locally, otherwise FPS changes are less noticable when downloading speed is not as high as in local or on WiFi.
Link: http://www.filedropper.com/preloadjsfps
Related
world.
I have many videos that I want to compare one-to-one to check if they are the same, and get from there the delay of frames, let's say. What I do now is opening both video files with virtualdub and checking manually at the beginning of video 1 that a given frame is at position, i.e., 4325. Then I check video 2 to see the position of the same frame, i.e., 5500. That would make a delay of +1175 frames. Then I check at the end of the video 1 another given frame, position let's say 183038. I check too the video 2 (imagine the position is 184213) and I calculate the difference, again +1175: eureka, same video!
The frame I chose to compare aren't exactly random, it must be one that I know it is exactly one I can compare to (for example, a scene change, an explosion that appears from one frame to another, a dark frame after a lighten one...) and I always try to check for the first comparison frames within the first 10000 positions and for the second check I take at the end.
What I do next is to convert the audio from video 1 to video 2 calculating the number of ms needed, but I don't need help with that. I'd love to automatize the comparison so I just have to select video 1 and video 2, nothing else, that way I could forget forever virtualdub and save a lot of time.
I'm tagging this post as powershell too because I'm making a script where at the moment I have to introduce the delay between frames (after comparing manually) myself. It would be perfect that I could add this at the beginning of the script.
Thanks!
I want to play a smoke particle system continuously but at present, it was taking a pause for some time then after again started spawning particles.
This is my particle system inspector values:
I want particles to remain to continue always not take any kind of pause. What kind of changes will solve my problem?
EDIT:
Okay now I understand, exactly this kind of problem running, it does not disappear but exists in a different place.
Still, I can't able to get continuous emission of particles, it getting a pause in mid:
I have also checked by changing Emission from Time to Distance but still the same problem.
So lets take a look at some specific settings. Rate over Time = 10, Max Particles = 10, Start Lifetime = .5 and Duration = 1.00. In order - you are emitting 10 particles per second, allowing a maximum of 10 particles, which exist for .5 seconds, and then it starts over again after 1 second. So, 10 particles are immediately emitted. No more than 10 can be emitted while they are alive, so for .5 seconds no new particles are being emitted. Then, at .5 seconds they all disappear. So now we have .5 seconds per second that no new particles are being emitted. Then, after a full second the process restarts. You can solve this in two ways.
Lower Duration to .5 seconds from 1.0 seconds so that it restarts right when the particles die
Increase the start lifetime to 1.0 seconds so that the particles stay until the next batch is ready to spawn
The first solution is probably the better fit.
This issue was related to Unity Particle System. Based on other forum discussions, I got the suggestion to update Unity with the latest version because I was using Unity 2018 earlier version.
I downloaded Unity 2018.4.2 and play the game with the same settings. With my surprise, the error was gone and the problem solved.
#TheBatman for giving useful suggestion too.
Try raising the rate over time in the Emission section.
I created a very very simple 2d game in Unity, but sometimes (every 2-3 seconds) there is a small lag. (on iMac, on iPhone, on iPad, on editor unity)
Information:
All textures reduced and still compressed (5kb - 100 kb) (aprox. 50 tex)
All scripts are optimized (In update I use only one Translate for one object which contains multiple objects(train with 10 railway carriage) with Rigidbody2D(isKinematic) and CapsuleCollision2D,
and small checkers (like if(sound != 1) then sound = 1))
Scene have about 20 objects (images, canvas, panels, 2 particles system (snow) with mobile shader > particles > additive and spawn one in every 1 second).
In Awake I set Screen.SetResolution((int)(Screen.width / 1.7f)), (int)(Screen.height / 1.7f)).
I have already optimized everything, and several times. He raised a lot FPS, reduced weight, increased smoothness, but small lags remained.
TODO: I created new clean project, I added 1 image and created script which translate image from right to left, and THERE ARE ALSO friezes!!!
When I play:
The game was created by support cocos2d 0.99.5 and Box2d.
Iphone SDK 4.3
We have a character. When a character moves quickly, it looks blurred (fuzzy // unfocused). On a simulator and on device (iPhone 3G).
To move a character using mouseJoint (dampingRatio = 0 // frequencyHz = -1).
In the screenshot image clearly. link
The character is focused. The screenshot not transfer problems.
All the time 60 fps.
Tried params:
use kCCDirectorProjection2D // 3D
alies // antialies to texture params
CC_COCOSNODE_RENDER_SUBPIXEL 1 and 0
Video sample: link
How to get a clear image of the character during the move?
I also had a problem like this and fixed it by changing this line in ccConfig.h:
#define CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL 0
to
#define CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL 1
This is the comment for this define, maybe it helps someone.
/** #def CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
If enabled, the texture coordinates will be calculated by using this formula:
- texCoord.left = (rect.origin.x*2+1) / (texture.wide*2);
- texCoord.right = texCoord.left + (rect.size.width*2-2)/(texture.wide*2);
The same for bottom and top.
This formula prevents artifacts by using 99% of the texture.
The "correct" way to prevent artifacts is by using the spritesheet-artifact-fixer.py or a similar tool.
Affected nodes:
- CCSprite / CCSpriteBatchNode and subclasses: CCLabelBMFont, CCTMXTiledMap
- CCLabelAtlas
- CCQuadParticleSystem
- CCTileMap
To enabled set it to 1. Disabled by default.
#since v0.99.5
*/
I am pretty sure that what you are describing is an optical illusion. LCDs, especially lower-quality LCDs, have a finite response time. If this response time is too slow, it can cause ghosting, i.e. the moving object looks smeared. Basically what's happening is the previous frame's (or several frames') pixels take a long time to actually "turn off" and you see fainter versions of your sprite left behind as it moves.
With regards to your comment:
For the experiment, I took a pencil and put it to a sheet of paper
began to move quickly. Eyes see a pencil in focus, then problem is not
an optical effect, a code problems
Looking at a moving object in the real world is not the same as looking at a moving object on the screen, with or without a poor display response time. The real-world object moves continuously, but the screen object moves in discrete steps. Your eye can follow the pencil exactly and keep the image sharp on your retina. If you follow a screen image, however, your eye moves smoothly, while the screen image "jumps" from place to place. This can cause a "juddering" effect for sufficiently fast-moving objects, even at high framerates. If 60fps is still juddery, there is basically no way around this; it is a limitation of current technology.
I'm currently working on an iphone app that lets the user take a picture with the camera and then process it using Quartz 2D.
With Quartz 2D I transform the context to make the picture appear with the right orientation (scale and translate because it's mirrored) and then I stack a bunch of layers whith blending modes to process the picture.
The initial (and the final result) picture is 3mp or 5mp depending on device and it takes a great amount of memory once drawn. Reminder : it's not a jpeg in memory, it's bitmap data.
My layers are the same size as the initial picture so every time i draw a new layer on top of my picture i need the current picture state in memory (A) + the layer to blend memory space (B) + the space in memory to write the result (C).
When i get the result i ditch "A" and "B", takes "C" to the next stage of processing where it become the new "A"...
I need 4 pass like this to obtain the finale picture.
Giving the resolution of these pictures my memory usage can climb high.
I can see a peek at 14Mo-15Mo and most of the time i only get level 1 warnings but level 2s sometimes wave at me and kill my app.
Am i doing this the right way regarding general process ?
Is there a way to speed up the processing ?
Why oh why memory warnings spawn randomly ?
Why the second picture process is longer than the first as you can see in this pic:
Because the duration looks to be about twice as long; I'd say it was doing twice as much processing. Does the third photo taken take three times as long?
If so, that would seem to indicate it's processing all previous photos / layers taken. Which - of course - is a bug in your code somewhere.