Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] General maintenance for all things boulder related. #2630

Closed
wants to merge 1 commit into from

Conversation

NaakaKo
Copy link
Collaborator

@NaakaKo NaakaKo commented Feb 18, 2024

Original PR: https://api.github.com/repos/tgstation/tgstation/pulls/81358

About The Pull Request

1. Qol

  • Adds screen tips & examines for screwdriver & crowbar acts on BRM, Refinery & Smelter
  • Adds examines to display number of boulders stored inside a refinery & maximum number of boulders it can hold. Right click screentip to remove boulders
  • Adds examines to display maximum number of boulders than can be teleported by a BRM & screentips for interacting with wires
  • More audio & visual feedback for refinery processing. If a boulder requires multiple steps you will get a balloon alert saying "crushing" for refineries & "smelting" for smelters along with a sound per process tick(which is every 2 seconds so no need for cooldown) giving you a better idea of what's happening in the pipeline
  • BRM now will display all lights when the "Automatic boulder retrieval" is on & turn off the lights when disabled along with examines giving you a visual indicator of its state

2. Code Improvements

  • Splits types of boulders into its own file boulder_types.dm for easy maintainability
  • Moves beacon for refinery machines into its own file boulder_processing/beacon.dm for easy maintainability
  • Moves the cooldown for processing a boulder processing_cooldown into the refinery machine itself. Since 100's of boulders can be created per round this var can take up memory quickly so by moving them into the refinery machine it gives us some savings
  • Compressed & merged procs such as create_mineral_contents() , flavour_boulder() etc with the vent code. These procs were only used by the vent 1 time & by merging the code we removed if conditions to check if a parent vent was passed or not(since now that's always the case). Helped in removing boilder plate code

3. Fixes

4. Refactors

  • Repathes obj/machinery/boulder_processing/brm -> just obj/machinery/brm.
    Even though semantically it looks nice that the brm is a subtype of obj/machinery/boulder_processing from a code & operation perspective they have 0 similarities.

    1. The BRM does not accept boulders feed into it from a conveyer belt unlike a refinery but instead picks boulders from SSore subsystem & put it on the conveyer belt. This means procs for accepting boulders such CanAllowThrough(), breakdown_boulder(), accept_boulder() etc have no use in the BRM. Their just code clutter at this point
    2. The BRM overrides process() & does not call its parent proc making that code wasted
    3. It has no use for silo materials & mining points making those vars go to waste

    With so much wasted code its better to just let go off all of it & just make it a basic instance of obj/machinery making maintainence easy

  • BRM now teleports boulders in a batch (batch size determined by boulders_processing_max max value from upgraded parts is 7) with a boulder appearing every 1.5 seconds rather than spawning all at once. After a batch is processed it has a cooldown of 3 seconds before repeating the process if automatic boulder retrieval is on. This stops the conveyer belt from getting crowded with boulders and makes the refining process more efficient.

With this BRM wires are removed because only it had only 1 wire responsible for toggling boulder retrieval but now since this process is automatic, we have true control over the timing of boulders spawned & don't want to leave it in the hands of players

Changelog

馃啈
qol: adds examines & screentips for crowbar, screwdriver acts to BRM & refinery machines
qol: adds examines about the number of boulders stored & processed to BRM & refinery machines
qol: BRM now has its lights turn on/off depending on wether automatic boulder retrieval is on/off for visual clarity along with examines
qol: refinery machines now display ballon alerts & plays sounds more frequently when processing boulders for better feedback
fix: vents now spawn boulders of all sizes & not just small ones
fix: expanded gulag boulders now have correct materials in them.
fix: manual tapping of vents now has a cooldown applied as intended.
fix: BRM has its light turned off when area power goes off
fix: boulders ejected from refineries by hand no longer teleport all over the place occasionally.
fix: refineries no longer eject boulders with 0 durability
fix: Boulders & refineries no longer pile up on top of BRM's & refineries in long rounds. Their locs have to be clear of boulders before they spit out more boulders to prevent a large pile of boulders from causing lag
fix: sheets ejected from lathes no longer get rejected when inserted back which could happen at random, no more boulders with empty materials
code: splits boulder types into its own file along with other items
code: merges & autodocs procs, vars related to boulders
refactor: repaths BRM to a simpler subtype
refactor: BRM now spawns boulders in batches(batch size can be increased with upgraded parts) with a boulder appearing every second. After a batch is processed a 3 second cooldown is applied to stop the conveyer belt from clogging up, With this BRM wires are removed as there is no need for timers to be attached to wires which intefers without our batch processing timings.
/:cl:

@NaakaKo NaakaKo added the Upstream PR Merged Used by the mirror bot. label Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Upstream PR Merged Used by the mirror bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants