## About The Pull Request
I have received feedback that after the prior changes in #81971, the
gulag is still a little bit too subject to RNG.
The main culprit (as in my previous PR) is Iron being kind of cheap and
the fact that unlike the old Gulag you no longer have any way of
headhunting more valuable materials (everything appears as boulders on
your ore scanner).
My solution to this is wider than the last one of tweaking point values,
but also much simpler:
Just make every boulder you mine be worth the same amount of points
regardless of what is inside of it.
On the average test I made I could comfortably mine about 40-45 boulders
in ten minutes.
We'll make some adjustments to that rather than leaving 40 as the target
number;
Most players upon being teleported to the gulag are going to spend a few
minutes whining and bemoaning their fate instead of getting straight to
work. I had the benefit of being able to make sure my run started as
soon as a storm ended so I wouldn't need any kind of midpoint break. I
was also always the only person playing on my local instance, there
hadn't been any other pesky prisoners before me who had already mined
out all the nearest available deposits. And of course, let us not
forget, I am an MLG master league ss13 player who was surely performing
well above average.
So we'll round that down to: Each boulder is worth 33 points, meaning
you need to collect 31 boulders to complete a 1000 point (roughly ten
minute) sentence.
How do I ensure that every boulder is worth the same amount of points?
Well it's pretty easy.
One boulder = one material sheet. One material sheet = 33 points.
Simple.
"Now Jacquerel", I hear you not saying because you don't want me to know
about this thing you would prefer to do instead of hitting rocks
outside; "if I simply smash all of the tables and microwaves and botany
trays and bed in the gulag I can easily get like 65 sheets of Iron,
which is almost enough to buy the freedom for two entire people!"
Unfortunately I knew you were going to try and do that and the prisoner
point machine will only give you points for material sheets which have
been printed from the material smelter (well, any material smelter
actually but you should probably use the one in the gulag). You'll be
able to tell because if you examine a valid material sheet it will
mention a little maker's mark on it, which is absent in the beat-up iron
that you get from smashing furniture to bits.
Also glass is worth 0 points. Don't waste time digging up that shit.
As glass has had all of its point value removed, I have added a "work
pit" to the gulag to compensate. You can pull boulders out of this
indefinitely via effort, however it also stamcrits you every time.
It's not very fun to do this, but that's because I would prefer you to
go find the rocks out in the field instead. This is a last resort.
You can do this if there's no boulders left to mine or if you really
really really hate mining and would rather very slowly click on one tile
repeatedly to get your boulders instead.
As a tiny bonus doing this gives workout experience.
This isn't a totally ideal solution but I think it'll do for now.
## Why It's Good For The Game
What we want out of the gulag is:
- Something where officers can vaguely approximate an expected sentence
duration.
- A task that requires players to actually be spending that time doing
something to get out of here.
- Produces at least some amount of useful materials.
In I think roughly that order.
I hope this change accomplishes all three of these in a way that is
somewhat predictable rather than throwing darts at a board.
## Changelog
🆑
balance: Gulag mining has been rebalanced so that every boulder is worth
the same amount of points to mine for a prisoner regardless of what it
contains, and should be more consistent.
add: A vent which boulders can be hauled out of by hand has been added
to the gulag which you can use if there's nothing left to mine. It is
very slow, but at least it gives you a workout...
/🆑
## About The Pull Request
Fixes#82440
This PR just creates a new macro, `LOWER_TEXT()` (yes the irony is not
lost on me) to wrap around all calls of `lowertext()` and ensure that
whatever we input into that proc will be stringified using the `"[]"`
(or `tostring()` for the nerds) operator. very simple.
I also added a linter to enforce this (and prevent all forms of
regression) because I think that machines should do the menial work and
we shouldn't expect maintainers to remember this, let me know if you
disagree. if there is a time when it should be opted out for some
reason, the linter does respect it if you wrap your input with the
`UNLINT()` function.
## About The Pull Request
- Fixes#81486
Happens only with items that are Indestructible like the pai card, It's
a 2 part fix
- First display error message saying the item was rejected
- If the item is indestructible but was put inside another object like
an bag or anything else, then move the object to turf where this object
was inserted(`context`) & not the ore silo(`parent`) thus fixing the
teleportation bug
## Changelog
🆑
fix: Indestructible items like the pai card don't teleport to the ore
silo when you insert them into silo linked machine & also displays a
message saying it was rejected.
/🆑
## About The Pull Request
- Fixes#81289
It has nothing to do with `dump_contents()` but with the material
container that drops its materials on `Destroy()` causing side effects.
Now it only drops sheets when an object is deconstructed but not
destroyed.
For this to work properly on all instances we have to ensure
`deconstruct()` is not overridden at least on machines for now, so they
can send `COMSIG_OBJ_DECONSTRUCT` signal. That comes in the next PR
## Changelog
🆑
fix: deleting objects with local material storage(autolathe, drone
dispenser etc) no longer drops sheets, they only drop materials when
deconstructed
/🆑
## About The Pull Request
Refactors underlying autolathe code, mostly about how it prints items
Items are now printed sequentially
Items now have their custom materials set to the the materials actually
used to create them
Items are now printed based on their design construction time instead of
a default 3.2 seconds per item always
Closes https://github.com/tgstation/tgstation/issues/80755
## Changelog
🆑
fix: Autolathes no longer allow you to duplicate materials at higher
levels of stock parts
qol: Autolathes now show name instead of typepath when selecting a
custom material
qol: Autolathe now print out items one by one instead of waiting for all
of them to print at once
/🆑
Productionizes #80615.
The core optimization is this:
```patch
- var/hint = to_delete.Destroy(arglist(args.Copy(2))) // Let our friend know they're about to get fucked up.
+ var/hint = to_delete.Destroy(force) // Let our friend know they're about to get fucked up.
```
We avoid a heap allocation in the form of copying the args over to a new
list. A/B testing shows this results in 33% better overtime, and in a
real round shaving off a full second of self time and 0.4 seconds of
overtime--both of these would be doubled in the event this is merged as
the new proc was only being run 50% of the time.
## About The Pull Request
1. Removes material breakdown flags i.e. all flags with the format
`BREAKDOWN_XXX`. These flags do nothing, there are no special checks to
transform materials based on these flags, they are passed around just
because certain procs require them for syntax purposes only.
Apparently there were plans to make these flags do something special
from the comment
302247c0d1/code/__DEFINES/construction/material.dm (L43)
But nobody got any ideas for years now. The only special thing we can do
with them now is remove them and reduce code clutter, so let's do that
The only flag that ever did something was the
`BREAKDOWN_INCLUDE_ALCHEMY` flag. This only worked when coupled together
with `TRAIT_MAT_TRANSMUTED` trait(which is only used by the reagent
metalgen) and when both this trait & flag are combined together... they
still do nothing
302247c0d1/code/game/atom/atom_materials.dm (L41-L42)
Yup they cancel out each other to prevent returning an empty list, the
traits only job was to prevent materials from being recycled (like why?
what's the benefit of that? nothing) and the flag was meant to bypass
this restriction so both the trait & the flag cancel out each other
therefore doing nothing meaningful. Best remove them both and call it a
day.
2. Fixes an error in displaying number of sheets inserted into a mat
container when that sheet is made up of alloy materials. it would count
as 2 or more because it would take the sum of total material amount
inserted and not the actual sheets. That's fixed now.
3. Remote materials now properly respect the `MATCONTAINER_NO_INSERT`
flag
4. Adds helper proc to insert materials via the remote material
component with proper context
## Changelog
🆑
fix: mat container displays correct number of sheets inserted for alloy
materials.
fix: remote materials now properly respect the `MATCONTAINER_NO_INSERT`
flag.
code: removes material breakdown flags and related traits.
code: adds helper proc to insert materials via the remote material
component with proper context.
/🆑
## About The Pull Request
Forgot to format the chat in the right format when items are rejected by
the mat container. Rather than displaying the item is rejected it would
simply runtime & not display anything. That's fixed now
## Changelog
🆑
fix: items that are rejected by the mat container will display the chat
message saying that.
/🆑
## About The Pull Request
**1. Mat container `user_insert()` tweaks**
- Mat container will now skip over an item & its contents if that item
cannot be processed (not suitable for redemption or not an allowed type)
this is not only realistic(if an item has an tough outer shell you can't
crush it to access its contents) but also saves us computation time as
we can skip over contents quickly
- Mat container now properly respects the `MATCONTAINER_SILENT` flag
- You can now hit machines like autolathe, protolathe etc with iron
sheets (or any other material item type those machines accept) when in
combat mode rather than inserting them because it makes sense
- Mat container now has much reduced chat spam as it will sum up all the
items inserted, and the material collected rather than displaying them
individually.

Much improved readability and overall faster as we do much less
`to_chat()` calls
**2. ORM Tweaks**
- Fixes https://github.com/Skyrat-SS13/Skyrat-tg/issues/25329 .
ORM now generates points correctly always, regardless of how the ore is
inserted be it
- Via hand
- Thrown at the ORM
- Ore Box
- Some other bag containing ore
Points will always be generated at a common proc so no more checking
every inlet on how the ore enters the machine. Once the silo receives
the material it will inform the ORM about it, so it does not have to
check itself therefore reducing code bloat.
## Changelog
🆑
fix: ORM will generate points regardless of how the ore enters it.
fix: Machines like autolathe, techfab etc can now be hit with iron
sheets (or any other material item type those machines accept) when in
combat mode rather than inserting them because it makes sense.
fix: Mat container won't display chats fully if the
`MATCONTAINER_SILENT` flag is passed.
refactor: Machines like autolathe, techfab etc now display summed up
material inserts to chats rather than each item individually. Also, will
skip items & its contents if it cannot be processed thus saving time
/🆑
---------
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
## About The Pull Request
Continuation of https://github.com/tgstation/tgstation/pull/77946, I
missed quite a few of these it seems.
## Why It's Good For The Game
Stop the spread of these typos!!
## Changelog
Nothing player facing
## About The Pull Request
As #77936 pointed out an infinite while loop occurs in the recycler.
This was caused due to my recent mat changes as follows.
When the recycler eats up an item. If it found any material inside, it
would attempt to eject any sheets formed from it over here
ed71735fb3/code/game/machinery/recycler.dm (L199)
Inside this proc i first create the sheets in `null space` why is
explained in the comment
ed71735fb3/code/datums/components/material/material_container.dm (L599-L600)
After doing logging & stuff i then would move the sheets back into its
target turf so it could get merged again
ed71735fb3/code/datums/components/material/material_container.dm (L607-L608)
Unfortunately this would trigger `COMSIG_ATOM_ENTERED` signal which the
recycler is hooked onto. The recycler would then eat the newly ejected
sheets again, which would cause more sheets to be ejected, which would
again trigger the signal `COMSIG_ATOM_ENTERED` and you have your
infinite loop.
I did this because i had no clue how to stop the stack from merging when
it got spawned and this was a poor solution, so upon examining the code
i found there is a var to specifically stops stacks from merging
ed71735fb3/code/game/objects/items/stacks/stack.dm (L81)
Yup there is specific param called `merge=TRUE` which allows you to
explicitly stop stacks from merging. I now use this var and manually
merge stacks afterwards without calling `forceMove()` so it doesn't
trigger the recycler anymore which caused the infinite loops.
## Why It's good for the game
Writing checks to see if an object came from null space is weird. It
makes the code difficult to reason with as such situations never happen.
Now it makes sense for an atom to be moved "into" null space for e.g.
when it gets deleted but for an atom to "return back from it" never
happens and you shouldn't be bothered with figuring out how that
happened.
## Changelog
🆑
refactor: sheets are merged in a better way when ejected from machines &
material related stuff
/🆑
1. Removes `/obj/machinery/ore_silo/proc/remote_attackby()`. This proc
calls `datum/component/material_container/user_insert()` anyway which
performs all the checks necessary for inserting stuff into the ore silo
and `/obj/machinery/ore_silo/proc/remote_attackby()` was just repeating
its code & checks. So now inserting into the ore silo is directly
handled by the mat container without this proxy proc making the
operation slightly faster
2. Removed silo `attackby` code. Same operations can be done via
`screwdriver_act` & `crowbar_act` procs much cleaner
3. The ore silo now hooks onto signals
`COMSIG_MATCONTAINER_ITEM_CONSUMED` and
`COMSIG_MATCONTAINER_SHEETS_RETRIVED` and logs into silo when they are
triggered. This means when you insert/eject sheets from the silo the
connected machine performing the operation no longer has to do the
logging manually thus the proc `silo_log` has been removed from a lot of
places ,reducing overall code size
4. A lot of stuff that use materials from the ore silo follow this
pattern.
i.e. They first use the materials from the silo and then log it via
`silo_log` proc. This code pattern is repeated in a lot of places so
let's just merge these 2 lines with some extra sanity checks into a
single proc inside `remote_materials` itself. That's what was done and
the number of places where you log manually into the silo has been
removed further reducing code size everywhere.
5. Added auto doc & cleaned up some procs
Since logging is now done by the ore silo directly, we need a way to
pass the machine that is inserting items into the silo to the signal
handlers of the ore silo [via the `context` var]. So other code changes
elsewhere is because of this var
## About The Pull Request
1. Fixes#77177
Some things were not connecting to the ore silo round start because the
silo was not initialized yet so it went to local storage. Now it
connects with the ore silo again
3. Removed some unused code in remote materials
4. Protolathe uses `eject_sheets()` defined in remote materials and not
it's own version because that's redundant
5. Don't put the item back in the players hand when inserting it in the
material container cause we haven't even removed it yet
6. `fast_split()` is now even faster & robust and is a global proc
7. Some code cleanup for RHD silo link
## Changelog
🆑
fix: some things not connecting to the ore silo round start
/🆑
## About The Pull Request
**1. Material container clean-up & refactor**
- Replaced `total_amount` var with `total_amount()` proc, this var can
be easily computed by summing up all material amounts rather than
storing it as a var which is tedious to update & keep track of when
materials are added/removed
- Removed unused procs `transer_amt_to()`, `can_insert_amount_mat()`,
and `get_categories()`. These procs are not used anywhere in the
codebase so let's remove them & make some space.
- Callbacks are replaced with signals, the callbacks don't need to be
explicitly garbage collected & having macros & procs marked with
`SIGNAL_HANDLER` makes your intentions more readable & explicit.
- Fixes#76151
All material adding, removal, checking operations are "Integer"
operations, i.e. the final value is rounded & them made 1 if the final
value is 0 using the macro `OPTIMIZE_COST`[coudn't come up with a better
name]. No more dealing with decimal value materials
The problem was after the protolathe was upgraded with better parts all
the design costs were multiplied with a decimal `efficiency_coeff`
value, this means even though in the UI the cost was displayed as 60
bluespace crystals its actual cost was `60.0001` something in the
backend causing this check for materials to fail & print the error
message.
- Replaced `GetComponent(/datum/component_material_container)` with just
a simple ref to the material container when adding the component, so we
can save some overhead from calling this proc
- Gave all procs a ton of documentation with documentation having
documentation
- Fixes#76506 RCD and other devices that uses the silo link upgrade now
have the correct material usages
- Fixes#72096. It wasn't just a problem with ancient protolathe but
with all machines that used `datum/component/remote_materials` the
problem was remote materials would add an instance of
`datum/remote/material_container` if it wanted to use local storage but
this component would get added before `datum/component/remote_materials`
could be registered i.e. it comes before remote_materials in the
component list. So when the machine is destroyed it will first destroy
`material_container` & then `remote_materials` therefore destroying the
materials before they could get ejected
- Silo link is established when parent is registered with remote
materials raher than adding an external timer which is faster
- Everything that uses a material container will auto eject their sheets
when destroyed
- Moved this & remote materials into its own folder for better
organization
**2. Material UI Changes**
- Removed the x25 & x50 print buttons from the autolathe, now they just
have x5 & x10 buttons like the protolathe, These buttons were of no use
since you could just type the exact amount you want to print in the
`[Max: <some amount>]` side bar. The code to compute these buttons was
just plain right nasty & some of it unused in the UI.
- The material eject button in the material bar does not gray out when
you can eject exactly one sheet
- All material cost are integer values rounded
- Fixes#76253 Exosuit Fabricator sends the material container static
data to the UI so its material bar is not greyed out when there are
sufficient materials to eject
- Component printer material bar sends the material container static
data to the UI so its material bar is not greyed out when there are
sufficient materials to eject
- Autolathe Material bars now display number of sheets available
- Max printable amount of items are now computed & updated correctly in
the UI. They were displaying wrong values & now get updated when items
are printed, materials are removed
- Silo hold actually works now. When a machine is put on hold it calls
this proc
e929cf39cd/code/datums/components/remote_materials.dm (L78-L87)
Notice how the key is `src` so we should be consistent during checking
if a machine is on hold using the same `src` var. But for some reason we
did dumb shit like this
e929cf39cd/code/datums/components/remote_materials.dm (L150-L153)
What is category? Why do we care for the area the machine is in? None of
it made sense so i removed all that junk and just made it check for
`src` like it should
- Removed redundant `removable` & `sheets` var from the material
container ui_data. These vars are unused in the UI
- If an item does not have the required materials then upon clicking
that item you will not get any error message but instead nothing happens
## Changelog
🆑
fix: items can be printed from autolathe & protolathe when the exact
material amounts are present in them after upgrading
fix: max printable amount now shows the correct value & updates when
items are printed, materials are removed in the autolathe & protolathe
fix: component printer material bar is not greyed out when there are
sufficient materials to eject
fix: rcd and other devices that uses the silo link upgrade now have the
correct material usages
fix: silo hold actually works
fix: machines using local storage to hold materials will eject it's
materials as sheets when deconstructed/destroyed
refactor: Autolathe Material bars now display number of sheets available
refactor: printing an item that does not have enough materials will fail
silently with no error messages
refactor: Drone dispenser will eject sheets upon deconstruction
refactor: all things that store materials will auto ejects its sheets(if
there is sufficient material) when destroyed
refactor: inserting an item into the material container will display the
units consumed as sheets not absolute units
refactor: removed x25 & x50 print buttons from the autolathe