Page 1 of 1

Unshuffle (iOS puzzle game)

Posted: Fri Nov 27, 2015 10:17 pm
by spill
I just released a game called Unshuffle on the iOS app store that uses this experimental iOS port by slime. I made use of the HUMP timer and vector modules, the slither class framework, and the bloom shader by slime from this thread. I also implemented my own gamestate framework and UI library, as well as a few custom shader effects for creating ripples and wiping between levels. If anyone has any questions for me, or wants a more in-depth postmortem, don't hesitate to ask. I owe this community a lot, for all the awesome ways you guys have contributed to Löve and, directly or indirectly, to my game. This definitely won't be my last Löve game on the app store!
unshuffle.gif
unshuffle.gif (2.62 MiB) Viewed 3340 times
unshuffle3.gif
unshuffle3.gif (4.81 MiB) Viewed 3340 times

Re: Unshuffle (iOS puzzle game)

Posted: Sat Nov 28, 2015 10:18 am
by rmcode
Looks great! Are you planning to port this to Android as well? I'd love to read an in-depth postmortem about it :nyu:

Re: Unshuffle (iOS puzzle game)

Posted: Sat Nov 28, 2015 2:23 pm
by s-ol
Looks very cool! How exactly does the "ripple and disperse" effect work (seen in the end of the second gif)?

Re: Unshuffle (iOS puzzle game)

Posted: Mon Nov 30, 2015 2:07 am
by spill
S0lll0s wrote:Looks very cool! How exactly does the "ripple and disperse" effect work (seen in the end of the second gif)?
The basics of it are: I keep 3 textures for "previous state", "current state", and "next state" and I draw into the "next state" texture using a custom shader I wrote with the current and previous textures as parameters. The shader does a wave simulation similar to those you can find by googling around a bit. Approximately, it works by converting RGB to HSV color and using the V component (value) to represent pressure. In the shader, each pixel looks at its neighboring pixels' pressures and its current and previous pressure and uses this formula:

Code: Select all

float new_pressure = 2.*current_pressure - prev_pressure + A * (left_pressure + right_pressure + above_pressure + below_pressure - 4.*current_pressure);
Where "A" is a constant that represents the speed of ripple propagation*. Whenever a node is snapped into place, I draw a circle onto the "current state" texture (which is equivalent to adding a spot of high pressure). There's also some code that handles hue-shifting to create the rainbow colors and some code that handles damping so the ripples don't continue forever.

*I have some fancy, but nonessential code that looks up the speed of ripple propagation from a separate texture, so that I can draws to that texture and make the ripples propagate at different speeds on the lines and nodes vs. the background.

Re: Unshuffle (iOS puzzle game)

Posted: Mon Nov 30, 2015 2:12 am
by spill
rmcode wrote:Looks great! Are you planning to port this to Android as well? I'd love to read an in-depth postmortem about it :nyu:
I'd like to do an android port at some point, but I'm a little bit burnt out on Unshuffle at the moment, so I'm going to be doing some prototyping for my next game before I try doing the android port. I'm also not looking forward to porting, because I suspect I'll have to spend a long time slogging through build configurations and environment setup, which is my least favorite part of programming. But it will happen eventually! :awesome:

As for an in-depth postmortem, I can start writing some stuff up, but if you have any particular parts you'd like to hear about, let me know.