Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Feature] Functional Organs, also some Cyber Organs(updated)
#1
Okay, this is a long time coming, and there's a bunch of stuff in this patch, I'll outline it here. I'm calling it finished, but there are still some things that "technically" need doing. Mostly the Cyber Organ functions and such. When I originally set out to do this project I wasn't even thinking about Cyber Organs, but about halfway through I decided to put them in. But I didn't really have any idea what sort of function most of them should have. So I figure I can field some ideas here or if someone wants to contribute, they can add a function to the organ's(There's not much too it, unless you want to get really fancy).

This patch adds in functionality/surgery for all organs that currently existed in organ.dm for which there were sprites. Here are all the ones I've added and a summary of their attached functionality:

- Liver - Supposed to allow for "metabolizing" toxins. To simulate this, Liver takes damage based on tox damage taken. If it "dies" then you start taking tox damage perpetually until replaced and depletion rates of chems slows.
- Kidneys - Basically the same as the Liver, both need to die for you to experience the bad effects. 
- Pancreas - Produces insulin in response to sugar in the bloodstream
- Spleen - Needed for natural blood regeneration. 
- Lungs - Needed to breath and for stamina. Losing one drastically lowers stamina and you'll gasp every so often. Losing both, you'll have basically no stamina and die after a minute or two with no aid.
- Appendix - Does nothing, but there is a minor random event that can afflict someone with appendicitis. 
- Stomach & Intestines -does nothing currently. mbc said he'd possibly tie them into the motive system.


Surgery

All of these organs are operable. I had to weirdly work in the current surgery system, which was tough. Code wise all of it changes the op_stage of the chest area. Here is the tree to see how it works. The video also shows it in action.

//this exists in the code, just leaving it here
------------------------------------------------------------------------------------
chest op_stage description
snip = surgical scissors/garden snips

op_stage = (actions you can take) -> where it will send you
0.0 = snip -> 1.0 || cut -> 5.0
1.0 = snip -> 3.0 || cut -> 4.0 || (G)saw -> 2.0
2.0 = cut is remove lungs R/L
3.0 = snip is remove appendix || cut is remove liver
4.0 = snip is remove stomach || cut is remove intestines
5.0 = snip -> 6.0 || cut -> 7.0 || saw -> 8.0
6.0 = snip is remove pancreas || cut is remove spleen
7.0 = snip is remove kidneys

8.0 = cut -> 9.0
9.0 = saw is remove heart


remove lungs = snip -> saw -> snip -> Right/Left hands for removing R/L lungs -

remove appendix = snip -> snip -> snip -
remove liver = snip -> snip -> cut -

remove stomach = snip -> cut -> snip -
remove intestines = snip -> cut -> cut -

remove pancreas = cut -> snip -> snip -
remove spleen = cut -> snip -> cut -

remove kidneys = cut -> cut -> snip -> Right/Left hands for removing R/L kidneys -

remove heart = 0.0 cut -> 5.0 saw -> 8.0 cut -> 9.0 saw//Also with these, you need to "close up" by suturing the chest after you get to the end path before going down another path.
--------------------------------------------------------------------------------------------------------

video demos:

surgery - https://streamable.com/ky3rn

organ functions - https://streamable.com/wu0ck

organ damage and failure diseases - https://streamable.com/s3vpn

EDIT: also, I forgot to say. Sundance has kindly agreed to make some cyber organ sprites for this, they're almost all done, but I'm gonna add them all in at once when they are. So they aren't in yet.

----------------------------------------------------------------------

More description:

- So it looks like there are a lot of new lines of code because of this and I feel bad about it, but there isn't much I can do about it. The bulk of it comes from organ.dm, surgery.dm, human.dm, and the new organ failure diseases in code/datums/diseases/organ_diseases. For most of this, I didn't really see any way around it, I was trying to stick with the current conventions for new organs to add, which means a tonne of lines in organ.dm and surgery.

- Stamina changes due to lungs VS current cyber heart stamina changes. So I wrote this annoying proc called handle_lungs_stamina() in organs.dm that adds stamina modifiers and removes them based on the number of lungs. The cyber heart doesn't have anything like that. When a cyber heart is added to a human, the human gets that stamina buff, when they lose that heart, they lose the debuff. Period. It doesn't matter if the heart is broken or the patient has flatlined, its human has that stamina buff as long as the heart is in their body. But with my new organs, a lung can get damaged enough so that it does not function anymore and when that happens I wanted their stamina to suffer. Because of this constraint I imposed on myself for this organ system it's going to have to check the number of lungs each life tick and change the stamina correspondingly. And that sounded intensive to be adding and removing stamina each tick, so the proc just checks if the number of working lungs changes and it does THEN AND ONLY THEN does it change the stamina modifiers. So it's really doing a much less intensive process each life tick, though I guess it could be improved efficiency wise by doing this every 10 or 20 life ticks or something.

--------------------------------------------------------------------

What is unfinished:

- Flavour text for some surgery steps and disease effects. This stuff I kinda just stopped on, but they usually say something. I don't know enough about medicine IRL to make it sound accurate so i just settled for ridiculous or generic stuff. Updated flavor text, things look unique and I think OK. It's the best I can do.

- Functions for cyber appendix/pancreas/spleen/kidneys. I didn't know what interesting stuff could be done with these so they'll exist, but not do anything other than a normal organ. EXCEPT all cyber organs take damage from EMP's.

- Maybe a recipe for chemistry crafting the organ healing drugs. Right now they just dispense from medical vendomats.

- Some other unexpected ways to injure organs. Currently there is stuff like drinking too much or eating too much sugar, or smoking. But there should be some other ways that can cause damage, I kind of wanted some secret ones, or ones that weren't obvious, but maybe that's asking too much. I stopped where I did because I felt like I'd be making a tonne of single line changes everywhere and that would get so cluttered.

- Like Zewaka said, gotta clean up some useless extra lines and stuff. Removed useless extra lines and issues. 

- Also, I don't know if I should call this next part "Unfinished", but this new organ system is not used by the heart, brain, or butt organs. This was intentional on my end, for one thing, in my patches I usually want to try to change as little existing code as possible and rewriting the heart/brain surgery health/diseases to fit with these new non-vital organ additions would just make it terrible to merge.

https://github.com/goonstation/goonstati...l/73/files
Reply
#2
this needs a lot of cleaning up and finishing


also to clarify for people who read (G) means grab intent, (D) means disarm intent
Reply
#3
Stomach and intestines suggestions: Make them containers inside you

Stomach: When you eat things, they go into the stomach. When it's full, eating something else pushes an item through to the intestines. Puking empties the stomach. Removing the stomach from someone allows you to open it up and examine, remove, or add items.

Intestines: When an item is passed into the intestines, it becomes partially digested. The more items in the intestines, the louder your farts are. Using the bathroom empties the intestines.
Reply
#4
I had been planning to try and work up something similar to this and think it would be an excellent addition. Im amazed by how closely the way I imagined this system has been implemented into your patch. Nice work
Reply
#5
The organ system here is really neato, but I'm wondering about how intuitive the surgery steps are. Right now, it's really easy to remember surgery without having to look at the wiki, but with the organ system it may be a little more complicated. Maybe add some kind of menu after their chest is cut that has a list of all organs and lets you easily interact with them?
Reply
#6
I'd be extremely interested in some more simulated organs, if this gets finished to a standard that zewaka + co are happy with.
Reply
#7
(08-04-2018, 06:04 PM)Triacontakai Wrote: some kind of menu

please no


how about a different tool? Use the hemostat? Stapler? Spoon?
Reply
#8
(08-05-2018, 03:50 PM)ZeWaka Wrote:
(08-04-2018, 06:04 PM)Triacontakai Wrote: some kind of menu

please no


how about a different tool? Use the hemostat? Stapler? Spoon?

Yeah, hard agree. Those html popup menus are terrible for everything except computers and some things. I have heard tell of a "secret" type of menu that could be more use friendly and not break immersion, but I don't have access to that. 

But yeah, Triacontakai is right. The surgery steps I made for it aren't super intuitive. I want to say that is by design, because I wasn't trying to make a whole "new" surgery system, just a bare bones way to get organs in and out. And the easiest way to do that within the tools I had seemed to be to change pathways based on surgeon intent. 

As to why I didn't make it use a different tool, I felt like using the scalpel was the most accessible and easiest to visualize I probably don't know more than the average person about medicine or surgery and I didn't want to spend time trying to figure out what would be the most realistic tools to use. Then I'd have to create them and people might not even like them and want to use it. Plus having a bunch of other tools for each thing seemed tedious, and for these new organs it seemed that removing these organs wouldn't really take much more than a scalpel and knowledge. 

But since it's mostly bare bones with the scalpel, it wouldn't be too confusing to change out my steps for something else so long as whoever does it follows the tree I made and switches it accordingly. (Also, I don't think it's too much less intuitive than current surgery. In the course of my testing, I think I've got a decent handle on how take out which organs)
Reply
#9
does Grab Intent chest cutting not overlap with the current chest surgery fun ?
Reply
#10
Okay, I've made some updates, some requested and some that I just decided to do while bored and waiting for sprites. I still stand by my original work and think that it was still basically ready at that point, but having said that, there are more than a few changes made. I'll list all of the ones I can remember here.

 - Requested by Zewaka, I've added a new surgery tool for getting at the new organs, Garden Snips. The sprite was made by Kmc from discord and I did a bunch of recolors on the handle because I wasn't sure which would be easiest to see when laying on a floor or table. I'll update the surgery pathway in the original post so you can see what they'll look like now. I just want to go on the record saying it was very frustrating to change from the original intent-based paths to using this new tool.
[Image: Pv5V6vy.gif]

- The other change that appears large was my addition of a new health scanner organ upgrade. This was kind of an afterthought as I previously had all reagent scan upgraded analyzers output the organ damage, but I thought that maybe it could get cluttered. So now there are health analyzers for: standard, reagent-scan, organ-scan, both-upgrades. The scanners have an obfuscated message showing damage instead of a number(minor, moderate, significant, critical) like how brain damage currently works, but the admin check_health power shows the damage number.
[Image: xQ6DB4F.png]

- I added a minimum stage duration for diseases. Partly for testing and partly because it always annoyed me that due to bad luck you can go from stage 1 to stage 5 in like 10 seconds. This can be removed I guess if you don't want it. Also, I considered making all the organ failure diseases have a chance to do organ damage to their specific organ and maybe another one at every stage, but right now it only damages the organ at the final stage. Not sure what's best from a balancing standpoint so I just decided to err on the side of caution and make them less dangerous.

- Also requested by Zewaka, Brain damage is converted to new organ system. Now for humans with an organHolder, all brain damage will physically damage the brain organ, instead of just a brain damage var on mob/living/carbon/human. I just did a simple override of the do brain damage proc somewhere in human.dm I think.

- Mostly converted the Heart to the new system. In terms of surgery pathing and damage. Hearts take damage during the heart failure disease at the final stage. 

- I realized that from the player's perspective, there are a lot of new things here regarding surgery, so I thought it best to write up an in-game surgery textbook that can be found in medbay along with the standard medical textbook. This surgery book describes some of the orginal surgery, and is mostly focused on the new stuff I've added in my patch. There are some extra little things about organ specifics and such I won't mention in this post, but I allude to in the book. Of course, you could just read the source code to learn all that anyway.
[Image: xA38g0n.png]

- You can sell these organs at the QM. I wanted to make it so that damaged organs are worth less than pristine ones, sort of like the material quality from mining. But that isn't in 2016, so I thought it best to leave it and hopefully someone in the know will leverage that system for organs. 

- Added cyber organs as fully as I'm willing to do at the moment: The first 3: Lungs, Stumach, and Liver were made by Sundance. The next 3: Kidneys, Pancreas, and Spleen were made by Navi.OS. The last 2: Intestines and Appendix were done by me. I just recolored the original sprites for those, if someone thinks they can do better, I encourage you to do so.
[Image: YsbZkaZ.png] [Image: 0ebfIU9.png] [Image: yEps853.png]  [Image: pzGoi2J.png] [Image: NJ0bwWQ.png] [Image: Nk8s47X.png] [Image: BpKynDi.png] (I removed the appendix image here since it's boring and I'm only allowed 10 images per post)

    - The cyber organs, all have functions that make them "superior" to meat organs. Each organ offers a slight stamina regen/maximum buff and some organs have unique functions to make them better than regular. For instance, Cyber Liver doesn't take damage from Ethanol overdoses like the regular liver does, it get's healed by it! And the Cyber Appendix doesn't explode killing you like the regular appendix, it had a chance to inject some weak healing chems into you if you go into crit.
    
    -Also Cyberorgans all take damage from emp grenades now. It's only 20 burn damage I think now, but it can be changed for balancing.
Reply
#11
Hnnnnngh I want to make a bionic man/woman now. Patch looks awesome. Looks like a lot of learning, but thats part of the fun in my mind.
Reply
#12
Patch sounds cool, but I have a question:

If you perform stomach-surgery on someone that is mid-digesting, does the "digested glob" come out?
Reply
#13
(09-14-2018, 11:17 AM)MeWaka Wrote: Patch sounds cool, but I have a question:

If you perform stomach-surgery on someone that is mid-digesting, does the "digested glob" come out?

Not yet. Currently the stomach and intestines are non-functional since the current digestion system doesn't exist in 2016. So this will depend on whichever coder decides to merge it.
Reply
#14
(09-14-2018, 11:27 AM)kyle2143 Wrote:
(09-14-2018, 11:17 AM)MeWaka Wrote: Patch sounds cool, but I have a question:

If you perform stomach-surgery on someone that is mid-digesting, does the "digested glob" come out?

Not yet. Currently, the stomach and intestines are non-functional since the current digestion system doesn't exist in 2016. So this will depend on whichever coder decides to merge it.

Hmm, okay.

Will there be synthetic plant version of the new organs?
Reply
#15
(09-15-2018, 09:29 AM)MeWaka Wrote: Will there be synthetic plant version of the new organs?

This patch does not contain Synth organs. I had no particular ideas for what they should be able to do. I barely knew what to do with cyber organs.

But, this is set up in such a way that it will be relatively simple to add functional Synth organs provided someone makes up sprites and has ideas about what each should do.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)