EDIT: Part 2 of the article is now up!
So, I've been working on a game again (which now has a name: Dank Tombs), and it includes a really swanky real-time lighting engine. Working on it was a blast and I learned a lot of good stuff when optimizing it, so I decided to clean up the code, share it here and write a series of posts on it so that others can benefit as well :).
Read part 1 and part 2 of the write-up.
This is just a demo, so most of the cart is showing off the tech.
Controls: (O)/(X) change the light radius, d-pad walks around
If you want to explore the cartridge for yourself, the best place to start from is probably _draw() - it references all the interesting stuff and clearly shows what order things happen in.
The code is under a CC-BY-SA license, so feel free to repurpose stuff :).
P#37083 2017-02-02 12:57
P#37094 2017-02-02 21:40
Indeed, one of the reasons I worked so hard to get it running in 60FPS was to make it usable for a more complex game at 30FPS :) The CPU usage also depends on the radius needed, and whether shadows are on or not (both adjustable), so even 60FPS might be salvageable.
I'm open to more optimizations, though!
P#37119 2017-02-03 19:29
@enderoute As far as I know, nobody found a way control the audio output itself directly (which would let us do all sorts of crazy stuff!).
But you can directly change the SFX memory, which is useful for dynamic pitch (I think Pico Racer uses this for the classic 8-bit engine revving effect) or packing more SFX into the limited space.
P#37293 2017-02-08 14:42
That's unfortunate, thanks for the info.
I've pretty much given up on thinking of PocketCHIP as a viable platform for PICO-8 games, though. The biggest reason being that the keyboard is very inconvenient for any game requiring even a bit of dexterity.
As it also turns out, it's not able to "emulate" PICO-8 at full speed, but that probably only matters for 1% of games and demos (like mine, heavily relying on Lua's execution speed being able to match the "official" PICO-8 cycle counts).
P#37389 2017-02-12 13:09
regarding this particular (awesome) tech demo, showing it off at 60 fps might be misleading. the effect seems far more suitable to adventure or rpg than real arcade/action. so going for 30 fps seems like a no brainer.
P#37395 2017-02-12 17:17
The whole performance conundrum is interesting. The demo is running at 60FPS on all platforms where Lua itself is not a bottleneck - i.e. where the only limitations are PICO-8's artificial ones.
I don't think it would be a problem if we had native PICO-8 versions for mobiles, but that'll probably be a while still.
P#37418 2017-02-13 08:04
Log in to post a comment