Log In  

I wanted to share a few projects that I've been working on to prove out that making low-vision / blind accessible games is possible in PICO-8!

To get to the meat of it, here are the two games that my friend and I were able to put together that we built in prep for, and as a submission to the Games for Blind Gamers game jam:
Tiger & Dragon - https://jrjurman.itch.io/tiger-dragon

Lunch Gambit - https://jrjurman.itch.io/lunch-gambit

The games require a screen reader if you want to hear the text being read aloud, but the long and short of it is that the text on the right will be read out to screen readers. For people who might have trouble reading the text or need especially large fonts, the right side panel respects the font-size of the page, and allows players to zoom in if that would help readability.

The way that we were able to accomplish this is by having a special HTML template that reads the GPIO output from PICO-8 - pico-a11y-template

There is a chunk of code from the pico-a11y-template project that needs to be copied into the cart, but once you've done that, then you get access to a couple of methods that interact with the page and allow you to send text in a way that screen readers will be able to pick up.

set_sr_text(text) is the main method to set screen reader text, and allows you to send text (of any size) to the web page to be read out. That text will be loaded into a text element on the web page, which will alert screen readers (if the text has updated).

if (btnp(🅾️)) then
  counter = 0
  set_sr_text("counter reset")
end

There is a required update_sr() that handles the processing of larger text chunks, and finally there is a handle_pause_sr() - frustratingly, the default pause menu isn't (and can't be made from what I can tell) accessible by any means, so the best we can do is alert the user that the game has been paused, and when they unpause reset the text readout to what it was before.

function _update()

  -- your game logic ...

  update_sr()
  handle_pause_sr()
end

Accessibility is a spectrum, so aside from using this, we decided to use the Tomorrow Night font from VEXED for Lunch Gambit, so that low vision users who might not need a screen reader would be able to read the text in the PICO-8 window. This limited the amount of text we could fit on the screen, but was worthwhile to make the game accessible to those who might have issues reading the low resolution font built in.

From the feedback so far, it seems like there were no issues from Blind Gamers on playing these games in Pico-8, so I hope that this library opens up the kinds of games possible in Pico-8, and the total number of games available to those with low-vision

P#143442 2024-03-17 06:43 ( Edited 2024-03-17 15:18)

Update - I've been playing around with the amazing shrinko8, and aside from some linting, decided to provide a minified version of the code snippet. Now you can use this super tiny snippet to get all that accessibility goodness!

a11y_code.min.lua

a11y_start=24448a11y_page_size=128-4a11y_end=a11y_start+a11y_page_size a11y_read=a11y_end+1a11y_page=a11y_end+2a11y_last=a11y_end+3a11y_text=""function update_sr()local has_read_page,page,last_page=peek(a11y_read)==1,peek(a11y_page),peek(a11y_last)if(has_read_page and page<last_page)page=page+1poke(a11y_read,0)poke(a11y_page,page)
if(page<=last_page)for i=a11y_start,a11y_end do poke(i,0)end local text_start=a11y_page_size*page for i=1,a11y_page_size do local char,addr=ord(a11y_text,i+text_start),a11y_start+i poke(addr,char)end
end function set_sr_text(text)printh("sr:"..text.."\n")a11y_text=text local page_size=#text/a11y_page_size poke(a11y_read,0)poke(a11y_page,0)poke(a11y_last,page_size)update_sr()end pre_paused_text=""function handle_pause_sr()if(pre_paused_text~="")set_sr_text(pre_paused_text)pre_paused_text=""
if(btn(6))pre_paused_text=a11y_text set_sr_text"you've entered the pause menu, read out is not available yet, press p or enter to leave"
end
P#143518 2024-03-17 15:08 ( Edited 2024-03-17 15:14)

[Please log in to post a comment]