Version 1.0.2 Preview

Started by knucracker, October 21, 2016, 02:11:14 PM

Previous topic - Next topic

Kharnellius

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

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

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

Can I ask how many energy packets the game can serve per frame (assume infinite production)?

knucracker

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.