Announcement: Be excellent to each other.


Caravel Forum : DROD Boards : Bugs : Crash when restoring in Picross rooms
New Topic New Poll Post Reply
Poster Message
starwed
Level: Delver
Rank Points: 49
Registered: 12-16-2006
IP: Logged
icon Crash when restoring in Picross rooms (0)  
(This is actually preventing me from even playing the game right now!)

System: OSX 10.9.5, MBA (late 2010).
Drod version: 5.01.6060

I keep on experiencing hard lockups in the picross/route validation rooms. They occur when I try to restore state in these rooms after playing with the puzzles. I've seen them:

- When undoing the last move in room 5
- When restoring from within room 5 using R
- When (and this is the real kicker) loading the game after half completing room 6, either using Continue or Restore.

I noticed that the game ran quite slowly in room 6 (the 20x21 puzzle) even before I got it to crash.

I don't get a crash report; the game just locks up, and I have to force restart by holding down the power button. I'd be glad to upload whatever files you might need to diagnose this, though.

Also, I'd appreciate a workaround for loading my game, since it locks up even when I try to go to the restore screen. :)



[Last edited by starwed at 01-29-2015 09:31 PM]
01-29-2015 at 09:29 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Jacob
Level: Smitemaster
Rank Points: 3746
Registered: 10-01-2004
IP: Logged
icon Re: Crash when restoring in Picross rooms (0)  
This used to happen to me, but would resolve given enough time.
I thought it was just me though, so sorry for not reporting this before.

____________________________
New to DROD? You may want to read this.
My Holds and Levels:
Click here to view the secret text

01-29-2015 at 09:37 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
starwed
Level: Delver
Rank Points: 49
Registered: 12-16-2006
IP: Logged
icon Re: Crash when restoring in Picross rooms (0)  
This used to happen to me, but would resolve given enough time.
Do you mean, if you let it just sit there, it eventually will load?

I think I gave it about 10 minutes, but I'll try being more patient some time soon. :)
01-29-2015 at 09:42 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon Re: Crash when restoring in Picross rooms (0)  
These rooms are pretty heavy on scripting. I'd give it a few minutes to think the calculations through :). If that doesn't help we can think what else can be done.

____________________________
My website | Facebook | Twitter
01-29-2015 at 09:47 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
starwed
Level: Delver
Rank Points: 49
Registered: 12-16-2006
IP: Logged
icon Re: Crash when restoring in Picross rooms (0)  
It didn't seem to resolve itself, but I was able to work around the issue by starting a new game. This let me access the restore menu without it attempting to process that one damnable room, so everything is fine now. (Well, except now I'm dreading returning to the route validation.)

Obviously I'd still consider this a bug, since every other part of the game runs just fine on my machine.
01-30-2015 at 02:54 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Tuttle
Level: Smitemaster
Avatar
Rank Points: 1545
Registered: 02-22-2003
IP: Logged
icon Re: Crash when restoring in Picross rooms (+1)  
It's not a great answer, but rather than buying gruntier hardware just for a few puzzle rooms... :)
- Resist the undo key if you make a mistake. If you hit wait a couple of times to cycle the cell then the script has to run twice. If you hit undo then it's potentially running a few hundred times each time you press undo (however many moves have passed since the game's last internal snapshot of the room).
- If you think you'll need more than one session to figure a puzzle out, maybe solve it in a drawing app or on paper instead and then just plug in the solution.

Unfortunately the last two puzzles only get bigger.
01-31-2015 at 12:07 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
disoriented
Level: Smitemaster
Avatar
Rank Points: 2384
Registered: 08-07-2007
IP: Logged
icon Re: Crash when restoring in Picross rooms (0)  
It may help to temporarily remap the undo key so you don't instinctively hit it by mistake.

____________________________
34th Skywatcher

Best to PM me, since I might miss your message on CaravelNet chat.
01-31-2015 at 12:11 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon Re: Crash when restoring in Picross rooms (+1)  
I know it's not an answer anyone wants to hear but I seriously doubt there is anything that can be done here without major changes. The best I could do is, after some amount of time, the restore screen would come back with a message "This room cannot be restored to because of good reasons".

____________________________
My website | Facebook | Twitter
05-17-2015 at 09:44 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
Tuttle
Level: Smitemaster
Avatar
Rank Points: 1545
Registered: 02-22-2003
IP: Logged
icon Re: Crash when restoring in Picross rooms (0)  
If you can catch a timeout, maybe after 30 seconds or so pop a dialog: "Restoring to this checkpoint may take a long time. You can continue to wait, or restore to the room entrance instead."

The game knows where the entrance for a save was, so it's possible to quickly restore to that point without replaying the move sequence. That gives the player a chance to at least keep their progress through the rest of the hold and make their own decision whether they're willing to wait for the room to figure itself out.
05-18-2015 at 10:42 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon Re: Crash when restoring in Picross rooms (+2)  
This is one of the tasks I wanted to tackle for 5.1.1 and after investigation I have noticed the following:

1. The picross scripts' speed can be trivially improved by adding the following check at the start of "check" label:
  If ... 
        Wait until var "puzzleSolved" = 0
     Wait 1
     Go to check
  If End 

This would skip the processing of the given hint number if it's already known that the solution is incorrect from a previous hint number. I'd guesstimate it'll cut the time to load the save point by about half a second.

2. I've investigated the possibility of injecting a popup message that would appear if room processing takes longer than X, asking you whether you want to cancel the process - unfortunately the code responsible for that is very tightly bound and there doesn't seem to be a good way to achieve this without some excessive hacking. I've attempted and failed it and I am afraid at this point there isn't anything that could be done to solve this problem.

____________________________
My website | Facebook | Twitter

[Last edited by skell at 10-29-2020 09:32 AM]
10-14-2020 at 11:00 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
TFMurphy
Level: Smitemaster
Rank Points: 3118
Registered: 06-11-2007
IP: Logged
icon Re: Crash when restoring in Picross rooms (+5)  
The Picross rooms are a spectacular piece of scripting... but a player is not in a position to see what went in to it. To them, there is no difference between (1) a room where the individual placement of specific hints dynamically changes the solution, and (2) a room where the solution is fixed and a single script checks for it.

If changing the scripting for this room is being considered a valid solution to the problem, then the best solution would be to prioritise restore/undo functionality and change all picross rooms to let a single script check for a predetermined solution (similar to how the meta-puzzle in Scorching Path operates).

This wouldn't be a trivial change, but it would be the healthiest, especially given how long (move-wise) these rooms can end up being.

(It would be nice if the picross scripting could be preserved in a separate anyone-edit hold in Architecture so that it can be better showcased, but that might be something you'd have to ask Zch about....)
10-15-2020 at 08:04 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Xindaris
Level: Smitemaster
Avatar
Rank Points: 1531
Registered: 06-13-2015
IP: Logged
icon Re: Crash when restoring in Picross rooms (+1)  
If I recall correctly the picross scripting is among the things in the TSS custom elements pack thing that people who own TSS can have.

____________________________
109th Skywatcher

Here are some links to Things!
Click here to view the secret text

10-15-2020 at 04:18 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
TFMurphy
Level: Smitemaster
Rank Points: 3118
Registered: 06-11-2007
IP: Logged
icon Re: Crash when restoring in Picross rooms (+3)  
skell wrote:
1. The picross scripts' speed can be trivially improved by adding the following check at the start of "check" label:
  If ... 
        Wait until var "puzzleSolved" = 0
     Wait 1
     Go to check
  If End 

I was thinking about this today, and had a bit of time to investigate tonight. This is a good optimization (and I think skell might possibly be underestimating its impact, but he has better access to diagnostic tools than I do....), but there's a couple of further tweaks that can/should be done.

First, all Picr Col/Row characters need the following code deleted:
  If ... 
        Wait until var "picr_MySize" = 0
     Imperative No ghost display
  If End 

Instead, this code should be reserved for the Picr Col/Row 0-7 values, only check whether _MyO is 0, and be placed immediately before the "check:" label. (Otherwise, the Wait until var "puzzleSolved" = 0 will cause the '0' hints at the start of each row/col to remain visible.)

Secondly, in Picr Changer, the "Set var puzzleSolved = 1" should be set after Build Bridge and Build Grass seperately instead of immediately before all 3 Build options. There is no need for puzzleSolved to be set to 1 after a change from Grass to Floor, so avoiding that would cut down on some unnecessary runtime.

These optimizations help a lot of random running around in a room, and thus help a lot with undo. Might be enough to avoid having to completely rescript the rooms, though some testing would of course be advised (I did a random test of LCS:5N with a completely unoptimized ~2500 solution, and undo was still working very well... though I'm good enough at Picross that I don't end up toggling the squares much more than I needed to).


[Last edited by TFMurphy at 10-15-2020 07:20 PM]
10-15-2020 at 07:06 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Crash when restoring in Picross rooms (+2)  
Thank you, gents, for the investigation and proposals.

Yes, this is a good time to fix things in the TSS hold for an upcoming 5.2 release. Thank you for the detail. I'm fine with either you, me, or skell making these edits, though we should stay in touch as we do so to ensure all i's are dotted, etc.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
10-16-2020 at 12:14 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon Re: Crash when restoring in Picross rooms (+2)  
his is a good optimization (and I think skell might possibly be underestimating its impact, but he has better access to diagnostic tools than I do....),
I just realized I wrote "by half a second" rather than "by half". It'd probably cut the processing down to 25%, because assuming player is solving the puzzle correctly, it won't be possible for all rows to be marked as correct while some columns to be incorrect (and vice versa). So until the last move half of the processing will always be skipped. As for the remaining half, I estimate that the percentage of correct columns/rows matches how far the player is in demo.

In other words, by the time half of the demo passes, half of the rows/columns are correct.

But that's probably overly pessimistic, as my experience with doing a lot of picross is more like, you only have 20% of rows/cols finished by the time you have 80% of the puzzle done.

So most likely, just that change would improve the speed by an order of magnitude.

I have one more optimization - if we could hardcode the number of squares in the picross for each room, we could keep a tally of how many squares are drawn at any given point in time, and only check the solution if the numbers match.

____________________________
My website | Facebook | Twitter
10-29-2020 at 09:31 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
TFMurphy
Level: Smitemaster
Rank Points: 3118
Registered: 06-11-2007
IP: Logged
icon Re: Crash when restoring in Picross rooms (+2)  
You're neglecting the most important reason the optimization is good (compared to the original script): if the hints don't run unless "puzzleSolved" is not 0, then they no longer run on turns when Beethro is just running around without toggling tiles.

Which is easily over 80% of DROD's implementation of Picross.
10-29-2020 at 09:46 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Crash when restoring in Picross rooms (0)  
Wow, good point.

Sounds like with these changes, we're going to get timing down to something like 1-2% of the current script execution overhead.

Awesome!

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
10-29-2020 at 09:49 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Bugs : Crash when restoring in Picross rooms
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.