Goonstation Forums
A look at botany splicing & more - Printable Version

+- Goonstation Forums (https://forum.ss13.co)
+-- Forum: Discussion (https://forum.ss13.co/forumdisplay.php?fid=6)
+--- Forum: Ideas & Suggestions (https://forum.ss13.co/forumdisplay.php?fid=8)
+--- Thread: A look at botany splicing & more (/showthread.php?tid=6346)



A look at botany splicing & more - UmmonTL - 05-06-2016

I've messed around with botany quite a bit lately and as many people have found it is currently pretty useless. The production of even a single botanist far outstrips any need the station might have and as long as you don't need huge amounts of whatever is grown it is usually quicker to get it somewhere else. The potential for traitors is also rather limited with really only one useful option unique to botany, exploding crops. And while I had fun potatobombing the station I don't think that is quite working as intended.

Roomba already suggested here to add more potency effects which would certainly be nice. My focus is more on the potential I see with crop splicing. 

So, what are the strenghts of botany and splicing?
  • Mass production of crops and the reagents within
  • Harvesting more complex chems directly from plants.
  • Seemingly limitless scaling of how much reagent can be in a single plant
  • Impossible reagent combinations in a unique semi-stable state (both in crops and in honey). From my understanding they react as soon as something triggers a check of the chemical state, this is when they change containers (eating/extracting/rolling a joint) or get heated.
That last part is the most interesting aspect in my opinion. It is obviously kind of a bug but one I find rather cool. Plants allowing you to grow unique combinations that can't be reproduced in a beaker in a lab.

What are the problems I see currently?
  • Mutated plants can't be spliced properly, loosing the unique reagents within (no cannabis containing meth)
  • The variety of reagents available is very limited
  • The reagents within the plant are often lost in processing (no wine containing THC) or lose the semi-stable state and react immediately.
  • Certain plants can't contain reagents though this is rather minor. (e.g. trees)
  • Extracting the reagents in the large amounts you get them is rather slow and tedious.
  • The one useful splice combo (potatobombs/grapes of wrath) is too simple and strong in my opinion. Seething tomatoes were nerfed for similar reasons if I understand correctly.
  • Alien plants and weed type plants have little to no function and are mostly not spliceable.
Now on to the solutions I envision:
Firstly I would like to see more base reagents in the different plants so more interesting reagent combos are possible. In my opinion all plants should contain some sort of reagent regardless of them bearing fruit. 
Secondly the mutated plant variants need to be spliceable as well allowing the additional reagents to be carried over into the spliced version.
Thirldy I would love to see some rarer reagents and other complex chems contained in mutated plants. For example radweed could contain radium and smoldering radweed uranium. Or I could see a plant containing voltagen. Here the balancing gets a bit more difficult of course. 
With these three things splicing could be a whole lot more interesting. For example just adding phosphorous to a plant would suddenly make it possible to have a smoke reaction contained in a plant through splicing. Having salt would allow a plant to make saline-glucose solution when consumed. I would need to make a list for what plants could contain which reagents without breaking all logic but some stuff like having iron in iron wheat just makes sense.
The balancing factor to all of this should be the splice potential of the various plants. You would often need to go through several other plants in between adding more reagents you don't even want and diluting your final product. One more idea for balancing the contained reagents would be to have most plants start out with some sort of basic plant extract. In the case of fruits for example this is already the case with their natural juice. These would further dilute the final spliced product and could be used to determine taste.

The next step would be to have certain plants act as delivery mechanisms. Thrown Tomatoes and eggs could for example work like getting the reagents splashed on you. The slurrypod explosion already splashes the slurry around the area IIRC, it currently can only be spliced with radweed so I have no idea if it could carry other reagents. Lashers could inject their reagents and killer tomatoes and maneaters could be the botany traitor version of a wizard golem. Maybe have clockwork orange acting as a timed reaction?
Again I envision the splice potential being the balancing factor here with the more potent delivery plants being harder to splice into. Tomatoes for ranged splashes might be too simple but apart from that I think a proper balance is possible. Especially if you factor in that even on a 100% splice its 50/50 which source plant the hybrid takes after. So risking limited seeds of alien plants or maneaters on that is a high risk.

Lastly I would love some mass production facilities for botany where you can just dump in your harvest and get the product you want. In the most basic form I imagine it would be a combination of reagent extractor and chemmaster, you select which reagents you want and how they should end up (pills, patches, bottled, etc.). Dump in any number of plants and get as much of the final product as is possible. You don't need to manually click so much, the time it takes should be similar though and maybe add a certain loss percentage.
The cooler version would be an actual assembly line, different machines strung together on a conveyor with different configurations. These could include a heater/cooler, a still and maybe more. No idea where you could fit all this on the maps though.

One final thought I've had is that it would be cool if all vending machines and assembly machines on the station would work with limited tanks containing the necessary reagents. So your medbay vendor wouldn't start with 12 silver sulfadiazine patches but rather contain a tank with enough silver sulfadiazine for 12 patches. A replacement tank could be either ordered from QM (expensive) or filled by botany or maybe mining. It would add a whole level to the station economy though I shudder in horror at how much coding all that would entail. And it could end up being really annoying so let's leave that for another time.


RE: A look at botany splicing & more - Noah Buttes - 05-06-2016

(05-06-2016, 07:03 AM)UmmonTL Wrote: [*]The one useful splice combo (potatobombs/grapes of wrath) is too simple and strong in my opinion. Seething tomatoes were nerfed for similar reasons if I understand correctly.

Technically, you can do this with any crop.

(05-06-2016, 07:03 AM)UmmonTL Wrote: Especially if you factor in that even on a 100% splice its 50/50 which source plant the hybrid takes after. So risking limited seeds of alien plants or maneaters on that is a high risk.

Actually, the genes can be either dominant or recessive.

It's only a 50/50 chance if both your plants are dominant or recessive in the species gene.


RE: A look at botany splicing & more - Vitatroll - 05-06-2016

I've always wished that splices retained mutant strain reagents. I'm guessing this a coding thing and not for balance as we just got back Odd Cig Packets.


RE: A look at botany splicing & more - Noah Buttes - 05-06-2016

Judging from the the code in seed.dm, it seems like it's not a balance thing.


RE: A look at botany splicing & more - UmmonTL - 05-07-2016

I completely forgot about the dominant and recessive parts. So you'd be able to tell which of your manhunter seeds to splice but there would still be the risk of failed splices. 

My assumption in  regards to the mutations was that it's an attribute of that one plant.
The comment
[font=Consolas, 'Liberation Mono', Menlo, Courier, monospace]// Only share the dominant species mutations or else shit might get goofy[/font]
certainly seems to suggest that something of the sort has been tried. Looking at the plantpot.dm it seems that the mutations are special procs that can override or work alongside the normal growth procs. I would guess the additional reagents are added by these mutation procs working alongside the normal growth. Couldn't find where exactly these mutations are defined.


RE: A look at botany splicing & more - Noah Buttes - 05-07-2016

(05-07-2016, 12:55 AM)UmmonTL Wrote: The comment
[font=Consolas, 'Liberation Mono', Menlo, Courier, monospace]// Only share the dominant species mutations or else shit might get goofy[/font]
certainly seems to suggest that something of the sort has been tried. Looking at the plantpot.dm it seems that the mutations are special procs that can override or work alongside the normal growth procs. I would guess the additional reagents are added by these mutation procs working alongside the normal growth. Couldn't find where exactly these mutations are defined.

Hydroponics code is a mess that's distributed all around the repository.

Here's a list of all the ones I could find.

  1. https://github.com/goonstation/goonstation-2016/blob/d8a2d60915fd3b74653a1b7d4b8a0910c6fc2f19/code/datums/controllers/hydro_controls.dm
  2. https://github.com/goonstation/goonstation-2016/tree/d8a2d60915fd3b74653a1b7d4b8a0910c6fc2f19/code/datums/hydroponics
  3. https://github.com/goonstation/goonstation-2016/blob/d8a2d60915fd3b74653a1b7d4b8a0910c6fc2f19/code/obj/submachine/seed.dm
  4. https://github.com/goonstation/goonstation-2016/blob/d8a2d60915fd3b74653a1b7d4b8a0910c6fc2f19/code/obj/item/hydroponics.dm
  5. https://github.com/goonstation/goonstation-2016/blob/d8a2d60915fd3b74653a1b7d4b8a0910c6fc2f19/code/obj/item/plants.dm
  6. https://github.com/goonstation/goonstation-2016/blob/d8a2d60915fd3b74653a1b7d4b8a0910c6fc2f19/code/obj/item/seeds.dm (yes, seeds.dm, not seed.dm)
  7. https://github.com/goonstation/goonstation-2016/blob/d8a2d60915fd3b74653a1b7d4b8a0910c6fc2f19/code/obj/item/food/plants.dm (a separate plants.dm, different from other one)
Then, of course, there's some interactions with chemistry, but I'm not going to include those.


RE: A look at botany splicing & more - UmmonTL - 05-08-2016

Alright I did more codedigging and found some relevant bits though there is some strange code doubling going on.
plantpot.dm has a HYPadd_harvest_reagents proc which as the name suggests adds the reagents as the plant is harvested. Basically it determines the amount the individual fruit can hold based on quality/potency/etc. then it makes a list of reagents that go in it and finally it fills it with an equal amount of each reagent. The relevant part here is how it generates the reagent list:
Code:
proc/HYPadd_harvest_reagents(var/obj/item/I,var/datum/plant/growing,var/datum/plantgenes/DNA,var/special_condition = null)

[...]

var/list/putreagents = list()
    putreagents = growing.assoc_reagents
    if (MUT)
        putreagents = putreagents | MUT.assoc_reagents
    // Build the list of all what reagents need to go into the new item.

    if (special_condition == "rotten")
        putreagents += "yuck"

    for (var/datum/plant_gene_strain/reagent_adder/R in DNA.commuts)
        putreagents |= R.reagents_to_add

[...]

So it takes the associated reagents from the plant being harvested, adds all reagents from the plant mutation and then does some other stuff. The part in plantpot.dm I found earlier is what makes it impossible for mutation reagents to carry over a splice.
Code:
[...]

for (var/datum/plantmutation/MUT in dominantspecies.mutations)
                    // Only share the dominant species mutations or else shit might get goofy
                    P.mutations += new MUT.type(P)

                if (dominantDNA.mutation)
                    DNA.mutation = new dominantDNA.mutation.type(DNA)

[...]

Which means the Hybrid Cannabis seed coming out (->cannabis is dominant) can only get cannabis mutations ergo the reagents added above will be from those mutations. Note the plural though, this is a list of possible mutations which in the case of cannabis obviously contains all the cannabis variants. The seed also gets the same mutation that the dominant species already had.
 Finally the hydroponics folder contains the actual plant data of basic plants, gene strains and mutations. The mutations mostly replace certain variables on their base crop e.g.
Code:
/datum/plantmutation/cannabis/rainbow
    name = "Rainbow Weed"
    iconmod = "megaweed"
    crop = /obj/item/plant/herb/cannabis/mega
    assoc_reagents = list("LSD")

replaces the name of the crop, changes the icon of the plant in the pot and changes the item that spawns when harvested. The reagent list however is obviously not handled as a replacement but as seen above works alongside the base plant reagent list. I thought about what would happen if we allow a mutation on a plant it's not made for and while it would work it would certainly get wonky. However if we take a look at more of the splicing code:
Code:
            var/obj/item/seed/seed1 = src.splicing1
            var/obj/item/seed/seed2 = src.splicing2

            // Now work out whether we fail to splice or not based on species compatability
            // And the health of the two seeds you're using
            var/splice_chance = 100
            var/datum/plant/P1 = seed1.planttype
            var/datum/plant/P2 = seed2.planttype

[...splice chance calc...]

            if (prob(splice_chance)) // We're good, so start splicing!
                // Create the new seed
                var/obj/item/seed/S = new /obj/item/seed(src)
                var/datum/plant/P = new /datum/plant(S)
                var/datum/plantgenes/DNA = new /datum/plantgenes(S)
                S.planttype = P
                S.plantgenes = DNA
                P.hybrid = 1

[...dominant species determination...]

                for (var/datum/plantmutation/MUT in dominantspecies.mutations)
                    // Only share the dominant species mutations or else shit might get goofy
                    P.mutations += new MUT.type(P)

                if (dominantDNA.mutation)
                    DNA.mutation = new dominantDNA.mutation.type(DNA)

                P.commuts = P1.commuts | P2.commuts // We merge these and share them
                DNA.commuts = P1DNA.commuts | P2DNA.commuts
                P.assoc_reagents = P1.assoc_reagents | P2.assoc_reagents

[...mixing the other attributes and the rest...]

The trick would be to add another variable recessiveDNA which is filled with the DNA from the side that loses in the domination "battle" I skipped. Then in that last line where the reagent list of the new plant is determined by simply throwing the lists of both spliced plants together we could check if the recessiveDNA is mutated and if so add the reagents from that mutation as well. E.g.
Code:
                P.assoc_reagents = P1.assoc_reagents | P2.assoc_reagents

                if (recessiveDNA.mutation)
                    P.assoc_reagents = P.assoc_reagents | recessiveDNA.mutation.assoc_reagents
No guarantee that this is correct code.
Now the resulting hybrid would have the reagents of both plant species and the existing mutation from the non-dominant species. And it would still have the mutation of the dominant species or it could gain one from that list and add those reagents. AND it could then be further spliced into another plant. 
What I am not sure about is how this splicing system currently stops adding the same reagents over and over if the same seed is spliced again and again. Might be that duplicates are eliminated elsewhere. The other thing I noticed is that we actually have three plants.dm, one in the hydroponics folder, the other two listed by Noah containing data about the resulting crops, sub-items like sliced fruit, brew results and other stuff. Now these latter two sometimes have their own reagent lists for the items and I'm not exactly sure where those are used.
Finally what would that allow? You could easily splice poisons into regular foodstuffs but it's not like eating fruit you find lying around is actually safe as it is.

PS: Is there a way to spoilertag stuff like the codesections btw?


RE: A look at botany splicing & more - UmmonTL - 05-11-2016

Alright so I managed to get a testbuild running and it did work as easily as it seemed, I need to do some further testing but I will try to get a patch together.