Page 2 of 4

Re: Dismemberment & Organs

Posted: Wed Jun 17, 2015 6:35 pm
by Ricotez

Bottom post of the previous page:

Today I came up with a new idea to balance dismemberment. I haven't implemented anything yet, so let me know what you think of this.

Every weapon that can dismember has a damage threshold. The damage on the limb has to be at or above that threshold before that weapon can dismember it. Right now the brute damage that a destroyed limb counts for is lower than the max damage of an attached limb, so if you dismember a badly damaged limb you actually increase someone's health, but...
Anyway, to give a few examples: for eswords this value would be 0. For fireaxes maybe 0 or something low like 10 or 20. For botanist hatchets it could be something like 40-50, and for bonesaws maybe 70-75 (the cap on arms and legs) since they can be mass-produced in autolathes.

Maybe we should exclude heads from most items, though.

Re: Dismemberment & Organs

Posted: Wed Jun 17, 2015 6:46 pm
by Remie Richards
DTs (Damage Thresholds) or DRs (Damage Resistances) are good ways to balance this, Yes.

Where DT would be a value of health the limb needs to be at, and DR being a percentage of health the limb needs to be at from it's maximum (I'd lean towards DR as it allows for easier scaling of limb health and strength in that odd mysterious thing called the future)
Up to you.

Re: Dismemberment & Organs

Posted: Wed Jun 17, 2015 6:59 pm
by TechnoAlchemist
I feel like the esword should have a higher dismember chance than a fireaxe.

Since y'know, it's practically a lightsaber.

Re: Dismemberment & Organs

Posted: Wed Jun 17, 2015 7:05 pm
by Wyzack
That was what he suggested. The E sword having a value of 0 means it can cut off limbs without the limbs having any prior damage

Re: Dismemberment & Organs

Posted: Wed Jun 17, 2015 7:54 pm
by TechnoAlchemist
Oh, woops!

Re: Dismemberment & Organs

Posted: Wed Jun 17, 2015 8:14 pm
by One Seven One
I can see it now "Ah shit I'm dieing and I need health! I know, I'll chop off my own arm to get me through!"
Can we keep that? It sounds great.

I like that system. It's fair while still being threatening. I think it would be best to take heads off the chance to dismember, it'll give people a reason to aim for anywhere else in combat and not instantly kill people. Maybe we can have a head choppable only after the person is dead? It'd give lings/people trying to kill lings an easier chance to remove brains if they can carry the head around with them at the cost of say.. a constantly bloody backpack.

Quick question. I'm not sure how the code works but how would this effect cloning? Would they need the head attached since it has a "Mental interface" pop up on the cloner or would the entire body with no head/just the head work?

Re: Dismemberment & Organs

Posted: Wed Jun 17, 2015 8:31 pm
by Ricotez
One Seven One wrote:Quick question. I'm not sure how the code works but how would this effect cloning? Would they need the head attached since it has a "Mental interface" pop up on the cloner or would the entire body with no head/just the head work?
I still have to update the cloning code, but I will require the head with brain to still be attached to the body for the cloning to go through. What I have not yet decided on is whether to allow the cloner to clone someone from just a head with a brain, so without the rest of the body.


EDIT: I should specify that I will specifically check if the brain is still in the body. But since the brain is a child of the head, this means the head still has to be attached too.

EDIT 2: Alright, so progress for today is: found a bunch more special cases that I had to update for datums and organsystems, still haven't gotten the new body renderer to work. As soon as I do I might run a few open test rounds, it's much easier to find bugs in a stress test.

Re: Dismemberment & Organs

Posted: Thu Jun 18, 2015 4:00 am
by PKPenguin321
That seems like a huge, unneeded buff to eswords and axes. Being able to heal people with it is pretty bad, too. However, I do like it more than getting dismembered being based on RNG...

Re: Dismemberment & Organs

