Games "skipping frame!!!" good or bad?

Gunther

Active Member
Licensed User
Longtime User
Hello,

when I am getting in the log "skipping frame!!!" is it good or bad or a point to check?

In B4A, but not in B4J with the same code.

The app is running but every now and then this pops up:
B4X:
skipping frame!!!
skipping frame!!!
skipping frame!!!
skipping frame!!!
skipping frame!!!
skipping frame!!!
skipping frame!!!
skipping frame!!!
skipping frame!!!
skipping frame!!!
skipping frame!!!
skipping frame!!!
skipping frame!!!
skipping frame!!!
skipping frame!!!
skipping frame!!!
skipping frame!!!
 

Cableguy

Expert
Licensed User
Longtime User
This is too little information for us to even try to help you.
"Skipping frames" ... I guess, and can only guess, it's related to video playback (?)
WHEN does it happen?
Have you tried different devices? (Video playback can be very hardware dependent)
Also consider that, a b4j app runs in a completely different type of machine, when compared to android devices
.

I decided to strike my post .. why?... Well, on the 3rd post we finally get the info needed to be able to properly advise..
 
Last edited:

Gunther

Active Member
Licensed User
Longtime User
It is just when the App is idle (except running the Gameloop). Means nothing to do just waiting for user action.

Let me check the "old" X2.bas's for the source and the reason.... done:

it is in X2Utils.bas
B4X:
        If gs.ShouldDraw Then
            Drawing = True
            If IsDebugDrawEnabled Then
                DebugDraw.Draw(gs, VisibleBodies)
            End If
            gs.DrawingTasks.AddAll(LastDrawingTasks)
            #if STATS
            StatsClockForDrawings = DateTime.Now
            Log("Drawing tasks: " & gs.DrawingTasks.Size)
            #End If
            MainBC.DrawBitmapCreatorsAsync(Me, "BC", gs.DrawingTasks)
        Else If NonDrawingIteration = False Then
            Log("skipping frame!!!")
            SkippedFrames = SkippedFrames + 1
            LoopsPerSecond = LoopsPerSecond - 1
        End If
        LastDrawingTasks.Clear

and the "NonDrawingIteration" is here:

B4X:
        Dim NonDrawingIteration As Boolean
        If LoopsPerSecond < TargetFPS - 6 Then
            If IsLowFPS = False Then
                LoopsPerSecond = -1000000
                IsLowFPS = True
            End If
            NonDrawingIteration = counter Mod 2 = 0
        Else
            IsLowFPS = False
        End If
        gs.ShouldDraw = Not(NonDrawingIteration Or Drawing = True)
 
Last edited:
Top