auzzy / 18xx-routes-web Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Linked Issue: Auzzy/1846-routes-web#62
This would be neat, but would need a better concept of a game for it to make sense. Or maybe just tying it to "Clear Map"?
There seems to be a race condition. In most cases when loading from local storage, the stations are drawn correctly. But sometimes, they're drawn both in the correct position, and where they'd be if no tile had been placed. I clearly shouldn't draw any stations until the tiles are loaded, and should refactor the code to enforce that.
Linked Issue: Auzzy/1846-routes-web#61
It might be useful to allow undoing some actions.
The main page of the app needs to link to the currently supported games. It shouldn't be fancy for now, just functional.
I haven't explicitly tested, but I think it all works. It's just not the best, since it's a touch-based but shows up pretty small. Fixing the map sizing will likely be required.
Linked Issue: Auzzy/1846-routes-web#58
Users can indicate the owner of private companies via the tile selection modal by selecting the owner of the token to place on the space. Having something similar for private companies that allow placing stations would also be useful. However, I'm going to hold off on it until I implement another game which uses such private companies.
It would be great if you could select the game from each game page. Maybe a dropdown when you click on the game name in the top left?
Same idea as #7. This is another very popular one, and a user actually wrote a tool to generate the import data: https://github.com/Petesuchos/18xx.games-to-1846routes-web. I would likely reach out to him, as well as whoever develops 18xx.games.
After calculation, the routes are displayed in text form and on the map. There is nothing to indicate which route on the map corresponds with which route in text form. There should be!
Linked Issue: Auzzy/1846-routes-web#75
A user suggested this, and it's a good idea to avoid any potential copyright issues. I'll generally prefer proper PnP materials since they often look nicer (like I did for 1889), but failing their availability, I can give https://18xx.kelsin.net/ a shot.
Both have made a major version jump: redis to 3.x, and rq to 1.x. Once I've completed my refactor to support routes-18xx, I should see what's required to upgrade them to their latest version.
Linked Issue: Auzzy/1846-routes-web#76
This may be solved for free if I implement #26 . The tricky thing will be testing it, as I've yet to repro this issue.
It might be nice to flesh out the error handling some more. That is, have all the controllers return JSON messages and an appropriate status code. I'd likely want to use Flask's built-in error handler registry to catch general issues, but it would also mean doing more processing and/or try-excepts in the controllers, so they could get messy for not a ton of payoff.
Linked Issue: Auzzy/1846-routes-web#71
Instead of just magically included it, print it out on the route calculation.
If a user places a station which blocks a railroad's home city station from being placed, an error should be raised. It's be great if I can prevent it in the first place, but more likely, it will just be displaying a message when attempting to run the route.
This is dependent on Auzzy/18xx-routes#25.
With is_removable as an attribute in the railroad info files from routes-18xx, the app should only list legally removable railroads in the "Removed Railroads" dropdown.
On the station selection modal, display some indicator of which station is the home station. This will lead to less confusion as to why that city cannot be unselected if the player forgets.
Also maybe indicate it on the railroads table.
Since of the games currently supported, only 1 has a split city tile and it only has 1 legal rotation, there is no need to support the rotation of split city tiles. This also means that if I were to support it, I wouldn't be able to test with high confidence that it works. As such, once a game is under development with a split city which can be rotated, their handling will need to be revisited.
Namely:
When drawing routes in 1889, they're just a little bit off on the curves. Not too bad, so it looks fine, but it's noticeable. This results from the slightly different tile sizes due to the different map sizes. There's probably a way to relate the arc radius to the tile size, so it will always fit tightly.
At the bottom of the page, there's a large blank buffer. I need to look into what of my styling is causing it and remove it.
Linked issue: Auzzy/1846-routes-web#29
This isn't a huge problem, as it can be solved by just refreshing the page. But it's annoying, and can make the page look like it's broken, which could scare users away.
The contents of the About modal should be moved to the game selection screen. The About modal on each page should display some more basic info, and link back to the main page for more details.
When a user visits a URL for a game that is not currently supported (e.g. 1829), an error message should be shown stating as much.
It would be SUPER cool if I could integrate with BOARD18, and/or other sites which host 18xx games. Something like allowing you to pass a URL into my app, and it would pull all the data from the game itself. This would of course require talking to the site maintainer, to both see if they're okay with it and for any help making it work.
Add a checkbox or something to enter strict mode. This will apply stricter controls over what you can place. For example, it will ensure any tile you lay is a legal upgrade to the one currently on the space.
This really should only be implemented after #28 . Otherwise, it'll just be a pain in the ass.
In the tile selector modal, when displaying a tile's possible orientations, collapse those that are the same. That is, if the paths and branches are the same in orientation X and orientation Y, only display orientation X as an option. X should probably be the minimum orientation, for consistency's sake.
Linked Issue: Auzzy/1846-routes-web#69
Seems like a decent idea, and I don't think it'll be very tricky.
I haven't checked in a while, and I just got an error when trying to use ENTER to select a space. It's worth looking into.
The tiles displayed in the tile selection modal hang way off the modal background. Instead of scrolling the list of tiles, the whole modal screen gets scrolled. So the white background stays put and scrolls off the screen, while the tiles appear over a grayed out board. This is hard to use, in large part because the tiles are hard to see. It also messes with the orientation display, since they appear somewhere along that section.
I thought I made this switch a long time back, in the original 1846 Routes Finder app, but it looks like not. Here's a guide to using gunicorn on Heroku: https://devcenter.heroku.com/articles/python-gunicorn
Some private companies place their token on a space to increase its value for the owning railroad. It would be great to display that increase on the space, and overlay it on any tiles placed.
I haven't figured out exactly when or how to reproduce it. But what's happening is the page will occassionally load without the data from localStorage. Additionally, the railroads and privates tabs from the right of the map are missing (I believe shifted below the map).
When the user clicks calculate, we should evaluate if all the tiles on the map are of a sensible upgrade level. That is, if the game is in phase 2, there shouldn't be any brown or gray tiles on the map.
I don't want to prevent their placement, since I want to allow flexibility in building up the game state. But validation seems useful.
In a bunch of places, if an AJAX call returns an error, I either ignore the error or simple display it in an alert. I really should go through and make sure to handle errors better everywhere, such as displaying them more nicely, or at least logging them to the console.
The modal I currently use for tile selection is clunky. For one, it's currently broken. But moreso, orientation selection sucks. It would be much better to choose the tile, have it appear on the board, and allow rotation (probably by left and right clicking).
It may also be interesting to look at the tray setup BOARD18 uses. That is, the tile selector will be just another tab, maybe with dropdowns to choose the type of tile (yellow, green city, etc). The user would click on a tile to select it, then click a space on the board to place it, then click to rotate, then hit ENTER to lock it.
A similar interface could be used for the tokens. Click to select a token, then click to choose which tile to place it on. I can use my current mechanism to place the token for the user, with I think it much better than BOARD18's free form placement. This token tray would likely be another entry in the aforementioned tile tray dropdown.
When a user visits the private companies tab or the PCs section of the tile modal when the privates are closed, they should see a short message informing them of that. This will reduce confusion as to why nothing is changing on the map, even though you're changing the data in the app.
Linked issue: Auzzy/1846-routes-web#49
It would be nice if things flickered less when placing new things.
Linked Issue: Auzzy/1846-routes-web#60
Cons: modifying that section by hand would be a bit messier, although admittedly not much. And I doubt many people would use it this way.
Pros: more convenient to capture the whole game state. A user also suggested it would help with bug reports through GitHub, and they're definitely correct.
That sounds like I should definitely do it.
At the same time at #1 , I should look into using Flask-RQ2: https://pypi.org/project/Flask-RQ2/. I don't know much about it, but it seems to better integrate Flask with RQ. However, the project appears to be dormant, as it hasn't received a release in almost 2 years, so caution is advisable.
Linked Issue: Auzzy/1846-routes-web#70
If I go through with Auzzy/18xx-routes#7, then I can take it on in the app. There are some nuances to make it usable described in the original issue which make it slightly trickier than it appears at first blush.
The column names are only used for the placed tiles, although they're generated for railroads and private companies, too.
Linked Issue: Auzzy/1846-routes-web#78
The highest value route is selected before applying the Mail Contract. So if applying the Mail Contract to a different route would make it the most valuable, the app might miss it.
Consider the attached scenario. Without the Mail Contract, the run on G is 80, and the Detroit route is 90. Give Grand Trunk the Mail Contract, and the Detroit run becomes 110, while the G run is 120. Therefore, the G run should be selected, but it's not; Detroit is.
Another interesting note. If there is also a city tile on Dayton (G13), then it does select the G run. So maybe it has something to do with length?
In a practical sense, this is very rare. The nature of how close the city values are, plus trains usually running their full length, ensures that. It took some care to contrive such a scenario. Still, it should be rectified.
railroads-mail-contract-bug.txt
private-companies-mail-contract-bug.txt
board-tiles-mail-contract-bug.txt
Each route finder page needs a link back to the site's game selection page.
It would be useful to indicate on the map when a tile has too many stations, so users will know before clicking calculate. Maybe something like highlighting it in red?
Linked issue: Auzzy/1846-routes-web#39
This is probably still an issue, although I haven't checked recently. It also might be solved when I upgrade my version of rq or start using Flask-RQ2 (#1 and #2 ). It would be super useful if I can get this working.
Linked Issue: Auzzy/1846-routes-web#56
The order of tiles in the tile selection modal should be more sensible. It should first sort by upgrade level, with lower upgrade level being first. Then it should sort by tile type: track, cities, towns. And finally, it should sort by tile ID.
Linked issue: Auzzy/1846-routes-web#77
The Report Issues button sends an email to me with a bunch of details about what went wrong. However, most of the time if someone did so in the routes1846 app I got security alerts from Google informing me that someone tried to log in as that account, so it blocked them. Which means it blocked people attempting to send me an error report.
I need to solve this, as that button is super convenient, and collects a bunch of info for me. I thought I'd set Google to allow logins from anywhere, but it seems that something else needs to be fixed.
Using the Gmail API is almost certainly a better solution than trying to connect to the SMTP server directly: https://developers.google.com/gmail/api/guides
To allow migration from routes1846, there needs to be an endpoint which can take the data, translate the orientations, and load it into the map.
Linked issue: Auzzy/1846-routes-web#52
Users being able to resize the map would be nice.
Linked Issue: Auzzy/1846-routes-web#68
I don't know why I'm not already doing this. It should be super easy.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.