Giter Site home page Giter Site logo

18xx-routes-web's People

Contributors

auzzy avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

siryaro

18xx-routes-web's Issues

Stations get drawn twice

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.

Basic game selection screen

The main page of the app needs to link to the currently supported games. It shouldn't be fancy for now, just functional.

Make mobile interaction better

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.

Claim private company stations via the map

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.

Improve game selection screen

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?

Color code train route text

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!

Upgrade redis and rq

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.

JSON error handling

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.

Handle reserved cities

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.

Only allow removing removable railroads

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.

Display home indicator on station selection

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.

Handle rotation of split city tiles

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:

  • drawing stations
    • probably can base it on the offset setup
  • placing stations by tile modal
    • determining the legal branches is the tough part. you probably list them based on the currently placed tile. but what if they downgrade the tile, and one of the listed branches is no longer legal?

Generalize the route drawing arc radius

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.

Handle Heroku timeouts

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.

Move about to the game selection page

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.

Integrate with BOARD18

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.

Strict Mode

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.

Collapse symmetrical orientations

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.

Fix tile selection modal

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.

Display private company value on map

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.

Occasionally fails to load properly

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).

Validate tile upgrade levels

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.

Improve error handling

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.

Investigate BOARD18 inspired tile/token selector

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.

Display that privates have closed

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.

Single text area to import/export entire game state?

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.

Look into Flask-RQ2

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.

Use dynamic colnames

The column names are only used for the placed tiles, although they're generated for railroads and private companies, too.

Mail Contract bug

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

Add home link

Each route finder page needs a link back to the site's game selection page.

Indicate space with too many stations

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?

Fix Report Issues button

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.