-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement canvas-based Dwarf Fortress display in the web interface. #6
Comments
I've started working on this (repo). It can load fonts from images, like DF, and will also support different foreground and background colors (hopefully it'll support transparency as well, once I figure out how to do that in JavaScript). Speed shouldn't be much of an issue with a canvas, as long as the browser is decent (which most browsers that support websockets are). |
Here's a demo. |
I should be able to get this done pretty soon – I've managed to get DFHack almost working (hopefully that'll be done soon). I'll also be able to fix any playing UI problems that #18 caused, although I haven't heard of any since that was merged. |
I think we should rewrite the web interface part while we do this. Currently it's all very inconsistent. The admin panel HTML is generated on the server side whereas the playing interface is implemented with text-file HTML. There's a mix of ad-hoc written JavaScript, jQuery and Bootstrap and I find the thing annoying to work with. I'm thinking of doing this:
I think this would significantly simplify the web code I currently have on the server side. I could have a well-defined JSON API and those are fun to write. However, I have no experience with implementing this kind of thing on the client side. Any thoughts on this? |
I would definitely like more consistent JS. :) (Admittedly, part of it is my fault, since I added a lot of bits and pieces in various locations back when I was working on the web UI and never got around to organizing them). |
I cannot be sure, but I suspect the web interface itself is a major source of perceived lag. The current display is implemented as a two dimensional grid of -objects that get their classes and text contents changed all the time, probably triggering nasty, performance-killing things like reflows.
I think it may be worth it to experiment with a canvas object to see if it was faster and more CPU-friendly.
The text was updated successfully, but these errors were encountered: