Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable radiation #275

Closed
wants to merge 6 commits into from
Closed

Configurable radiation #275

wants to merge 6 commits into from

Conversation

numberZero
Copy link
Contributor

This pull request contains several modifications:

  1. Entities can be hurt by radiation (may be disabled in the config)
  2. Long-term radiation effects may be disabled
  3. Radiation protection is supported (using the “radiation” armor group instead of callbacks proposed earlier); this may be disabled too (see also my pull request to the 3d_armor mod)
  4. Shielding is sane again (line 269→271 in technic/radiation.lua; the change I reverted looks accidental, as it makes a block of dirt be almost enough to protect from corium radiation)

Now it is applied to mobs too.
Moreover, it should now respect "radiation" armor group, or fall back to "fleshy" group to detect vulnerable things
return 0
end
if ag.radiation then
return 0.01 * ag.radiation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain this multiplier, it looks arbitrary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calculate_damage_multiplier does the following:

  1. It checks is the object damageable at all.
  2. If the object has the radiation armor group, it uses its value. As with default damage with the fleshy AG, its value is not protection but percent of damage actually done.
  3. If the object have no radiation AG but have fleshy one, it is still considered to be damageable by radiation; that’s necessary to support existing mods. But as its value varies a lot, I take a square root to reduce variance.

Actually that function is mostly a workaround for current mods that don’t support radiation yet. It seems reasonable that entities that are “fleshy” are vulnerable to radiation too, but the level may only be guessed.

@ShadowNinja
Copy link
Member

I made shielding more effective on purpose. Before it was so weak that most of the protection you got from adding more protective layers was just from the increased distance that that forced. A dirt node still shouldn't offer full protection from a corium source though.

The rest looks good.

@numberZero
Copy link
Contributor Author

Shielding actually needs careful tweaking as it is a bit too weak by default, although in realty meters (of concrete) are required to protect from radiation.

It’s a bit difficult to make reasonable coefficients in simplified game mechanics as radiation resistance against different types of radiation differs a lot; moreover, some materials that protect well e.g. from gamma-rays (like lead) offer little protection from neutrons, and vice versa (for example, concrete protects well from neutrons but not from X-rays)

@numberZero
Copy link
Contributor Author

So may it be merged?
If you expect me to e.g. correct shielding coefficient I will do necessary testing and changes.

Also it may make sense to make overall multipliers configurable (both for damage and shielding).

@ShadowNinja
Copy link
Member

I'll merge this -- once I get to it...

@Fixer-007
Copy link
Contributor

Bump

@ShadowNinja
Copy link
Member

1810f41, 51be33d, b739ed6, 73afc40, cbe9743

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants