Author of Oust, a cave-flying mash-up of my favourite games of the genre; PICO Space, a 2D space sim featuring small animals in space; Halloween Horrors; P8C-BUN; The Pico Mermaid and Demystifying the Christmas Tree.
WIP Dungeon Apprentice (a pico version of FTL's Dungeon Master which is proving a bit tricky...).
I toot, tweet and itch. Maybe one day I'll even steam.
This is the demo of my latest game: Oust. It has the first 12 asteroids of the full game and a final 13th one, unique to the demo.
Fly your ship within the hollow asteroids of Corvus to retrieve precious, glowing Clystron orbs and yellow jump-suited prisoners. Deliver them to green transmitters that will beam them away to safety.
Destroy the security systems that seem to have spun out of control and search for the keycards needed to access deeper areas beyond your insertion point. It's believed that there is a store of advanced Nova weaponry somewhere in the facility that you may be able to utilise.
Controls
The full game is uploaded on itch now:
edit after 0.2.5e
The cart works fine in local 0.2.5e PICO-8, but uploading to the BBS (i.e. inserting in this post) is still broken. I think the _ENV is being changed to _env still by some processing after upload(?).
earlier post
The following prints out 1 twice on 0.2.5c, but crashes on 0.2.5d with:
runtime error line 10 tab 0
return function_a(_ENV)
attempt to call global 'func_a'
(a nil value)
in func_b line 10 (tab 0)
at line 17 (tab 0)
Code:
function get_thing() return { func_a=function(_ENV) return 1 end, func_b=function(_ENV) return func_a(_ENV) end } end thing=get_thing() print(thing:func_a()) print(thing:func_b()) |
Makes some of the OO/class stuff (based on https://www.lexaloffle.com/bbs/?pid=116282) that I've been doing a little limited.
The second music track from PICO Space. This swaps with the main track every time you earn a reward from completing a mission.
There's a (short) third track too, but you need to finish the game for that...
1day1k
You successfully hyperspaced behind the enemy bug alien invaders to their incubation caves, but alas - your ship's controls are horribly damaged. It only fires when you turn and when you turn it slowly gets faster and faster. What's more, you can't stop the ship...
Try to take out as many of the enemy egg-pods before you crash into the cave walls.
Use LEFT and RIGHT to steer - and shoot.
Made for the Pico1K game jam 2022. The game fits into 1KB of compressed PICO-8 code thanks to cutting out anything extra and to Shrinko-8's minifying mode.
This is the same as the entry, but without the code minification and some explanatory comments added.
"How it works" summary
-- update: fixed a bug where I was still drawing 16x16 sprites from testing that.
Cart showing how to exploit the undocumented multiple display functions to set up extra sprite buffers that can be mapped back into memory for negligible cost.
Use at your own risk ;)
Procedure
Init
-
poke(0x5f36,1) -- enable multidisplay
- write sheet 0 of sprite graphics to screen however you want
_map_display(1)
- write sheet 1 of sprite graphics to screen
_map_display(2)
- write sheet 2 of sprite graphics to screen
_map_display(3)
-
write sheet 3 of sprite graphics to screen
- swap screen and sprite addresses
poke(0x5f55,0) -- map display to where sprites are to start poke(0x5f54,0x60) -- map sprites to where screen mem was
Obviously your cart doesn't get any more storage space for sprites this way so how you fill the extra buffers is a bit of a challenge.
Use sprites
- map in display containing the sprite you want (_map_display seems to map to 0x6000 regardless of whether you've poked the screen or sprites address to somewhere else)
- draw the sprite as normal with spr() (or sspr() or map() or tline() etc.)
Example cart
In the example cart there's a simple wrapper function that takes a sprite number from 0 to 1023, maps in the buffer and chooses the sprite for spr() to use.
This is used to draw 256 sprites across the whole screen each frame. Looking at the performance with ctrl-P on my system, it costs approx 0.02-0.04 per frame compared to reverting to spr() with no mapping.
Background
I've been storing extra sprite sheets in strings that I decoded into packed tables to dump into memory with a line like poke4(0,unpack(sprites))
. This works okay, but took a significant amount of performance each frame. To stay at 60fps with other stuff going on I'd had to restrict changing sprite sheets pretty carefully e.g. twice a frame: background sprites, character/object sprites. Otherwise, I'd tried only mapping portions of the sprite sheet as needed, but it gets fiddly and still hurts performance.
I've also played about with the multidisplay functionality (take my Christmas Chaos game on itch for instance). During dev on that I realised that the different display buffers are persistent and accessible whether PICO-8 is actually in multi display mode or not, but it didn't seem very useful at the time.
I knew we were going to get to change the address of screen and sprite memory with 0.2.4, but I haven't got round to playing with it until now.
Perhaps there's some other fun things to do with this, but I haven't thought of them yet.
I hope zep doesn't mind me posting this :)
aka writing down how my cart works before I forget.
This is about my game, Halloween Horrors, which is here.
This game was written very much based on previous work, with functions dating all the way back to P8C-BUN, my first game. I started from the Demystify the Christmas Tree code because I wanted the kittens. It's not very token efficient at all, but I didn't come close to running out of tokens in the end (6447/8192). Originally, I was making another Christmas game - it was only very late on that my gf persuaded me to make it into something for Halloween - thus it's a little bit messy and rushed.
The unminified source is at the bottom of this post in a spoiler - it's too big to make into a cart without minification. Even after minifying, I did run out of space: v1.0.1 takes up 99.8% of the compressed cart size(!).
General Notes
Sprite sheets
Banish the evil monsters from the house by putting out the magic candles.
Break ornaments, cups and other items about the house as you go for extra points.
Press left to play as Frankie or right to play as Philly: put out all the candles as fast as possible or with maximum destruction.
For a two player game with both kittens press X: beat the other kitten or work together to get the maximum score in the fastest time.
Controls
Player 1
Swipe/Hit: X, V, M (X on gamepad)
Jump: Up Arrow, Z, C, N (A on gamepad)
Left - Right: Left Arrow - Right Arrow
Drop down: Down Arrow
Player 2
Swipe/Hit: Q (X on gamepad)
Jump: E, Tab, W (A on gamepad)
These are my own notes on saving token tricks that I've used previously. I'm sure what's here is not unique to me - there are other documents about this subject (e.g. https://github.com/seleb/PICO-8-Token-Optimizations) and I recommend looking at those as well, probably before this one. I intend to add and update here as I learn more.
If you see a mistake or are a true wizard that can offer wisdom to this humble novice then please feel free to comment :)
Starting out
I say "starting out", because the next few ideas concern initialisation and structure, but this might be a good place to suggest that a lot of these tips produce much nastier to read code that's more of a pain with which to work and employing all this stuff straight away, especially if you're new to coding is just going to make the whole experience more difficult and probably not much fun. I tend to bear some of the things here in mind as I code and some things are becoming (bad) habits, but usually I've only used these techniques as a second, third or an in desperation when PICO-8 won't run any more pass.
Early on in playing around with PICO-8 I wrote a function to print text with a black outline.
function prt_out(s,x,y,c) print(s,x-1,y,0) print(s,x+1,y) print(s,x,y-1) print(s,x,y+1) print(s,x,y,c) end |
I imagine a lot of people have also done this and I can't be the only person who found it a bit clumsy and, near the end of a project when casting about for tokens, wondered if those five very similar print calls couldn't be reduced.
Nowadays we have P8SCII so I thought I'd have a look. Here are some candidates I've written with their token counts and times from my crude testing:
function p1(s,x,y,c) -- 42 tokens, 5.6 seconds ?'\f0\-f'..s..'\^g\-h'..s..'\^g\|f'..s..'\^g\|h'..s..'\^g\f'..chr(c+(c>9 and 87 or 48))..s,x,y end function p2(s,x,y,c) -- 26 tokens, 6.2667 seconds for i in all(split'\f0\-f,\-h,\|f,\|h') do ?i..s,x,y end ?s,x,y,c end function p3(s,x,y,c) -- 38 tokens, 5.6667 seconds ?'\f0\-f'..s..'\^g\-h'..s..'\^g\|f'..s..'\^g\|h'..s..'\^g\f'..sub(tostr(c,1),6,6)..s,x,y [ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=98796#p) |
A simple demo of a reflection.
Press X to enable/disable the reflection effect.
Press Z to enable/disable the ripple effect.
Use up/down to move the view up and down i.e. change the amount of reflection on the screen.
Uses the extra palette to dim the portion of the screen where the reflection will be.
Draws everything else like normal above the reflection surface.
'memcopy's to the lines below the reflection surface, starting with the line immediately above it.
Adding an offset with some sin() calls moves each line a bit to allow the ripple effect. Downside is a little bit of mess at the edges.
[edit] Minor bug fix to make ripple effect constant with distance from the shore.
Fireworks
Some fairly simple particle fireworks just for fun.
Press X to switch the screen effect on/off. For more about that see here: https://www.lexaloffle.com/bbs/?tid=41149
Every sixth of a second, 50-100 Particles are emitted at a random point on the screen with random angle/velocity determined by a tiny bit of trig. They're given colours in the top half of the PICO-8 palette (7+) and as the particles get old the colour changes according to the same mapping that the screen fade effect uses to a darker colour.
If they run out of life or become black then the particles are deleted.
There are two possible update functions for each particle - one with a wiggle :)
Making PICO Space
This is a rambling description of some of what went into making PICO Space. I've tried to write it for most readers to follow - there's some basic stuff and nothing very advanced. Hopefully it's not too dull and might help someone.
When You Wish Upon a Starfield
Coming up to Christmas of 2020 I had been spending most of my dev time trying to squeeze image data into PICO-8 to make a Dungeon Master clone (I promise I will return to this at some point). I'd got a bit tired of writing compression and encoding routines and feeling like I was fighting PICO-8 rather than playing nicely with it. I'd seen some other nice star-fields and particles in other peoples' games and wondered how much it would take to do my own.
PICO Space
v1.2
Defend the animals of the galaxy from the space weevil invasion in your grandad's space taxi!
Check the notice boards at space stations for prospective passengers. Gain rewards when they're delivered safely and discover how to defeat the weevil menace.
The galaxy is quickly becoming a more and more dangerous place so be careful out there - with 50-70 systems and some questionable government policies an animal needs to look after themselves!
Please report any bugs or if something is unclear below. Feedback helps me improve and is always welcome :)
Controls
Main Menu
- Use Up, Down and X to select options in the menus.
Fading Stars Demo
Demo showing the combination of the stars and fade effect I used in PICO Space: https://www.lexaloffle.com/bbs/?tid=42279.
[UPDATE 2021-4-12: 8bit and 16bit cached modes (explanation below and in code), some other small tweaks]
[UPDATE 2021-5-6: added interleaved 8bit mode]
Stars
The stars are just simple particles that have x,y,z coordinates.
In this demo I use a couple of sin functions to give them some movement combined with a divide by the z coord for a bit of parallax. In game, I feed in the player's position.
Then I clamp the resulting x,y values to the screen with the modulus operator so they're always visible (%128). It does mean that the same stars go past constantly, but otherwise I was processing a lot of particles that don't get seen very often (not aiming for realism here).
Demystifying the Christmas Tree
Help your kitten destroy as many decorations as you can before the tree is fully decorated or their energy runs out and they nap.
Try to destroy multiple decorations within a short time to get combo bonuses and improve your score. Use your energy wisely, young feline.
Play as Philly or Frankie on their own or with a friend against each other. See who can cause the most chaos!
Controls
Action Frankie (Player 1) Philly (Player 2) jump up E run left/right S, F descend down D poke O(Z) W swipe/hit X Q Return menu, including music on/off and restart. |
(These are the standard PICO-8 controls so some other keys work too)
Silly Snow
(update: added 2 new methods that incorporate gusts of wind)
Controls
UP/DOWN chooses different behaviour for the snow flakes
X changes the colour of the falling snow so you can see the "trick" a bit easier
O/Z toggles drawing the non-snow bits of the graphics each frame on and off
What it is
--
TL;DR
Only track falling snow, add lying snow to the background.
--
As it's that time of year again, I thought I'd write some winter-themed stuff.
This is my take on ye olde faithful falling snow demo, which I'm using for the intro screen for another cart (on its way soon). I've cleaned it up a bit, added way more comments than I normally do and added some options to show what's happening a bit and show some variations. Click "Code" below the display above if you're interested.
The Pico Mermaid
Use (X) to control the Pico Mermaid as she fetches pearls from the bottom of the sea back to the surface. Avoid the piranhas that will swim faster and faster as the mermaid retrieves more pearls.
This is my entry into Tweet Tweet Jam 5 and so the code fits into 560 characters (two tweets).
Features:
- Single-button controls (X)
- Animated and multi-colour pixel art sprites*
- air and water physics*
- Two particle systems*
- Difficulty ramp*
- Score effect*
- Death effect*
- start animation*
- current score and high score display*
- in-game instructions*
(* kinda)
Here's the code:
P=pset::A::x=64y=0v=-9t=0w=127e=0d=.6s=0for z=0,29do [ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=84034#p) |
P8C-BUN is now uploaded to itch.io here: https://drake-blue.itch.io/p8c-bun
I've also been working on something else that I really want to share a preview of soon, but I need to clean it up just a little more first.
P8C-BUN
Help your chosen bunny cover each level with poo then escape down a rabbit hole. Don't get caught by the fox or anything else that's out to get you!
Finish all 16 levels without restarting to achieve "Iron Bun" or just try to post a high score. Start at whatever level you like.
Controls
- Use the d-pad/arrow keys to direct your bunny.
- z/c/(O) to show where you haven't pooed yet.
- x to paws and return to the title screen.
- You can toggle the music or return to the title screen from the menu as well.
Tips
- The buns will keep running in the direction you choose until there's no clear path in front of them so there's no need to hold down the arrow keys.