Commit Graph

2314 Commits

Author SHA1 Message Date
Dustin Carlino
69b248cd66 Move agent counters to the minimap, removing the top-right agent panel entirely. #551
Adjust the tutorial for these changes.
2021-03-12 17:48:35 -08:00
Dustin Carlino
5b386af6ba Move most things out of the top-right agent meter panel to reclaim more horizontal space. #551
1) Move finished trips to the top-left time panel.
2) Move "tentative results" and "recording trips" controls (only
   occasionally used) to the top-left time panel.
3) Move the "more data" button to the minimap.
2021-03-12 17:48:35 -08:00
Dustin Carlino
8ac62fed47 Trying out some UI changes suggested by Martin:
- Increase day mode panel opacity to 95% to help text legibility
- Combine the time/speed panels, and remove the sunrise/sunset icons
- 4 mode colors matching actdev, also changing night mode residential
  buildings
2021-03-12 17:48:35 -08:00
Dustin Carlino
95b1d884cf Rename Map::new to be more clear that it should only be used in non-UI
tools. There's one place in the UI that doesn't work on the web!
2021-03-12 06:38:17 -08:00
Dustin Carlino
522b902453 Improve the traffic signal timing UI. There's a choice between fixed and
variable timing, but currently you have to remember to toggle it; the
two extra spinners get ignored otherwise. The new version is still
confusing, but I think it's an improvement.
2021-03-11 11:39:58 -08:00
Dustin Carlino
8be24bf007 Use AsRef<str> in more widgetry methods, getting rid of &format at many
call-sites. #253

To make some of these work, changed Label to store a String. Ultimately
it gets transformed into Text, so we need to allocate eventually.
2021-03-11 11:29:18 -08:00
Dustin Carlino
f0de4e4583 Don't use Bezier curves for right/left turns at tiny intersections. They
wind up looping back on themselves in a nonsensical way, causing
vehicles to visually glitch when moving through.

This was started in 081819d86b, but it
used to gridlock 2 maps. All the recent roundabout fixes seems to have
resolved those! And adjusting offstreet parking for two maps.

But wallingford does regress; plunging forward for now.
2021-03-10 15:58:16 -08:00
Dustin Carlino
bf8f51ae05 Consistently count hours for a time. There was some disagreement between
recorded analytics and code that later summed things up, making the
relative throughput layer more confusing than it is already. #85
2021-03-10 13:59:38 -08:00
Dustin Carlino
957d08e8b9 Add tooltips to the relative throughput layer, to get exact before/after counts of the data being displayed. #85
(The before counts are still bucketed on the hour mark)
2021-03-10 13:24:56 -08:00
Dustin Carlino
f0b522f89a Figure out which files are in the us/huge_seattle DataPack more consistently. This'll now work from the proposals screen. 2021-03-10 12:40:55 -08:00
Dustin Carlino
fdc6601520 Prompt the user to download missing cities from the Proposals screen, too. 2021-03-10 12:10:16 -08:00
Dustin Carlino
db96b0a7c4 Add an included proposal for making Poundbury<->Dorchester use a pair of one-way roads. cyipt/actdev#114
And handle community proposals when the weekday scenario doesn't exist.
2021-03-09 13:23:40 -08:00
Dustin Carlino
d13478f355 Make Poundbury run more smoothly, and prebake sim data for all
scenarios, so we can run A/B tests with map edits. cyipt/actdev#114

