8 ms·
Show HN: Driftmania – an open source PICO-8 racing game
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 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
- gausswho 3y agoReally 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!
- Moru 3y agoThis is part of the Pico-8, you need to map the buttons in the "OS". Write "keyconfig" at the prompt.
- freedomben 3y agoWhoa 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 https://en.wikipedia.org/wiki/PICO-8
- AugusteLef 3y agoJust 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.
- freedomben 3y agoAh 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.
- frenchie14 3y agoAh, 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
- hombre_fatal 3y agoAside, 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.
- VyseofArcadia 3y agoI just ran into this also. Incredibly annoying.
- deleted 3y ago[deleted]
- vunderba 3y agoyeah, this used to happen a lot to me on the itch.io platform which uses iFrame embeddings for HTML5/Canvas games.
- silenced_trope 3y agoThis happens with anything Vimium. I usually just hit the "i" button to enter insert mode.
- vincston 3y agoThanks, good workaround :)
- frenchie14 3y agoSorry about that! There's another version uploaded here: https://www.lexaloffle.com/bbs/?tid=140202 https://www.lexaloffle.com/bbs/?tid=140202 Does that one work better with vimium?
- 3y ago
- MattPalmer1086 3y agoReally cool! I made some pico8 games with my son, which were fun but nowhere near as good as this. Nice work.
- vunderba 3y agoNice 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 https://github.com/kitao/pyxel
- jamesgeck0 3y agoIIRC, 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.
- vunderba 3y agoSo I just ran a test deploy of a Pyxel little animated star field: https://gondolaprime.pw/games/starfield/index.html 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 https://tic80.com/js/1.1.2837/tic80.wasm
- filleduchaos 3y ago> 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.
- 3y ago
- VyseofArcadia 3y agoWhat 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.
- frenchie14 3y agoMy .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
- sen 3y agoThere’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.
- japhib 3y agoThere’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.
- hombre_fatal 3y agoYou just open game.p8 in an editor, save changes, and ctrl-r in Pico-8 to reload the game.
- lagniappe 3y agoThis device is perfect for PICO-8 if anybody wants the handheld formfactor https://powkiddy.com/products/pre-sale-powkiddy-rgb30-rk3566-handheld-game-console-built-in-wifi 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 https://www.youtube.com/watch?v=LIMepWAzUuw
- frenchie14 3y agoI 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
- asimovfan 3y agois there a way to play these on the phone?
- city41 3y agoIf 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.
- renewiltord 3y agoThank you for the recommendation. Bought one!
- blacksmith_tb 3y agoI have a Gameboy-shaped Anbernic RG351V (which runs Linux behind the scenes), it is fun to play PICO-8 games on too.
- deleted 3y ago[deleted]
- 3y ago
- joemi 3y agoNice. 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 https://en.wikipedia.org/wiki/Super_Off_Road
- amethyst 3y agoMixed with R.C. Pro-Am, one of my favorite NES titles: https://en.wikipedia.org/wiki/R.C._Pro-Am https://en.wikipedia.org/wiki/R.C._Pro-Am
- ninjin 3y agoIndeed, 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 https://yewtu.be/watch?v=axsaC04jc98 [2]: https://littlelimit.net/bad_apple_2_5.htm https://littlelimit.net/bad_apple_2_5.htm
- elwell 3y agoI 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).
- Moru 3y agoIt's a two player console emulating two joysticks, you can set the keys to use. Type keyconfig at the prompt.
- lbotos 3y agoInteresting 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.
- frenchie14 3y agoThere are 15 levels with a variety of start directions. Which direction I picked was based on how I wanted that particular level to flow
- willio58 3y agoI 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.
- d--b 3y agoI wish there was an iPhone app for pico 8, the controls in the browser are terrible.
- grugagag 3y agoGot 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..
- deleted 3y ago[deleted]
- cellularmitosis 3y agoNice work! It captures the same fast, small-track feel of RC Pro-Am from back in the days of the NES.
- theogravity 3y agoIt'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.
- redundantly 3y agoIs there a clip of gameplay somewhere?
- frenchie14 3y agoI posted a bunch of gifs on Twitter during development: https://twitter.com/MaxBize https://twitter.com/MaxBize
- wkirby 3y agoI 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!
- AlienRobot 3y agoReminds 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.
- karlgrz 3y agoThis rules, thanks for releasing it and open sourcing it!
- Mphetbug 3y ago[flagged]
- cubano 3y agoI 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!
- ambigious7777 3y agoThis is a great game, one question: what does ghost mode do?
- frenchie14 3y agoIt allows you to race against a replay of yourself. Turn on ghost then finish a map and select retry
- bemmu 3y agoWhat 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?
- frenchie14 3y agoI 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/driftmania.lua#L641 https://github.com/maxbize/PICO-8/blob/master/Driftmania/dri...
- Llamamoe 3y agoYou need a README, with screenshots.
- pengaru 3y agonice
- WithinReason 3y agoVery nice Trackmania demake!
- deleted 3y ago[deleted]
- bowsamic 3y agoI 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.
- ergonaught 3y agoFun little game. Brought back many memories of too many decades ago.