CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.64k stars 4.18k forks source link

Extend fast travel routing on the overmap to make a path rather than a single line #76589

Open CoroNaut opened 1 month ago

CoroNaut commented 1 month ago

Is your feature request related to a problem? Please describe.

The fast travel system is very good for short runs between locations, but what about longer distances? If a player wants to go long distances, past 5 cities/towns, around a mi-go scout tower, around a massive fungal infestation, it becomes a bit tedious. Having to go a small stretch, open map, scroll a bit, go another small stretch, open map, scroll a bit, go another small stretch... becomes dull fast.

Solution you would like.

My solution is minimal in terms of having no UI, not having to mark your map with needless dangerous areas, is simple to use for everyone, and allows easier map movement without re-opening the map a lot.

The following map area has two cities and a wasp nest in the middle of the field. The user wants to fast travel from A to G.

  1. Tap 'W' on B, User sees path A->B. 'W' to confirm line
  2. 'W' on C. User sees path A->B->C. 'W' to confirm line
  3. 'W' on D. User sees path A->B->C->D. 'W' to confirm line
  4. 'W' on E. User sees path A->B->C->D->E, but doesn't like it as it goes on the road just south of D too much
  5. so user taps 'W' on H instead. User sees path A->B->C->D->H. 'W' to confirm line
  6. 'W' on F. User sees path A->B->C->D->H->F. 'W' to confirm line.
  7. Then finally, 'W' on G, 'W' to confirm line.
  8. User sees path A->B->C->D->H->F->G
  9. 'W' while on the preview path. Popup asks if you want to "Travel to this point?" User hits 'Y'.

The sample: Untitled Map without dangerous areas: image

Describe alternatives you have considered.

Brambor came up with the idea of marking your map with 'dangerous area' circles to force the preview route around that mi-go scout tower, around that city, etc. This is what I do now and it makes the map super ugly. Plus, setting these up and taking them down is extra thought and keypresses that could potentially be avoided.

Another solution may be to add some options for the user to define how their path is made. IMO, straight lines beat the current path finding algorithm to prioritize roads. Even roads far outside of cities sometimes have hordes that put a wrench in the gears. A straight line could let me pass straight over that road with minimal involvement with zombies. Another player might want to use roads more for their death-mobile, in which case that option could be selected. Various different settings could be put into the options here.

The obvious alternative is to just deal with making tons of small fast travels to prevent the case that you find yourself deep in a random zombie horde on the road while fast traveling.

Additional context

No response

IdleSol commented 1 month ago

Additionally:

  1. Visual highlighting of key points. By color/letter/sign.
  2. Pressing W on a path tile adds a key point to the path.
  3. Pressing W on a key point allows you to do one of two things:
    • delete the point (simple option)
    • opens a menu with items:
    • delete key point
    • move the key point
    • move to a key point
CoroNaut commented 1 month ago

I like the idea of coloring your specific points separately to show you've made a key point there. I however don't like the idea of a menu popping up, it sounds like additional key presses and distracts from the actual path-making. Rather than the menu, if a player hovers over a key point and taps 'W' on it, it could just revert all paths after that key point and go back to making a preview for that specific line.

IdleSol commented 1 month ago

This is for adding and editing intermediate points.

In your example, you have built the route: A-B-C-D-D-E-F-G. But you need to change the route through point H. Either cancel points E-F-G. Or you put the cursor on the segment D-E (anywhere on the segment). Press W and get point H. Then press W again and get a menu where you can choose to move the point. Then use the arrows to move the point to the desired location.

You can do it without the menu, but you need additional hotkeys. W on the control point removes this point. And G (for example) moves that point.

P.S. Google maps. Distance measurement functionality. But there you can just take a point and move it.

PGR-14 commented 1 month ago

Already have some of the code w/ faction camp scout missions

CoroNaut commented 1 month ago

Oh, I see what you mean about adding/editing a point while keeping all before/after points. I'm not certain how useful this feature would be. If you are working on a path, the preview should show you where it will go. Ideally the player would get a sense of how the fast travel makes a route and never need to use that feature. I'm not against it though, it seems reasonable to add a very lightweight menu for it. An extra hotkey for this would be a bit much IMO If overmap paths become more complex in the future, hotkeys would be more useful.

IdleSol commented 1 month ago

Mostly random encounters while driving. As an example, roadblocks, bandits. Relevant when moving through a new open area.

CLIDragon commented 2 weeks ago

I have two features planned (and code half-written) to address this. The first is allowing dangerous areas to be any rectangle rather than defaulting to a circle (and perhaps allowing more shapes in the future). The second is being able to save a list of places to fast travel to (e.g "Home base", "Scrap Yard").

Additionally, altering the pathfinding algorithm with a few parameters ("prefer straight lines", "prefer roads") would be possible.

Would those address your problems? You mention that you need to take down the dangerous areas - why is that?