Create a button's icon with a part of a big image? - Beleaguered Castle

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Zax
Posts: 519
Joined: Mon May 28, 2007 10:12 am
Contact:

Re: Create a button's icon with a part of a big image? - Beleaguered Castle

Post by Zax » Sat Sep 03, 2022 1:36 pm

stam wrote:
Fri Sep 02, 2022 7:43 pm
I did however encounter some resizing issues... when one of the side-stacks of card became very large, the scale of everything jumped to a smaller size even though it didn't really need to. I tried resizing the board and then found the cards didn't overlay the wells properly and then the game wouldn't work. I quit the game hoping that restart would fix it, but was faced with this:
Like I previously said to Andreas, I encountered this bug with older versions. I thought it was fixed.
I'm unable to reproduce this bug on MacOS 10.12 (Sierra), so it's very hard for me to fix it.
I don't think the different OS are in question. I think it's it's rather the power and the speed of the processor which changes something combined to the user's click speed.
Anyhow, board checking has been fully rewrited in 0.14 version. So, if strange behaviors occur, try to use the "Check board data" menu item.

Concerning the missing hilite. It's working fine for me, and a new hilite has been added: right-click on the board (outside any card) to hilite card that could be moved onto foundations.
I didn't modify the code for the previous hilite functions, so I don't know what to say. Is this hilite problem has occured to other users?

Mac OS: https://sw.ixoft.com/files/_OLD/Beleagu ... 14_OSX.zip
Windows: https://sw.ixoft.com/files/_OLD/Beleagu ... 14_win.zip
Linux: https://sw.ixoft.com/files/_OLD/Beleagu ... inux64.zip

stam
Posts: 3069
Joined: Sun Jun 04, 2006 9:39 pm

Re: Create a button's icon with a part of a big image? - Beleaguered Castle

Post by stam » Sun Sep 04, 2022 2:42 am

Well i downloaded 0.14 and have played a few matches (even won twice!) and eventually ran into problems again... Trying to see if i could re-trigger the issue, i tried to make the side-piles as long as possible. In this case, it didn't trigger a resize, but a card became unresponsive.

In the screenshot below the 8 of hearts (left, 3rd down) became unresponsive - couldn't be moved to the 9 below it. I though maybe a resize would restore it, but enlarging the board actually made all the cards smaller (the opposite of what should happen i think?) and the 8 dropped below the rest as seen in the image. Even in this state the game remains playable for a few more clicks, but the 8 of hearts can't be picked up or moved and after a few moves, more cards become unresponsive and more drop below the rest.

I wonder if the issue is with the code that decides when to shrink the cards when the side-piles get too long? In my limited testing so far, this seems to be when cards can become unresponsive and then trying to resize the stack causes the weird graphic glitches...

Most of the time this does work OK, so it's not a reproducible error.
When working normally, it does seem to shrink the cards disproportionately leaving *a lot* of free space while making the cards disproportionately small compared to the board size. Perhaps reducing the distance between cards and instead of significantly reducing their size would help?
resizing.jpg


Hope this helps and hope this can be fixed - really enjoying the game otherwise!

Zax
Posts: 519
Joined: Mon May 28, 2007 10:12 am
Contact:

Re: Create a button's icon with a part of a big image? - Beleaguered Castle

Post by Zax » Sun Sep 04, 2022 7:27 am

Thank you stam for your tests.

I played the 0.14 on Mac and Windows without any problem.
Have you used the History buttons before running into problems?
Also, have you tried to use the "Check board data" menu item when strange behaviors occur? It had to be done as soon as possible.

Concerning the extra space at the both sides of the cards rows, I choose to let lot of space to avoid resizing too often.

stam
Posts: 3069
Joined: Sun Jun 04, 2006 9:39 pm

Re: Create a button's icon with a part of a big image? - Beleaguered Castle

Post by stam » Sun Sep 04, 2022 1:47 pm

Zax wrote:
Sun Sep 04, 2022 7:27 am
Thank you stam for your tests.

I played the 0.14 on Mac and Windows without any problem.
Have you used the History buttons before running into problems?
Also, have you tried to use the "Check board data" menu item when strange behaviors occur? It had to be done as soon as possible.

Concerning the extra space at the both sides of the cards rows, I choose to let lot of space to avoid resizing too often.
HI Zax,
The few times this has happened it's been after 40+ moves in the game, so may be something other than resting that causes the problem.
I haven't used the history buttons but probably have used the undo feature (cmd-z)
I wasn't at all aware of 'check board data' - i now see this is in the file menu, will use this as soon as the problem recurs and report back.

Finally - the reason i mention spacing between cards is that you wouldn't need to resize, just move the cards a bit and it would be a lot nicer. Personally it bugs me when the cards just from a nice big comfortable size to a much smaller size and am left with a ton of free space around the cards (but that's just me)... I suppose it's a matter of performance, but wonder if that may be an acceptable compromise?

For a certain board size, shrinking the cards seems excessive - repositioning them should be all that's needed (adjusting size should really be needed only if the board changes size i would have thought?)

Anyway will report back with 'check board data'.

S.

Zax
Posts: 519
Joined: Mon May 28, 2007 10:12 am
Contact:

Re: Create a button's icon with a part of a big image? - Beleaguered Castle

Post by Zax » Sun Sep 04, 2022 1:55 pm

stam wrote:
Sun Sep 04, 2022 1:47 pm
For a certain board size, shrinking the cards seems excessive - repositioning them should be all that's needed (adjusting size should really be needed only if the board changes size i would have thought?)
Well, I choose at the beginning of the project to horizontaly center foundations stacks, but maybe I rather should only check both sides free spaces and not try to center foundations. I think this could be done in a future version - but not now because it involve lots of code modification. The immediate thing to do is to have a stable version.

