Tips to improve performance?

94 views
Skip to first unread message

ThumpBaconBacon1

unread,
Feb 7, 2024, 11:40:43 AMFeb 7
to PuzzleScript
I am currently working on a humongous project in Puzzlescript and currently the map is massive. (For reference, it’s even bigger than Enigmash’s map and might become even larger) I am using Puzzlescript Plus and to help with performance I am using local radius.

I’ve found that in my case a lot of the noticeable performance killers are during again rules or when large masses that span a lot of tiles can’t move. 

There’s probably more to it than that that I don’t know about but just for the purposes of what I’m working on are there any good general tips to improve performance when developing Puzzlescript games?

Stephen Lavelle

unread,
Feb 7, 2024, 11:59:27 AMFeb 7
to ThumpBaconBacon1, PuzzleScript
I can't give feedback about using puzzlescript plus, only the vanilla version, but - have you tried enabling the various prelude debug tags ( https://www.puzzlescript.net/Documentation/prelude.html ) to see 

1) what rules are getting generated (keyword: debug)
2) what rules are getting executed, and how much?  (keyword: verbose_logging) The cost of searching for rules is normally small in comparison to that of doing an replacement, so it might be of help.


Another more advanced option would be to use your browser's developer mode to do javascript profiling, but that may not yield much directly actionable info.

Other things: 

Rules with asterisks can be expensive.  

Certain properties on the left-hand-side can end up getting exploded into a lot of rules on compilation (the puzzlescript compiler breaks down rules into multiple simpler rules).  

Using 'again' can in certain circumstances be expensive, because it effectively has to run everything all over again (maybe more than once).

Also, try it out on different browsers - you want your game to perform well on all, but you might find the per-browser performance differences interesting (in my experience safari was by far the fastest for puzzlescript gameS).

I hope some of the above can be of some help.


--
You received this message because you are subscribed to the Google Groups "PuzzleScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puzzlescript...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/puzzlescript/5cfb008a-115a-4281-821d-741622da9ee4n%40googlegroups.com.

ThumpBaconBacon1

unread,
Feb 7, 2024, 12:08:26 PMFeb 7
to PuzzleScript

I’ll give that stuff a shot. I haven’t tested it much on other browsers so that might be of help. Thanks!

That Scar

unread,
Feb 15, 2024, 6:53:58 PMFeb 15
to PuzzleScript
By "asterisks", did you mean ellipses?

Stephen Lavelle

unread,
Feb 16, 2024, 3:20:27 AMFeb 16
to That Scar, PuzzleScript
> By "asterisks", did you mean ellipses?

yes, sorry ^^

Reply all
Reply to author
Forward
0 new messages