Ludeon Forums

Ludeon Forums

  • December 16, 2018, 08:22:54 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: [Modding Tool] Rimworld Weapons Balancer  (Read 10911 times)

Bog

  • Colonist
  • ***
  • Posts: 264
  • Rimworld Weaponsmith
    • View Profile
Re: [Modding tool] Rimworld Weapons Balancer
« Reply #15 on: August 15, 2014, 08:00:08 PM »

Quote
Hopefully sometime this week I'll have the time to systematically figure out where the system evens out. Is a pistol that only has 1 damage but shoots 10x as fast better? Or would it be better to shoot 1/5th as fast but deal out 50 damage a shot? Or is it best as-is?

Assuming that losing a limb is something that you want to avoid, then pistol that deals 1 damage but shoots 10x as fast is less deadly than one with higher damage but normal shooting rate, because damage is then equally distributed among all body parts.
For example if someone's body consists only of 3 parts with 50 health each (all with 33.(3)% coverage). Then one 50hp bullet = 100% chance to lose a limb, while 50 1hp bullets would usually lead to ~16 damage per body part.
Yup, that was my point when I made the post. I'm just wondering where the "sweet spot" is, because if you make the weapon do too much damage it gets waste, as Tynan said.

So if I make a whole bunch of weapons with the same DPS, but they have different bullet damage and rate of fire the current RWB system will think that they're equal in usefulness. But in reality there'll be some which don't perform well because the bullet damage is too low, not letting them easily destroy body parts because the damage gets shared between them.

There will also be those which don't preform well because bullet damage is too high, and when they destroy a body part there's still extra damage which doesn't get the change to affect the target. In these cases the gun doing less damage but getting a higher rate of fire to maintain it's DPS would actually make it better.

I've been doing some preliminary thinking in this area, so far I've made a list of the different body parts broken down into "wound severity" and mapped out where the damage reaches thresholds where it'll instantly destroy body parts.

In the end formula hopefully we'll be able to get it so that the system will value a bullet in accordance to the variety and severity of wounds that it can give, then devalue it in accordance to how much waste it has from overshooting the different wound thresholds.

Wound types in accordance to the kinds and number of body parts with their HP stats:
Code: [Select]
Leathal hits: (x6)

Torso 40 HP
Head 30 HP
Skull 30 HP
Neck 30 HP
Heart 20 HP
Brain 10 HP


Dual Lethal hits: (x4)

Lung 20 HP (x2)
Kidney 20 HP (x2)


Paralysis: (x11)

Spine 35 HP
Leg 30 HP (x2)
Pelvis 25 HP (x2)
Tibia 25 HP (x2)
Femur 25 HP (x2)
Foot 20 HP (x2)


Medium Injury: (x16)

Arm 30 HP (x2)
Clavicle 25 HP (x2)
Humerus 25 HP (x2)
Radius 20 HP (x2)
Hand 20 HP (x2)

Stomach 30 HP
Jaw 20 HP
Eyes 10 HP (x2)
Ears 10 HP (x2)


Small injury: (x34)

Sternum 25 HP
Rib 15 HP (x12)
Nose 10 HP
Fingers 7 HP (x10)
Toes 7 HP (x10)

Minor injury:

(nothing)


(Note: Stomach, Jaws, Eyes and Ears have been classified as "medium injuries", but I haven't checked to see exactly how badly they affect characters in comparison to losing an arm.)


Different damage levels and the types of wounds they can instantly give:
Code: [Select]
1-6 damage: (Minor injury only)

Lethal: 0/6
Dual Lethal: 0/4
Paralysis: 0/11
Medium Injury: 0/16
Small Injury: 0/34


7-9 damage:

Lethal: 0/6
Dual Lethal: 0/4
Paralysis: 0/11
Medium Injury: 0/16
Small Injury: 20/34


10-14 damage:

Lethal: 1/6
Dual Lethal: 0/4
Paralysis: 0/11
Medium Injury: 4/16
Small Injury: 21/34


15-19:

Lethal: 1/6
Dual Lethal: 0/4
Paralysis: 0/11
Medium Injury: 4/16
Small Injury: 33/34


20-24:

Lethal: 2/6
Dual Lethal: 4/4
Paralysis: 2/11
Medium Injury: 9/16
Small Injury: 33/34


25-29:

Lethal: 2/6
Dual Lethal: 4/4
Paralysis: 8/11
Medium Injury: 13/16
Small Injury: 34/34


30-34:

Lethal: 5/6
Dual Lethal: 4/4
Paralysis: 10/11
Medium Injury: 16/16
Small Injury: 34/34


35-39:

Lethal: 5/6
Dual Lethal: 4/4
Paralysis: 11/11
Medium Injury: 16/16
Small Injury: 34/34


40+

Lethal: 6/6
Dual Lethal: 4/4
Paralysis: 11/11
Medium Injury: 16/16
Small Injury: 34/34
Ideally the system should value weapons that have a higher ability to kill or maim targets, then start to care a lot less about damage per bullet after it reaches a certain threshold because the extra damage is all wasted.

So my gut feeling just looking at the data without doing any real math is that against un-armoured targets 30 damage might be the most "efficient" bullet type. It can instantly destroy the vast majority of most body parts, and also looks like it has the best "damage to lethal hit" ratio.

Of course that's only covering unarmoured humans, it doesn't take power armour or mechanoids into account.

For example, right now against humans I think the bullet damage probably hard-caps at 62. That's when a gun should be able to kill a target with a single torso shot even if it's wearing power armour. Any damage more than that shouldn't help the weapon at all and so shouldn't add to it's power rating by much at all. Of course a 1000 damage super-gun would still be useful for destroying cover in a single shot, so there's nothing in the way for a second shot. Oh, and blowing up mortars and stuff. ::) I also haven't yet checked centipede's body parts and their HP yet on this front. :P

