[Opensim-users] changes to regions automatic damage in 0.9 master

AJLDuarte ajlduarte at sapo.pt
Tue Jul 26 12:09:05 UTC 2016


Hi,

                Following a request in mantis 7973 (http://opensimulator.org/mantis/view.php?id=7973) I did a few changes to damage, since improvements on physics broke what we had even more.

 

                If llSetDamage() is not used,  damage amount is now estimated from collision relative velocity, and not the penetration depth.

                The value reported by physics for this (and collision sounds intensity) is the projection of the relative velocity on the direction of the collision plane normal, so it does depend on the collision angle with that plane normal. This value is then squared so to express a kind of “Energy”. Objects mass is not taken into consideration

                This result value is then scaled to give a little amount of damage identical to sl, with the difference that moving objects do damage to avatars not sitting (currently physics doesn’t know about sitting ones).

                Physics engines are temperamental things. The collision plane may not match a real object surface, etc, etc, so results may still seem odd.

                To have effective and predictable damage, llSetDamage() should be used.

                Automatic heal is now done on a timed event (heartbeat actually) so it should work a bit better.

 

                Added OSSL functions:

                osSetHealth(key avatar, float health) sets current health (1% to 100%) (avoided 0 for now because it would not work predictably)

osGetHealRate(key avatar) gets the current automatic healing rate in % per second

osSetHealRate(key avatar, float healrate) sets the automatic healing rate in % per second. A value of zero can disable automatic heal, current maximum value is 100 % per second.

Default heal rate is now around 0.5% per second.

 

(think we do need to also be able to disable the llSetDamage object autokill, eventually the death behavior, ?)

 

The goal is just to improve the current simple health control system, for simple uses.

Keep in mind the testing nature of opensim master branch.

This may be broken and will change, at least in details, also according to your feedback

 

Regards, 

Ubit

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-users/attachments/20160726/cf9b6428/attachment.html>


More information about the Opensim-users mailing list