Commit Graph

5278 Commits

Author SHA1 Message Date
Dustin Carlino
6a8e01d4cd Remove an unnecessary slider from the polygon debugger, and lock down set_percent, which is causing some scrollabr dragging bugs. 2020-10-27 11:31:37 -07:00
Dustin Carlino
b4c39a0850 An initial script to mass import cities. #326 2020-10-26 17:46:53 -07:00
Dustin Carlino
004ca95842 Optionally just create a circle of some radius around the 'center' of a city. #326 2020-10-26 16:57:50 -07:00
Dustin Carlino
0c0104d1e2 Parallelize parking lot spot generation. Austin goes from 81s total import down to 44s. #270 2020-10-26 16:28:11 -07:00
Dustin Carlino
806d5d59db Just regenerate Cargo.lock; the format changed in rust 1.47, and I don't want a later diff updating deps to create a huge diff 2020-10-26 15:07:51 -07:00
Dustin Carlino
fda4c4da7b Refactor a few utilities, and use convex hull of the city boundaries to simplify them considerably. #326 2020-10-26 14:15:25 -07:00
Dustin Carlino
30ad6709a8 Create a tool to turn huge .osm extracts into just the cities. The
result isn't quite useful yet; the clipping polygons are massively
complicated. #326
2020-10-26 13:40:22 -07:00
Dustin Carlino
1cc7982ff7 fix web build and redeploy 2020-10-26 10:23:24 -07:00
Dustin Carlino
c018de86b1 new release 2020-10-25 17:29:42 -07:00
Dustin Carlino
47fa997f72 Refactor a proper Amenity struct. Leave room for optional raw OSM tags.
Don't expose the tags in the UI yet. [rebuild]
2020-10-25 11:49:46 -07:00
Dustin Carlino
1a630c6361 Highlight categories of businesses in the osm viewer 2020-10-24 15:19:51 -07:00
Dustin Carlino
34b41a909e Optionally keep building OSM tags. Display in info panels and the new viewer, when present.
Don't keep the tags by default. File size increase from the empty map is
negligible.
2020-10-24 14:19:22 -07:00
Dustin Carlino
ad23da1f6c Workaround widgetry panel bug in the osm viewer, where scrollbars aren't
recomputed when panel contents change size.
2020-10-24 13:41:06 -07:00
Dustin Carlino
614c744dc9 Add a POI search to the new viewer 2020-10-24 13:13:04 -07:00
Dustin Carlino
a538b5cd64 Add the minimap to the OSM viewer, making a variation that hides some features 2020-10-24 12:27:27 -07:00
Dustin Carlino
6fef09fb8d Flesh out the OSM viewer:
- outline around fixed objects
- open OSM keys in the wiki
- info panels for buildings, intersections, and parking lots
- show turns from lanes
2020-10-24 11:38:19 -07:00
Dustin Carlino
8339c893eb Show some OSM key/values for roads in the new viewer 2020-10-23 21:15:09 -07:00
Dustin Carlino
ecabf2436f Experiment with a dedicated OSM viewer, to debut at Connect 2020. For
now, this is still embedded in A/B Street, to take advantage of
everything that already exists. But later, the idea is to split it into
a separate crate, sharing lots of code.
2020-10-23 16:28:47 -07:00
Dustin Carlino
9dbb156058 Skip wakeup_waiting while we're handling live map edits. Based on the
order of vehicle deletion, we try to ask about stop sign and traffic
signal movements that may be deleted and would be irrelevant anyway if a
different deletion order happened. #312

We should really defer wakeup_waiting until after all cleanup is done,
but for now, willing to risk some stuckness at a stop sign...
2020-10-23 12:15:51 -07:00
Dustin Carlino
3db8fe6669 Also need to clean up vehicles that're laggy heads on live-edited parts
of the map. #312
2020-10-23 11:58:43 -07:00
Dustin Carlino
781604907c While deleting cars for live edits, don't opportunistically lane-change for woen-up followers. They're likely about to be deleted, too. #312 2020-10-23 11:38:21 -07:00
Dustin Carlino
536971b641 Cleanup formatting after #371 2020-10-23 10:42:12 -07:00
Javed Nissar
c74dcf025f
Update georust (#371) 2020-10-23 10:41:00 -07:00
Dustin Carlino
5973da0717 Handle bike trips that wind up with no actual biking portion due to live
edits. #312

... And with this, traffic seitan makes it through an entire day at
montlake! Next up, lakeslice I guess.
2020-10-22 21:39:54 -07:00
Dustin Carlino
8b0d6c6e92 Fix thought bubble svg; for some reason, it had cyan in one of the bubbles instead of white 2020-10-22 21:06:55 -07:00
Dustin Carlino
773176f321 Handle live edits affecting multiple cars at one stop sign, and cars
turning to/from an edited lane. #312
2020-10-22 21:04:12 -07:00
Dustin Carlino
50c9c3236d Deal with a race condition. #312
1) A car tries to spawn, but fails because there's something in the way
2) The player makes live edits
3) The retry occurs, but the path has become invalid due to edits

Need to make the detection of this more efficient later.
2020-10-22 19:53:49 -07:00
Dustin Carlino
e55dfd68dd Document the state/transition system. #253 2020-10-22 18:27:25 -07:00
Dustin Carlino
c2b6c917ae Generalize the State/Transition GUI structure, moving it into widgetry.
Nothing about it is specific to A/B Street, and other apps built with
widgetry could organize themselves as a stack of states. This is also a
first step towards sharing more common code between A/B Street and a
future OSM viewer.

Mostly mechanical change. Some more cleanup / documentation coming up
next.
2020-10-22 17:34:59 -07:00
Dustin Carlino
89977b3b31 Move grey_out_map out of State, in preparation for generalizing state/transition. #253 2020-10-22 16:53:15 -07:00
Dustin Carlino
4a3ea8b5c7 Add a tool to export a road to streetmix. Untested, because still having trouble making manual API calls. 2020-10-22 16:29:42 -07:00
Dustin Carlino
058103b84f Cars in the process of parking were being double-counted for deletion in
live edits! #312
2020-10-22 14:28:16 -07:00
Dustin Carlino
22ae06c3a4 Remove the --pathfinding_upfront option. #312 and #258
Originally, all trips in the entire scenario had their paths calculated
at the beginning of a simulation. The sum time is faster than
calculating them individually, because we could use multiple threads.
But a while ago, this was disabled by default to improve the startup
latency. Especially if a player isn't making it through an entire day
anyway, calculating all of the paths upfront is a waste and slows down
their initial experience.

Now I'm hitting all sorts of bugs with live map edits, because the map
change between initial planning and when a trip starts. Previously, the
PathRequest was calculated up-front and resolved when a trip starts. But
even this PathRequest can become stale. So now always calculate it when
a trip actually starts, looking at the current map. To do this sanely,
totally rip out support for --pathfinding_upfront.

If we really want it later for performance, we could add it back in, and
be very careful about detecting stale PathRequests and recomputing. But
for now, there's no use case for this, so it'd needlessly complicate the
code.
2020-10-22 13:47:03 -07:00
Dustin Carlino
cd62ad26d1 Lazily fix up TripLeg when the exact starting position for somebody
biking changes due to live map edits. #312
2020-10-22 12:47:41 -07:00
Dustin Carlino
83c1c09936 Notify the player how many trips got oofed after live map edits. #312 2020-10-22 11:58:16 -07:00
Dustin Carlino
357ac4e549 Fix a crash with the new FixedMap. Don't assume the keys exist! 2020-10-22 11:12:24 -07:00
Dustin Carlino
ad41303e5c After making live map edits, indicate that results aren't finalized. #312 2020-10-22 11:05:07 -07:00
Dustin Carlino
3caa72b288 Prevent traffic seitan from making illegal edits that orphan a parking
lane. #312
2020-10-21 16:32:48 -07:00
Dustin Carlino
8e6aa08d59 Breakdown agent counts much more in the tooltips. #331 2020-10-21 14:26:59 -07:00
Dustin Carlino
3d1ca3af9e Handle live map edits that rip away parking while a car is actively parking in it. #312 2020-10-21 13:00:49 -07:00
Dustin Carlino
adcd0f65fe Clean up some of the trips state when abruptly deleting agents. #312 2020-10-21 12:32:14 -07:00
Dustin Carlino
d98c5bc6bc Better error message when the GPU doesn't support the requested mode. #103 2020-10-21 12:19:06 -07:00
Dustin Carlino
3c81480550 Make sure DrivingSimState has the correct queues after live map edits. #312 2020-10-21 12:00:56 -07:00
Dustin Carlino
011ed8c7cf Handle agents deleted mid-turn. #312 2020-10-21 11:17:27 -07:00
Dustin Carlino
035b8ee96f Fix alpha colors on the web by making the background canvas black instead of white. https://webglfundamentals.org/webgl/lessons/webgl-and-alpha.html has other workarounds, but I can't figure out how to control the webgl context parameters.
Also improve the loading message that appears before wasm has taken
over.
2020-10-21 10:50:40 -07:00
Dustin Carlino
8bc6b09b10 Upgrade to rust 1.47. No relevant changes except that stack traces hide some useless boilerplate now. 2020-10-21 10:25:55 -07:00
Dustin Carlino
a579cb4f74 Add a sanity check to catch live map edit bugs faster. Deleted turns
aren't getting cleaned up properly.

Also fix broken headless build, woops.
2020-10-21 10:23:56 -07:00
Dustin Carlino
e9f9d3884b Simplify the traffic seitan tool's logging and make it easier to find
the last savestate and edits of a crash.
2020-10-21 09:59:17 -07:00
Dustin Carlino
4760d6b2cf Fix one bug with live edits, found using traffic seitan. Agents may be
deleted in the middle of a turn.
2020-10-21 09:40:45 -07:00
Dustin Carlino
8a1525ddfa Lift parsing of --scenario_modifiers to a more common place, so it can be done in run_scenario too. #368 2020-10-21 08:35:38 -07:00