I’m using SpriteKit. The built-in physics engine made this pretty painless. Making a block draggable is just a matter of tracking the touch movement, and updating the block’s position, then letting the physics world push back if the block is moving into a wall or another block.
The trickiest part was letting you move a block by dragging another block into it. In this case, you want all of the affected blocks to respond to your finger. But in the standard physics world, the other blocks essentially “push back” against your finger. A bit of custom logic was required to circumvent this.
Ok, I’ve been playing around with the idea for a few weeks. Now’s the time I like to look through prior art to see what’s out there already and to get inspiration.
I google “block slide game” and similar. The closest match is an old browser game that pops up with various names on various flash-game hosting sites. Red Block Rescue is one.
A fun little game. Compared to my dominoes puzzles, this game packs the blocks in tighter, with fewer degrees of freedom. And it leverages more single-square blocks requiring more “micro” movement tactics. Qualitatively, the gameplay reminds me of those old tile puzzles where you unscramble a picture.
On the iOS side, I found a number of games with a wooden block-slide aesthetic. I don’t know which one is the original and which is the clone, but here’s a sample:
Despite surface similarity, these games are quite different from Red Block Rescue and my dominoes puzzles. Key difference: each block only slides in one direction. Vertical blocks only slide up or down; horizontal blocks only slide right and left. As a result, the gameplay is very different. The problems feel less spatial and more about sequencing moves in the right order.
Further searching led me to a gem of an iOS game: Puzzle Retreat. This is really a high-quality game. It has similar wood block aesthetics, but the game play is very different. There are different block types (ice, fire, etc.), and goal is not “escape” but rather filling the floor with blocks.
I was really impressed with Puzzle Retreat’s online forums. Each level has a facebook thread where people ask for help and give tips. I poked around these forums and ended up following a link to a game I had never heard of, but won some awards in 2014: A Good Snowman (is hard to build).
I really like A Good Snowman’s 2.5-D aesthetic. It’s sort of brilliant. The gameplay is strictly a top-down, 2-D grid. There’s no perspective (and this is not “isometric”). But the graphics give an illusion of depth and height.
Inspired, I quickly sketched some mocks of my dominoes puzzles using this 2.5-D aesthetic. The pawn is maybe a giraffe, maybe a panda. Side boundaries are bushes, and the blocks have the illusion of height.
My new favorite time filler, for those moments where I’m tempted to pick up my phone and get lost in the internet. Now I sit down with some dominoes and invent puzzles.
The goal is always the same. Get my pawn (in this case, a usb plug) from its starting point in the bottom row to an exit on the top.
I start by picking a grid size, say 4×5. Then pick a starting spot and arrange the dominoes to fill up the grid. (At this point, the grid is in my head, I’m just arranging the dominoes on the table). Important, now I sketch the positions of the dominoes on paper. If this ends up being a good puzzle, I don’t want to forget the starting pattern.
Next I try to “solve” the puzzle. I don’t know yet where the exits will be. Instead, I try to work the pawn up toward the top row in as many places as I can. In doing so, I figure out which exit squares are too easy and which exit squares are impossible. Then, of the remaining possibilities, I pick one “easy” exit and one “hard” exit and mark them on my paper. (In some puzzles, it is impossible to get to the top row, so I mark these failed puzzles with an X).
A half an hour later I have a few post-it notes filled with puzzles. Here’s what I accumulated over the course of a few days last week.
My three-year-old loves to arrange dominoes in big rectangles like this.
But sometimes gaps are left along the edges. I noticed it’s kind of fun to slide the dominoes and manipulate the negative space. Maybe there’s a game to this, something about moving the holes together, merging the gaps…
What about putting an item in a gap. (In this case, it’s a usb adapter!) The puzzle is to move the item from one side to the other.
Has it really been three years? Between being a father and my day job, there hasn’t been much time for game dev. Super Gravity Pong is shelved for now. But I have a few other things cooking that I can hopefully push out in 2019-2020. Stay tuned!
Next week I will start iterating on the design of Super Gravity Pong, beginning with some experimentation putting different shapes into my pong physics world.
Well, a bit late, but here it is! The video below shows the first set of experiments, putting progressively more complex objects into the Gravity Pong world. I’m using Sprite Kit’s (iOS) physics engine, which is a wrapper around Box2d.
The hardest object to get right was the weighted stick. Sprite Kit approximates air friction with rotational damping, but this effect doesn’t consider any aerodynamics. Consequently, arrow-like projectiles spin as if they were in a vacuum, shown in the first GIF below.
Instead, we want the projectile’s head to roughly point in the direction of travel, with the tail following, while still allowing natural physical interactions with walls and other objects. To achieve this effect, I added some custom physics computations. The next GIF below shows the end result.
I’ll try to do a complete write-up and share some code in a future post, but briefly, there are two computations required to get a realistic projectile. These computations are applied as a post-process after each physics time-step. First, I adjust the projectile’s orientation so the head is pointing closer to the direction of movement. The amount of adjustment at each time-step is correlated to the projectile’s linear velocity: faster linear velocity yields faster spin. Second, I decrease the projectile’s angular velocity as its head gets closer to the correct direction. This has a smoothing effect and stops the projectile from spinning too far.
The springy diamond object looks a bit weird at first. What’s the deal with those lines pointing outward from each small circle? The answer comes from the fact that Sprite Kit’s spring joints are non-compressive. Their physics is based on being stretched, not compressed. Luckily, we can fake a compressive spring by taking a stretch-based spring and flipping it around. This gives us an odd-looking physics body, but the forces are all correct. And in the actual game, you won’t see these lines anyway!
One can only go so far looking at raw physics bodies. The next step is to add graphics to these objects to get a real sense of how they look and move. At the moment, I’m not quite sure what graphic style I want to use. I’m thinking either a cartoon style, a la Egg Brain, or a minimalist style, a la Umbrella’s Loop Mania. I also like the idea of something a bit surrealistic. Some of the more complex objects (clacker, cat’s cradle) could be rendered as creepy insectoids in a surreal landscape.
If you have any thoughts or suggestions, be sure to post comments below! Meanwhile, I’ll post more physics and graphics demos as soon as they are ready.
Hi folks! In the coming months, I hope to regularly post to this blog (maybe once a week?!). I’ll have a few posts about my recent release Egg Brain: Concentration, as I work on monthly updates and marketing. But mainly I’ll be doing a detailed step-by-step of my new project, Super Gravity Pong, launching in November for iPhone and iPad.
Impossible Pong and Egg Brain’s Gravity
The Gravity Pong concept predates Egg Brain. It came from a wonderful little game called Impossible Pong by Appnoxious. In Impossible Pong, you have a tiny paddle at the bottom of a minimalist arena, a white orb drops from above, the paddle always moves, and you tap the screen to change the paddle’s direction in order to keep the ball in the air.
Impossible Pong is blindingly hard, but I love the feel of the gameplay once you get into a good flow. It is reminiscent of Circle Pong and its copycats, but somehow more compelling, because instead of dealing with a linear movement of the ball across a circle, in Impossible Pong, you deal with the non-linear, gravity-affected movement of a ball in a physics environment. There is just something quite compelling about tracking the ball’s movement on its parabolic arc, and timing the movement of your paddle so that they intersect. A bit like that catching a frisbee in a moving speedboat.
Because I was so taken by the idea, I decided to incorporate it into Egg Brain: Concentration as a mini-game called “Gravity”. In Gravity, the white orb is replaced by a colorful, cartoon-faced egg. The paddle is made much wider, for easier, more mellow gameplay. And the controls are subtly different, as I talk about below.
Two lessons from Egg Brain’s Gravity
I learned two important lessons from developing and play-testing Egg Brain’s Gravity game. The first concerns the controls. My original design mimicked Impossible Pong’s one-touch controls, tap anywhere to change the direction of the paddle. But when I thrust a prototype onto my patient wife, she immediately reverted to a two-touch mode, tap left to make the paddle go left, tap right to make the paddle go right. And she was frustrated when this intuitive control scheme conflicted with the one-touch controls I had implemented.
Incidentally, this echoes some feedback I was given on my 2014 game Shmoober, which also had a single button that switched the little toaster’s direction. The feedback was: make it two separate buttons, left and right! In hindsight, I think Shmoober, Impossible Pong, and Egg Brain’s Gravity all fell into the trap of trying to simplify user interface, while actually making it more complicated. While reducing the left-right action to a single button seems like a simplification from the developer’s perspective, from the player’s perspective, it actually makes a more complicated, less-intuitive interface. In contrast, a two-button left-right scheme just feels right, and doesn’t require any learning on the player’s part. Despite multiplying the number of inputs, it actually reduces the complexity of the controls.
With that feedback on my Gravity prototype, I quickly saw the light! The released version of Egg Brain’s Gravity uses two-button controls, and the game is better for it. Super Gravity Pong will have two-button controls as well.
The second lesson I learned from making Egg Brain’s Gravity game is that odd shapes are oddly fun! Egg Brain’s Gravity trades the plain white circle for an egg shape. The choice was not deliberate: I used an egg shape in Gravity only because the rest of the game features eggs to fit a loose Easter theme (for a Spring release). In a physics context, the egg is interesting for two reasons. One, it has an irregular perimeter, meaning it’s interaction with the paddle (and walls) will vary depending on which part of the egg makes contact. Two, it has an irregular center of mass due to its larger bottom and smaller top. This leads to interesting emergent equilibria, such as a pogo-stick-like pattern where the egg remains upside-down, bouncing on its tip for several hits.
Super Gravity Pong: Main Idea
In Super Gravity Pong, I will take these lessons from Egg Brain’s Gravity and incorporate them into a full game focusing on the gravity pong concept. The main idea is to follow this notion of “odd shapes are fun” wherever it leads me. If we can have eggs, then certainly we can have beach balls, bananas, bats (with wings!), fish (that flop), and more.
And once we open up the possibilities for the object we are hitting, we also expand to possibilities for the objectives of gameplay. How many hits can you get without dropping? How long can you keep the ball in the air? How many can you juggle at once? Can you aim the beach ball to collect coins and tokens, or trigger buttons which affect other objects in the physics world? Can you aim the fish to land in a bucket? And so on.
Next week I will start iterating on the design of Super Gravity Pong, beginning with some experimentation putting different shapes into my pong physics world. Look forward to a full report next week! (Update: the next post is here). In the meantime, I leave you with a little audio soundbite of (a first draft) of Super Gravity Pong’s theme song (apologies for Leila chirping in the background!).