Posted: Thu Jun 18, 2015 8:04 am
by Fr05tByt3
PKPenguin321 wrote:That seems like a huge, unneeded buff to eswords and axes. Being able to heal people with it is pretty bad, too. However, I do like it more than getting dismembered being based on RNG...
What do you want, then? Either LEL I CAN CHOP OFF ARMS WITH HATCHET BUT NOT LIGHTSABER LELELELE REEEEEEEEE
or no dismemberment at all?

Also, how much damage does an arm do when you hit someone with it? I think a leg should do more damage than an arm.
And a clubbed tail should do more damage and non-clubbed.

Re: Dismemberment & Organs

Posted: Thu Jun 18, 2015 1:04 pm
by Ricotez
PKPenguin321 wrote:Being able to heal people with it is pretty bad, too.
I'll shed some more light on what is the problem here.

The maximum damage any single arm or leg can sustain is 75 damage, in any combination between brute and burn damage.

Now this damage is stored in the limb itself. If you burn your arm and then cut off your arm, the burn is still on your arm even though it's not a part of your body any more. Therefore, when a character is dismembered in the game, the injuries on that limb are no longer a part of their body.

I solved this by giving limb datums a "destroyed_dmg" var. This is the damage that will be used to calculate your total damage if that limb is missing. But I decided to set this value to 40 instead of 75 for arms and legs. Why? Because with 75, cutting off 2 arms or legs sends someone into crit, and cutting off 3 kills them. With 40, you have to cut off at least 3 arms or legs before someone goes into crit, and you can never kill them just by cutting off all four (4x40 = 160 and you die at 200 total damage). I don't count heads here of course, since your brain is a vital organ your body dies the instant you are decapitated. Also this doesn't take into account the proper removal of limbs, where the wound is closed; if you do that the limb does not count for any damage at all, but it's a surgical procedure.

It's an issue with the way we calculate damage that I had to find a solution for. This is the best one I could come up with. I agree it's not perfect, but I personally don't have a better idea. You can think of it like how even in real life doctors sometimes have to amputate limbs that are too damaged.

Re: Dismemberment & Organs

Posted: Thu Jun 18, 2015 10:41 pm
by Ricotez
Progress for today:

Image

I finally figured out the mistakes I made while adjusting RemieRichards' code. There are still a few minor bugs left after this, but at least limbs render properly now.

Re: Dismemberment & Organs

Posted: Fri Jun 19, 2015 3:09 pm
by Miauw
Is there any chance to add a bloody stump as long as the dismembered limb is still bleeding?

Re: Dismemberment & Organs

Posted: Fri Jun 19, 2015 3:44 pm
by Ricotez
Miauw wrote:Is there any chance to add a bloody stump as long as the dismembered limb is still bleeding?
Scones offered me to make such sprites, so yeah!

Re: Dismemberment & Organs

Posted: Fri Jun 19, 2015 7:17 pm
by Lumbermancer
Do you think robotics will handle the additional load of making prosthetics for each inevitably amputated limb of every person? What about the possible prolonged handicap of lacking limb if there will be no means to get you a new one?

Re: Dismemberment & Organs

Posted: Fri Jun 19, 2015 7:24 pm
by Ricotez
Lumbermancer wrote:Do you think robotics will handle the additional load of making prosthetics for each inevitably amputated limb of every person?
Given that (at least right now) the prosthetic is a regular cyborg arm I don't see why not. Maybe in the future I'll add "advanced prosthetics" that don't even require surgery: apply them to a dismembered stump and the prosthetic connects itself to your body.
Lumbermancer wrote:What about the possible prolonged handicap of lacking limb if there will be no means to get you a new one?
I thought that was the whole appeal of dismemberment? It has a very serious impact on the rest of your round. That's why I'm trying to balance it so dismembering someone against their will is not easy.

Re: Dismemberment & Organs

Posted: Fri Jun 19, 2015 7:28 pm
by Wyzack
>But if my arms get cut off i will be at a DISADVANTAGE! WTF man?

Well no shit, is that not entirely the idea?

Re: Dismemberment & Organs

Posted: Fri Jun 19, 2015 8:12 pm
by allura
my only suggestion: remove damage caps from limbs

