Paradise
Paradise copied to clipboard
refactor: Datumizes ore.
What Does This PR Do
This PR:
- Turns the ore contents of mineral walls from a set of attributes on the mineral wall type into separate datums that can be set for a given wall.
- Creates an UpdatePaths script for relevant map changes and applies it.
- Refactors some of the admin logs around gibtonite mining, utilizing log macros.
I believe I did the calculations for the gibtonite countdown correctly to match the original implementation, but I'm probably missing something, or shouldn't be keying it to world.time, or some similar oversight. My read of the original code is that the detonation countdown is anywhere from 4 to 5 seconds (det_time = rand(8, 10)
) because the detonation countdown is spun off to another thread which calls sleep(5)
, ticking down that value every half-second.
Why It's Good For The Game
ChangeTurf is an expensive operation, even during mapload when most important behavior is deferred until AfterChange. By datumizing ores, the MTPC for /turf/simulated/mineral/random/Initialize()
has been reduced by 40%, resulting in a commensurate speedup from 5.5s to 3.1s over the course of mapload (locally):
It also reduces the needless amount of subtypes, which had turned into a combinatoric explosion of every permutation of ore type, ore randomness weights, and mineral atmos environment:
From 36 distinct subtypes, we now have 15.
Testing
Copius lavaland spawning, as well as learning that /obj/item/mining_scanner/admin
didn't and quite possibly has never worked.
A little more testing of gibtonite needed since that's the most complex ore.
Declaration
- [X] I confirm that I either do not require pre-approval for this PR, or I have obtained such approval and have included a screenshot to demonstrate this below.
Changelog
NPFC