Author Topic: Help needed! I'm having a problem with slowdown on my theme (FIXED!)  (Read 7752 times)

markc74

  • Full Member
  • ***
  • Posts: 28
    • View Profile
Hi all,

I'm almost finished creating a theme for my upright CRT cabinet but I've ran into a problem that I can't seem to fix and really hope someone here might be able to help me out.

The theme (called the Invaders) is a relatively simple list with a video running in the background. Pressing the "custom1" button cycles between the video of the game running, the flyer, and cabinet before returning to the video again. This happens via animate.nut which just slides the images in and out from the side.

On initial loading, scrolling up and down through the list works perfectly well, but after cycling through the vid/flyer/cabinet a couple of times the whole theme starts slowing down and becoming choppy.

I've done some searching but didn't really come up with anything. The laptop I'm using to create the theme is an i7 with 16GB ram and 500GB SSD so I dont think that should be causing the problem so I expect the problem lies with my code being inefficient in some way (I'm learning as I go!)

Anyway -if anyone has time to take a look at the attached layout and see if they can see anything obvious I'd be very grateful!

Here's a youtube link showing initially how smooth it runs, and then the slowdown/stuttering appearing (around the 1:00 mark)

https://youtu.be/-YSqlLmkfMs
« Last Edit: February 12, 2018, 11:12:39 AM by markc74 »

calle81

  • Sr. Member
  • ****
  • Posts: 184
    • View Profile
Re: Help needed! I'm having a problem with slowdown on my theme
« Reply #1 on: February 07, 2018, 08:29:16 AM »
Add this for your videosnap

snap.trigger = Transition.EndNavigation;

Then the video will only change when you stop scrolling.

calle81

  • Sr. Member
  • ****
  • Posts: 184
    • View Profile
Re: Help needed! I'm having a problem with slowdown on my theme
« Reply #2 on: February 07, 2018, 08:31:33 AM »
Or in your case vid.trigger = Transition.EndNavigation;

You should do the same with the rest of the art aswell:

flyer.trigger = Transition.EndNavigation;

calle81

  • Sr. Member
  • ****
  • Posts: 184
    • View Profile
Re: Help needed! I'm having a problem with slowdown on my theme
« Reply #3 on: February 07, 2018, 08:34:03 AM »
You can also use fadeart for a smooth fade

local vid = FadeArt( "video", flx*0.2, fly*0.18, flw*0.5, flh*0.65);

verion

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 861
    • View Profile
    • new projects
Re: Help needed! I'm having a problem with slowdown on my theme
« Reply #4 on: February 07, 2018, 08:35:44 AM »
It's a great theme - simple, but elegant. And really needed, because there is just a bunch of vertical themes.

markc74

  • Full Member
  • ***
  • Posts: 28
    • View Profile
Re: Help needed! I'm having a problem with slowdown on my theme
« Reply #5 on: February 07, 2018, 08:57:52 AM »
Thanks calle81! I'll give that a go this evening and see if it solves it.

Verion - once I've got it working properly I'll upload the final version for anyone to use - it's been made to run on my 15hz cabinet so I needed to keep it simple.

popoklo

  • Full Member
  • ***
  • Posts: 50
    • View Profile
Re: Help needed! I'm having a problem with slowdown on my theme
« Reply #6 on: February 07, 2018, 12:44:52 PM »
nice theme mark!

i had exactly the same problem witch my own theme. when i turned of the animations (i think u use the animation module?) there seems to be no slow down. i now use liquids new animation module on GitHub. now it is working, no slowdown after loooong scrolling tests. BUT... it is only one possible idea. of course there can be different problems.
by the way. the new animation module from liquid is also more precislely.

good luck!

YellowBirdAZ

  • Full Member
  • ***
  • Posts: 80
    • View Profile
Re: Help needed! I'm having a problem with slowdown on my theme
« Reply #7 on: February 08, 2018, 01:12:12 PM »
Quote
i now use liquids new animation module on GitHub.

I can't find this... do you have a link?

EDIT:
Nevermind, found it...

https://github.com/liquid8d/attract-extra
« Last Edit: February 08, 2018, 02:04:17 PM by YellowBirdAZ »

popoklo

  • Full Member
  • ***
  • Posts: 50
    • View Profile
