Skip to content

More R&D tweaks and fixes#39367

Open
boy2mantwicethefam wants to merge 6 commits into
vgstation-coders:Bleeding-Edgefrom
boy2mantwicethefam:R&D-console-fix
Open

More R&D tweaks and fixes#39367
boy2mantwicethefam wants to merge 6 commits into
vgstation-coders:Bleeding-Edgefrom
boy2mantwicethefam:R&D-console-fix

Conversation

@boy2mantwicethefam

@boy2mantwicethefam boy2mantwicethefam commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Changed defines from decimal values to whole number values because frankly there's no difference. May even fix a rare bug in which clients interacting with the R&D console crash but probably not.
Changed the "dat" variable that contains all the HTML data from a list to a string, which may also fix that rare bug but maybe not. No in-game difference.
Fixed an ancient bug where items in the Protolathe and Circuit Imprinter menus would show the "x5/x10/x20" buttons when there was 0 of their material costs in storage (such as if you had 500 iron and 0 glass for an item that required both). This coincidentally restored a functionality that used to be broken where the item cannot be clicked until you have the materials for it. And I added color-coding for whether materials are available.
image
image

Fixed a bug where a "Name" design would appear in the list of R&D database designs
Acquiring materials via bluespace matter bins will now cover the cost instead of seeing if there are enough materials in other fabricators to print the item on its own, meaning that if a design costs 1000 metal but you have 500 metal in your machine and 700 metal in bluespace it will now take 500 metal from your machine and 500 metal from the bluespace-connected fabricator instead of saying that there's not enough materials. This should also fix it if the 700 metal in bluespace is split between multiple machines, such as 350 in one and 350 in another
Optimized the protolathe/imprinter design menus by reducing the amount of times the designs have been checked from somewhere over 6000 times at max research (it was going through over 500 known designs for each item category which is up to 13 times if you had Nanotrasen research) to less than 2000 (going through every design once and filtering the ones that don't belong on the protolathe/imprinter, removing them from the list with each one that has been added to a category), and subsequently undid those optimizations with the addition of a lot of checks to make the pretty colors work.
Added a global list of bluespace-connected fabricators to be referenced instead of going through the global machine list, making it a much shorter list.
R&D consoles now have a dummy "bluespace" materials datum that is used for making the protolathe/imprinter design menus by going through the bluespace machine list and adding up all the available resources.
A fabricator that's flagged to ignore material/chemical costs will now allow multiple queue buttons again instead of just custom.
Renamed check_mat() (counts how many times a material cost is covered by dividing the amount in storage with the design's material cost) to material_print_amount() because it was too similar to check_mats() (checks how much material there is in storage, with support for chemistry reagents)
Fixed an edge case bug (except for flatpack fabricators, I'm not fixing that yet) where if an item didn't have enough materials but it acquired some materials through bluespace matter bin connection then some of those materials would be transferred over to the fabricator that required the materials because the code was transferring them to the machine but since there wasn't enough of a material to be transferred from other bluespace machines it would just leave those materials transferred.
Changed a round() to a floor() for a similar effect.
Changed build_part_loop() from calling new procs of itself to a while() loop for the same effect but less ugly.

🆑

  • bugfix: Fixed a bug where a design called "Name" would appear in the R&D known design database, which was actually a supertype of medal designs that was not supposed to be there.
  • bugfix: Fixed an ancient bug where the "x5/x10/x20" item queue buttons would show up if you had 0 of any component materials.
  • bugfix: Fabricator machines (such as the Protolathe, Autolathe, Exosuit Fabricator etc) with bluespace matter bins will now properly cover the cost of missing materials in cases where there were enough resources if both machines' resources were pooled together.
  • rscadd: The item queue button bugfix has restored a functionality in which Protolathe and Circuit Imprinter designs cannot be clicked if you do not have the necessary materials for them.
  • rscadd: Added red and cyan text for material costs in the R&D console for whether there's not enough material or it will be covered by the bluespace matter bin network respectively.
  • tweak: Changed a significant amount of code behind item printing code and the R&D console's Protolathe and Circuit Imprinter menus. Please report any bugs!

@mentgah

mentgah commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

The man who saved vg

@Inorien

Inorien commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Fixed an ancient bug where the "x5/x10/x20" item queue buttons would show up if you had 0 of any component materials.

This thing is at least 11 years old, at this point I almost want to call it a feature/change rather than a bug given it didn't negatively impact gameplay. Rather, is this not technically feature loss as you can no longer queue items you don't have the materials for?

@Eneocho

Eneocho commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

It is a featureloss, by technicality. But it's also thanks old coders and legacy bug.

@Eneocho Eneocho added Bug / Fix This is either a bug or a fix for a bug. Feature Loss Oh no, where'd this feature go? Legacy Bug Way old content that's bugged. Thanks old coders The world may never know why. labels Jun 1, 2026
@boy2mantwicethefam

boy2mantwicethefam commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

It is a new dawn of scientists being able to tell at a glance if they can actually print something instead of trying it and then failing to do it.
Now that I think about it I believe it might need to be fixed so that it works with bluespace matter bins, the feature might predate it.
I could probably color-code the text that way so that missing resources are red and bluespace-compensated resources are blue.
Also have to fix it for circuit imprinters.

@CrazyAmphibian

Copy link
Copy Markdown
Contributor

make the buttons greyed out instead

@Inorien

Inorien commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

fuck it just make a whole new interface you have Permission

@boy2mantwicethefam boy2mantwicethefam changed the title A few R&D fixes More R&D tweaks and fixes Jun 4, 2026

@Inorien Inorien left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@boy2mantwicethefam pls confirm this

break
update_buffer_size()
else if(has_bluespace_bin() && is_material) //Now extract per fabricator
var/list/other_fabricators = bluespace_fabricators - src

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls correct me if im wrong but does this not imply that installing a bluespace bin and there aren't enough materials locally means that:

  1. it will only attempt to pull material from other fabricators
  2. it will either break and return 1, or not break, print a warning and then return 1 anyway, producing the item for any spend

sorry its 10pm and im tired but this smells weird

@boy2mantwicethefam boy2mantwicethefam Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's not removing the fabricator's own resources if there aren't enough materials, good catch
The early break is so that it doesn't parse needlessly through the rest of the bluespace fabricators once it has pulled enough materials from them.
The return is redundant, I am removing it. I'm keeping the warning though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug / Fix This is either a bug or a fix for a bug. Feature Loss Oh no, where'd this feature go? Legacy Bug Way old content that's bugged. Thanks old coders The world may never know why.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants