same code different result

Create fast, sprite powered games with Animation Engine, co-developed with DerBrill Software!

Moderators: heatherlaine, kevinmiller, robinmiller, malte

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

same code different result

Post by Samuele » Sun Feb 06, 2022 2:33 pm

Hi, I was starting to use the animation engine in my stack when this problem appeared, i use the same code to move two objects in a card but 1 is "glitched" meaning is not moving well, with glitches on the way and the other totally normally, the strange thing is that in the beginning the "glitched! one was moving normally then i changed the image resolution and since then it's glitched, even after I have returned the resolution to the one it was before :shock: Any ideas on how this occurred? Thanks!
P.S i leave here an example stack.
Menu.zip
(51.08 KiB) Downloaded 123 times
Samuele.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9660
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: same code different result

Post by dunbarx » Sun Feb 06, 2022 5:02 pm

Samuele.

Opened your stack and hit the button. The yellow thing moves smoothly. What is it you wanted to demonstrate?

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9385
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: same code different result

Post by richmond62 » Sun Feb 06, 2022 6:51 pm

Nothing obviously wrong.

However I could not resist the temptation to rewrite the functionality so you do not need the animation engine:

:twisted:
-
SShot 2022-02-06 at 19.48.48.png
Attachments
MenuTwitch.livecode.zip
(22.62 KiB) Downloaded 113 times

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7235
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: same code different result

Post by jacque » Sun Feb 06, 2022 7:28 pm

LC may be caching the image when the stack opens. Try closing and removing it from memory, and then open it again. See if that fixes it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9385
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: same code different result

Post by richmond62 » Sun Feb 06, 2022 7:50 pm

Exactly what Jacque says.

Be careful NOT to choose CLOSE but choose CLOSE and REMOVE:
-
closeNremove.png
closeNremove.png (54.76 KiB) Viewed 5715 times
-
AND try and see if the same problem arises with my version . . . 8)

Different code same result
:wink:

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: same code different result

Post by Samuele » Sun Feb 06, 2022 9:51 pm

jacque wrote:
Sun Feb 06, 2022 7:28 pm
LC may be caching the image when the stack opens. Try closing and removing it from memory, and then open it again. See if that fixes it.
ahh, so send it to myself and then download it?
Last edited by Samuele on Sun Feb 06, 2022 10:12 pm, edited 1 time in total.
Samuele.

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: same code different result

Post by Samuele » Sun Feb 06, 2022 10:19 pm

richmond62 wrote:
Sun Feb 06, 2022 7:50 pm
AND try and see if the same problem arises with my version . . .
yep, so that's the proof that the problem is on the images and not the script...
Samuele.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7235
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: same code different result

Post by jacque » Sun Feb 06, 2022 11:09 pm

Samuele wrote:
Sun Feb 06, 2022 9:51 pm
jacque wrote:
Sun Feb 06, 2022 7:28 pm
LC may be caching the image when the stack opens. Try closing and removing it from memory, and then open it again. See if that fixes it.
ahh, so send it to myself and then download it?
You don't need to do that. Just choose "Close and remove from memory" from the File menu. That will eliminate the cache. Then choose Open Stack to open your file again.

Or you can accomplish the same thing by just restarting LC.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

stam
Posts: 2682
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: same code different result

Post by stam » Mon Feb 07, 2022 1:57 am

I must say, i never really understood why LC will 'close' files but keep them open in memory. There must be a use-case for this, but none that affects me, so i have set my preferences to always close file (even if destroyStack is false) and to assign destroyStack to true for all new stacks, so closing them removes the from memory as well.
Can be quite confusing occasionally otherwise!

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9385
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: same code different result

Post by richmond62 » Mon Feb 07, 2022 10:28 am

yep, so that's the proof that the problem is on the images and not the script...
Well, either I'm very stupid (don't answer that one), or there's some sort of communication breakdown,
because:

1. I can see nothing wrong with the functionality of your stack.

[I can see something wrong with the affordances, and will write about those later]

2. I cannot exactly understand what you mean by your problem.

If you could make a quick on-screen movie of the problem that would be super.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9385
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: same code different result

Post by richmond62 » Mon Feb 07, 2022 11:03 am


Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: same code different result

Post by Samuele » Mon Feb 07, 2022 12:18 pm

jacque wrote:
Sun Feb 06, 2022 11:09 pm
Samuele wrote:
Sun Feb 06, 2022 9:51 pm
jacque wrote:
Sun Feb 06, 2022 7:28 pm
LC may be caching the image when the stack opens. Try closing and removing it from memory, and then open it again. See if that fixes it.
ahh, so send it to myself and then download it?
You don't need to do that. Just choose "Close and remove from memory" from the File menu. That will eliminate the cache. Then choose Open Stack to open your file again.

Or you can accomplish the same thing by just restarting LC.
ahhh, i restarted LC like a million times and tried your way as well, with no success...
Samuele.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9385
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: same code different result

Post by richmond62 » Mon Feb 07, 2022 12:24 pm


Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: same code different result

Post by Samuele » Mon Feb 07, 2022 12:31 pm

richmond62 wrote:
Mon Feb 07, 2022 11:03 am
Affordances:

https://en.wikipedia.org/wiki/Don_Norman
-
SShot 2022-02-07 at 11.55.58.png
-
SShot 2022-02-07 at 12.01.10.png
alright, i know I'm a bit color blind and now i know I'm also not particularly smart, but what difference does it make if you understood? :wink:
Just kidding here, that's the video, i hope it'll be clearer than my words :) https://www.dropbox.com/t/z6dHsrfOOXJqxKhl
Samuele.

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: same code different result

Post by Samuele » Mon Feb 07, 2022 12:32 pm

richmond62 wrote:
Mon Feb 07, 2022 12:24 pm
Try your stack with another version of LiveCode:

https://archive.org/details/live-code-c ... ws-x86-x64

https://archive.org/details/live-code-c ... taller-mac
i already have have 2 versions on my pc, LC community 9.5 and 9.6.3
Samuele.

Post Reply

Return to “Animation Engine”