Commit Graph

5674 Commits

Author SHA1 Message Date
Dustin Carlino
dff6d6004d On the web, use URL query parameters as the command-line arguments. This
is a step towards initializing with any map. #344

As a demo, running locally, http://0.0.0.0:8000/?--dev&--color_scheme=night%20mode now works
2021-01-09 13:02:39 -08:00
Dustin Carlino
26f3726abd gzip two large SVG character files to trims down wasm size more for #377. game from 31MB to 24MB!
I didn't have to do anything to gunzip, because usvg is such a magical
crate that it already has flate2 support baked in.
2021-01-09 09:26:41 -08:00
Dustin Carlino
2972fef609 Trim wasm size for #377
- Remove one of Holly's characters, since it's still unused
- Exclude assets/music

game from 54MB down to 31MB
2021-01-08 17:41:53 -08:00
Dustin Carlino
64d5f487b1 Add address/business search to 15m. #393 2021-01-08 15:55:14 -08:00
Dustin Carlino
fea3ebbe5b Change the city picker UI to show cities on the left. After clicking one, open up the overview for that city. 2021-01-08 15:51:22 -08:00
Dustin Carlino
6e3ce1d9ee Stop generating footways and service road KML files out of Seattle. They're only used for debugging, and not actively. For cities with multiple maps, the order of importing maps causes the files to get overwritten anyway. 2021-01-08 09:44:38 -08:00
Dustin Carlino
afceb5e268 Adjust Leeds import: #444
- stretch central polygon a bit to avoid crash when clipping
  https://www.openstreetmap.org/way/511767781
- rename polygons ("center" to "huge", and removing the "leeds_" prefix
  from the others)
- generate a region overview from the huge map
- only import/match collision data on the huge map
2021-01-08 09:29:45 -08:00
Robin Lovelace
6af15c202c Break-up Leeds, closing #444 2021-01-08 09:21:05 -08:00
Dustin Carlino
82c1495cc4 Seemingly fix the first screenshot of some maps by double drawing the first tile. Not sure what the problem is or why this appears to fix it. 2021-01-07 20:22:27 -08:00
Dustin Carlino
77c76a2a9c Clean up and categorize overrides for allowing vehicles to block-the-box at hardcoded intersections. 2021-01-07 14:24:48 -08:00
Dustin Carlino
b487678ee0 Delete all out-of-date manual overrides for traffic signals, and make it
a hard error when they become out-of-date going forward.

Better heuristics make some of these unnecessary. And now the the JSON
files are in this repo, updating files manually when pulling down new
OSM data becomes less tedious.
2021-01-07 12:24:07 -08:00
Dustin Carlino
f28bdc9b9e Grab new Seattle OSM data with some junction=intersection tags in Montlake and along Aurora. #114 2021-01-07 11:11:59 -08:00
Dustin Carlino
65b2b581fa Attempt to take many screenshots of one map at different zoom levels for Leaflet. Various bugs, but progress. #440 2021-01-06 16:33:53 -08:00
Dustin Carlino
5b4a689125 Initial steps to internally refactor buttons. Name action/label/tooltip
consistently.
2021-01-06 11:07:24 -08:00
Dustin Carlino
92be9c57ed Optionally tile screenshots at smaller dimensions than the window. #440 2021-01-06 10:52:22 -08:00
Dustin Carlino
4cf133cc32 Make the new screencaps preserve alpha properly by switching to
premultiplied alpha. See option 1 of
https://stackoverflow.com/a/24380226

Upload the "new" screenshots (and lakeslice map)!
2021-01-05 18:28:30 -08:00
Dustin Carlino
7f0cdace5a Use OpenGL to take screenshots instead of scrot. Benefits:
- Simple -- one OpenGL call and feeding to the awesome image crate
- Faster -- seemingly don't need the sleep() for whatever vsync problems
- Portable -- doesn't use the Linux scrot tool
- I can switch windows and wiggle the cursor with impunity while this runs

One disadvantage: screencaps in S3 are now slightly larger PNGs, because
for some reason, the image/gif feature is super slow, even in release
mode.

