Log In  

Picotron FAQ

How does Picotron Differ from PICO-8?

Although Picotron is conceptually similar to PICO-8 -- an imaginary machine that you can make things for with built-in tools -- it aims to be a more practical and flexible development environment. The two main differences are in specifications (larger display and cartridge capacity), and the way that built-in tools are implemented.

Unlike PICO-8 and Voxatron, all of the design tools in Picotron are written in Lua and are editable from inside the machine itself. Even things like the file browser, code editor and the terminal are implemented in userland. Custom tools can be created from scratch that run in fullscreen workspaces alongside the bundled editors. These additions and the subsequent shift in focus of the machine give Picotron the title of 'Workstation' rather than 'Console'. Instead of 'Plug in a keyboard to get a devkit!' It feels more like: 'Unplug the keyboard to get a console!'

Is Picotron Compatible with PICO-8?

Yes and no. Picotron supports PICO-8 style shorthand syntax, almost the whole API, and other compatibility features that make it relatively easy to port PICO-8 cartridges. However, it is not designed to run PICO-8 carts out of the box, because the underlying machinery is quite different. For example, Picotron uses floating point numbers, and so can only approximate PICO-8's fixed point math behaviour.

Can I Use Picotron to Make Large Games?

Yes! In the future, programs exported as stand-alone binaries/html will not have a size limit. Cartridges saved in .p64.png format however are limited to 256k of (compressed) data. This format is intended for posting cartridges on the Lexaloffle BBS, and targets small and medium sized projects. Picotron has some basic compression support for sprite and map data, so 256k can still mean quite a substantial project depending on the type of game and art style.

What is Picotron's Video Format?

Picotron has a 480x270 6-bit display, so 64 colours can be displayed at any one time. The palette can be defined with arbitrary RGB values; there are no hard-wired colours like PICO-8. There is a default system palette of 32 colours, with 32 empty slots, that is a combination of the standard PICO-8 palette and 16 extra colours. The extra colours are not the secret PICO-8 palette, but are intended to function nicely when recombined with the standard 16. Additional colours can also be displayed in the same frame by defining up to 3 alternative palettes and switching between them per scanline.

WIP default palette (32 colours):

Picotron's draw state includes a 4k colour table: a 2d 64x64 lookup table is observed by all Picotron gfx functions. Every time a pixel is drawn, the value written to video memory is determined by looking up the table using 2 indexes: the colour of the target pixel, and the draw colour. This can be used to implement effects like shadow rendering, fog, additive blending, and per-pixel clipping.


How is Data Represented in Picotron?

As well as usual Lua objects, Picotron includes a general purpose userdata api that can be used as 1d or 2d arrays of several types (u8, i16, i32, i64, f64). All of Picotron's standard resources are stored in this way (bitmaps, audio data, maps), and can be accessed with the same API functions. This allows for more efficient storage and manipulation of things like large in-memory world data than is available by using standard Lua data structures.

	a = userdata("u8", 16, 16)  -- allocate a 16x16 block of memory
	a:set(4, 3, 15)             -- set a value at 4,3
	spr(a, 50, 50)              -- 2d arrays can be treated as sprites
	memmap(0x70000, a)          -- expose the contents of a in ram
	?peek(0x70034)              -- 15


How is Cartridge Data Stored?

Graphics, maps, audio data and source code are bundled into a single cartridge file (.p64, .p64.png), and like PICO-8 it is usual to have many .p64 files lying around. Although they are single files on the host machine, they can also be treated as folders from inside Picotron. So it is possible, for example, to copy resources directly across cartridges using the cp command. All files in Picotron are "pods", which are strings encoding structured Picotron Object Data.



How Fast is the CPU?

The Picotron CPU limits have been chosen to allow any Picotron cartridge to run on relatively low-spec machines and web browsers. In terms of raw Lua instructions, Picotron is only around 2x the speed of PICO-8 (so, around the same per scanline). The gfx api is much faster (around 8x per pixel), and more api primitives are provided to carry a lot of general heavy work. For example, although Picotron isn't designed for making 3D games in particular, a reasonable 3D engine could be constructed using tline3d() (perspective correct scanline rendering), userdata:sort() for back-to-front painting ordering, and userdata to store and manipulate matricies.

What kind of Audio does Picotron support?

Picotron has its own particular sound format that is part of the reason Picotron exists in the first place! Originally conceived as a replacement for Voxatron's built-in audio system / tools, the PFX6416 is a synthesizer that aims to be lightweight enough to play in realtime on the web and have tiny synth definitions that can sit comfortably in a 256k cartridge. It is also very flexible: instruments definitions are a tree of "nodes", each one either generating or modifying a signal sourced from a wavetable, and then sequenced as notes in tracker-like format. A total of 64 nodes can be active across 16 channels. Raw audio data playback is also possible in the 0.1 design by stuffing data into wavetables if you really want to.


For a demo of the synthesizer running under web, try /demos/bells.p64 in Picotron Playground (ESC for terminal, cd /demos, load bells.p64, ctrl-r to run).

Below is a preview of the bundled instrument designing tool that (like any other Picotron app) is made in userland. It interacts with the sound system by poking values into special address ranges, and instrument definitions can be change while they are playing.

Which Platforms will Picotron Support?

Initially Picotron will target Windows, Mac, Linux, and HTML5/wasm. Longer term, Picotron's runtime will be made available as a C library that depends only on a small amount of OS-specific code, and uses SDL2 to implement this by default. Licensing for this is TBD, but the goal will be allow cartridge authors to port and customise their carts for additional platforms.

Picotron Specs