CleverRaven / Cataclysm-DDA

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

Using toggle fast travel doesn't record map memory at all #76350

Open CoroNaut opened 1 week ago

CoroNaut commented 1 week ago

Describe the bug

When using the toggle fast travel option, it doesn't record map memory for your character. So if you decide to fast travel into an area that you have no map memory for, it will path there, but won't record any tiles.

Attach save file

TESTINGTWO-trimmed.tar.gz

Steps to reproduce

  1. Load save
  2. Fast travel to any nearby forest tile using 'toggle fast travel'
  3. Notice no map memory is updated

Expected behavior

Map memory should be recorded as if 'toggle fast travel' were off.

Screenshots

Just for clarification, I used the fast travel mechanic to get into this forest in the top-left spot, then directly east. I then disabled 'toggle fast travel' so that map view didn't stay open while traveling, and traveled south. As such, you have map memory when the option is disabled. image

Versions and configuration

Additional context

No response

ShnitzelX2 commented 5 days ago

So currently, it looks like map memory is only recorded during map drawing, and fast travel mode doesn't call those draw functions. I would expect map memory to be recorded according to what's visible to the in-game player on the map, independent of what's drawn. That would involve extracting a lot of code from the map draw functions.

It's good to identify this, at any rate. Thanks!

kevingranade commented 3 days ago

Correct, for performance reasons it is deeply entwined with the draw code so if you don't run most of the draw code it's not going to be able to decide what yours to memorize. Plus if you run that much of the draw code, you're going to reverse most of the speed gains from not drawing as you go.

I could imagine doing something like adding some code to disable actually drawing always and running just enough code to get a map memory snapshot once every 12 tiles of travel or so.

CoroNaut commented 3 days ago

Adding code to update every so often instead of every tile might be OK for moving around in the daytime. Inside a forest would however leave behind some janky map memory as you go. But definitely not at night. #37968 would become a bit more severe.

Otherwise, its a decent compromise to keep some performance but still update a little map memory for longer distances through not yet recorded areas.

RenechCDDA commented 1 day ago

Based on the confirmed behavior and what's been said I'm going to go ahead and mark this confirmed so we at least remember it exists.