Post Sun Jun 21, 2020 7:45 am

Depleting Asteroids Fix (with explanation)

Scenario:
Multiple mining modules (and possibly multiple ships) sucking from same rock.
said rock is almost depleted. (less than full cycle amount for any given laser)

Problem:
live (and eve echoes) will award remaining ore to first module to complete cycle, and all others silently deactivate and disengage.
i have always disagreed with this as it breaks their mining laser mechanics, and it's a fight to see who finishes first on that last bit of aknor

Theory:
the theory behind mining modules is simple: they will shoot the asteroid with a laser to break it up then suck the broken chunks back to the module.
the module will hold a set amount (cycle volume) before having to dump into cargo (or whatever hold is being used) at the end of cycle.
this means the mining laser is holding a certain amount of ore during it's cycle (based on time), so it will have some ore from it's target at any given time.
only when it's cycle ends will it dump the full load, the quantity of which is defined in the laser's cycle amount.

Solution:
all lasers mining a rock will get a portion of ore when rock is depleted.

Code Mechanics/Fix:
i have coded a system that does the following:
when any laser cycle ends, check for remaining ore in rock vs cycle amount for all currently-activated lasers on it.
if rock has enough to complete cycle for all current lasers, continue cycle without interruption.
however, if rock will be depleted by all current lasers full cycle, determine what each laser has accumulated so far based on activation time against current time.
determine each laser's portion of remaining ore and distribute accordingly
deactivate all lasers targeting this rock, then remove rock (separate system)
this will also inform pilot of depleted asteroid and laser shutdown, same as any other module activated on a destroyed target.


basically, this fix will properly set gameplay to described mining mechanics, and something else that has bothered me about how live works.

this fix is active on main and dev servers, and works quite well from my testing.

cheers
~me