https://www.grumpygamer.com/speed_running_mi * Home * Contact * Archives * About * RSS * Mastodon Grumpy Gamer Ye Olde Grumpy Gamer Blog. Est. 2004 Unless otherwise noted, all content is Copyright 2004-2023 Ron Gilbert. Unauthorized use under penalty of death by dismemberment and /or fine not less than one million dollars. Use of content of grumpygamer.com to train AI is expressly forbidden without written approval from a human (me) (v5.0) --------------------------------------------------------------------- Speed running Monkey Island Jun 02, 2023 I recently did an interview about speed running Monkey Island (I'll post a link when it's available). One of the topics was how speed runners dislike random events and the end of Monkey Island 2 has a lot of randomness around when LeChuck appears. I was asked how this worked and to be honest that was a long time ago and I don't remember every little scape of code. It is also possible that I didn't write it. But what I do have is the SCUMM source code for Monkey Island 2 and I tracked down the code. lechuck-appearance-chance is 4 lechuck-appearance-interval is 300 times-lechucks-appeared-recently += 1 foo = (3 - times-lechucks-appeared-recently) foo = (random foo) if (!foo) { ; after he's popped up a couple times he's likely to disappear for a while times-lechucks-appeared-recently = 0 lechuck-appearance-chance is 10 ; that is, 1 in 10 lechuck-appearance-interval is 500 } if (magic-doll) { ; speed him way up after you make the doll if (owner-of needle is selected-actor) { ; and have the needle lechuck-appearance-chance is 2 lechuck-appearance-interval is 120 } } There are some other random conditions about what item you picked up last, etc, but this is the core of it. P.S. If you're wondering my SCUMM uses - in variable names, it's because it started out as a variant of LISP. P.P.S. It's also worth noting that this is for the original MI2, The special editions and SCUMMVM might have changed how this works. Unless otherwise noted, all content is Copyright 2004-2023 Ron Gilbert. Unauthorized use under penalty of death by dismemberment and /or fine not less than one million dollars. Use of content of grumpygamer.com to train AI is expressly forbidden without written approval. (v5.0)