MegaMek / megamek

MegaMek is a networked Java clone of BattleTech, a turn-based sci-fi boardgame for 2+ players. Fight using giant robots, tanks, and/or infantry on a hex-based map.
http://www.megamek.org
GNU General Public License v2.0
299 stars 288 forks source link

Visually-Impaired support #1257

Open HammerGS opened 5 years ago

HammerGS commented 5 years ago

From this forum post.

https://www.megamek.org/bb/thread-2592.html

Hi All,

I'm coming back with a renewed interest in Megamek and the Battletech game system and setting, and was wondering about how to use some of the "client commands," I've found in the source code. As a totally blind player I can't use the game map, obviously, but there are commands for showing tile information, mech information, moving and deploying units etc. (See "showtile, "showentity," and others in the client commands directory.

Are these meant to be typed into the chat window in some fashion? I can't seem to find a chat window reliably, at least not when doing unit deployment for instance. Is it possible to pull one up with a keyboard command?

I feel like I'm missing something obvious. The rest of the Megamek screens are very accessible for my purposes, and I feel with perhaps one or two more commands I could easily play this game as it stands now.

Any advice would be greatly appreciated. Thanks!

A little judicious poking around in the source has lead me to the answer, the commands start with the "#," character.

The screen reader I'm using seems to not see the chat window when I'm in deployment or movement mode, which is irritating. If I could get a command-line only client program that would be ideal, but I don't know how easy or practical that would be.

I know that the developers have previously said that implementing visually-impaired support would be a great deal of work for a small team, and I certainly understand that. Nevertheless, I remain optimistic that with a few fairly simple UI changes, things mightend up being surprisingly accessible.

HammerGS commented 5 years ago

https://www.reddit.com/r/battletech/comments/armtcc/help_make_megamek_accessible/

sixlettervariables commented 5 years ago

This is would definitely like to help with. I'd like to gather some more of the requirements and start knocking out these accessibility items.

BlindGuyNW commented 5 years ago

I'm happy to help however I can. My accessibility background is more on the web accessibility side, with ARIA and related technologies, but some of the principles are probably broadly applicable.

I've just been looking at the Java components individualy trying to understand where they fit together. At the moment the CHatterbox panel seems to be problematic for accessibility, and that's where all my client commands need to be typed.

sixlettervariables commented 5 years ago

I don't know much about Java's accessibility support with respect to your screen reader, but I'd imagine ensuring all controls have tooltips is a start and that they all could be executed as chat commands.

Probably other commands to describe the relationship of your units, allied units, and enemy units.

I'm not exactly sure how best to enable movement and conceptualizing the board between you and the enemies.

But it sounds like breaking out the chat box into it's own window is a good first start.

BlindGuyNW commented 5 years ago

Yeah, that does sound like a good place to begin.

The chat/client commands are individually coded in the Client/Commands folder in the MegaMek source. The pre-existing ones allow for movement, weapons fire, deployment and querying map and unit info, which is a good base to build from. :)

On another note, if there's interest I might be able to create an audio or video recording of my experience interacting with the client, just to give an idea of where things stand.

BlindGuyNW commented 5 years ago

For some additional context, here is a thread from an accessible gaming forum which originally inspired my interest in this topic. It's obviously many years old now, but this is at least an indicator of where the original developer was going. The commands still seem to work even if not in the chat panel.

sixlettervariables commented 5 years ago

Some details on how we can ensure the UI is accessible to assistive technology: https://docs.oracle.com/javase/tutorial/uiswing/misc/access.html

BlindGuyNW commented 5 years ago

THanks for passing that along. I had meant to but got distracted. :)

The majority of the UI, aside from the board, of course, is actualy reasonably accessible already. There’s probably room for improvement but it’s not a huge obstacle. :)

Also, I’m not sure if he’s already subscribed to this thread or not, but I got in touch with the original developer behind the Audiogames thread I linked, and he’s willing to do some work to help out with this project. HE hopes to have some kind of prototype soon.

Thanks for the support, all.

On Feb 22, 2019, at 9:27 PM, Christopher Watford notifications@github.com wrote:

Some details on how we can ensure the UI is accessible to assistive technology: https://docs.oracle.com/javase/tutorial/uiswing/misc/access.html https://docs.oracle.com/javase/tutorial/uiswing/misc/access.html — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MegaMek/megamek/issues/1257#issuecomment-466618570, or mute the thread https://github.com/notifications/unsubscribe-auth/ABtsc7Cux6Y0uMpq8UubouqV5fd5j3nCks5vQNE5gaJpZM4a_nLr.

Dirk-c-Walter commented 5 years ago

I'm just hackign something together to see if I can get it in a working state, my very very rough WIP is here;

https://github.com/Dirk-c-Walter/megamek/tree/FixChatWindow

It's still not in a usable state but I am planing on keeping poking at it. I'll also double back and see if I can add accessibility to our normal UI, rather than making it entirely reliant on using rather cumbersome text commands. Though having the option to play a basic game entirely through text commands would still be a good option.

BlindGuyNW commented 5 years ago

I'm more than happy to start knocking off some low-hanging fruit on this, like making sure text fields are properly associated with their labels. I'm not sure about PR etiquette here, should I just work on my fork and request a merge when I've done a decent amount?

I was poking around with the in-progress stuff provided by @Dirk-c-Walter. The accessibility window seems to work well, outstanding focus issues aside. My current thoughts are on slightly bigger picture questions…

I'm wondering how we can present the map. One option would be to just dump all the hexes one at a time into the output stream, this isn't ideal but would probably work as a prototype. I had a thought about creating a way to indicate the position of the virtual cursor, so you could explore hex-by-hex. I'm not sure about a way to get the broad overview that's possible visually, unless we did something like "describe the map in a text paragraph."

Just been thinking about this game quite a bit lately, and feeling hopeful for positive progress. :)

sixlettervariables commented 5 years ago

If you're doing work like updating labels and tooltips, feel free to submit PRs per window or dialog to keep things in manageable chunks. Larger work requires more time to review, but eventually gets reviewed.

sixlettervariables commented 5 years ago

I've been thinking about the board too. Something where it automatically centers on the unit you select and perhaps the numpad keys walk your Described Map cursor around.

BlindGuyNW commented 5 years ago

YEah, that was the thought I had. :) THe screen readers tend to co-opt the numpad for their own purposes, but if you turn num lock off it works welle enough.

I’ll get to work on some PRs.

On Mar 2, 2019, at 5:38 PM, Christopher Watford notifications@github.com wrote:

I've been thinking about the board too. Something where it automatically centers on the unit you select and perhaps the numpad keys walk your Described Map cursor around.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MegaMek/megamek/issues/1257#issuecomment-468977695, or mute the thread https://github.com/notifications/unsubscribe-auth/ABtsc6seE6qaDe9ik4nyO28HYPsE25XTks5vSyexgaJpZM4a_nLr.

BlindGuyNW commented 5 years ago

In terms of concrete components that aren't currently very accessible, the picMap widget is high on the list. It seems to be the basis for a lot of the custom controls on some screens.

It's a subclass of jComponent, which isn't accessible by default. I'm wondering if it's worth trying to make something so low-level workable, or if we're better off relying on text commands or alternative outputs.

The example which immediately comes to mind is the UnitDisplay. THat's probably very useful info to have, and currently a black hole as far as my screen readers are concerned.

sixlettervariables commented 5 years ago

Another good reference https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/W10ef84c59396_40fb_aa66_a05ad699cda6/page/Accessibility%20Design%20and%20Coding%20Guidelines%20for%20Java%20Swing%20and%20SWT%20GUI%20Development

BlindGuyNW commented 5 years ago

I was inspired last night and decided to give the in-progress work by @dirk-c-walter a try. I was able to play a1V2 engagement, though the bot obliterated me quite handily and I must have messed up the unit assignments, because I definitely intended it to be 1V1.

The client commands worked well as a way to do movement and weapons fire and such. The default Chatterbox2 seems to occasionally pop up and make typing into the other window harder than it should be.

Nevertheless, this experience was pretty positive over all. I would definitely like a way to use the main game interface, but the command line does its job. A few commands seem to currently be missing, such as one to do physical attacks, declare charges and DFAs and such, but those seem fairly easy to add. It's easy for me to think of quality-of-life improvements which should be fairly simple to code, in general.

All in all, the raw text output for the game is definitely present, it's just a matter of finding a way to convey that to the screen reader, one way or another.

Hadi-1624 commented 5 years ago

Another visually impaired user here. BlindGuyNW shared the current progress with me and i find the commandline interface very efficient and fast to work with, It is absolutely great that using the cli we can basically perform any action. However i find it super hard to play without any sense of the map overview. There is a command that lists all the units and their coordinates but the map being a hex i personally don't get a good idea of the relative position of the units to each other, so most of the time i try to get close by using the auto pathfinder and mindlessly fire towards the enemy units without taking account of covers or any tactical advantages. My personal idea is that finding a way to read the board with the screen reader should be the priority. How possible it is to implement a new window that shows the board in text and allows navigation with the numb pad keys? Thanks for implementing the commandline window and making this game accessible, we are so close it is just the matter of seeing the actual board with the screen reader.

BlindGuyNW commented 3 years ago

Just dropping a note here to say that I've been getting back into this lately, as @Dirk-c-Walter can attest. THere's an existing pR, #2655, which has some additional work on the command line UI.

At the moment there are two major sorts of problems.

  1. Some aspects of the UI are presented in a form the screen reader can't currently digest. This includes a lot of mech data, the UnitDisplay subsystem, and all the sprites on the map, which convey things like movement envelopes.
  2. Some parts of the game, particularly around movement, are just inherently difficult to deal with non-visually. It can be done, and the code in the above-mentioned PR makes it easier than it's been before, but hex maps are still a little confusing.

I think that the first class of problems is definitely solvable. Some of the data is probably more important, mech display info, for instance, whereas stuff like movement envelopes can probably wait a while. I'm fresh out of ideas on how to deal with the second, beyond adding ways to interrogate the hex map for details… "What is the nearest hex with a special feature?" We can already walk around the map hex by hex, which is very nice, it just takes getting used to.

I just wanted to drop by and say that I'm very much looking forward to seeing what we can do with this. I gave a copy of the current in-progress code to @h-rezaei, and hopefully he'll have some ideas.

Scoppio commented 1 week ago

I want to take a look on that

BlindGuyNW commented 1 week ago

Any help would be very much apreciated. I haven't played this in several years--got distracted by other games but always meant to get back into it.