If I'm writing too much and not making sense it's because I'm having an information overload. My mind is racing thinking about all of it. ;D

Anyways, still processing...

Edit: Had a good long chat with my brother about this. We're pretty optimistic that we can make it work, and do it in such a way that it can be fairly easily "calibrated" after it's been made if there're changes in the health system.
« Last Edit: August 16, 2014, 12:36:04 AM by Bog »
Logged
Divergence of Civilization Lead Developer (in this case that's the fancy way of saying "Only Developer")

Project Armoury Developer (New huge 2.13 Release now live!)

Bog

  • Colonist
  • ***
  • Posts: 264
  • Rimworld Weaponsmith
    • View Profile
Re: [Modding Tool] Rimworld Weapons Balancer
« Reply #16 on: August 17, 2014, 05:37:54 PM »

Well we did a bunch of work on the new version last night. It's not ready for release yet but it's looking pretty cool.

Here's a chart based on it's attack value calculations:

So the bar on the bottom is the Damage after Armour stat. (which is basically BaseDamage with armour reduction applied)

The bar on the side is the "attack value" which in the new version is later multiplied by shots per second, accuracy and range to figure out the weapon's power rating.

As you can see, the weapons get a lot more attack value in Alpha 6 whenever they cross a threshold that allows them to destroy body parts, but crossing that threshold also starts causing "overkill decay" which lowers the passive attack value gain. At first the weapon gains 1 attack value for every 1 base damage it has, but after it passes the 40 damage mark it's finished eroding down to less than .1 attack value per damage it gains.

Here's the above stats in "list" format:

Code: [Select]
Damage Attack Value
1 1.0
2 2.0
3 3.0
4 4.0
5 5.0
6 6.0
7 9.0
8 9.966
9 10.932
10 16.299999999999997
11 17.1534
12 18.006799999999995
13 18.860200000000003
14 19.7136
15 22.5
16 23.333000000000002
17 24.165999999999997
18 24.999000000000002
19 25.832
20 35.2
21 35.82320000000001
22 36.4464
23 37.0696
24 37.6928
25 45.099999999999994
26 45.59289999999999
27 46.08579999999999
28 46.57869999999999
29 47.07159999999999
30 61.199999999999996
31 61.378299999999996
32 61.556599999999996
33 61.73489999999999
34 61.91319999999998
35 66.8
36 66.9608
37 67.12159999999999
38 67.2824
39 67.4432
40 74.8
41 74.8735
42 74.94699999999999
43 75.0205
44 75.094
45 75.16749999999999
46 75.241
47 75.3145
48 75.38799999999999
49 75.46149999999999
50 75.535
Notice how at 7 damage the value jumped from 6 to 9? That's because a 7 damage weapon can shoot off a finger or toe in a single shot. A 6 damage gun needs 2 shots.

The damage thresholds for injury types are listed in my previous post.

The current bonus attack values are:

    small_injury_value = .1
    medium_injury_value = .3
    paralysis_injury_value = .6
    dual_lethal_injury_value = .5
    lethal_injury_value = 3.0

These numbers are added to the attack value every time a gun reaches a threshold for that type of injury.

The current overkill values are:

    small_injury_overkill = .0017
    medium_injury_overkill = .0059
    paralysis_injury_overkill = .0175
    dual_lethal_injury_overkill = .0145
    lethal_injury_overkill = .0873

These numbers are  multiplied by the BaseDamage gained after reaching the threshold for their type of injury, then that number is subtracted from the attack value.

The injury values and overkill values can be really easily modified, so I can change them later to "calibrate" the formula. :)


I have two questions though,

First, how does the armour handle rounding? So if a 7 damage gun hits someone wearing power armour it has a 35% damage reduction. That comes out to 4.55 damage. Does the game handle that as 4 damage, 5 damage, or what?

Second of all, do all the body parts have the same chance of getting hit? Like if a guy gets shot with a bullet, is it equally likely to hit his left pinky as hitting his right big toe as hitting his brain as hitting his torso?

Thanks in advance.
« Last Edit: August 18, 2014, 03:31:38 AM by Bog »
Logged
Divergence of Civilization Lead Developer (in this case that's the fancy way of saying "Only Developer")

Project Armoury Developer (New huge 2.13 Release now live!)

ZestyLemons

  • Super Tester
  • Colonist
  • ***
  • Posts: 421
  • Wiki Master
    • View Profile
    • Steam Profile
Re: [Modding Tool] Rimworld Weapons Balancer
« Reply #17 on: August 18, 2014, 06:37:50 PM »


I have two questions though,

First, how does the armour handle rounding? So if a 7 damage gun hits someone wearing power armour it has a 35% damage reduction. That comes out to 4.55 damage. Does the game handle that as 4 damage, 5 damage, or what?

Second of all, do all the body parts have the same chance of getting hit? Like if a guy gets shot with a bullet, is it equally likely to hit his left pinky as hitting his right big toe as hitting his brain as hitting his torso?

Thanks in advance.

Generally, 4.55 would be rounded up, 4.51 would be rounded up, 4.50000001 would be rounded up, but I'm guessing like most programs (and computers in general) that 4.5 is rounded down.

As for your second question, I have a really detailed article about how the damage model works. Not every part has the same chance to be hit, but rather is determined by a "coverage" percentage that determines what the chance there is to hit a certain group of body parts

http://rimworldwiki.com/wiki/Human

This is highly subjective to where the body part is located - for example, the brain has a 100% coverage rating, and the brain is in the skull (and the skull is inside the head). This means anything that hits the skull will also hit the brain (there is no account for glancing blows I guess), but the chance of having a bullet strike the head -> hit the skull is very low.



Logged
Help out with the wiki!

Steam: http://steamcommunity.com/id/Divaya/
Wiki: http://rimworldwiki.com/wiki/User:Zesty

Feel free to contact me about wiki questions or wiki admin stuff.

Bog

  • Colonist
  • ***
  • Posts: 264
  • Rimworld Weaponsmith
    • View Profile
Re: [Modding Tool] Rimworld Weapons Balancer
« Reply #18 on: August 18, 2014, 06:39:57 PM »


I have two questions though,

First, how does the armour handle rounding? So if a 7 damage gun hits someone wearing power armour it has a 35% damage reduction. That comes out to 4.55 damage. Does the game handle that as 4 damage, 5 damage, or what?

Second of all, do all the body parts have the same chance of getting hit? Like if a guy gets shot with a bullet, is it equally likely to hit his left pinky as hitting his right big toe as hitting his brain as hitting his torso?

Thanks in advance.

Generally, 4.55 would be rounded up, 4.51 would be rounded up, 4.50000001 would be rounded up, but I'm guessing like most programs (and computers in general) that 4.5 is rounded down.

As for your second question, I have a really detailed article about how the damage model works. Not every part has the same chance to be hit, but rather is determined by a "coverage" percentage that determines what the chance there is to hit a certain group of body parts

http://rimworldwiki.com/wiki/Human

This is highly subjective to where the body part is located - for example, the brain has a 100% coverage rating, and the brain is in the skull (and the skull is inside the head). This means anything that hits the skull will also hit the brain (there is no account for glancing blows I guess), but the chance of having a bullet strike the head -> hit the skull is very low.
Thanks a lot. That'll help us get chart the attack value of weapons a lot more accurately.
Logged
Divergence of Civilization Lead Developer (in this case that's the fancy way of saying "Only Developer")

Project Armoury Developer (New huge 2.13 Release now live!)

Glendog

  • Muffalo
  • *
  • Posts: 5
  • Refugee
    • View Profile
Re: [Modding Tool] Rimworld Weapons Balancer
« Reply #19 on: March 11, 2018, 08:32:17 PM »

Do you still have this?
Logged
Pages: 1 [2]