Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Driftmania – an open source PICO-8 racing game (frenchie14.itch.io)
276 points by frenchie14 10 months ago | hide | past | favorite | 65 comments
I've been spending a lot of my spare time over the last year creating this little racing game. It's built in PICO-8, which is a really fun “fantasy retro console” that's been mentioned on HN several times. The console has strict limits and I wanted to see how far I could push them

The source code for the game is over here: https://github.com/maxbize/PICO-8/tree/master/Driftmania. It's a bit of a mess, but I'm happy to answer any questions on it or development of the game. Cheers!

EDIT: For those not familiar with PICO-8, there's only a few inputs: arrow keys, Z/C/N, and X/V/M




This device is perfect for PICO-8 if anybody wants the handheld formfactor

https://powkiddy.com/products/pre-sale-powkiddy-rgb30-rk3566...

Non affiliated with the company, I get nothing from saying this, it's just a decent device all around. The 1:1 aspect ratio on the screen really does PICO-8 games justice, along with MAME and other popular platforms. The greatest thing is these devices are super cheap and easy to come by if you're patient.

Here's a video review of it by a youtuber whose opinion I've come to respect https://www.youtube.com/watch?v=LIMepWAzUuw


I got an RGB30 after all the hype surrounding it. The screen is nice, but people should know Powkiddy devices are typically very cheaply made, and you can expect near-zero support from the company. The build quality of this thing leaves a lot to be desired.

In comparison, Anbernic and Retroid sell devices with better build quality and slightly better QC.


I have an RGB30 and can confirm PICO-8 looks and runs great on it! It's a Linux handheld and can run the native PICO-8 binary


I have a Gameboy-shaped Anbernic RG351V (which runs Linux behind the scenes), it is fun to play PICO-8 games on too.


"Decent" feels like the correct word to describe the RGB30.

