toddmedema / electrify

Take Charge of the Power Market
http://electrifygame.com
MIT License
6 stars 2 forks source link

Advanced forecast chart views: Energy supply by fuel source, stored energy #82

Closed toddmedema closed 2 months ago

toddmedema commented 3 months ago

Help players understand where their current energy is coming from and anticipate the effects of their actions (e.g. do I have the spare energy storage capacity for the next year to be able to delete my old coal power plant?)

Right now, the timeline/forecast state doesn't capture this level of info (facility power and energy state per tick), so I need to refactor in some way...

  1. I could just add this info to generateNewTimeline / TickPresentFutureType - it's only used in a few places (forecast view and calculating new months), and this data is already calculated as part of the pipeline in updateSupplyFacilitiesFinances, so it's just adding it to memory
  2. Or, split out calculations for monthly updates vs forecast view - although this might be more memory efficient, it wouldn't save any CPU (since all this needs to be figured out to get to supply/demand), and would increase code duplication

1 seems right for this project, so going with that