stam
Posts: 3069
Joined: Sun Jun 04, 2006 9:39 pm

Re: Create a button's icon with a part of a big image? - Beleaguered Castle

Post by stam » Sun Sep 04, 2022 1:55 pm

Further to this i was quickly able to reproduce the error:

1. play the game until the a side pile reaches a size that would trigger a resize
2. undo - in the example below i did 'undo' all the way to 0 (using cmd-z)
3. boom

the picture below shows the output of the 'check board data' command.

HTH,
Stam
Attachments
check board data.jpg

stam
Posts: 3069
Joined: Sun Jun 04, 2006 9:39 pm

Re: Create a button's icon with a part of a big image? - Beleaguered Castle

Post by stam » Sun Sep 04, 2022 2:08 pm

Further to this - resize is not needed to trigger the 'check board data' error.

In two consecutive games i made 5 moves then did 'undo' down to 0 (more precisely i did 'undo' until i heard a bleep, meaning i'd try to back further than zero). Same error with the check board data function.

Perhaps the issue then lies with 'undo'.

BW
Stam

Zax
Posts: 519
Joined: Mon May 28, 2007 10:12 am
Contact:

Re: Create a button's icon with a part of a big image? - Beleaguered Castle

Post by Zax » Sun Sep 04, 2022 3:44 pm

stam wrote:
Sun Sep 04, 2022 2:08 pm
In two consecutive games i made 5 moves then did 'undo' down to 0 (more precisely i did 'undo' until i heard a bleep, meaning i'd try to back further than zero). Same error with the check board data function.
Can you tell what kind of moves you did?
"manual" move, aka drag a card onto another, or "auto" move, aka click on a card which will automatically be moved to another available card
I never encountered problem with manual moves, but if the user double-click very fast on a card, it may cause problem as it seems the second "mouseUp" is sent to the card below while the first auto movement is not already finished. For example, with my old machine, all the scripts performed during an auto movement take a total of 170 milliseconds (lots of things are made when a card is moved).

So, to perform auto movements, I strongly recommend to single-click (and not double-click), and not too fast!

Could you please try this and tell me if it's better? Thank you.

stam
Posts: 3069
Joined: Sun Jun 04, 2006 9:39 pm

Re: Create a button's icon with a part of a big image? - Beleaguered Castle

Post by stam » Sun Sep 04, 2022 3:46 pm

Hi Zax, i appreciate the thought it's either drag and drop or single click. I have never double-clicked.
On my system i can reproduce this eventually in all games if i use cmd-z a lot.

regards
S.

Zax
Posts: 519
Joined: Mon May 28, 2007 10:12 am
Contact:

Re: Create a button's icon with a part of a big image? - Beleaguered Castle

Post by Zax » Sun Sep 04, 2022 6:17 pm

stam wrote:
Sun Sep 04, 2022 3:46 pm
Hi Zax, i appreciate the thought it's either drag and drop or single click. I have never double-clicked.
On my system i can reproduce this eventually in all games if i use cmd-z a lot.
:(
Last point to check: when using Undo (or cmd-z, it's the same script), do you use it very quickly? Please try to do several undo but slowly, to let each card be moved back to its previous location. If a resize occurs, let it let it complete before performing the next undo.
Thanks for your time, stam.

stam
Posts: 3069
Joined: Sun Jun 04, 2006 9:39 pm

Re: Create a button's icon with a part of a big image? - Beleaguered Castle

Post by stam » Sun Sep 04, 2022 6:51 pm

No, admittedly I do the “undos” in quick succession to get back where I want to be. I certainly don’t wait for the card to be repositioned.

This probably reflects what most players would do.

If this is the issue, perhaps don’t animate the card move? I think people “undoing” stuff like that wouldn’t really expect to see slow animations (just my experience from other solitaire games).

S.

Zax
Posts: 519
Joined: Mon May 28, 2007 10:12 am
Contact:

Re: Create a button's icon with a part of a big image? - Beleaguered Castle

Post by Zax » Mon Sep 05, 2022 11:28 am

The problem actually comes from the speed.
I am unable to manage actions that follow one another too quickly - and this is even more true if, for example, an action in the history triggers a resizing. I tried several things to manage this delay but without success. It's beyond my LC skills.

I don't think the card movement animation is the main cause of the problem. Besides, I find it very useful to know which card is moved during a history movement.

So I don't know what to say except to repeat not to click too quickly on cards, or to navigate in the history too quickly.
It should perhaps be kept in mind that a solitaire card game is mostly for old people, who slowly click with their gnarled fingers on cards they don't see well, while drinking herbal tea ;)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10092
Joined: Fri Feb 19, 2010 10:17 am

Re: Create a button's icon with a part of a big image? - Beleaguered Castle

Post by richmond62 » Mon Sep 05, 2022 11:41 am

One of the way to slow things down is by using wait.

Zax
Posts: 519
Joined: Mon May 28, 2007 10:12 am
Contact:

Re: Create a button's icon with a part of a big image? - Beleaguered Castle

Post by Zax » Mon Sep 05, 2022 11:49 am

richmond62 wrote:
Mon Sep 05, 2022 11:41 am
One of the way to slow things down is by using wait.
I tried this, with or without messages.
It was worse - but once again, perhaps I didn't place the wait command at right places.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10092
Joined: Fri Feb 19, 2010 10:17 am

Re: Create a button's icon with a part of a big image? - Beleaguered Castle

Post by richmond62 » Mon Sep 05, 2022 12:31 pm

Try putting a wait after every resize and every move.

Post Reply