To fix it up, I hand-timed
https://www.openstreetmap.org/node/2124133019, which could have smarter
heuristics as a button-operated half-signal in the future. And allowed
blocking-the-box on some small intersections near that area.
2021-03-09 10:45:44 -08:00
Dustin Carlino
65d7bc5c8e Rename {Text,TextSpan}::draw to into_widget, for consistency. #253 2021-03-09 09:59:30 -08:00
Dustin Carlino
a4a20ce1e5 draw_text renamed to text_widget, for consistency. #253 2021-03-09 09:56:41 -08:00
Dustin Carlino
b0bcdb2115
Replace Widget::draw_batch with batch.into_widget, for consistency. #253 (#554) 2021-03-09 08:55:12 -08:00
Dustin Carlino
e61e0c885b Backpeddle on bcde40d35c. If advancing time at startup takes too long, switch over to the jump-to-time dialog, so things don't seem frozen and the user can stop early if impatient. 2021-03-09 07:38:51 -08:00
Dustin Carlino
06e2f22ba9 Add a --time flag to jump the sim forward immediately. Faster gridlock debugging. 2021-03-08 15:10:18 -08:00
Dustin Carlino
bcde40d35c Add a deadline to actdev starting at 8am. If it takes too long to advance time, just start earlier. If it's taking a long time, then there must be active traffic to look at anyway. 2021-03-08 14:49:56 -08:00
Dustin Carlino
f260fc3b40 Fix warping to bikes by ID 2021-03-08 14:42:51 -08:00
Dustin Carlino
8082640da9 Add warp buttons to the blocked-by tool to jump to the worst problems, instead of squinting for the circles 2021-03-08 14:34:00 -08:00
Dustin Carlino
7ccdc217c7 Don't display a path from a building to the nearest parking when infinite parking is enabled. [rebuild] [release] 2021-03-07 11:09:09 -08:00
Dustin Carlino
3f32c7abf3 Move the minimap code from common to sandbox, reflecting where it's used. (Never in debug or edit mode) 2021-03-06 16:20:32 -08:00
Dustin Carlino
9118ae6216 Hook up the actdev UI to the new scenarios with background traffic mixed in. #556 2021-03-05 16:37:06 -08:00
Dustin Carlino
42bd63e79b Lift URL and viewport code from game to map_gui. Also use it for OSM viewer and the 15min tool. 2021-03-04 13:22:09 -08:00
Dustin Carlino
0c81b31d7e Also, just move the uber-turn viewer to debug mode. 2021-03-04 09:36:48 -08:00
Dustin Carlino
81678822bc Clean up the old MergeIntersections experiment in the uber-turn viewer. The map_editor can now live-debug intersection geometry and merge short roads; faster to iterate there. #114 2021-03-04 09:34:00 -08:00
Dustin Carlino
3875f6b542 Pick random people with the actdev 'follow someone' button, instead of focusing on the same arbitrary first match. 2021-03-04 08:56:45 -08:00
Dustin Carlino
9e92435859 Get 2 more Seattle maps to complete without gridlock! Just had to
increase offstreet parking to better match the demand.
2021-03-03 14:53:04 -08:00
Dustin Carlino
9dc181a7c5 Start to detect cases when one vehicle may want to over-take a slower-moving leader. #81 2021-03-03 14:07:32 -08:00
Dustin Carlino
0c12948c86 Also grey out unhighlighted people when zoomed in. #539 2021-03-02 12:03:26 -08:00
Dustin Carlino
17e2f485b4 Add support for highlighting certain people in the simulation. For now,
mark random people as highlighted when background traffic is active for
actdev. #539