To be clear, I'm ultimately glad I bought it, and it's germane to this discussion that the release of the RGB30 is what got me interested in PICO-8 in the first place (I had apparently purchased a license years ago as part of the Bundle for Racial Justice and Equality on itch.io and didn't even realize it until late last year). Also, the 720p 1:1 display is one of those developments that in retrospect feels so perfect for this form factor it ought to have been obvious, but it was a weird move at the time and they deserve full credit for taking the risk.

Having said that, I want to love this thing, but I just can't. Mainly because the D-pad sucks. It's not unusable, but it's worse than my Miyoo Mini and Anbernic devices, worse by a mile than my 8BitDo controllers, worse still than my Hori Fighting Commander, worse than even my Steam Decks (which have sort of weird D-pads themselves)... you get the point. It's annoying that the device on which I would prefer to play 8 & 16 bit games at a 1:1/8:7 resolution has—out of everything I own—by far the worst controller for exactly those games.

The ergonomics also leave a bit to be desired. Again, like the D-pad, it's not so uncomfortable as to be unusable, though I much prefer pairing it with a 3D printed grip I bought from ComfortGrips on Etsy¹. That obviously makes it a much less pocketable device, which isn't a big deal for me, but might be for others.

Finally, I hesitate to critique the software experience, because on the whole I'm incredibly impressed with how much improvement I've seen (both in terms of quality and frequency of updates) to JELOS in the nearly five months I've owned the RGB30. But the fact remains that that confusing preference conflicts, occasional crashes, frequent sleep/wake flakiness, ridiculously bad battery drain when asleep or even fully powered off (which thankfully has been cleaned up in recent updates)... they're all just facts of life with the RGB30. It was honestly kind of shocking coming from OnionOS on the Miyoo Mini which is absolutely rock solid in comparison. But that's obviously a less powerful device with a completely different form factor.

Anyway, as lagniappe correctly pointed out, PowKiddy makes budget devices, which means they're generally inexpensive enough to take a flyer on despite their limitations, and the RGB30 is arguably the best thing they've ever made.

1. <https://www.etsy.com/listing/1602072205/powkiddy-rgb30-comfo...>


So what device do you recommend for pico-8?


TL,DR: If PICO-8 is your highest priority, no preferable alternative exists anywhere near the RGB30's price point. The next best options are probably the TRIMUI Smart Pro or the Miyoo Mini v4, but both have serious shortcomings relative to the RGB30, including the fact that neither can run the PICO-8 binary natively, and the workarounds they employ can negatively impact performance¹ ². At any price, Android or FPGA-based devices are non-starters, and I would strongly discourage you from considering anything with a 640x480 (or 320x240) display. The Steam Deck might be the best handheld for playing PICO-8, but it's much more expensive and a fundamentally different device. Similarly, the Anbernic RG552 could be an attractive option if it isn't your primary/only gaming handheld AND price isn't a factor.

==========

A good PICO-8 handheld has one absolutely mandatory quality, it must be able to run PICO-8. That may seem ridiculously obvious, but it's important to note that there is no Android port of PICO-8, and therefore most Retroid, AYN, and AYANEO offerings, as well as many Anbernic devices (as well as any other Android-based retro handhelds) can't run PICO-8 natively. While emulation is technically possible, it's incredibly complicated and only barely works³. (Sidenote: other than the RGB30, the only 1:1 720p retro handheld in development that I'm aware of is the ZPG A1 Unicorn⁴. Regrettably, it will run Android, which is a huge bummer.) This issue is even more pronounced on FPGA-based devices like the Analogue Pocket. The Pocket's 1600x1440 screen is nearly perfect for 1:1 content, but PICO-8 obviously doesn't have any native hardware to be emulated (or whatever terminology you prefer to use, I don't want to get drawn into the FPGA holy wars). Theoretically someone could develop a powerful enough x86 Pocket core to run an OS that you could maybe run the PICO-8 runtime and its Lua interpreter inside... but that's so convoluted it hardly merits discussion.

In short, you need a Linux-based handheld, which is a good start, because there are lots of them, and plenty of custom OSs/frontends under development like EmuELEC, ArkOS, JELOS, MinUI, OnionOS/GarlicOS etc. Only some of these will run the PICO-8 binary natively, but as is the case with so many retro handheld topics, Retro Game Corps has a guide that can be useful for sorting out the specific details for each device and OS⁵.

Next, it would stand to reason that for the best PICO-8 experience you'd want a handheld with a square-ish display. However, I'd argue that aspect ratio doesn't actually matter very much, and what you're really looking for is something with enough vertical pixels to get you clean integer scaling of the PICO-8's native 128x128 output with minimal black bars at the top and bottom of the screen. The black bars on the left and right don't matter very much, in my opinion. Shaun Inman's Console to Screen tool⁶ is very useful for visualizing these details. Using that tool, if you set the console to PICO-8, enable integer scaling, and select any of the devices with a 640x480 resolution, you'll see that the top and bottom black bars are mostly responsible for the PICO-8's square output looking like a postage stamp when it isn't utilizing enough of the screen. In contrast, devices like the RGB30 and Steam Deck can reach 5x and 6x integer scaling respectively, while sacrificing very few vertical pixels. Impressively (and somewhat inexplicably), the Anbernic RG552 features a 1920x1152 IPS display, which accommodates 9x integer scaling without a single wasted vertical pixel, but that was an expensive device with some serious warts when it came out over two years ago. Its price-to-performance ratio was bad then, and it's even more difficult to recommend in 2024. Having said that, Russ from Retro Game Corps loves it⁷, and I could imagine the RG552 filling a very specific role for someone who owns several gaming handhelds and has already made their peace with spending way too much money on this hobby.

The TL,DR spoiled the ending, but the two affordable retro handhelds I could find featuring PICO-8-friendly resolutions are the TRIMUI Smart Pro and the Miyoo Mini v4. The v4 is particularly interesting to me because the original Miyoo Mini is the device that sent me (and many others) down this rabbit hole in the first place. Eventually, Miyoo couldn't keep up with demand for the Mini because they could no longer source the original display component (reportedly an OEM Blackberry replacement screen). So they slightly redesigned the Mini, critically (for the purposes of this discussion) swapping out the original 640x480 display with a 750x560 panel. Those 80 additional vertical pixels enable 4x integer scaling for PICO-8, as illustrated by this graphic from a post on Reddit⁸. The leftmost image is a screenshot of maximally integer scaled PICO-8 on a Miyoo Mini+, then on an original Miyoo Mini, followed by the v4, and finally an isolated screenshot of a comparable PICO-8 frame without black bars. That slight improvement in resolution really does make a difference. Disappointingly, the Miyoo Mini's lack of wireless connectivity options means no access to Splore. That leaves us with the TRIMUI Smart Pro, which I have never even seen in person, let alone used. I'm probably the wrong person to offer any recommendation here. But Russ from Retro Game Corps⁹ and TechDweeb¹⁰ both gave it positive reviews, and its 1080x720 display, responsive controls and decent performance check all the relevant boxes for this exercise.

The other important-but-perhaps-not-essential feature is built in Wi-Fi. Sure, PICO-8 games are small, and easy to move around, and there are plenty of places to find them. (Including OP's game on itch.io. You should try it! It's fun!) So downloading game files on the web, doing the MicroSD card dance, and importing them manually on your handheld isn't the end of the world. But why would you do any of that when you could just use Splore? Splore is maybe the coolest thing about PICO-8. It's the hook that makes me open PICO-8 first when I turn on my RGB30 without any specific intention, just looking for something to play for a bit. The lack of wireless connectivity in the Miyoo Mini v4 may be a dealbreaker with this in mind, and the TRIMUI Smart Pro might therefore be the only direct RGB30 competitor, for now anyway.

1. https://www.youtube.com/shorts/wT-8T71edmk

2. https://github.com/liartes/retro8/releases/tag/retro8-trimui...

3. https://www.lexaloffle.com/bbs/?pid=104423

4. https://twitter.com/Z_Pocket_Game

5. https://retrogamecorps.com/2020/11/12/guide-pico-8-on-retro-...

6. https://shauninman.com/utils/screens/#src_screen:17,src_nn:1...

7. https://www.youtube.com/watch?v=IUjJa1pA9tE

8. https://preview.redd.it/3tg9khrr9cic1.jpg?width=1232&format=...

9. https://www.youtube.com/watch?v=gUEED4ht3lQ

10. https://www.youtube.com/watch?v=_36Sv5pFlr4


Really cool, do you know if it supports also the Switch emulator?


It does not


Thank you for the recommendation. Bought one!


is there a way to play these on the phone?


If you mean pico8 games, they can do that out of the box. Click on play game, then the play button and touch controls will show up if on a phone.


Whoa dude, this is really cool! Nice work! You should definitely include this on your resume/CV because if I were reviewing your resume and saw this, I'd be very interested :-)

For those not familiar with PICO-8:

> PICO-8 is a virtual machine and game engine created by Lexaloffle Games. It is a fantasy video game console[1] that mimics the limited graphical and sound capabilities of 8-bit systems of the 1980s to encourage creativity and ingenuity in producing games without being overwhelmed with the many possibilities of modern tools and machines."[1]

[1] https://en.wikipedia.org/wiki/PICO-8


I started learning python about 6 months ago and this game is absolutely the most perfect codebase/project i've seen to help me "level-up" my coding game within this particular language, plus the game is an absolute gem so thank you from a 60yo out-of-work developer.

I have been looking for some sort of project to help pass the days and scratch my just build something dummy!-itch that had developed now that no one will hire me and I can work on anything that floats my boat.

This looks just perfect as far as 1] how cool the final output is 2] how complex the code is and 3] potential access to the original dev (well, we will see won't we? lol).

I already have a couple of ideas for some PICO-8 level games so I'm really excited about getting started...thank you very much for posting this!


Nice. Reminds me somewhat of Super Off Road, which was an arcade game I loved as a kid: https://en.wikipedia.org/wiki/Super_Off_Road


Mixed with R.C. Pro-Am, one of my favorite NES titles: https://en.wikipedia.org/wiki/R.C._Pro-Am


Indeed, it also has that fixed track perspective that was fairly iconic for NES era racing games. The only game I am aware of that does not have this is the homebrew F-Theta [1] for the Famicom that was released in 2021. The game looks cute and simple, but it gets fairly brutal a few courses in. For those that are prude, beware that Little Sound put in cutscenes that may not be to your liking. Probably this was either to show off or explore some fairly fancy animation compression techniques (I suspect the same technique is used for compressing the dynamic track perspective) that I personally have not really seen the likes of apart from in Little Limit's Bad Apple!! Famicom "port" [2].

[1]: https://yewtu.be/watch?v=axsaC04jc98

[2]: https://littlelimit.net/bad_apple_2_5.htm


Just played it for 10 minutes! Great game. One remark: to start the race, you need to select "restart level" even if you just started the game. I would suggest starting the race by simply pressing enter.


Ah, you must be entering a race from the pause menu. PICO-8 controls are arrow keys, Z, and X (emulating old school consoles with limited input options). There's a level select screen just off the title menu


Ah yes, I hit that too. Selecting "Continue" (which didn't make sense since this was my first load) just exited the menu. Didn't take me long to try "Restart" but it is a little confusing.


Nice work, gives me very Micro Machines vibes for the NES. The only thing I don't like about PICO-8 is that its completely closed source. An open source alternative that seems very promising is Pyxel. It has similar retro / pixel art limitations, a built-in sprite editor, music tracker, etc.

https://github.com/kitao/pyxel


IIRC, the browser builds of Pyxel games end up pulling down 30mb+ of Python libraries, which seems a bit overkill for little pixel games.

TIC-80 is probably the closest open source thing to PICO-8. The browser builds ran 10% slower than the desktop app last I tried. It doesn't have a "CPU budget," so it's possible to write inefficient code that works fine on powerful machines but not slower ones.


So I just ran a test deploy of a Pyxel little animated star field:

https://gondolaprime.pw/games/starfield/index.html

Developer console shows approx ~7MB transferred. Still more than I would have expected for literally just a small looping animation but a bit better than 30MB at least.

Maybe there's been some progress on this front.

Thanks for the TIC-80 recommendation - I really like that it supports multiple langs (Lua, JS, Python, etc) - that's some great flexibility.

EDIT: It looks like TIC-80 games pull a tic80.wasm file which is approximately ~6MB in size. I'd say Pyxel and TIC-80 are roughly comparable at least with respect to bundle size.

https://tic80.com/js/1.1.2837/tic80.wasm


> Developer console shows approx ~7MB transferred

Bytes transferred over the wire don't equal actual file size (due to gzipping, etc). Your page actually weighs 21MB.


Yes, I'm well aware of that - but your average viewer isn't going to notice expanded resources, however they ARE going to notice things like time-to-first-byte and network transfer.

EDIT: Just to be clear since I can't edit the older comment - instead of bundle size it would have been better to say that the "network transfer size" is roughly comparable.


There is also Nico, written in Nim therefore can be compiled for the Web or as a native binary: https://github.com/ftsf/nico


Aside, I just realized Vimium doesn't get disabled inside iframes on pages where it's disabled, nor can you disable the iframe domain from the parent page since the iframe regex won't match the parent url. I had to disable the whole plugin for "x" to work in the iframe. Seems like an oversight on Vimium's part.

As for the game, it's satisfying to ratchet down to the 39 second threshold for the gold medal by figuring our drifting. I realize I was overdrifting and easily beat 39 seconds once I stopped drifting much sooner along the turn.


Sorry about that! There's another version uploaded here: https://www.lexaloffle.com/bbs/?tid=140202

Does that one work better with vimium?


It's not your fault, of course.

I just figure HN is the only place where someone might commiserate with me for the self-inflicted pain of using a half-baked Vim keybinding plugin for the browser.

It's nice to have the BBS link so I could star it though. :)


This happens with anything Vimium.

I usually just hit the "i" button to enter insert mode.


Thanks, good workaround :)


Wow same for me. Been using it for quite some time but just noticed the bug, what a coincidence to see it here.


yeah, this used to happen a lot to me on the itch.io platform which uses iFrame embeddings for HTML5/Canvas games.


I just ran into this also. Incredibly annoying.


What would be “minimal viable vehicle physics”?

I’ve been prototyping an f-zero type game and so far have:

- pressing forward increases thrust

- thrust makes vehicle accelerate forward

- friction is higher for the component of velocity perpendicular to tires

- vehicle turns faster when it is moving faster (I don’t actually simulate tire direction)

- as a hack to make it feel a bit like drifting, make the vehicle visually turn more than it is actually turning

Any simple thing I should add?


I took a look at what's a part of my car controller[1] if you want some inspiration. A lot of these wouldn't make sense in an F-Zero type game

- Wheel modifiers (which wheels are on road, grass, boost tiles, etc)

- Control loss when airborne

- Slow turning when at low speed (a bit different from yours since the impact drops to zero very quickly)

- Speed / accel penalty when hitting a wall

- Visually rotating the car (this is what happens when a player presses the turn key but the actual velocity rotation is handled separately)

- Boost handling

- Nudge the car to the side a little if it's trying to turn but is blocked by a wall

- Acceleration, friction, breaking, and drift-breaking

- Corrective side force (basically an extra friction perpendicular to velocity like you have)

- Artificial speed limit (alternatively, you can include a drag component which applies a force proportional to the square of speed, but I've found it hard to get this feeling good in the past)

- Velocity rotation to align velocity direction and visual direction. This is a minor effect - it's mostly handled by the other physics

- Gravity

- Out of bounds checks

I think you've got the main pieces already. What's more important is understanding what you want your game to feel like and continuously tweaking until you get there

[1] https://github.com/maxbize/PICO-8/blob/master/Driftmania/dri...


Interesting meta question:

Do others expect the car be lined up to go right?

Is this a cultural expectation? I come from a LtR writing culture so I was wondering if others were surprised at the car going left at the start.


There are 15 levels with a variety of start directions. Which direction I picked was based on how I wanted that particular level to flow


Got a Miyoo mini for my kid and I played a bit on it and have to say I fell in love with pico-8 games. They’re simple games but the playability is off the charts. I think I’ll join the club and make some myself.

Will definitely check this out..


Really enjoyed this for my ten minutes. A note that I found it a bit confusing that 'enter' doesn't select, X does. But the core game feels really good!


This is part of the Pico-8, you need to map the buttons in the "OS". Write "keyconfig" at the prompt.


What was your workflow? Last time I played around with PICO-8 I found the built-in editor to be inadequate. Using an external editor was also annoying for reasons I don't quite remember, but I remember having to close and re-open PICO-8 all the time. Not exactly a the tight, seamless iteration loop I was hoping for.


My .p8 file just has `#include driftmania-min.lua` and I do all the code edits in an external editor on that file. By splitting it out you remove the conflicts from modifying code and audio/graphics at the same time


There’s a new-ish plugin for VSCode called pico8-ls that is much better for language support than what there used to be. But the #include approach mentioned by someone else allows you to use the full Lua extensions which are great.


There’s a VSCode plugin for PICO-8 that lets you use that. It ties in with the core and has hot keys to launch the current code to test it.

I find it way easier/faster than using the built-in IDE for the code part itself. Then just use the built-in IDE for assets/music.


You just open game.p8 in an editor, save changes, and ctrl-r in Pico-8 to reload the game.


Reminds me of micromachines. I'm not used to PICO games, but I'd expected enter to mean activate instead of bring menu, like "start" would in a console. That menu confused me a bit because it said "continue" as if I were already playing the game.


I wish there was an iPhone app for pico 8, the controls in the browser are terrible.


I recently picked up PICO-8 after about a decade of bouncing around different game engines. There’s something so satisfyingly simplistic about the SDK coming from Unity and Godot. Highly recommended!


This is a great game, one question: what does ghost mode do?


It allows you to race against a replay of yourself. Turn on ghost then finish a map and select retry


I love Pico8. The idea of starting with a small set of tools and building around those limitations I think leads to better game design and development.


It's pretty fun! I had problems trying to drift consistently. I wonder if it would help to have a curved accel / decel like gear shifting.


I prefer TIC-80 to PICO-8 for a number of reasons, but this seems okay. I have a bit of a distaste for a lot of popular PICO-8 games which often boil down to "try out my amazing game feel" but end up being weirdly disorientating and difficult to tame. I prefer puzzle games or something slower, or more basic.


I was excited by the appearance and sound but found it too hard to control to enjoy. Also took me a couple minutes to get started because I didn't know I had to press 'x' (and 'x' closes the tab for me with Vimium extension, even though I disabled all Vimium keys on that page).


It's a two player console emulating two joysticks, you can set the keys to use. Type keyconfig at the prompt.


Nice work! It captures the same fast, small-track feel of RC Pro-Am from back in the days of the NES.


Fun little game. Brought back many memories of too many decades ago.


This rules, thanks for releasing it and open sourcing it!


Really cool! I made some pico8 games with my son, which were fun but nowhere near as good as this. Nice work.


Is there a clip of gameplay somewhere?


I posted a bunch of gifs on Twitter during development:

https://twitter.com/MaxBize


You need a README, with screenshots.


Very nice Trackmania demake!


nice




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: