Commit Graph

1671 Commits

Author SHA1 Message Date
Dustin Carlino
b6ab06d51a Remove the old EditCmds. Realizing the new ChangeRoad does have some
gaps with detecting changes to individual lanes in the UI, though...
2020-08-27 09:36:00 -07:00
Dustin Carlino
30bfe93b5c Produce the new EditCmd::ChangeRoad in the UI. Tested the scenario that
caused #113 (change lane types, reverse some lane, save edits, load from
scratch) -- now it works!
2020-08-27 09:36:00 -07:00
Dustin Carlino
aacb17297d Introduce a consolidated EditCmd::ChangeRoad. Unused so far, and not
handling backwards compatibility yet. One step towards fixing #113 and
2020-08-27 09:36:00 -07:00
Dustin Carlino
59b14426bb Improve shared left turn lane markings and reorg some docs 2020-08-26 12:35:29 -07:00
Dustin Carlino
8b7ad86647 Regularly import Tel Aviv! 2020-08-26 10:25:45 -07:00
Dustin Carlino
8c1686c25f Add a tool to screenshot all of the maps currently under diff testing. This tiny bit of automation saves me some manual labor. 2020-08-26 09:41:03 -07:00
Dustin Carlino
95c43f8e1c Finally replace the underlying storage in Road 2020-08-25 12:08:54 -07:00
Dustin Carlino
376cf1292a And more. Now all the deprecated stuff is locked down to map_model, and
it's pretty much related to map construction and edits
2020-08-25 12:08:54 -07:00
Dustin Carlino
b6a4657dbb Whittle down more deprecated Road stuff 2020-08-25 12:08:54 -07:00
Dustin Carlino
aa3bd5073b Make some new methods on Road to handle child lanes from left-to-right,
not split by direction. Update many callers, and lock down the
visibility of the old methods.

Tested a few maps manually to make sure there's no behavioral diff. Only
problem right now is the z-order of adjacent lanes covering up half of
the white stripe sometimes. Have some ideas to fix that later, and not
_super_ important in the meantime.
2020-08-25 12:08:54 -07:00
Dustin Carlino
4005adecf8 Refactor: create a Direction enum, in preparation for two-way cycletracks on one side of a road. 2020-08-24 13:30:13 -07:00
Dustin Carlino
b41b52d7bd fix crash in debug mode when opening info panels 2020-08-24 09:01:27 -07:00
Dustin Carlino
6b7747c37a Overhaul lane markings:
- Cut off the one-way markings before the end of the road, to stop stomping over turn markings
- Draw turn arrows to every road, not each lane
- Only draw turn arrows when a lane is restricted from going to some
  outbound lane. At most intersections, all turns are legal, so don't draw
  anything.

[rebuild]
2020-08-23 12:00:25 -07:00
Dustin Carlino
0fd40bd04e Explicitly mark buildings with private off-street parking from OSM. 2ebf463635 added parking icons to all buildings with > 10 spots, but this makes the downtown map look ridiculous. The intention was to show the tagged buildings, so just go do that. 2020-08-23 11:09:00 -07:00
Dustin Carlino
6250cb8393 Be more specific about access restrictions in info panel. For capped roads, print the value and current counter. 2020-08-23 09:41:12 -07:00
Dustin Carlino
ca8af784c7 Add an explicit version number to the edits schema 2020-08-23 09:22:41 -07:00
Dustin Carlino
83c0a31e62 show roads with changed access restrictions in edits layer 2020-08-22 20:27:04 -07:00
Dustin Carlino
66151e8aa4 Dump route goldenfiles during the smoke-test, so that it's run when all
data is regenerated. (Ideally screenshots would also be automated, but
that's a little trickier.)

_NOW_ regenerate all data! The only diff anywhere is the binary map
format, so there's confidence the last few commits haven't changed
anything.
2020-08-22 10:53:05 -07:00
Dustin Carlino
11832aa606 Record throughput through a traffic signal by direction, expose through
the API (#245), and beef up the Python example.

Impact to prebaked file size is tiny -- for lakeslice, the original
intersection_thruput is 2MB and the new traffic_signal_thruput is 435KB.

[rebuild]
2020-08-22 09:13:16 -07:00
Dustin Carlino
5b2a548c93 When regenerating all map data, make sure proposals still work. Lo and
behold, I've broken two of them by updating OSM!
2020-08-21 15:49:28 -07:00
Dustin Carlino
ad423b22e9 Remove the glium backend, now that @michaelkirk has gotten the glow native/wasm backends ship-shape. Got rid of the glutin fallback behavior for now; need to ideally upstream something there for #103 2020-08-20 16:59:54 -07:00
Dustin Carlino
fa83554eb4 Consolidate code for loading edits from JSON 2020-08-20 16:33:08 -07:00
Dustin Carlino
084b9d74cd Store delay for traffic signals per direction of travel, using a compressed representation of turn groups. No substantial increase in prebaked file size. 2020-08-20 16:21:52 -07:00
Dustin Carlino
14c66c5528 A humble start to a Percent type for #274. There are so many places to
use it; just start a few in ezgui. Also a good time to object to the API
so far.
2020-08-20 11:01:59 -07:00
Dustin Carlino
2c5bbd3e7e Use alternate language building names and amenities, when available. Fixes #271.
Tested in Shinjuku. No substantial file size increase for any maps.
2020-08-20 10:39:28 -07:00
Dustin Carlino
f31c4ec7fb New tool to union two scenarios. One use case is manually defining some
new trips, then seeing the impact they'll have on the normal weekday
scenario. So how much externality would be caused by a bunch of new
trips if some building is built?

Demo showing the whole flow: https://youtu.be/adpED0KGQ7Q. Why do those
few trips at the beginning impact some later trips so much? Who knows.
Likely parking spots get gobbled up.
2020-08-19 17:49:39 -07:00
Dustin Carlino
24a8d4a836 Prepare to support capping the number of vehicles that can pass through
a zone per hour. This is part of support for some kind of congestion
charging experiments. This step just rearranges the data to define the
cap and makes a UI to edit it. Not enforcing the cap yet.
2020-08-19 17:46:40 -07:00
Dustin Carlino
2ebf463635 Handle buildings tagged as parking garages in OSM. 2020-08-19 17:19:54 -07:00
Dustin Carlino
d427893843 Model parking lots with extra un-renderable spots. This fixes #150, lots
without aisles, and #265, multi-story garages.
2020-08-19 17:19:54 -07:00
Dustin Carlino
71ab485022 Attempt curved road labels for #173. Two issues left before enabling it:
- Need to draw a background underneath the curved text
- Sometimes the text is "upside-down" relative to what's expected; we
  should be able to reverse the polyline sometimes to deal with that. But
  when?
2020-08-19 13:43:36 -07:00
Dustin Carlino
8f258b33a6 Add dev-mode buttons to open OSM objects for buildings and parking lots too. Noticed they were missing while working on #271 2020-08-19 11:43:27 -07:00
Dustin Carlino
6749edb2b6 Change language of roads via settings, for #271 2020-08-18 17:32:49 -07:00
Dustin Carlino
9a350b7568 Regularly import Xi'an 2020-08-17 19:37:34 -07:00
Dustin Carlino
b75867f0c2 Implement Yuwen's interactive signal demand UI, fixing #277 2020-08-17 15:31:36 -07:00
Dustin Carlino
7d460f27c8 squish_polygons_together infinite loops sometimes. until a proper fix, just limit it to 100 relaxations 2020-08-16 08:36:00 -07:00
Dustin Carlino
a6520b26c0 Omit trip timeline buttons to jump to the beginning/end of a trip in freeform mode. When you reset there, the sim is empty; there's no scenario. So it'll just crash, because the person doesn't exist. 2020-08-15 11:14:13 -07:00
Dustin Carlino
a70131b629 While hovering on turn icons in map-space, highlight the intersection and offset in the side panel to help orient. Little laggy, but worth it... 2020-08-15 11:04:22 -07:00
Dustin Carlino
3623296548 Improve rendering of multiple traffic signals in the side-bar by
"compressing" empty space between intersections. The result is a little
unexpected sometimes, but it's an improvement over the previous thing.
@michaelkirk suggested a variation in Slack that I'll try soon.
2020-08-15 10:40:15 -07:00
Dustin Carlino
100d126d62 Also lazily render road center-lines. London from 42s down to 32s 2020-08-14 20:57:46 -07:00
Dustin Carlino
49ea9f2d54 Faster London:
- wire up the flag to skip building contraction hierarchies in one-shot
  importer. 406s to import london without, 230s by skipping CH
- lazily render zoomed parking lot details. 72s and laggy X11 mouse
  before, 42s and no GPU melting after
- add my script for stress-testing the importer
2020-08-14 20:50:22 -07:00
Dustin Carlino
5bede4aca2 Start some initial UI for tuning offset of multiple intersections 2020-08-14 20:50:13 -07:00
Dustin Carlino
3f86af0dc0 Add back some primitive control for signal offset at a single
intersection. Interpret the value in the simulation layer again (it was
removed around bb3da1f8eb or so due to
being unused).
2020-08-14 20:50:13 -07:00
Dustin Carlino
e6c1d960ec In traffic=none mode, allow recording (most of) the manually specified
trips as a Scenario to later re-run. This is useful for quickly defining
"test cases" for development, and it's a start to a UI for letting
players specify (and eventually share) traffic patterns they define.
2020-08-14 18:53:39 -07:00
Dustin Carlino
377e154a1c Refactor the Transition enum, collapsing enum variants that were
combining primitive transitions into sequences.

Brief context on the state/transition system: The game crate is
organized as a stack of states, with the topmost one being active.
Transitions manipulate this stack. For example, the stack might look
like: [main menu, sandbox mode, edit mode, traffic signal editor, signal
picker]
2020-08-14 14:38:50 -07:00
Dustin Carlino
b8e9155ada Adjust picker UI 2020-08-13 15:12:03 -07:00
Dustin Carlino
340d61d33e Refactor how signal editor applies a single new change 2020-08-13 15:12:03 -07:00
Dustin Carlino
92a7279a44 Just warn when lining up phases for multiple signals. Not sure what the
UX should look like for undoing the synchronization.
2020-08-13 15:12:03 -07:00
Dustin Carlino
06c7beb369 Proper UI for picking multiple traffic signals to edit together 2020-08-13 15:12:03 -07:00
Dustin Carlino
d7eb07502b Reorganize signal editor code into some submodules 2020-08-13 15:12:03 -07:00
Dustin Carlino
91f0076d35 Remove the old TrafficSignalEditor, cut over to the new variant for both individual and multiple signals 2020-08-13 15:12:03 -07:00