Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] Screen/sprite flicker issue

Author
Message
Zaxxan
Developer
4
Years of Service
Recently Online
Joined: 17th Nov 2020
Location: England
Posted: 26th Mar 2021 15:28 Edited at: 31st Mar 2021 04:47
This post has been marked by the post author as the answer.
Hi all, I seem to be having a problem with playing cards flashing on the screen in my latest game as though they are staying resident in memory. When I start a game the cards are tweened back to the deck but then there is a brief flash on the screen of where the cards are going to be tweened to. Has anyone any suggestions on how to fix this?

Note: it doesn't do this on every deal it seems to be intermittent.

Attachments

Login to view attachments

The author of this post has marked a post as an answer.

Go to answer

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 26th Mar 2021 19:25
That has got to be in your code somewhere.
I would go through your code and Log( szMessage ) everytime you sync() make the message so you can identify where it is. I'm pretty sure you'll find there is an errant piece of code in there somewhere
I think you need to run with debug for log to work
Zaxxan
Developer
4
Years of Service
Recently Online
Joined: 17th Nov 2020
Location: England
Posted: 26th Mar 2021 20:10
Ok thanks for the advice I will give it a try. Oddly It only seems to do it on windows, I've never seem it on android and they both use the same code. I use the same code on my Klondike game and I've never seen the error on that either. Very strange.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 26th Mar 2021 21:06
Quote: "as though they are staying resident in memory"

not 100% sure what you mean but making sure that you see that the "brief flash" cards are the "new" deck (not old that might somehow stay "resident").
[My Itch.io Home] [Now Playing]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
Zaxxan
Developer
4
Years of Service
Recently Online
Joined: 17th Nov 2020
Location: England
Posted: 26th Mar 2021 21:13 Edited at: 26th Mar 2021 21:15
Hi sorry, at first a thought it was the old cards but after watching the video a few times I realised it was the new deck that was flashing up and amended my post but forgot to remove the comment about the memory.

The brief flash is the position that cards will go to when the tween has completed.

I have one tween to move the cards to the deck and one tween to move the cards to the tableau. The brief flash is the tween destination point so I'm not sure how it can do this. I've played hundreds of games on my phone and haven't seen the issue. It only appears on windows every now and again.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 27th Mar 2021 01:43
Maybe try this.
Every frame hit test the position of the top card in the first row.
If the sprite is one of the cards AND visible (And it shouldn't be) the execute a break.

Something like;


The run the app with debug and set a beak on the line: id = id
Zaxxan
Developer
4
Years of Service
Recently Online
Joined: 17th Nov 2020
Location: England
Posted: 27th Mar 2021 08:15
Thanks Blink0k, I'll give it a try later today.
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 27th Mar 2021 09:29 Edited at: 27th Mar 2021 09:30
I would log the tweentime and x,y position of the sprites, as I think the tween must be responsible for that behaviour.
Sync() is like a tank, no matter what it will be executed each loop if not told otherwise.
There is aswell no hidden buffer that may save any rendering information for more than one frame (the swap buffer can't do such jumps)

I suspect a float value going above a certain treshhold like


but v# can't be more than 1.0 or everything will be moved to 0.0 tween

Such a construction is able to trigger such a rendering error.

Zaxxan
Developer
4
Years of Service
Recently Online
Joined: 17th Nov 2020
Location: England
Posted: 27th Mar 2021 11:19
I think I have found the issue. A tween returns the cards to the deck which then triggers the deal tween it looks like sometimes the deal tween was being triggered fractionally before the return tween had completed. I've put a small delay in between the two tweens and it hasn't had the issue since. Hopefully it is fixed now.

Login to post a reply

Server time is: 2024-11-21 17:57:15
Your offset time is: 2024-11-21 17:57:15