Under Dog Deliveries

Hello!

I'm new here but I've been working on a game over the past month involving a cybernetic dog that delivers packages from the air. Here's the progress so far.:

playdate-20240113-123050
playdate-20240113-123356

I'm making use of the accelerometer and the crank when flying as an alternative to pressing the d pad and it works pretty nicely. Well, my 5 year old kid enjoys it anyway!

The most challenging thing was getting the rope physics working, and to also get it to play nicely with the crates and not chug like a steam train on device. I'm sure I can optimize it even further to be honest...

I'll be updating pretty regularly as I add new stuff and hopefully come up with a name for this lil game!
:dog:

12 Likes

Today I added health to crates displayed on the boxes in the form of hearts. They take damage when dropped from a height.
And the arrow that points to your target now hugs the edge of the screen instead of being stuck on top. Thanks to a friend for recommending that.
playdate-20240114-132025

5 Likes

Here's my first attempt at adding parallax to the game using extra tilemaps.

playdate-20240115-195125

Was getting a nasty tilemap smearing bug with transparent tiles but the latest SDK fixed all that thankfully! FYI this is the bug: Using transparent images as tiles on tilemap lead to smearing effect - Playdate Developer Forum and you need to update both the SDK and the playdate to fix it.

1 Like

This looks sweet. Can't wait to see the final product.

Thank-you! I can't wait to see what I end up doing with it too!!

1 Like

I wanted to have the layer at the very back scrolling too, but that started to impact the framerate, so I'm leaving it fixed in place. This isn't the final look, but is meant to look a bit like a cavernous cybperpunk city for our curious cybernetic canine courier
playdate-20240117-101013

2 Likes

I've improved the look of the parallax now. Prebaking a background tilemap that's static and having a mid-ground tilemap for slight parallax with some contours and lights to make it stand out. The only thing left is to add some foreground elements, but I think I'll leave that till nearer the end
playdate-20240119-144854

I've also improved performance and physics slightly, mostly by baking images wherever I could for things like the energy bar and the conveyor belt. I know I'll have to do some culling as my levels get bigger, but this should hold me out for a little bit longer.

2 Likes

I've been working on a couple of things this weekend. The first is a column of wind that can push both the player and crates up. That should open up a few slightly puzzly gameplay elements for the player to solve. It was fun getting the physics to work nicely for both

playdate-20240119-150738

Secondly, I'm trying something a bit crazy and discovered a nice technique to let me capture the display image with a transparent background. It's allowing me to do some crazy stuff like this, which is currently a work in progress as I figure out a few things, but it does look nice and brain melting:

playdate-20240121-105624

My main goal was to remove the background image and then get the working image and draw it on the screen with scaling to look like I'm zooming, but that didn't work, so in the end I basically draw the entire scene a second time without the background onto a new image (instead of the frame buffer) and make sure that the first sprite I draw is one with a custom draw function that clears the image.

Hopefully I'll be able to show the final effect soon...

Is it as smooth on device? It looks great!

Thanks!

It runs at a smooth 45FPS during gameplay, with a small drop to 30 when carrying crates. With the zoom I managed to get it to about 20FPS during the transition, which I think is acceptable for what I'm doing. I could probably do further optimization for that to get to 30 if I cache a few more images, but for now I'm happy with what I've achieved there!

1 Like

That looks so cool!
:sunglasses:

I love how the dog is so expressive! The face he makes while flying or pulling the box is great!

I'll keep an eye on this good dog!

1 Like

Thanks Logoman!

I've been making slow progress on the delivered crate cutscene. It sure is a challenge to program a cutscene by hand and make sure all the fake objects line up with the real ones.

playdate-20240123-103612

3 Likes

That zoom is looking great, nicely done.

Thank you so much, Duncan!

1 Like

This week I added a timer for delivering crates and a score display to show during the delivery cutscene. Finally the crates actually contain things now!

playdate-20240126-094640

I'm going to have to create quite a few sprites for all the items the dog will deliver, but first I think I need to actually start making a proper level or two and figure out how I unlock other levels. I'm thinking maybe a door opens when you deliver crates or maybe the door just unlocks and you still have to pull it open with your grapple.

3 Likes

I've not poked around the forum in a long time, It's cool to see this project.
Great work!

1 Like

Thanks Donald!

Today I didn't do much. Just added the door at the end.

playdate-20240128-142255

Fast progress on this - it's looking great! I really like that zoom in on the crate with it falling open to reveal the contents (and that feels like it has lots of potential for funny little reveals!)

1 Like

Firstly, I've come up with a name for the game: Under Dog Deliveries!

Secondly, I was dealing with a collision problem. There are 2 ways you can pull crates, either by flying, in which case it relies on the rope and a semi-realistic physics model, or by dragging, which is when the dog walks like he's carrying the weight of the world on its back. The problem I had was that when dragging you can sometimes get stopped by a small raised section. Since I don't have slopes, the crate would just get stuck and eventually break, like this:

playdate-20240130-194039
Not very fun!

So what I do instead is try to lift the crate up a bit when you're dragging and it hits something in that direction. First it needs to check if there are any objects to collide with in the way, and if not it'll lift it up by the height of 1 tile (+1 pixel for good measure). Here's a code snippet:

function Grabbable:tryToLiftOverHumps()
    -- crates can get stuck by a small raised hump. To get out of it we just move the crate up by 1 tile high.
            
    -- first need to check this object can be lifted up
    local rect = self:getCollideRect()
    rect:offset(self.x - self._centerOffsetX  + (math.sign(self.xVelocity) * 5), self.y - self._centerOffsetY - 17)
    
    local sprites = gfx.sprite.querySpritesInRect(rect)

    local hasCollision = false
    if sprites.length ~= 0 then
        local myMask = self:getCollidesWithGroupsMask()
        for _,sprite in ipairs(sprites) do
            if sprite ~= self then
                local otherMask = sprite:getGroupMask()
                if otherMask & myMask and self:collisionResponse(sprite) ~= gfx.sprite.kCollisionTypeOverlap then
                    hasCollision = true
                    break
                end
            end
        end
    end

    -- Now we know if it's safe to move the crate up a little so we can pull it over a small hump
    if not hasCollision then
        self:moveTo(self.x, self.y - 17)
    end
end

Now the crate will lift up and continue on its merry way!
playdate-20240130-194139

Finally, I added some animations and transitions for when you walk in and out of doors. Here's the thing in action:
playdate-20240130-195106
I'm not sure if I'll stick with that type of fade. I'm half tempted to do one of those circles closing in on the character instead, but for now this'll do.

And thanks for your words of encouragement @orkn !

A couple of small things were bothering me overnight.

Firstly, that the crate snapped up when going over the hump, so I added a bit of smoothing to that. And secondly, that when dragging a crate the camera didn't let you see the crate, so I got it to focus on the player when dragging instead of the usual look ahead.

playdate-20240131-085324

Ok, I can sleep now!

2 Likes