OwenGHB / angband-webclient

Browser client and webserver for playing Angband and variants
http://angband.live
GNU General Public License v2.0
18 stars 7 forks source link

Update terminal to xterm? #51

Open peterdresslar opened 3 years ago

peterdresslar commented 3 years ago

xterm is a much more recent fork of term.js that claims to be more performant. I am volunteering to take a look

kaytrance commented 3 years ago

sure, take a look, make any synthetic performance tests to see if there's any gain and make a pool request.

smbhax commented 2 years ago

Yeah, regarding the term vs xterm question, on the mirror issue for #52 in the angband/angband git, backwardsEric just wrote https://github.com/angband/angband/issues/5174#issuecomment-992843505

I tried to look at the term.js dependency for angband.live. The one directly listed by GitHub has a readme saying it's unmaintained, and I couldn't tell from the code how it was implementing the xterm compatibility (though that is likely just me since I don't know anything about Javascript). The project listed as a successor to term.js, https://github.com/xtermjs/xterm.js , has an implementation that's clearer to dig into. There, the color changing in browser/renderer/BaseRenderLayer.ts (https://github.com/xtermjs/xterm.js/blob/master/src/browser/renderer/BaseRenderLayer.ts ), looks suspect: the setColors() method updates the character atlas member but doesn't appear to do anything with the _colors member which is used for the clearing color in _clearAll().

peterdresslar commented 2 years ago

Hmmm, that's useful to know. I tried swapping it out when I raised the issue and I think the work from an angband.live standpoint would be relatively easy. Possibly it would not be so great from the standpoint of the games themselves.

I didn't have any band variants handy since I am on a mac. Trying to decide whether it is easier to spin up a docker dev environment or just work through the issues with compiling a variant on my local machine.