Re: Dismemberment & Organs

Posted: Fri Jun 19, 2015 8:13 pm
by Ricotez
allura wrote:my only suggestion: remove damage caps from limbs
that falls way out of the scope of this update, damage caps on limbs have existed for as long as I can remember and they are an integral part of game balance

this is probably better off in the suggestion or policy discussion forums

Re: Dismemberment & Organs

Posted: Fri Jun 19, 2015 10:26 pm
by MisterPerson
Limb damage cap was literally just so space doesn't cause infinite damage.

Re: Dismemberment & Organs

Posted: Fri Jun 19, 2015 11:04 pm
by MMMiracles
I thought the point of capping limb damage was to prevent 90% of armor ingame being completely negated by aiming for the arms or legs?

Re: Dismemberment & Organs

Posted: Fri Jun 19, 2015 11:26 pm
by Ricotez
Progress for today:

I'm finishing up the penalties for not having arms. To avoid having to edit every single instance of attack_hand, I perform a check BEFORE it is ever called, in the click code itself. I'll probably add an exception for telekinesis, but other than that you can now not perform any kind of world interaction with a hand you don't have.

If an item ends up in a hand you don't have anyway, you instantly drop it. Interestingly right now you can still interact with items that you are wearing, so you can strip yourself without hands. I'll fix that too.

We're slowly getting there. I have to figure out what to do without legs (high chance to drop on the ground or some kind of new crouch ability), and after that I have to add code that makes you bleed if you have an open limb stub. Then the basic system should be in place, and I can add methods of dismemberment.

Re: Dismemberment & Organs

Posted: Sat Jun 20, 2015 1:09 am
by AdenAbrafo
I don't code but why not use the handcuff code for missing arms?

Re: Dismemberment & Organs

Posted: Sat Jun 20, 2015 1:34 am
by Ricotez
That's actually a really good idea, I completely forgot about that. I'll look into it tomorrow.

Re: Dismemberment & Organs

Posted: Sat Jun 20, 2015 1:56 am
by One Seven One
Oh, how will this effect changelings? Since the arm blades and shields they create are technically in their hands I believe.
Also, how would handcuffing someone missing an arm work? It could be a kind of silly plus side if it just didn't effect them.

Re: Dismemberment & Organs

Posted: Sat Jun 20, 2015 2:10 am
by Wyzack
I assume flesh mend will regrow limbs? I am so friggin hype for this, keep up the good work Rico

Re: Dismemberment & Organs

Posted: Sat Jun 20, 2015 3:02 am
by MMMiracles
Make arm blades replace the arm of the active hand when used. Being able to chop off arm blades for free melee weapons sounds like a fun trophy item to get off a killed ling.

Re: Dismemberment & Organs

Posted: Sat Jun 20, 2015 10:52 am
by Tokiko2
If you lose a limb in a fight, will there be any way to reduce/heal the 40 damage caused by the loss of it without actually replacing the limb? I do think that this should be possible, even if it would require extra surgery.

Losing a limb in a fight, then visiting medbay to get your wounds fixed should not leave you in a worse situation than having the same limb surgically removed. It doesn't really make a lot of sense. Sure, the improper removal of a limb may have caused some damage, but medbay should be able to fix that(without having to actually replace the limb).

Re: Dismemberment & Organs

Posted: Sat Jun 20, 2015 12:24 pm
by Ricotez
One Seven One wrote:Oh, how will this effect changelings? Since the arm blades and shields they create are technically in their hands I believe.
I'm not entirely sure, but since changeling items cannot be dropped my guess is they will stay in the hand slots. Unfortunately the intercept only happens on unarmed contact right now, so they will probably be able to still use them. I'll have to test and fix that.
One Seven One wrote:Also, how would handcuffing someone missing an arm work? It could be a kind of silly plus side if it just didn't effect them.
Right now you can handcuff someone who has one hand (but not someone who has no hands). I still have to modify the code so that the handcuffs have no effect if you have only one hand.
Wyzack wrote:I assume flesh mend will regrow limbs? I am so friggin hype for this, keep up the good work Rico
Yeah, I always intended to have changelings be able to regrow their limbs. Fleshmend is a good way to do it.
MMMiracles wrote:Make arm blades replace the arm of the active hand when used. Being able to chop off arm blades for free melee weapons sounds like a fun trophy item to get off a killed ling.
That's a pretty good idea, but it involves a lot more code editing because I'd have to add more exceptions to unarmed combat code. I might do this in a future iteration.
Tokiko2 wrote:If you lose a limb in a fight, will there be any way to reduce/heal the 40 damage caused by the loss of it without actually replacing the limb? I do think that this should be possible, even if it would require extra surgery.

