Tips for framerate ? [Fixed]

merrak

  • *
  • Posts: 2738
I'd read through this before using it: http://hxscout.com/guide.html

As for what to keep an eye out for, I attached an example session of my own. Click and drag on the timeline to highlight an interval of time to analyze. In the hierarchy, you'll have to keep expanding until you see functions you recognize (the ones you see if you do 'view code' in design mode). This particular interval was okay. It spent 795ms in the render routine. I found a potential bottleneck in my own code. I had to expand pretty far to get there, but it pointed out behaviors that were causing problems.

Orange bars refer to garbage collection. Periodic peaks should be expected, but if these occur when your game is lagging then you have a problem. Deleting a bunch of things can cause a lot of garbage to be collected. If you can't avoid this, you may need to pause the action and make some kind of loading scene/loading bar so that the scene had time to load before the game starts.

airman4

  • Posts: 875
I got a lot of little red
but wait , i need to try to identify the damn problem

airman4

  • Posts: 875
here we go !
I got several red

merrak

  • *
  • Posts: 2738
222MB of memory seems high to me. From your video the lag seemed to occur after scene transitions, so I'd investigate a time interval that includes one.

airman4

  • Posts: 875
I see
When i recorded the video 50 fps of mine , the lag occured at a transition
That mega weird since i use reload , then i'll use other thing

I also have a slow motion code put when we die
"the code engine step size " thingy

I also have this code put in the beginning as 10 value cause , i noticed some bug when the slow motion carried away

Also my transition is very short
time transition in and out are 1.3 seconds

greatanthony

  • Posts: 166
tip: if you are having more than 15 actors on the screen , then try to make=====>>>>
==============reduce attributes as much as possible================
==============reduce scene behaviours as much as possible==========
==============reduce actors with 0.1 frame rate (( i.e those you think are taking more memory and could be replaced                        by drawing that actor in the background itself (( which dont move but have animations ex. wall lamp/streetlamp))
=============dont let a lots of codework work every frame under your {{always}} section.  THINK and THINK and you will be able to improve everything!!!!

merrak

  • *
  • Posts: 2738
tip: if you are having more than 15 actors on the screen , then try to make=====>>>>
==============reduce attributes as much as possible================
==============reduce scene behaviours as much as possible==========
==============reduce actors with 0.1 frame rate (( i.e those you think are taking more memory and could be replaced                        by drawing that actor in the background itself (( which dont move but have animations ex. wall lamp/streetlamp))
=============dont let a lots of codework work every frame under your {{always}} section.  THINK and THINK and you will be able to improve everything!!!

Eh, the effects of some of these tips will be marginal. I have hundreds of actors in a scene and no issues whatsoever. Performance isn't a function of the number of attributes and behaviors. Keeping an eye on what is in an 'always' event is good practice--but hxScout will reveal if an 'always' event is the source of lag.

I sometimes get some extra lag with hxScout, particularly when assets are loaded.

airman4

  • Posts: 875
I'm kinda lost , i'll export a version for people to Test

airman4

  • Posts: 875
https://www.dropbox.com/s/7m6vxzz7hxcbaf2/Malaika%20Princess%20Victory%20Road%20v3%20not%20final%20%20Press%20N%20to%20get%20inside.swf?dl=0

Go ahead and tell me please

Press N to enter

Commands
After press ENTER
In game press UP , back, left and right arrow to move
Left is slow down , dont do that cause the Boss behind will get close (logic )
Right is dash , it's also infinite (since the heroine is inside a dream )

Concept , touch the YELLOW CUBES to push back the BOSS
RED CUBES give  a dash towards heroine to the BOSS , so AVOID THEM

TELL ME if you REACH 60 FPS constant

airman4

  • Posts: 875
I'm discussing with a fellow dev (he doesnt uses stencylworks )
and he told to check the task manager when the dips happens

I saw like a culprit when i did

RUNTIME BROKER


I'm on windows 10 and i'm gonna desactivate this s****


SadiQ

  • Posts: 1795
I reach a constant 4 FPS on my crappy laptop :( Win 7 here.
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

airman4

  • Posts: 875
Dannnng

Try playing into a Browser also

Check your Task Manager

I also tested quick on windows 7 and got 20/30 FPS

edit

After removing RUNTIME BROKER , nothing changed much so i'll keep testing cause , every time i close my laptop and re-open , i get 60 fps until something happens.
You can try with my link

I will also try to remove things from my game to help.

The 4fps constant is very bad , that stresses me

« Last Edit: January 05, 2017, 05:10:57 am by airman4 »

SadiQ

  • Posts: 1795
It's most likely a code issue.
I just got a #1009 error by simply not doing anything:
Code: [Select]
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.stencyl.behavior::Script$/createRecycledActorOnLayer()[C:/Program Files (x86)/Stencyl9283 file/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Script.hx:1768]
at MethodInfo-10012()[Source/scripts/SceneEvents_4.hx:4051]
It seems to be using 800 MB of memory? That's huge.
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

airman4

  • Posts: 875
thanks
i'll take a look into that then

800 mb memory , okay , i'll compress the sprites quality then , maybe it will help

SadiQ

  • Posts: 1795
Focus on the code first. Timers could be a problem?
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.