Weekly Updating 1: Grappling Hooked

snapman's picture

In an effort to help this site grow, I will be giving weekly updates on my various experiments with Glorious Trainwreck's favorite democratized game creator, Klik & Play. I haven't used KnP in 8 years, during which I've learned a fair amount about both programming and game design by making games in other languages, and working towards obtaining a college degree in computer science (the last part being in the last 3 1/2 years). So far, returning to the event-based game design paradigm has felt extremely limiting. Many simple things I could do in more advanced languages are either difficult or impossible to accomplish in Klik & Play. What I've found very interesting, though, is that solving Klik & Play problems rely on both computational, and physical strategies. What would be impossible to do with the built-in object movements can usually be done with numbers, and what is difficult to do with the limited calculation abilities of Klik & Play can be assisted with the built-in movements, or other properties and behaviors of the program.

One of my later projects in KnP was an attempt at recreating the grappling hook, or "Ninja Rope" from the game Worms. At the core of my original design was a platform movement object constantly shooting particles at the grappling hook center point. I assumed that I could measure the distance from the player to the center point by the number of particles not destroyed by contact with the hook. Whenever the number was too high, I would lift the player higher. Eventually there would be some swinging code, changing angles, and everything would work out fine. Of course, this didn't work at all. The player quickly levitated off-screen, never to be seen again.

Yesterday, I took up the problem again. My first notion was to create chained object groups in even-odd pairs, aligning them by hotspot to action point. After a lot of testing various object selection methods (to some rather hilarious and frustrating results), I found a simple cycling scan worked best to build a segmented chain. I could easily manipulate the length by setting visibility cutoffs for chain elements with values higher or lower than the desired length. The biggest drawback to this multi-object line was the apparent refresh rate, due to the cycling update. With only 16 chain elements, the fastest I could rotate the construct was once per 30/100th of a second. I went as far as adding objects to calculate and visualize impulse speed (IE: letting go of the rope), but the results were inconsistent.

Today I plan to revise the system to a two-origin line, by calculating the end point of the chain directly, and drawing the line from both ends. This should effectively double the refresh rate, and thereby the maximum rotation speed. But by calculating the end point directly, the chain becomes not the driving force of the simulation, instead a visual cue. If the visual representation of the chain becomes broken slightly at high speeds, at least the actual positioning of the end point will remain consistent.

I have taken screen shots of this experiment, but I'm not currently at the computer they're on. I might post them later if people are interested in them. Next time I'll either talk about the difference between a swing simulation powered by update wait adjustments vs distance adjustments, or I'll talk about misuse of the built-in platform movement to approximate a limited physics simulation. Whichever people are more interested in. Or I'll post some pixel art. Who knows for sure!

Back in the heyday of Klik, I sometimes called myself "The Master of Useless Effects". I've spent a lot more time on game design balancing as of late, but sometimes it's just fun to make effects. At least now I have a better chance of transforming these ideas into finalized projects!


SpindleyQ's picture

That's... that's insane.

That's... that's insane. Please post your screenshots.

captaincabinets's picture

Oh man. And here I was

Oh man. And here I was thinking I was the captain's crackers for making a basketball obey the laws of faux gravity. You have humbled me.