Cataclysm-DDA
Cataclysm-DDA copied to clipboard
Toggle to Only Draw Overmap During Autotravel
Summary
Interface "toggle to only draw overmap during autotravel"
Purpose of change
Alternative to #75600, see that issue
Describe the solution
Separates the overmap UI from its static function by making a singleton overmap_data held in the game object. By doing this, we can draw the overmap UI e.g. over multiple game turns. This was bound to a toggle key on the overmap, so we can do this while autotraveling:
The time save is significant. For roughly 110 OMTs' uninterrupted drive in a 4x4, the following data was gathered:
| Drive Type | Time |
|---|---|
| TILES | 40 sec |
| TILES with fast travel | 24 sec |
| NO TILES | 34 sec |
| NO TILES with fast travel | 22 sec |
...and then on foot following the same path,
| Walk Type | Time |
|---|---|
| TILES | 20 sec |
| TILES with fast travel | 14 sec |
| NO TILES | 20 sec |
| NO TILES with fast travel | 14 sec |
Other Notes:
- This works for both tiled and ASCII overmaps.
- Any UI windows still draw over the overmap, including distractions, "Driving... press 5 or .", etc.
- When travel is finished or interrupted, you are booted out of the overmap.
- It's called "fast travel" in-game for lack of a better name. The toggle is currently bound to 'x', let me know if we want it changed.
- This is meant for traveling a safe or mostly-safe route and is less safe than just autodriving/moving; you only have yourself to blame if you ignore "mi-go spotted!" and end up next to a mi-go.
- This makes it easier to find wandering NPCs and hordes on the overmap.
Describe alternatives you've considered
See original issue
Testing
In addition to the basic tests in the tables above:
- fast travel into a monster
- ..ignoring that monster, then about to crash in vehicle
- ..ignoring that monster on foot
- fast travel while path blocked
- fast travel while grabbing furniture
- fast travel with allies
- fast travel on foot next to projectile shooter (no less safe than without fast travel)
Additional context
Drafted until clang runs and tests run locally