Frame-independent games brainstorm

,

I'm hoping to generate discussion here that will expand my vision of what kinds of games to build for the Playdate.

A lot of Playdate games rely on regular updates to game objects. The SDK supports updating as fast as possible and limiting the refresh rate to up to 50 FPS. What kinds of games would call for a frame rate limited to somewhere between 50 and infinity (which has been requested before) and what kinds of games could rely on little to no usage of the screen?

Some obvious examples would be utility apps and turn-based games. Audio games are a less obvious example, although I'm sure many of us have played Bop It. I'd love to hear about specific games that people have played and engaging design patterns that people have used.


Following is some background into how I started thinking about this, if you're interested.

When making Slingshot Gallery, I realized that I could easily give the game very smooth animations by making the Playdate update as fast as possible and by not updating the entire screen. If you put the following code block in a main.lua file, you will see that simply updating one pixel on each line of the display drastically reduces frame rate.

local function dot()
	playdate.graphics.drawPixel(200, 120)
end

local function line()
	playdate.graphics.drawLine(200, 0, 200, 240)
end

playdate.update = dot

function playdate.AButtonDown()
	if playdate.update == dot then
		playdate.update = line
	else
		playdate.update = dot
	end

	playdate.graphics.clear()
end

playdate.display.setRefreshRate(0)

This is a screenshot showing FPS while draw the dot, with the cursor hovering over an area when the line was being drawn.

1 Like

Daily Driver runs at 60fps (actually it was between 70 and 90 when I decided on the 60fps limit). I run it at zero/unlocked frame rate and write my own frame limiter.

Each frame it draws only the car, occasionally bakes in a skid mark, and if there's a collision then the other objects move. So generally, there are very few dirty rows in each update.

Fore! Track could also work this way but I was too lazy to implement it. It was a lot of effort for Daily Driver.

I'm also doing it in KOATARI, my Peggle game, so you can fast forward the action. Not much more than the small ball will be drawn reach frame. It runs at 80-105 fps right now, and I'm yet to do any optimisations of things like HUD drawing, so they are drawing all the text every frame.

2 Likes

Increasing the frame rate to support fast forwarding makes a lot of sense. What's the motivation for higher FPS in Daily Driver and Fore! Track?

I think the limiter would make a lot sense in all sorts of games with variable rate update loop since Playdate doesn't support separate update/draw loops.

For example, in a physics based game you might want to do the math at a rate higher than 50 FPS while the sprites update less often, but still fast enough to be smooth. You can do 100,150,200 FPS easily with a simple for loop, but that's as fine-grained as you can get.

My personal axe to grind here is of course AmigoTracker, falling into the category of utility apps, I guess. The audio engine works best at 50+ FPS because PAL refresh rate just happened to be 50Hz, but any updates faster than that quickly become just a waste of power. Since the GUI updates relatively seldom, the app can reach pretty ridiculous framerates (around 8000 FPS). That's so fast it even crashes the Playdate Mirror if you try to record the screen :sweat_smile:

2 Likes

My goals with Daily Driver were multiple:

  • higher frame rates mean quicker input polling so more responsive controls
  • higher frame rates mean smoother animation (it has a debug menu with FPS setting so you can try it at multiple and compare)
  • to be the first game to offer "impossible" higher-than-default frame rates (award winner Playdate Community Award 2022: Technical Achievement in SDK)

With Fore! Track it currently runs at 40 (or 30, I forget) and doesn't use the sprite system. I could use the sprite system but decided it wasn't with the substantial effort as it's a slow paced game. The main benefit would be smoother ball animation. I'm sure nobody is missing it, but once you've seen the smoother movement you can't go back. You'll see that in Daily Driver, and you can see the benefit of extra frames in an animation here.

I also did a prototype where I flash alternate dither patterns to get a shade of grey. But because the Playdate screen is so good it only works at very high frame rates (iirc 100 or higher)

In KOATARI the goal was to enable me to add a fast forward mode that runs at unlocked frame rate.

2 Likes