This changes the unzoomed rendering to "fade out" unhighlighted people.
Next up, similar change for zoomed, info panels, and trip tables.
2021-03-02 10:46:21 -08:00
Dustin Carlino
0ee22ad58e Add a checkbox for mixing in background traffic to the actdev scenarios. No effect on the scenario yet... #539 2021-03-02 09:55:08 -08:00
Dustin Carlino
6cacaf1c8a Actdev tweaks: flip walking/biking button order, start with 3x speed 2021-03-02 09:30:44 -08:00
Dustin Carlino
c5cfe76b05 Fix turn type classification for four-way intersections that meet at
weird angles. This leads to really bad traffic signal heuristics, even
causing gridlock in Rainier Valley.
2021-03-01 10:57:27 -08:00
Michael Kirk
86799e2832 Remove StyledButtons - instead implement everything on the individual
ButtonStyle
2021-02-27 21:08:26 -08:00
Michael Kirk
11a904a4da WIP: separate style for plain 2021-02-27 21:08:26 -08:00
Michael Kirk
c3985ffdd1 btn_solid -> btn_tab and replace inappropriate uses 2021-02-27 21:08:26 -08:00
Michael Kirk
7fe0e521ee Use btn_destructive.* methods instead of btn_destructive_* 2021-02-27 21:08:26 -08:00
Michael Kirk
cee0e5dbbd Use btn_primary.* methods instead of btn_primary_* 2021-02-27 21:08:26 -08:00
Michael Kirk
87a1a3f027 fix outline for spinner (without crashing!) and cache drawable 2021-02-27 15:29:03 -08:00
Dustin Carlino
fd41d0c573 Fix missing study areas in some actdev maps. It was just me accidentally passing in the site name with underscores.
I verified all sites have a study area showing up.
2021-02-27 14:50:55 -08:00
Michael Kirk
1e75352ce0 Theme section bg
`Widget::outline` takes OutlineStyle
2021-02-27 13:13:41 -08:00
Michael Kirk
73280bc114 consolidate OutlineStyle
We had a lot of constants sprinkled around. This consolidates the
constants and packages the outline thickness and color into a tuple,
making for a (usually) cleaner callsite.
2021-02-27 13:13:41 -08:00
Michael Kirk
c0fe742810 section styling for lane panel 2021-02-27 10:30:41 -08:00
Michael Kirk
2378da9731 theme signal editor bg 2021-02-27 10:30:41 -08:00
Michael Kirk
7f3c07f601 better tab legibility 2021-02-26 16:30:14 -08:00
Michael Kirk
cf69dd0370 slightly better approach to get the cut-scene looking better 2021-02-26 16:30:14 -08:00
Michael Kirk
d99c0e0634 HACK to make cutscene look decent 2021-02-26 16:30:14 -08:00
Michael Kirk
bcba72cddf enable new day theme, but retain legacy theme for pregame 2021-02-26 16:30:14 -08:00
Michael Kirk
4b2f3888ed replace btn_solid w/ primary/outline as appropriate 2021-02-26 14:05:19 -08:00
Michael Kirk
b2a0ba1572 logo should always be black 2021-02-26 14:05:19 -08:00
Michael Kirk
143fdc3fd5 label_underlined_text for "link" buttons 2021-02-26 14:05:19 -08:00
Dustin Carlino
611b0e8045 Enable separate cycleways experiment for Seattle. #330
Cleaned up a few unused (and out-of-date) traffic signals. No impact on
gridlock. See issue for detailed rationale and plan.
2021-02-26 13:53:24 -08:00
Dustin Carlino
8e04cada2e actdev scenarios for the remainder of the sites.
Now the code can be simplified, because the scenario always exists.
2021-02-25 20:15:03 -08:00
Michael Kirk
3019a6fff1
Introduce Image component to handle themed icons (#537) 2021-02-25 18:06:19 -08:00
Michael Kirk
46593b01ed theme text field (and fixup layout) 2021-02-25 17:42:04 -08:00
Michael Kirk
22223d4338 per design, remove separator after title 2021-02-25 17:42:04 -08:00
Dustin Carlino
0feeb3cee4 When nothing's selected, don't display anything in the status bar. Previously, it was '...', which looked clickable. 2021-02-25 10:56:02 -08:00
Dustin Carlino
0320b2be89 Little actdev fixes:
- when leaving edit mode, still return to actdev mode
- rename "bike network" layer to "cycling activity", to emphasize it
  shows where cyclists have been going so far in the simulation and not
  everything on the ground
- add tooltip with exact counts to the cycling activity layer, just like
  throughput does
- add a "walking activity" button (throughput layer with filters
  pre-applied)
2021-02-25 10:54:03 -08:00
Dustin Carlino
6bfa569923
Support changing fonts in the middle of a line. Use this to draw numeric (#533)
IDs in the status bar as bold, not red.
2021-02-25 08:57:42 -08:00
Michael Kirk
494be704da style parking lot info like other info panels 2021-02-24 20:21:14 -08:00
Dustin Carlino
7e4d529872 Import all the actdev scenarios again, which have a fix for more diverse destinations.
Automated:
1) rm -fv `find data/system/gb/ | grep base.bin | xargs`
2) rm -fv `find data/system/gb/ | grep dutch.bin | xargs`
3) for city in allerton_bywater ashton_park aylesbury aylesham bailrigg bath_riverside bicester castlemead chapelford clackers_brook culm dickens_heath didcot dunton_hills ebbsfleet great_kneighton hampton handforth kidbrooke_village lcid long_marston micklefield newcastle_great_park poundbury priors_hall taunton_firepool taunton_garden tresham trumpington_meadows tyersal_lane upton wichelstowe wixams wynyard; do ./importer/actdev_scenarios.sh $city; done
2021-02-24 18:18:12 -08:00
Michael Kirk
ac30774b06 theme dropdowns and menus 2021-02-24 18:10:06 -08:00
Michael Kirk
c6d361c4b0 remove take_menu 2021-02-24 18:10:06 -08:00
Dustin Carlino
5577021ee5 When merging intersections and preserving simple turn restrictions, pay
attention to which intersection is being destroyed. Fixes #527 --
montlake and phinney both look correct now.