Losing a limb in a fight, then visiting medbay to get your wounds fixed should not leave you in a worse situation than having the same limb surgically removed. It doesn't really make a lot of sense. Sure, the improper removal of a limb may have caused some damage, but medbay should be able to fix that(without having to actually replace the limb).
I haven't explained this very well in this thread yet, but there are 2 different statuses a lost limb can have: ORGAN_DESTROYED and ORGAN_REMOVED. (Right now there is also ORGAN_DESTROYED_NOBLOOD but I'm still figuring out how to do the bleeding system on destroyed limbs.) In DESTROYED, the limb is considered to have been ripped off forcibly and you have a massive injury on the stub. In this state, you suffer the 40 damage (and will likely also constantly bleed unless you receive some first aid). In REMOVED, the limb is considered to have been properly removed, and the injury is treated and sealed up. In this state, you don't suffer any special damage from the missing limb (but of course penalties such as not being able to use a hand still apply). I'll add a surgical procedure that lets Medical seal up a dismemberment to turn DESTROYED into REMOVED. In addition I am considering ways to temporarily reduce the impact of a DESTROYED limb, such as tying a belt around the stub. Something like that.

Re: Dismemberment & Organs

Posted: Sat Jun 20, 2015 9:10 pm
by Celdur
I can already see people intentionally removing their arm so that they can't get cuffed by sec.
I'm guessing a straightjacket would still work?

Re: Dismemberment & Organs

Posted: Sat Jun 20, 2015 9:46 pm
by Cik
you can still cuff a one armed man, and if they chop off both arms to escape sec more power to them i guess considering they won't be able to hold or manipulate anything

Re: Dismemberment & Organs

Posted: Sat Jun 20, 2015 10:20 pm
by Ricotez
Celdur wrote:I can already see people intentionally removing their arm so that they can't get cuffed by sec.
I'm guessing a straightjacket would still work?
Intentionally removing your arm means that:

1. You have one less hand to work with.
2. You suffer a permanent 40 damage and permanent bleeding unless you get surgery.
3. I intend to enable people to still drag you along without you being able to do anything about it when you're cuffed.

And yeah, straightjackets are handled separately. They are not affected by arms.

Re: Dismemberment & Organs

Posted: Sun Jun 21, 2015 9:28 am
by Alex Crimson
Could you not give Medbay a machine that accepts organic material(limbs, organs, corpses, monkeys etc) as a resource and can create new limbs/organs? Something similar to an Exosuit Fabricator.

Re: Dismemberment & Organs

Posted: Sun Jun 21, 2015 10:31 am
by lumipharon
Limb extruder

Like those spaghetti grinder things, only instead of dough going in, you have lumps of meat, bone and othe misc organics.

Re: Dismemberment & Organs

Posted: Mon Jun 22, 2015 8:34 am
by Not-Dorsidarf
Make it a function of the Gibber, that you can toggle "makes steaks" and "makes limbs"

Then add recipies made with limbs

Re: Dismemberment & Organs

Posted: Mon Jun 22, 2015 10:20 am
by DemonFiren
Like what, finger food?

Re: Dismemberment & Organs

Posted: Mon Jun 22, 2015 12:06 pm
by Ricotez
Woo I did not mess up my merge this time, the branch has been updated without any trouble.

Anyway, progress was a bit slow this weekend because of a bunch of stuff happening. Especially on Father's Day I had almost zero time to work on the code. The work I did do was finish up the hand penalties, there are a few bugs left to work out but it's pretty much done and you can no longer use a hand you don't have.

Unfortunately there is one final bug that persists with the renderer, which is that body parts don't get updated properly unless I force regenerate_icons. Not even upon spawn, my skin colour is always the wrong one.

Re: Dismemberment & Organs

Posted: Mon Jun 22, 2015 8:20 pm
by Ricotez
I've added all the necessary procs and variables to allow for dismemberment. Attack code for a weapon only has to call a proc with a limb, and that proc will determine if the limb gets dismembered or not. I literally have to add only a single line now, and every item in the game will have the potential to dismember and behead.

The problem is, I can't find attack code.

Re: Dismemberment & Organs

Posted: Mon Jun 22, 2015 8:33 pm
by ThanatosRa
... Special headless clone that you can harvest limbs and organs from? Maybe needing to make a monkey man then use your SE/UI whatever to make that monkey into you so You can safely harvest it?

Re: Dismemberment & Organs

Posted: Tue Jun 23, 2015 4:29 am
by Luke Cox
While you're working on a new limb system, is there any chance we'll see an enhanced augmentation system? I laid out a few ideas here if you want to have a look

Re: Dismemberment & Organs

Posted: Tue Jun 23, 2015 10:35 am
by DemonFiren
You're gonna have to pay him extra for that.

GO GO GET ANOTHER GAME!

Re: Dismemberment & Organs

Posted: Tue Jun 23, 2015 11:04 am
by Ricotez
Luke Cox wrote:While you're working on a new limb system, is there any chance we'll see an enhanced augmentation system? I laid out a few ideas here if you want to have a look
I fully intend to expand the system to cover all organ-related things, yes. But as I've explained in the first post, I try to approach this problem in iterations. It's simply too much work to try and do everything I want to immediately in the first iteration, and by pushing the basic system first the server can play around with it and give me feedback, which allows me to balance it.

Speaking of feedback, I have some problems with bugs, so I might ask MSO to set me up with a test server before I create the PR for the final product.

Re: Dismemberment & Organs

Posted: Tue Jun 23, 2015 7:34 pm
by Wyzack
I would love to help play test this, it will probably be on MSO's lag fest temp server that appears on the tgstation page from time to time, correct?

Re: Dismemberment & Organs

Posted: Tue Jun 23, 2015 10:54 pm
by Ricotez
Progress for today:

With Remie's help I found the part of the code where the dismemberment check needs to be added. But now that weapons can actually dismember, I realized the way the code handles datums and item separation isn't really working very well when organs depend on other organs (your brain in your head etc), so I'm trying to find a good way to deal with that right now.

Re: Dismemberment & Organs

Posted: Wed Jun 24, 2015 4:17 am
by Fr05tByt3
Ricotez wrote:Progress for today:

With Remie's help I found the part of the code where the dismemberment check needs to be added. But now that weapons can actually dismember, I realized the way the code handles datums and item separation isn't really working very well when organs depend on other organs (your brain in your head etc), so I'm trying to find a good way to deal with that right now.
You sound like you're getting excitingly close to getting these features server-ready.

Re: Dismemberment & Organs

Posted: Wed Jun 24, 2015 11:02 am
by Ricotez
Well, right now I just gave every organ item a new list, internal_organs, because I figured that the number of instances where I have to move organs into other organs because a limb got dismembered is actually really limited (most organs depend on the chest, and you cannot dismember a chest). The only limb it is relevant for right now is the head, because the brain needs to be moved, so that's what I will try this out with.

So with that, all that remains is the surgery, health checks that apply bleeding if you have a limb set to ORGAN_DESTROYED (and probably also makes you fall down every now and then if you miss legs), I have to look at the code that changes you into a monkey and back, and I'll have to update a few of the changeling abilities to account for the new limb system. After that we should probably test it on MSO's test server, because I am sure there are a whole bunch of special cases I forgot.

Right now, unfortunately, my code won't compile for a reason that I hope is not my own fault.

Code: Select all

code\game\gamemodes\malfunction\malfunction.dm:215:error:= : bad text
The line in question looks like this, and as far as I know it has not been changed in a long time:

Code: Select all

set desc = "Activates the self-destruct device on [world.name]."

Re: Dismemberment & Organs

Posted: Fri Jun 26, 2015 12:45 am
by Ricotez
For some reason, damage is horribly bugged right now. I'm slowly starting to isolate the issue, but it definitely delayed my progress by a lot.

Re: Dismemberment & Organs

Posted: Fri Jun 26, 2015 7:36 am
by Not-Dorsidarf
Ricotez wrote:Well, right now I just gave every organ item a new list, internal_organs, because I figured that the number of instances where I have to move organs into other organs because a limb got dismembered is actually really limited (most organs depend on the chest, and you cannot dismember a chest). The only limb it is relevant for right now is the head, because the brain needs to be moved, so that's what I will try this out with.

So with that, all that remains is the surgery, health checks that apply bleeding if you have a limb set to ORGAN_DESTROYED (and probably also makes you fall down every now and then if you miss legs), I have to look at the code that changes you into a monkey and back, and I'll have to update a few of the changeling abilities to account for the new limb system. After that we should probably test it on MSO's test server, because I am sure there are a whole bunch of special cases I forgot.

Right now, unfortunately, my code won't compile for a reason that I hope is not my own fault.

Code: Select all

code\game\gamemodes\malfunction\malfunction.dm:215:error:= : bad text
The line in question looks like this, and as far as I know it has not been changed in a long time:

Code: Select all

set desc = "Activates the self-destruct device on [world.name]."
This is absolutely not your fault at all. Someone merged something bad in. I have that error too.

Re: Dismemberment & Organs

Posted: Fri Jun 26, 2015 2:45 pm
by Ricotez
Currently humans have one new var called organsystem that keeps track of all organdatums in a list. The few dependencies that do exist are all hard-coded, and not inherent in the data structure. Ever since I began running into the limitations of this system I realized that there would be a point in the future in which I'd have to rewrite it, so I will cut to the chase and do that right now.

The organsystem will retain a list of organs that are currently a part of it, to make finding organs easier. But in addition, I'll give every organsystem a reference to its "core", the organ that all other organs depend on. This organ cannot be removed from the mob except for admin fuckery. For humans this is of course their chest. (You can argue that a human's core is their head, but this system will be a whole lot easier if we use chests as cores because that's where all the clothing goes. Chopped off heads are like removed brains.)

Every organitem gets a list of organdatums. These datums identify which suborgans that organ supports. For the head this is of course the brain, but for the chest it's not just the heart and appendix, but also all limbs and the head. The advantage of this is that when you chop off an organ, all suborgans that depend on it are still stored in the organitem and don't need to be specifically moved there. This will take away a lot of headaches I had while dealing with, for example, beheading.

I'll have to rewrite the data structures themselves, but I already depended a lot on helper functions for most organ related stuff so hopefully the number of changes I need to carry out in the code is minimal.


Oh, by the way, I solved the malfunction AI bug by updating my BYOND client. I haven't fixed the problems with dismemberment yet, but I'll do that after the data structure rewrite.

Re: Dismemberment & Organs

Posted: Fri Jun 26, 2015 3:48 pm
by Razharas
Thats a nice dismemberment implementation attempt you have here
I hope nothing bad will happen to it

Re: Dismemberment & Organs

Posted: Fri Jun 26, 2015 3:56 pm
by Ricotez
Razharas wrote:Thats a nice dismemberment implementation attempt you have here
I hope nothing bad will happen to it
Image

Re: Dismemberment & Organs

Posted: Sat Jun 27, 2015 1:56 am
by Remie Richards
Razharas wrote:Thats a nice dismemberment implementation attempt you have here
I hope nothing bad will happen to it
Not again Razh!
Come one everybody, shout at him and he'll go away!

Not again Razh!
Not again Razh!
Not again Razh!