Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CF: multiple protection



Frank Tore Johansen wrote:
Frank> I haven't looked at this code, but I'd like to suggest increasing the
Frank> scale on hitpoints, to enable higher variation in protection.  For
Frank> instance, if something damages you for 1 HP, and you have 50% protection,
Frank> you still get 1 damage since you can't go below that (unless something
Frank> changed since my time, that is).  Keeping floats out of it is probably a
Frank> very good idea, so hp should ideally be something with even more bits
Frank> (maybe), and your hp should be this value divided by something (for
Frank> instance 100, 1000, 256, or whatever). 

Hi, Frank. 
I am a member of multiple protection project.
and I made damage calculation code.

I think that making hp float is good idea, 
but on our protection system hp is not changed to float.
We've noticed at the problem you pointed out,
and we solved it by the probability.

The damage that calculated less than 1 as float value is changed to 1
with "probability of damage". 
For example, if you are hit with 1HP and you have 60% protection,
damage is set to 1 with probability 0.4, 
and damage is set to 0 with probability (1-0.4). 
The value 0.4 is calculated by following expression.

      0.4  = 1 * (100 - 60) / 100

--------------------------------------------------------------------------
Seikoh Nishita		      |	Dep't. of Information & Computer Sciences
			      |	Faculty of Engineering Science
[e-mail]		      |	Osaka University
s-nisita@ics.es.osaka-u.ac.jp |	Toyonaka, Osaka 560, Japan
[to unsubscribe etc., send mail to crossfire-request@ifi.uio.no]


References: