Log In  

Picotron FAQ

// answers subject to change, but mostly true

What is Picotron?

Picotron is a Fantasy Workstation for making pixelart games, animations, music, demos and other curiosities. It has a toy operating system designed to be a cosy creative space, but runs on top of Windows, MacOS or Linux. Programs made with Picotron can be exported as stand-alone binaries or Web apps, or shared directly with other Picotron users in a special 256k png cartridge format.

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. For example, it is possible to add a custom brush to the pixel editor, or to create new tools from scratch that run in fullscreen workspaces alongside the bundled editors. There is also a desktop-like workspace for making smaller tools that suit windowed / tiled layouts. Tools that run in windows or commandline can be distributed as .p64.zip files, or exported as stand-alone applications.

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!'

Will Picotron be 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! Programs exported as stand-alone binaries/html do not have a size limit and can also optionally read loose files included with the export.

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 compresses sprite and map data automatically, so 256k can still mean quite a substantial project, depending on the type of game and art style.

How is Memory Mapped in Picotron?

As well as usual Lua objects, Picotron includes a general purpose 1d~4d array type. This is implemented using the native userdata Lua type plus accompanying api functions (it is not a modification of the Lua language). All of Picotron's standard resource types are stored in this way (bitmaps, audio data, multi-layer world 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 = array("uint8", 16, 16)  -- allocate a 16x16 block of memory
set(a, 4, 3, 15)            -- set a value at 4,3
spr(a, 50, 50)              -- 2d arrays can be treated as sprites
	

Integer arrays can also be mapped to Picotron's ram in 4k increments, making their contents addressable with PICO-8 style memory functions and the @ operator:

a = array("uint8", 8192)     -- an 8k 1d array
memmap(a, 0x20000)           -- map it to 0x20000..0x21fff
poke(0x20123, 42)            -- set a value in the mapped region
assert(@0x20123 == get(a, 0x123))
	

How Fast is the CPU?

It depends how you measure it. 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 though (around 8x per pixel), and more api primitives are provided to carry a lot of general heavy work. For example, although Picotron isn't intended for making 3D games in particular, but a reasonable 3D engine could be constructed using tline3d() (perspective correct scanline rendering), sort() for back-to-front painting ordering, and 4d arrays to store and manipulate matricies. The Picotron CPU limits have been chosen to allow any Picotron cartridge to run on relatively low-spec machines and web browsers.

How does the Palette Work?

Picotron has a 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 colormap: 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. Internally it looks like this: putpixel(x, y, coltab[getpixel(x,y)][draw_color]) There is no concept of a "draw palette" in Picotron; instead functions like pal() and palt() modify the colormap to produce the equivalent behaviour. In addition to performing sprite recolouring and transparency, the colormap can be set up to implement effects like efficient shadow rendering, fog and additive blending.

Which Platforms will Picotron Support?

Initially Picotron will target Windows, Mac, Linux, Raspberry Pi (3 and higher) and HTML5/wasm. Longer term, Picotron's runtime will be made available as a permissively licensed C library that depends only on a small amount of OS-specific code, and uses SDL2 to implement this by default. This will allow any cartridges exported from Picotron (and Picotron itself) to run on any available third-party ports of the runtime.

When will Picotron be Available?

A limited alpha release is planned for late 2022, and a more general alpha release sometime in 2023. I'm still focusing mostly on Voxatron and PICO-8 in the meantime, but want to give the project time to co-evolve (the first prototype of Picotron was made around the same time as PICO-8, codenamed 'PICO-64', as a placeholder for things that PICO-8 should avoid!). You can also try #picotron on twitter for sporadic previews and developments.

Follow Lexaloffle:        
Generated 2022-09-25 07:13:46 | 0.018s | Q:0