I-Knight-I / Rimworld-MedicalOverhaul

MIT License
0 stars 1 forks source link

Splints and Broken Bones #44

Open I-Knight-I opened 6 years ago

I-Knight-I commented 6 years ago

I'm not sure how to go about implementing this. Injuries seem too short term to fully justify the need for a splint. Could we consider adding broken bones?

I-Knight-I commented 6 years ago

Each bodypart will be susceptible to bone breakages depending on the damage done to them. I'd say that 45% efficiency will result in the bodypart being broke. From here a pawn must wear a splint over a period of time to fix their broken bone. Depending on where the bone breakage is, manipulation and moving will be affected. Or both.

I'll begin working on this and see how it goes down...

I-Knight-I commented 6 years ago

Initial work: c699210

Here's how bone breakages work right now:

Only a specific number of bodyparts can be broken. This was decided by looking into BodyParts_Humanoid and looking beneath . A list is below - L/R means Left/Right and Mov/Man mean Moving/Manipulation, the stat that is affected when the bone is broken.

To break a bone the efficiency of the above bodyparts need to be below 40%. This is caused by any damage done to that bodypart in the form of bullets, melee, bites, burn, etc. You'd normally expect about 4-5x one of the above for the bodypart to reach 40% efficiency or below - e.g Cut x5. When broken the mov/man stat is reduced by 70%. This hediff, when tended with a 100% quality bandage, will take 10 in-game days to disappear. As the quality of the bandage lowers, the time needed to heal the broken bone is made longer sometimes taking up to 20 or even 30 in-game days. When not tended at all the bone will not heal.

To be added

In order to counter-act the effects of this hediff a pawn must wear a splint on the corresponding limb to gain 60% of that stat back leaving only a 10% penalty for the broken bone. In the case of a broken sternum or pelvis the pawn is - put nicely - knackered until the bone heals completely after the given time.

It might be reasonable to add fractures and shattered bones too depending on the varying degrees of efficiency/damage on the bodypart. For example - 10% or less efficiency would result in a fractured bone that requires more rigorous treatment and care.

Further balancing may be required e.g reducing the threshold at which a bone breaks or reducing the effects of the broken bone on the pawn's stats. This is extremely simple and can be changed in seconds.

ghost commented 6 years ago

Should burns cause bones to break? I don't know whether or not that happens in real life, but it seems kind of weird.

This looks like a pretty good implementation. I like the idea of tend quality affecting the healing speed - it suggests that a poorly set and wrapped broken leg would not properly align and immobilize the injured bone.


Just as an alternative idea (because I'm always suggesting alternatives lmao), you could base breakages off of amount of damage received per injury. For example, a humerus that receives a high-damage cut would break, but not if it received 5 low-damage cuts over time.

The thought behind this is that a bone getting cut 5 times by a small knife might not break, since the cuts are likely to be spread amongst different areas of the bone, whereas if it were cut by a sword it would easily cleave the bone in two. The same could be said about blunt injuries, etc. Someone could injure my humerus a bunch by hitting me with a hammer a few times, but it might not break if the injuries are spread throughout the bone and not too severe. If they were to give it a real big swing of the hammer, though, that huge impact would break it.

Again, just an alternative idea for the sake of brainstorming.


To elaborate on the "knackered" status (afaik there's no plan on adding a knackered hediff... although that would be hilarious), maybe a broken sternum or ribs could reduce breathing ability. IRL such injuries would make it hard to breathe.

I-Knight-I commented 6 years ago

I like the idea of the sternum affecting breathing and completely forgot about ribs. The only issue with ribs is how they get damaged - if at all - which I'll expand on next:

The thing with the power of the impact is that it's just not possible with the way Rimworld is coded. What I've done currently is I've hacked my way into the code that calculates the efficiency of a body part and am then checking to see if it meets the criteria to be 'broken'. In a sense, your thoughts are already implemented in the sense that a powerful blow to the bone will definitely be more likely to break it than smaller blows but it's not possible to stop the smaller blows from affecting whether or not it'll be broken. Think of it like this:

If a pawn has a surgical cut on a part then the efficiency of that part is lowered. If that efficiency gets to 0% then the part becomes destroyed completely - now, I'm no expert, but if there are enough surgical cuts on my arm I don't think it'll fall off and become destroyed beyond repair. Unfortunately that's just how Rimworld works and so I'm using that to add another threshold before "destroyed". As you can imagine, burns work similarly. A burn simply reduces the bodypart efficiency so unfortunately it'll have to just break a bone haha. There might be some ways around this but it's probably not worth prioritising right now given that the, for a bone to be broken by "burn" they'd probably have to be on fire for a long, long, long time... which usually means death.

EDIT: I forgot to append to my big comment: Broken bones also come with a severe amount of pain (75% per broken bone) that could actually completely immobilise the pawn. To deal with this the pawn should be given painkillers and then the splint should be applied whilst they can walk when the pain is being numbed. This'll then reduce the pain by making it 0.25x as strong essentially being long-term painkillers without the wasted resources.

Unfortunately - I haven't gotten any of the above to work yet. Pawns put on a splint and nothing happens, which sucks.