mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-18 21:53:22 +00:00
c7e11d71613dda596ef8194fcb51d0b5ece37bea
4 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
59d74624b1 |
Upstream power stuff combined and shit (#27284)
* Converts arbitrary energy units to the joule. Fixes conservation of energy issues relating to charging cells. (#81579) Removes all arbitrary energy and power units in the codebase. Everything is replaced with the joule and watt, with 1 = 1 joule, or 1 watt if you are going to multiply by time. This is a visible change, where all arbitrary energy units you see in the game will get proper prefixed units of energy. With power cells being converted to the joule, charging one joule of a power cell will require one joule of energy. The grid will now store energy, instead of power. When an energy usage is described as using the watt, a power to energy conversion based on the relevant subsystem's timing (usually multiplying by seconds_per_tick or applying power_to_energy()) is needed before adding or removing from the grid. Power usages that are described as the watt is really anything you would scale by time before applying the load. If it's described as a joule, no time conversion is needed. Players will still read the grid as power, having no visible change. Machines that dynamically use power with the use_power() proc will directly drain from the grid (and apc cell if there isn't enough) instead of just tallying it up on the dynamic power usages for the area. This should be more robust at conserving energy as the surplus is updated on the go, preventing charging cells from nothing. APCs no longer consume power for the dynamic power usage channels. APCs will consume power for static power usages. Because static power usages are added up without checking surplus, static power consumption will be applied before any machine processes. This will give a more truthful surplus for dynamic power consumers. APCs will display how much power it is using for charging the cell. APC cell charging applies power in its own channel, which gets added up to the total. This will prevent invisible power usage you see when looking at the power monitoring console. After testing in MetaStation, I found roundstart power consumption to be around 406kW after all APCs get fully charged. During the roundstart APC charge rush, the power consumption can get as high as over 2MW (up to 25kW per roundstart APC charging) as long as there's that much available. Because of the absurd potential power consumption of charging APCs near roundstart, I have changed how APCs decide to charge. APCs will now charge only after all other machines have processed in the machines processing subsystem. This will make sure APC charging won't disrupt machines taking from the grid, and should stop APCs getting their power drained due to others demanding too much power while charging. I have removed the delays for APC charging too, so they start charging immediately whenever there's excess power. It also stops them turning red when a small amount of cell gets drained (airlocks opening and shit during APC charge rush), as they immediately become fully charged (unless too much energy got drained somehow) before changing icon. Engineering SMES now start at 100% charge instead of 75%. I noticed cells were draining earlier than usual after these changes, so I am making them start maxed to try and combat that. These changes will fix all conservation of energy issues relating to charging powercells. Closes #73438 Closes #75789 Closes #80634 Closes #82031 Makes it much easier to interface with the power system in the codebase. It's more intuitive. Removes a bunch of conservation of energy issues, making energy and power much more meaningful. It will help the simulation remain immersive as players won't encounter energy duplication so easily. Arbitrary energy units getting replaced with the joule will also tell people more meaningful information when reading it. APC charging will feel more snappy. 🆑 fix: Fixes conservation of energy issues relating to charging powercells. qol: APCs will display how much power they are using to charge their cell. This is accounted for in the power monitoring console. qol: All arbitrary power cell energy units you see are replaced with prefixed joules. balance: As a consequence of the conservation of energy issues getting fixed, the power consumption for charging cells is now very significant. balance: APCs only use surplus power from the grid after every machine processes when charging, preventing APCs from causing others to discharge while charging. balance: Engineering SMES start at max charge to combat the increased energy loss due to conservation of energy fixes. /🆑 --------- Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> * Corrects Suit Storage Unit charge rate (#82192) ## About The Pull Request Adjusts SSU charge rate according to the new conversion ratio. Betcha didn't know SSUs recharge suit and MOD cells? This number is actually supposed to be equal to the rate a recharger station does it. I don't know if we have some macro for it. ## Changelog 🆑 Melbert fix: Fixed Suit Storage Unit cell charging rate /🆑 * Corrects EVA thermal regulator cell cost (#82195) ## About The Pull Request Another unit not converted to watts / joules ## Changelog 🆑 Melbert fix: Fixed space suit thermal regulators cell usage. /🆑 * Fixing cell power usage (Part 1) (#82197) ## About The Pull Request Yeah i am not about to create 30 different PR's to address 1 issue at a time. The changes are small enough to be grouped together in bulk. This fixes the following issues specified in #82196 - Borg & exosuit RCD (Fixes #82193) - Motorized wheelchair - Canister shielding - Electrolyser - Potato cell - Space heater - Microwave ## Changelog 🆑 fix: Fixed cell energy usage for a bunch of stuff(Part 1). See PR 82197 for details /🆑 --------- Co-authored-by: Pickle-Coding <58013024+Pickle-Coding@users.noreply.github.com> * Fixing cell power usage (Part 2) (#82198) ## About The Pull Request Continuation of #82197. Fixes these issues in #82196 - Cyborg self repair - Cyborg lollipop dispenser - Mauna mug - Plasma cutter (Initial charge not the number of laser shots so partial fix) ## Changelog 🆑 fix: Fixed more energy usages for cells(Part 2). See PR 82198 for details /🆑 --------- Co-authored-by: Pickle-Coding <58013024+Pickle-Coding@users.noreply.github.com> * Fixing cell power usage (Part 3) (#82204) ## About The Pull Request Continuation of #82198 Fixes these issues in #82196 - Borg hypo spray - Borg projectile dampen - Borg chameleon - Firelance - MODlink scryer - Emergency light usage ## Changelog 🆑 fix: Fixed more energy usages for cells(Part 3). See PR 82204 for details /🆑 --------- Co-authored-by: Pickle-Coding <58013024+Pickle-Coding@users.noreply.github.com> * [NO GBP]Fixes static power usage not always drawing the remaining energy of an APC cell. (#82205) ## About The Pull Request Makes APC static power draw consume the remaining energy of the cell if there's not enough energy. ## Why It's Good For The Game Prevents a niche issue where an area composed entirely of static power users with no dynamic users from running forever with no power supply. ## Changelog 🆑 fix: Fixes static power usage from being able to not draw power. /🆑 * Fixes recharge stations charge rates (#82191) ## About The Pull Request - Fixes #82190 Have to now use the assigned constants and not magic number `10000`. Also stuff will take the exact charge needed without any wastage. ## Changelog 🆑 fix: recharge stations draw the same amount of power as before but directly from grid(without using apc cell power) and won't waste any excess power /🆑 --------- Co-authored-by: san7890 <the@san7890.com> * Fixes space heater power usage (#82208) ## About The Pull Request Related to https://github.com/tgstation/tgstation/issues/82196 fixes the space heater power cell usage relating to power per tile heated. Space heater calculates the amount of power required to heat a tile, but only uses power at the end of the processing loop. Fixes so the power consumption matches the calculated usage per tile. Reverts changes to space heater power efficiency in https://github.com/tgstation/tgstation/pull/82197 that causes the heater to instantly drain the cell. Fixes https://github.com/tgstation/tgstation/issues/82228 ## Changelog 🆑 LT3 fix: Fixes Schrödinger's space heater, where a space heater both consumes a power cell instantly while also not consuming power when heating adjacent tiles /🆑 * General maintenance for reagent grinder (#82161) ## About The Pull Request **1. Qol** - Adds examines & screentips for screwdriver, crowbar & wrench acts. - Adds examines & screentips for inserting, replacing & removing beaker, Also for inserting items from bags or directly - Adds an off icon overlay for when the reagent grinder is either screwed open or loses power, **2. Code Improvements** - Replaced `attackby()` with `item_interaction()` so we can end the attack chain early for non combat operations like inserting beakers/ ingredients for grinding etc. - Removed custom shake animations & replaced it with the global `Shake()` proc cause it did the same thing - Removed constructed version of reagent grinder. We instead just check `mapload` to see if we need the beaker to be created or not for round start reagent grinders - Grinding & Juicing use the same `operate_for()` rather than having seperate procs for each operation - Removed trait `TRAIT_MAY_CONTAIN_BLENDED_DUST`. Why do we have this? Its just used to change the grinder description to warn it may contain dust. It's a waste. **3. Fixes** - You cannot insert hologram items into the grinder. Rather than destroying that item & making it vanish you simply won't be allowed to put it inside the grinder so you can save that item - You can hit the grinder with items like screwdriver, wrench, crowbar, beaker & even with stuff you would normally put in the grinder when in combat mode - Adds `can_interact()` checks for using the UI & other stuff - Fixes #46356. All items of type `obj/item/grown` can be put from any bag into the grinder - The item "and its contents" are now grinded/juiced recursively to get all the reagents it has to offer just like a real grinder would - An AI/Human with AI access examining the reagent grinder now actually works. **4. Refactors** - The grinder now measures its available capacity based on the "total weight" of all items present & not its number. This is more realistic because the grinder has limited space inside & so inserting huge items should have greater impact rather than deciding on an arbitrary number like 10(The grinder having the capacity for 10 items of any size inside its small compartment makes no sense). Examines are displayed to show how much capacity of the grinder has been filled. Upgrading the grinder with better matter bins will allow for higher storage capacities. - Total power consumed is measured based on the duration & weight of all items grinded cause you know its realistic. 🆑 qol: adds examines & screentips for tool acts & other operations for reagent grinder qol: adds an off icon for when the grinder panel is open/not powered code: auto docs vars & procs. Shared common proc for grinding or juicing code: removed trait for blended dust, changed some item interactions to end the attack chain early & save time fix: no inserting hologram items into the reagent grinder fix: you can hit the reagent grinder tools like screwdriver, wrench, crowbar & even beakers/ingredients etc when in combat mode fix; adds sanity checks for when & how mobs interact with the reagent grinder fix: examining a reagent grinder by an AI/Human with AI access now actually works. fix: you can insert Nova flowers & other food items from any bag type fix: reagent grinder now grinds all the contents of an item recursively to produce maximum reagents like a real grinder would refactor: reagent grinder now measures available capacity to store items as total weight of stored items & not number. Capacity can be increased with upgraded matter bin refactor: reagent grinder power usage is now a function of duration & total weight of items blended, meaining blending more number of items/larger items will consume more power refactor: reagent grinder code has been optimized overall. Report bugs on github /🆑 --------- Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk> * Suit Storage Units / Inducers can charge MODsuits without necessitating them be screwdrivered opened (#82194) ## About The Pull Request So MODsuits do this thing here with `get_cell` in that they don't return anything when they're closed  And I... can't tell why they do this. I looked through every use of `get_cell` and the only things affected by this are A. Suit Storage Units, which I believe have always been intended to charge MODsuits? and B. Inducers So I removed the `open` check. Allowing both Inducers and Suit Storage Units to charge mods without needing you screwdriver their panel open first. I also took the opportunity to allow SSUs to charge multiple items at once (divvying charge accross all items) ## Why It's Good For The Game I asked Fikou and they said it was "probably not" intended that you need to screwdriver them open so yeah. I think I remember charging my MODs during the original test merges years back but I can't remember if I opened the suit first when I did or not. Either way, it's not super intuitive. Though it's already not very intuitive that SSUs charge things. ## Changelog 🆑 Melbert qol: Suit Storage Units charge MODsuits while their cell panel is closed or open, rather than only when screwed open qol: Inducers can charge MODsuits while their cell panel is closed or open, rather than only when screwed open qol: Suit Storage Units will charge all items within simultaneously (if possible) /🆑 --------- Co-authored-by: san7890 <the@san7890.com> * Fixes modular computer boot-up (#82254) ## About The Pull Request Fixes a bug where modular computers (specifically PDAs) will fail to start up if there is zero required application power draw. PDA will now consume base active power usage during startup. Related https://github.com/tgstation/tgstation/issues/82196 Fixes https://github.com/tgstation/tgstation/issues/82245 Fixes https://github.com/tgstation/tgstation/issues/82229 ## Changelog 🆑 LT3 fix: Fixed modular computers failing to boot up using cell power (eg: contractor tablet) /🆑 * Fixing cell power usage (Part 4) (#82227) ## About The Pull Request Continuation of #82204 Fixes these issues in #82196 - Cyborg Electroadaptive Pseudocircuit - Defib EMP - Cell EMP - `/datum/action/cooldown/mob_cooldown/charge_apc` stuff - Mecha movement, melee, light ,weapon & tool energy drains - Ninja drain ## Changelog 🆑 fix: Fixed more energy usages for cells(Part 4). See PR 82227 for details /🆑 --------- Co-authored-by: Pickle-Coding <58013024+Pickle-Coding@users.noreply.github.com> * Fixing cell power usage (Part 5) (#82296) ## About The Pull Request Continuation of #82227 Fixes these issues in https://github.com/tgstation/tgstation/issues/82196 and others that weren't noticed. - Batton emp protection - Cyborg stun arm - Cyborg energy sword - Cyborg hug attack - Mechanical god religious sect charge check - Mecha fixes - Phasing energy drain - Short circuit energy drain - Durand shield damage energy drain - Plasma engine recharge rate - Mechbay recharge power rate - Recharge station charge rate Stuff that was already working & didn't require fixing. - Plasma cutter energy shots - Botany cell charging ## Changelog 🆑 fix: Fixed cell energy usage for a bunch of stuff(Part 5). See PR 82296 for details /🆑 --------- Co-authored-by: Pickle-Coding <58013024+Pickle-Coding@users.noreply.github.com> * Ties power limit of anchored circuits to 20 * standard cell charge to make it consistent with power changes. (#82287) ## About The Pull Request It just makes the power requirement 20 * standard cell charge instead of 20000 ## Why It's Good For The Game This is too restrictive to make anything with. https://github.com/tgstation/tgstation/assets/62126254/e39dcf27-8793-42b0-84a0-7f747e95efcc ## Changelog 🆑 fix: anchored circuits no longer blow up after 2 components are used. /🆑 --------- Co-authored-by: Pickle-Coding <58013024+Pickle-Coding@users.noreply.github.com> * Space heater power and heating tweaks (#82344) ## About The Pull Request - Fixes #82342 - Space heater computes total power for heating adjacent turfs and uses cell energy once rather multiple times per turf - Improvised space heater actually works & uses beaker heat capacity and not a constant of 200 for heating beaker contents ## Changelog 🆑 SyncIt21,Pickle-Coding fix: space heater(including improvised) turns off when cell is drained fix: optimized power usage for both improvised and main space heater. Improvised heater now works & uses beaker heat capacity /🆑 * Improved lathe error message (#82260) ## About The Pull Request Improves the auto/protolathe low charge error message. Instead of simply saying low power, it will tell you how long until it has enough charge to print.  ## Why It's Good For The Game Less mashing the lathe over and over with no idea how much APC charge it needs to start printing again ## Changelog 🆑 LT3 code: APCs can now calculate time-to-charge qol: Overloaded lathes will now tell you the wait time until they're ready to print again /🆑 --------- Co-authored-by: san7890 <the@san7890.com> * Fixes issues with multitools on power objects (#82389) ## About The Pull Request So at some point the power object's `multitool_act(...)` proc was set to _always_ block, for what I could find to be no discernable reason. ### The Main Thing |
||
|
|
8198e578ca |
[MANUAL MIRROR] Fix a merge skew on armor datums (#19212)
* Fix a merge skew on armor datums (#72909) And also add a check grep to find it in the future * fix linters * damn youuuu --------- Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com> |
||
|
|
6aebab2146 |
[MIRROR] MODsuit module update: clamp nerf, replacement of holster and pepper spray modules, some tweaks to suit starting modules [MDB IGNORE] (#12783)
* MODsuit module update: clamp nerf, replacement of holster and pepper spray modules, some tweaks to suit starting modules * Update mod_control.dm * fixes * fix2 Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com> Co-authored-by: Zonespace <41448081+Zonespace27@users.noreply.github.com> |
||
|
|
5910fd9649 |
[MIRROR] MOD update: Modular Cores [MDB IGNORE] (#10710)
* MOD update: Modular Cores * Fixing all dem conflicts * Okay now it's going to compile too * Fixing some Trigger() (they triggered me) Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com> Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com> |