Regenerating everything. Actually, Phinney now runs, so adding a 4th
prebaked map!!! But Rainier regressed -- there's an issue with the
signal heuristics that's now a problem; I'll fix later.
2021-02-24 15:16:12 -08:00
Michael Kirk
d774aeae44 rename toggle/checkbox 2021-02-24 14:59:47 -08:00
Dustin Carlino
23b19fa7ce Add a quick debug tool to find roads with no turns between them, for #527 2021-02-24 11:00:59 -08:00
Michael Kirk
3ab7fc4361
Fix tooltips and hotkey for day-theme (#528) 2021-02-24 10:52:57 -08:00
Dustin Carlino
b36ebec0b9 Penalize unprotected left turns at the routing layer. #494
I experimented on the Rainier Valley map, which recently started
gridlocking due to too many cars doing this, to tune the value. Got it
running again! The two other maps keep running, with some trips on
average getting a little slower.
2021-02-23 19:32:00 -08:00
Dustin Carlino
0344e51170
Merge pull request #525 from a-b-street/prefetch
Make a web loader that can 'prefetch' abst in the background. cyipt/a…
2021-02-23 13:34:55 -08:00
Dustin Carlino
4c97687a5b Make a web loader that can 'prefetch' abst in the background. cyipt/actdev-ui#15 2021-02-23 11:45:39 -08:00
Michael Kirk
62a433ed8d btn_solid_panel is the same as btn_solid 2021-02-23 10:17:49 -08:00
Michael Kirk
e6ed2e67de Collapse button styles to be theme specified (no visible changes).
Button colors are now determined by the color scheme, but for now all
schemes are hardcoded to use the same "night" button colors. Read on for
rationale...

Previously, which button colors to use (dark/light) was specified inline
while building the UI.

Eventually we want to live in a world where color scheme determines:
- panel colors
- button colors
- text colors

The theme could already choose panel colors easily enough, but because
the buttons and text were not determined by theme, choosing anything
other than a black or dark grey panel color makes the buttons and text
unreadable.

This PR tackled the themeable "button colors" portion, but all themes
continue to use the "night" colors for now, because using the actual
"day" colors would still make the text unreadable.

next up: themeable text!

The one intentional regression is within the pregame tutorial,
which has always been styled differently from the rest of the app. An
expeditious hack has caused the prev/next/continue buttons to lose their
visible hover state. I'll restore this upon completing the day theme
work.
2021-02-23 09:52:33 -08:00
Dustin Carlino
ecf7c0c836
On HiDPI screens with low resolution, allow widgetry applications to (#521)
* On HiDPI screens with low resolution, allow widgetry applications to
override the default scale factor in order to achieve a minimum width.
2021-02-22 15:59:57 -08:00
Dustin Carlino
a7de2eef14 Disable parking simulation for actdev. I noticed people in Poundbury walking very far just to fetch their car, because the data about available parking is nonexistent. 2021-02-20 13:19:38 -08:00
Dustin Carlino
c7ae44d02a Start actdev simulations at 8, not 6. And refactor the ffw-after-starting pattern. cyipt/actdev#66 2021-02-20 13:12:41 -08:00
Dustin Carlino
0804f877dd Toggle between the baseline/go active scenario in actdev mode. Don't allow opening up any scenario. If we settle on a good background traffic generator, that can probably be exposed as an orthogonal checkbox. cyipt/actdev#66 2021-02-20 13:03:42 -08:00
Dustin Carlino
7592d192e3 Rename the blog gameplay mode to actdev, since it's specific to that integration. In the future if we have a simplified simulation running in a blog, we can figure out common requirements and refactor. 2021-02-20 12:44:27 -08:00
Dustin Carlino
b11cd48fb3 On the web, constantly update the --cam param in the URL with the current viewport. 2021-02-20 11:10:14 -08:00
Dustin Carlino
05622760fc Fix crash when opening the tutorial when the wrong map is previously opened. 2021-02-19 10:15:48 -08:00
Dustin Carlino
2d182a4582 Fix crash in commuter viz layer. The block-finding algorithm was written before pedestrian-only roads. 2021-02-17 12:00:13 -08:00
Dustin Carlino
4de7cb68c0 Start actdev mode with the baseline scenario, if it exists. Improve the follow shortcut. cyipt/actdev#66 2021-02-16 17:58:20 -08:00
Dustin Carlino
12d73e10bc Add a few shortcut buttons to the actdev UI. cyipt/actdev#66 2021-02-16 17:34:56 -08:00
Dustin Carlino
3f23a3c57c Remove hotkey buttons entirely, to get closer to Yuwen's button spec. 2021-02-15 13:02:29 -08:00
Dustin Carlino
bc2767b89e Refactor lots of places that construct paths to the data/input dir, which is always organized by city. This would've made the previous change way easier. #326 2021-02-13 18:30:01 -08:00
Dustin Carlino
52ca5f5ede Fix lakeslice gridlock with a manual signal policy at 23rd/Rainier. 2021-02-13 17:44:34 -08:00
Dustin Carlino
0f1c30a889 Exclude collisions.bin from KML viewer; it's not KML anymore.
And fix a crash on the challenges screen by not considering the actions
of inactive buttons to count as duplicates.
2021-02-13 17:06:06 -08:00
Dustin Carlino
39f5d50fcd The grand country split. #326
City names are now disambiguated by a two-letter country code. This
commit handles almost everything needed to make this transition. Main
next steps are fixing up map edits automatically and making the city
picker UI understand the extra level of hierarchy.

A little bit of fallout: lakeslice gridlocks again; this regression is
actually from the recent traffic signal changes, but I'm just now
regenerating everything. Will fix soon.
2021-02-13 15:45:59 -08:00
Dustin Carlino
a938b9c1e2 Move building procgen to a standalone tool. 2021-02-12 16:28:15 -08:00
Dustin Carlino
c43af59004 Change the building procgen algorithm to just use the Map, now DrawMap. Preparing to move it into the import phase, where we won't be able to generate the DrawMap. 2021-02-12 16:06:49 -08:00
Dustin Carlino
8d0718d37d
On the web, modify the current URL as we change maps and scenarios. (#509) 2021-02-12 15:14:09 -08:00
Dustin Carlino
03538faf3f
A few traffic signal cleanups: (#512)
- Stop alerting when slow pedestrians can't make it through the minimum
  crosswalk time
- Simpler iteration style in lagging_green.rs
- Totally delete the old brute force signal config code; it never worked
  well, and the improved heuristics eliminate the need for it anyway
- Make a Duration::max function and use it in one case
2021-02-12 15:10:32 -08:00
Dustin Carlino
aacc0fa4d5 Fix a crash that happens when you load edits that transformed a stop
sign into a traffic signal.

And fix a few cargo fmt issues
2021-02-12 13:47:10 -08:00
Dustin Carlino
46caf98779 When selecting pedestrians or bicycles, pick the one closer to the cursor. 2021-02-11 15:09:58 -08:00
Dustin Carlino
4c1d610e4f Restore screenshots for Great Kneighton 2021-02-11 15:09:06 -08:00
Dustin Carlino
fd73166292 Prep to import actdev again, and fix build break in game/src/lib 2021-02-11 14:35:32 -08:00
Dustin Carlino
21573e09f1 Delete all of the actdev maps. I'm going to do this over again and just
use the site name as the city, instead of picking the "closest" major
city. This is introducing too much friction in automation.
cyipt/actdev#65

There will be a few awkward results -- cambridge gets renamed, and lcid
gets disassociated from leeds. Worth it for now.
2021-02-11 14:27:28 -08:00
Dustin Carlino
e333838560 If you start with --dev and wind up on an empty map, time starts at 6am. When you load another empty map, do the same and jump to daytime.
There is a little inconsistency still: say you're simulating a scenario
(starting at midnight). If you change the scenario to none, it'll stay
night, but if you then change maps, it'll jump to day.
2021-02-10 14:10:42 -08:00
Dustin Carlino
a5091a4f18 Clean up unused ctx param from SandboxMode::async_new and simple_new 2021-02-10 14:03:06 -08:00