Log In  

I've been messing/hobbying around with Pico 8 for about a year now. I love the limitations, and the old school coding feel. I grew up using the TRS-80 and the Apple II computers, and those are the feelings I get when using the software. With that said, it has always been a bit disappointing to me that I can't get a full screen 16:9 aspect ratio that's "pixel perfect" in Pico-8, and 4:3 and 5:4 aspect ratios are in short supply. I even started a little project (unfinished) to try and integrate Pico 8 with another program using the GPIO interface to run something side by side like a HUD of sorts with the unused space, and repurposed an old 1366 x 768 TV to allow me to get the 128x128 screen to pixel perfect full screen with the 768 height at 6x scaling, or width with the TV vertical, and leaving 598 pixels to the side, top, or bottom of the Pico 8 window for my "hud" of sorts. That said, two ideas came to me that might be something I'd like to see implemented, or get feedback on whether one of both them can be "done already" with some trickery that is at this point not obvious to me.

So...here's the idea. I don't mind the low rez, I iike it, and while I'm excited to see the next Zep project that changes the aspect ratio, it also "ups" the resolution and resources to do so pretty significantly. What if there was a way/is there a way to "crop" the vertical resolution of Pico 8 via a camera and the window scaling to 72 pixels vertical by 128 horizontal? This would scale with all 16:9 monitors at 16x, 20x, and 30x scaling for 1080p 1440p and 4k (2160p) resolutions. Obviously this wouldn't increase the resource footprint of pico 8 and would still be compatible with 8x8 tiles but at 9 vertical and 16 horizontal? Can something like that be done or if not implemented?

The second idea relates to the first, what if we could use the "cropped pixels" at the bottom or top of the pico 8 window, now at 72 pixels vertical, to extend the horizontal render size? That way we could make a game that is, for instance, 72 pixels tall and 168 wide to support 21:9 aspect ratio (or potentially other resolutions)? 72 x 168 (12,098 pixels on screen) which is still less than the 128x128 (16,384 pixels on screen) we have now. I realize that is a change to the rendering significantly as if it's rendering in lines from top to bottom there is some work to be done to shift the vertically rendered pixels on the bottom or top of the cropped image to the right or left, but again, it wouldn't really change the basic "footprint" of pico 8 while accommodating different aspect ratios (which I know I would like, and seemingly quite a few others would as well).

Anyway, I'd be interested to hear anyone's thoughts, insights, and feedback on my hair brained idea. :D

P#118717 2022-10-07 13:53 ( Edited 2022-10-07 14:44)

Hello @Redbeer:

Pico-8 is highly configurable. Here is the batch file I run every time when I need Pico-8. Feel free to adjust it to your liking.

You SHOULD be able to change the proportion of the screen across and down through this.

@start pico8.exe -software_blit 0 -gif_len 240 -gif_scale 3 -windowed 1 -width 702 -height 650 -draw_rect 10,5,682,640 -sound 128 -music 128 -pixel_perfect 1 -desktop c:\david\Pico-8\!pico-8_win32\!snaps -home c:\david\pico-8\!pico-8_win32 -foreground_sleep_ms 1 -background_sleep_ms 1000 -accept_future 1 -gui_theme 0

Copy the above to clipboard by triple left-clicking with your mouse, press CTRL+C.

Then open Notepad and press CTRL+V right there in the blank space. Save it as "p8.bat" directly where "pico-8.exe" is located. Then run that "p8.bat" like a regular Windows executable and you are all set !

There is also more information on these commands found HERE:

https://www.lexaloffle.com/dl/docs/pico-8_manual.html#Commandline_parameters

Hope This Helps !

P#118724 2022-10-07 16:38 ( Edited 2022-10-07 16:45)

Not sure those commands do what I want. Unless I'm missing something Pico 8 still renders a "square" 128x128, it just squashes and stretches the rendered in game image to fit whatever window size I specify. I'm looking to "crop" the vertical resolution down to 72 pixels from 128 and then scale it "up" to 1080 (or whatever else), and mostly just when I run my game as obviously the editor is not compatible with 72 pixel vertical resolution very easily as a crop would cut the bottom bar off although that could maybe be ok with vertical scrolling. I knew how to scale the screen, window, etc., already. I would think of it more as using the existing camera() but adding parameters that don't just effect the camera position, but also the size and aspect ratio, in game.

P#118727 2022-10-07 17:09

you can’t make pico-8 do that, but your games can certainly draw black bars at the top and bottom and use clip function to avoid drawing things outside the rectangle that you want!

P#118728 2022-10-07 17:14
1

@merwok is correct.

If you want 4x3 that would be resolution: 128x96
If you want 16x9 that would be resolution: 128x72
If you want 2x1 that would be resolution: 128x64

One consideration to have for instance for 4x3 is to have the main part of your game at the top of 128x96 and use the pixels below for data and information.

See this cart example showing white pixels for main display and darker for messages and information.

Cart #sirapajiyi-0 | 2022-10-07 | Code ▽ | Embed ▽ | No License

function _init()
  cls()
  rect(0,0,126,94,7)
  rect(0,96,126,126,5)
  fillp(24415.5)
  rectfill(0,0,126,94,7)
  rectfill(0,96,126,126,5)
end

function _update()
end
P#118739 2022-10-07 19:09

Thanks, I can "kind of" do what I want with clip and the window scaling combined. For reference, in case anyone else wants to do this I set Pico 8 config.txt as follows:

// :: Video Settings
window_size 1920 1920 // window width, height
screen_size 1920 1920 // screen width, height (stretched to window)
show_fps 0 // Draw frames per second in the corner
// :: Window Settings
windowed 1 // 1 to start up in windowed mode
window_position 0 0 // x and y position of window (-1, -1 to let the window manager decide)
frameless 1 // 1 to use a window with no frame
fullscreen_method 1 // 0 maximized window (linux) 1 borderless desktop-sized window 2 hardware fullscreen (warning: erratic behavior under some drivers)

I then used the clip(0,0,128,72) to limit the draw area.

It's not the most elegant way I can envision getting what I want, but it does sort of work. So now I can just write my code to constrain my character, ship, whatever to the 72 pixel tall screen and the bottom portion sits below the screen and is not visible to the user.
Would be nicer if the scaling for the window/screen could conform to a flag or coordinates in the camera, or clip functions so I don't have to alter config.txt or enter the flags in the shortcut, or a .bat file, and I could set the program to fullscreen rather than borderless window, but beggar's can't be choosers. :D
At some point I'll see if I can get it to work similarly in an html export but I suspect the fullscreen button will muck it up, but maybe it will work with F11 full screening of a clipped screen that doesn't match the aspect of the embedded window.
Thanks for the help.
Sorry to dredge the thread up again after a few days but work has been busy.

P#118933 2022-10-12 00:53

[Please log in to post a comment]