openly-retro / stellaris-machine-robot-expansion

Reviving XVCV's "Machine & Robot Expansion" mod
https://steamcommunity.com/sharedfiles/filedetails/?id=3163759042
2 stars 1 forks source link

Add mechanic to prevent stacking non-resource districts in world machines #109

Closed openly-retro closed 4 months ago

openly-retro commented 4 months ago

any district that doesnt produce resources can be stacked with disregard to thermal throttling

additionally there is no serious penalty when thermal throttling is over capacity

maybe also 5x the upkeep when throtling is high, for these non-resource districts

Reported by speedy

openly-retro commented 4 months ago

Formula:

Look in event xvcv_mdlc.72 , This is what is called when a district is built or destroyed. Add maths there.

Or .. at the end of xvcv_mdlc.72, fire another event that does the calculations.

Do NOT create a new event that is fired on district build/destroyed because Stellaris processes events asynchronously and doesn't wait for any one of them to finish before firing off another.

openly-retro commented 4 months ago

I can remove a resource district and put the threshold back to 100%.

But the penalty offset for the non-resource district still is applied to the planet.

So do a switch for planet class type. On recalculating the threshold. For each planet type, check if there's a throttling on. Then recalculate the offsets for the non-resource districts.

openly-retro commented 4 months ago

Also dont apply more offset than there are districts of that type!

openly-retro commented 4 months ago

Fixed in https://github.com/openly-retro/stellaris-machine-robot-expansion/pull/116

One heck of an implementation.. got it done tho