zenorogue / hyperrogue

A SDL roguelike in a non-euclidean world
GNU General Public License v2.0
554 stars 66 forks source link

Check tide before drawing cells. #372

Closed jlmjlm closed 2 months ago

jlmjlm commented 3 months ago

Fixes bug where on the first turn in a plane, the ocean cells are all displayed as water at high tide and volcano cells are all displayed as lava at low tide.

jlmjlm commented 2 months ago

The bug this fixes is still present in 13.0h. What's your plan for handling it?

https://github.com/zenorogue/hyperrogue/assets/501357/9d122f0b-b564-4567-b863-b8053ac819dd

zenorogue commented 2 months ago

Well, checkTide was called in celldrawer::draw later, but only under some conditions. Calling checkTide might not be recommended -- in the chaos mode, tides use a special implementation, which might need several iterations to converge, and also potentially be quite slow. But yeah, probably we should ignore that and always simply call checkTide. Thanks!

jlmjlm commented 2 months ago

If redundant calls to checkTide is a problem, I'd hope that some form of memoization could address that and allow the expensive computation to happen once per move.