For now, this makes the process of screenshot diffing map changes
easier. But it also might help with producing raster tiles for Leaflet. #440

Also, had to regenerate lakeslice because of the previous change --
it had an old adaptive signal baked in.
2021-01-05 14:58:31 -08:00
Dustin Carlino
6346302338 Remove the adaptive traffic signal experiment, now that Bruce's variable signals work. The adaptive case was added as a proof-of-concept, and its behavior is subsumed by the variable ones. Fixes #124 2021-01-05 13:06:44 -08:00
Dustin Carlino
6f5f001406 Address SUMO PR comments and also rebase. Mainly:
- use an enum for vehicle types
- distinguish lane and internal lane IDs
2021-01-05 12:44:38 -08:00
Dustin Carlino
8436b5358e Transform SUMO's connections and internal edges into ABST's turns 2021-01-05 12:44:38 -08:00
Dustin Carlino
802e020520 Import a SUMO network, transform it into an ABST map. So far, this gets
lanes and intersections displaying, but with lots of problems.
2021-01-05 12:44:38 -08:00
Dustin Carlino
eb9bf77bf0 Use roxmltree/std to get an error implementation and make using it more ergonomic 2021-01-05 11:37:48 -08:00
Dustin Carlino
e99def9124 Switch all error handling to anyhow. Nothing consumes our code as a
library yet, so this is a step forward from string errors. Manually
tested how errors show up (including the nice with_context bit).
2021-01-05 11:35:03 -08:00
Dustin Carlino
cd7dca87d7 Fix web build after rand upgrade. Unfortunately I think this has to happen in all of the binary crates individually: https://docs.rs/getrandom/0.2.1/getrandom/#indirect-dependencies 2021-01-05 11:12:03 -08:00
Dustin Carlino
bc3c3dfd6c Rename phase -> stage in the JSON traffic signal format. Meant to do this a long time ago. #295
Make this schema change backwards compatible for player edits.
2021-01-04 11:18:17 -08:00
Dustin Carlino
dedb041bdb Move CameraState to map_gui. Now widgetry has no dependency on abstio! #253 2021-01-04 10:39:15 -08:00
Dustin Carlino
bfa208ce6a Parameterize widgetry on a way to read SVG files. This is one of the last steps to remove the dependency on abstio. #253 2021-01-04 09:53:24 -08:00
Dustin Carlino
d529ae2e5c Upgrade usvg and rand 2021-01-04 09:19:54 -08:00
Dustin Carlino
965d999199 Upgrade misc other dependencies 2021-01-03 20:01:27 -08:00
Dustin Carlino
2945913fb3 Upgrade rand 2021-01-03 19:48:03 -08:00
Javed Nissar
c0c7e22c40
Add dist from sidewalk to cost to improve illustration of distance (#443) 2021-01-03 17:59:39 -08:00
Dustin Carlino
53227b6ec6 new release (and finally add a little more automation for this step) 2021-01-03 12:23:47 -08:00
Dustin Carlino
54968abeb1 prep for release. [rebuild] [release] 2021-01-03 10:34:21 -08:00
Dustin Carlino
5c04923dff Split abstio crate out from abstutil. #253
widgetry, geom, and abstutil may wind up on crates.io in some form to
let other projects use widgetry. abstio has A/B Street-specific tricks
for reading data on native/web. Note widgetry still depends on abstio,
will figure out how to clean that up next.
2021-01-02 10:28:00 -08:00
Michael Kirk
147c36d8fe
remove broken popdat main (#441)
I broke this in acadad8bd

We could fix this by making main async and fetching CensusAreas and
passing them into the generate function... but it doesn't seem like
we're using this any longer anyway.
2021-01-01 21:37:45 -08:00
Dustin Carlino
795c6bebb1 When producing GeoJSON, represent Polygons that arent Rings (like from SVGs) as a MultiPolygon of every pre-calculated triangle. #440 2021-01-01 15:33:11 -08:00
Dustin Carlino
b7d025b6a6 Simplify DrawRoad a bit (center line and label in the same batch). Include it in GeoJSON export. #440 2021-01-01 15:18:01 -08:00
Dustin Carlino
6119042b4f Reorder points when converting a PolyLine to a Polygon, so that the
result is usually a Ring. This gets lanes to render in the GeoJSON
export. #440

Ideally all Polygons would be expressed as an outer Ring and some
optional inner Rings. There are a few cases where this is hard, and we
instead just rely on the triangulation for rendering and point
containment and give up on GeoJSON export.

Not regenerating all maps yet -- zero screenshot diff, the map file does
change, but not sure how.
2021-01-01 15:03:09 -08:00
Dustin Carlino
302ec94e3d Try exporting the zoomed-in rendering of a map to geojson. #440
This approach has some manual effort and it's not capturing everything
yet, but it's a start.
2021-01-01 12:46:25 -08:00
Michael Kirk
acadad8bdf
fetch US census data from a hosted FlatGeoBuf (#432) 2020-12-31 16:20:32 -08:00
Dustin Carlino
d7afe4d318 Add a fastpath to the updater to 'download' from a local copy, to undo local temporary work more easily. 2020-12-31 12:44:31 -08:00
Dustin Carlino
4c348779db Adjust a signal in lakeslice and regenerate prebaked data after changes yesterday. The signal timing is necessary to workaround an unrelated roundabout gridlock bug at a nearby intersection, unfortunately. 2020-12-31 11:25:18 -08:00
Dustin Carlino
312a721e63 Fold the separate seattle_traffic_signals git repo back into this one.
Originally it was split out to organize a separate volunteer mapping
effort, but that never took off, and it's unlikely to happen. When we
have to occasionally update the prebaked signal data for some
intersections, it's unnecessary friction to update the other repo.
2020-12-31 11:01:48 -08:00
Dustin Carlino
9c63d9a181 Make a quick way of marking roads in the UI, dumping to a list, then
later overriding a .osm file with tags for these roads. This is a way to
test the effects of making simple OSM changes locally before
upstreaming.

Also handle repeated merging collapsing one of the roads. Not 100% what
happens here, but skipping the collapsed road works fine. The scary
Montlake intersections now look great with all the merging done, so
upstreaming the change! #114
2020-12-30 18:31:39 -08:00
Bruce
d47f2d84f3
Queue::try_to_reserve_entry needs improvement (#439)
If an intersection is short, and bike is spawned, another bike coming along will attempt to fit if force_entry is true. This results in a panic. To address this, if the reserved_length is >= the geom_len, false will be returned, even if forced_entry is true.
2020-12-30 18:08:43 -08:00
Dustin Carlino
629ee92a7e I got the turn restriction preservation direction wrong earlier. Now
everything along Aurora looks fine, but maybe I wrote the other way when
testing in Montlake earlier. Guess I'll find out soon. #114

Not regenerating all maps yet, since more churn is on the way.
2020-12-30 17:30:05 -08:00
Dustin Carlino
60e7c91d03 Handle one-way roads more uniformly in the traffic signal heuristics. #8
Previously, dual carriageways (pairs of one-way roads in opposite
directions) mostly didn't get any signal templates successfully applied.
This change ignores outbound-only roads when applying the templates. In
one fell swoop, lots of previously broken signals along places like
Aurora Ave suddenly work reasonably.
2020-12-30 15:28:17 -08:00
Dustin Carlino
df59b477a5 Start importing Bellevue. Treat it as a separate city from Seattle, and
don't even check if Soundcast data covers it yet.

Now regenerate all map data.
2020-12-30 13:21:59 -08:00
Dustin Carlino
9bc761f98e Explicitly model U-turns. Sometimes they're legal, often they get
generated incorrectly, but regardless, calling them TurnType::Left is
just confusing.

For the moment, always filter out U-turns from merged intersections.
When connections across merged one-ways are handled properly, we won't
need this, but in the meantime, it moves forward. #114

Not regenerating just yet, but will bundle it with the next commit.
2020-12-30 11:11:20 -08:00
Dustin Carlino
de4b026920 More turn restriction preservation... #114 2020-12-30 10:01:23 -08:00