Fix bit counter on datamines of Snatching

Issue #24 new
Cordarion the Grey created an issue

Background

On live datamines, UI+ currently shows only a portion of what you might expect from it. There are several reasons:

  1. First of all, we are severely restricted in the available information. The map is fogged; number of bits collected by other bosses is unknown; if a boss flies into the fog of war, we cannot say if there was something on the fogged cell; etc. Yet we have to work under such conditions somehow.
  2. We don’t have access to the full history. If the user lags, we can skip one or several frames (a frame is a quarter of a step).
  3. The most insane, time can go backwards. You’ll never know in which order the game is going to show the frames to you. What makes things even worse, we can’t tell exactly at which frame we are looking right now: only steps are numbered, not frames in them. (No, you cannot trust the progress bar.)

    However, about a year ago Godville devs made an attempt to prevent time-travelling. As they said, it’s probably impossible to avoid it altogether (?), but the experience should become better. And indeed, it became. Now, most of the time you will be sent only 1 or 2 frames into the past.

    I think, now this can be worked with.

Plan

What needs to be done, as I see it:

  1. Remember not only data about current frame, but 2 previous ones as well. This can be implemented, for example, as an !Object<number, !Frame>, where frames[0] is the current frame, frames[-1] is the previous one, etc. With it, we can detect if we are shown an outdated frame (via comparing step number and map), in which case we can (and should) take already calculated data instead of re-processing it. And we should not, of course, forget frames from the future but store them into positive indices instead.

    All datamine types will benefit from this change, not just Snatching.

  2. Check if we should apply different processing rules, i.e., check the datamine’s special condition. It is tested in log/mining/analysis.js currently. However, since we need it on /superhero, too, we have to extract it to GUIp.common.mining.parseConditions or something like that. It should return either {snatching: true} or {}GUIp.common.sailing.parseConditions has the same interface.

  3. Finally, implement bit-snatching in the map processor. Two things to keep in mind:

    1. Upon colliding, the boss drops a bit first, then picks up ones, not vice versa;
    2. The boss can die during the flight, in which case it will stop picking up bits over which it has flown.

I’m busy with other tasks right now, but I’ll move it on top of my UI+ to-do list. Please, tell if someone decides to work on it so that we won’t be working on the same task simultaneously (and I’ll be able to fix something else).

Comments (2)

  1. Log in to comment