Re: Help needed! I'm having a problem with slowdown on my theme
« Reply #8 on: February 09, 2018, 01:58:10 PM »
ou sorry. right. the link is correct. u only then have to go to /modules/animate2/
the animate2 is the new WIP animation module

FrizzleFried

  • Sr. Member
  • ****
  • Posts: 243
    • View Profile
    • Idaho Garagecade
Re: Help needed! I'm having a problem with slowdown on my theme
« Reply #9 on: February 10, 2018, 08:44:22 AM »
Looking forward to trying this theme out on my arcade cabinet... (standard resolution)...
Visit my arcade blog ... www.idahogaragecade.com (updated 06-27-19)

YellowBirdAZ

  • Full Member
  • ***
  • Posts: 80
    • View Profile
Re: Help needed! I'm having a problem with slowdown on my theme
« Reply #10 on: February 11, 2018, 06:31:26 PM »
I really like Liquid8d's animate2 module. The syntax is nice.

To the extent I got it working it seemed to run really fast too. I would like to use it, but I was running into all sorts of crash-inducing errors. I'm not doing anything fancy either, mostly all property-based animations.

Is it documented elsewhere, beyond what is on the Github page?

I know it's a WIP. It looks promising.

markc74

  • Full Member
  • ***
  • Posts: 28
    • View Profile
Re: Help needed! I'm having a problem with slowdown on my theme
« Reply #11 on: February 12, 2018, 11:12:20 AM »
popoklo - animate2 seems to have fixed it!

Attached the latest version - this works well enough for me but there are still some bugs.  I'll upload the latest version into the themes thread as well so anyone can take it (and hopefully improve it!). Like I say - I'm more of a tinkerer than a coder but hopefully it's of use to someone  :D

Thanks to everyone for their help. Much appreciated!!
« Last Edit: February 12, 2018, 12:31:23 PM by markc74 »

calle81

  • Sr. Member
  • ****
  • Posts: 184
    • View Profile
Re: Help needed! I'm having a problem with slowdown on my theme (FIXED!)
« Reply #12 on: February 13, 2018, 07:41:54 AM »
Great! :) Is animate2 a drop in replacement or do I have to make changes in order to use it instead of the old animate module?

markc74

  • Full Member
  • ***
  • Posts: 28
    • View Profile
Re: Help needed! I'm having a problem with slowdown on my theme (FIXED!)
« Reply #13 on: February 13, 2018, 05:17:33 PM »
Great! :) Is animate2 a drop in replacement or do I have to make changes in order to use it instead of the old animate module?

You shouldn't have to make any changes. If you download it to the modules folder (keeping the animate2 name) then it should work fine.

Neosys

  • Full Member
  • ***
  • Posts: 50
    • View Profile
Re: Help needed! I'm having a problem with slowdown on my theme (FIXED!)
« Reply #14 on: December 14, 2019, 06:58:09 AM »
I have a problem with the scroll speed when selecting games in my layout.

Now I have installed the animate2 module.

and so
In my layout:

// modules
fe.load_module ( "fade");
fe.load_module ("conveyor");
fe.load_module ("animate");
fe.load_module ("animate2");
//fe.load_module("objects/scrollingtext ");


My attract mode module folder looks like this:

C: \ attract-v2.6.0-win64 \ modules \
animate \
animate2 \
extended \
file-layout \
objects \
animate.nut
animate2.nut
animlist.nut
conveyor.nut
conveyor_helper.nut
fade.nut
file-format.nut
file-layout.nut
file.nut
pan-and-scan.nut
preserve-art.nut
spritesheet.nut

is that okay?

but then get the following error in the console:

AN ERROR HAS OCCURED [the index 'config' does not exist]

CALL STACK
* FUNCTION [transition_callback ()] C: \ attract-v2.6.0-win64 \ modules \ animate.nut line [347]

LOCALS
[anim] INSTANCE
[@ INDEX @] 0
[busy] false
[ttime] 0
[var] 0
[ttype] 0
[this] INSTANCE
Script error in transition function: transition_callback - the index 'config' does not exist

AN ERROR HAS OCCURED [the index 'config' does not exist]

CALL STACK
* FUNCTION [transition_callback ()] C: \ attract-v2.6.0-win64 \ modules \ animate.nut line [347]

Where is the mistake?