Version 1.0.2 Preview

knucracker · 2428

Kharnellius

  • Full Member
  • ***
    • Posts: 195
Reply #30 on: October 27, 2016, 09:26:49 pm
Pretty sure this is the correct save.  It is for a map I am currently making.  My game had popped up the changelog so I knew I had the new update.  Strangely, I just played it now and the energy usage halved and appears to be more in line with how it should look.  It was strange because before it would show a massive deficit of 130 and I would be producing...maybe 70-80 energy, and yet my energy pods weren't being used.

There are still times when my energy store is draining yet, my drain is less than my production.  See below screenshot.  I was watching it like a hawk and it never exceeded 70 yet the store would begin to drain rapidly.  I'm guessing it's just an artifact of prediction algorithm you created.



12345ieee

  • Jr. Member
  • **
    • Posts: 65
Reply #31 on: October 29, 2016, 09:41:11 am
I've seen the same effect @Kharnellius reports, but I couldn't replicate it, either.

I suspect it's related to the energy tank module, but I can't be sure.



knucracker

  • Administrator
  • *****
    • Posts: 11749
Reply #32 on: October 29, 2016, 10:21:43 am
It's really tricky calculating energy draw.  The problem begins with what that bar actually represents.  Energy production is in packets per second.  The energy store is in packets.  Energy draw should therefore be in packets per second.

One way to attempt to show energy consumption is to count packets created over a unit of time.  That works so long as there is sufficient energy to create packets.  If there isn't, then the energy demand exceeds production and packets won't get created that reflect that demand. 

So the way it works is to note the state that various energy consumers are in.  When a ship is building, it requests packets at around 2 per second while building the bridge.  That is the ships energy demand whether it gets it or not.  Once the hull and weapons are built and powering, it requests energy at 30 pps.  That is true on any frame it asks for packets (Even it it only needs 1 packets).  So you can see how this becomes a mini exercise in calculus.  Omnis are similar and want packets at a rate of 30pps.  Unless of course their reactors are coming online.   

Anyway, the demands of various things get summed and then added each frame to a rolling queue that is 30 large.  That queue is averaged every frame and that becomes the energy drain.  So it's a rolling 30 frame (1 second) average of all of the highly erratic energy request rates.



12345ieee

  • Jr. Member
  • **
    • Posts: 65
Reply #33 on: October 29, 2016, 12:44:16 pm
Can I ask how many energy packets the game can serve per frame (assume infinite production)?



knucracker

  • Administrator
  • *****
    • Posts: 11749
Reply #34 on: October 29, 2016, 01:19:50 pm
There is no limit on the amount that can be created.  The limit is that a thing requesting a packet can only request one per frame.