Concerning Monsters vs Animals

Want to discuss changes to the UOX3 source code? Got a code-snippet you'd like to post? Anything related to coding/programming goes here!
Post Reply
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Concerning Monsters vs Animals

Post by Xuri »

The COMBATANIMALATTACKCHANCE value in UOX.INI is pretty much worthless. Even with 1 as the value, it rarely takes more than a few seconds before the monsters viciously attack any animal they see nearby.

The reason? (I'm guessing) It's the percentage chance of attacking the animal PER NPC CYCLE. And seeing as how each NPC cycle lasts.. uh.. 0.1 seconds according to uox.ini - that's a lot of 1% checks in a few seconds :P

So.. is there a better way of achieving this? I guess one way would be to allow specifying very small chances.. like 0.05 or whatnot - but I tried that (and 0.99) and it doesn't seem to work at all when I used a decimal number.
-= Ho Eyo He Hum =-
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

Actually, we only check the NPC AI every short while, (according to my uox.ini it is 0.5 seconds). Thus it wouldn't be that.

I found the problem, however, someone wrote that little tidbit ass-backwards, thus causing 1 to give the most chance for attack, and 100 the smallest.

I am changing that as I speak, though. So in the future it will be a percentage chance, from 0 to 100.
Scott
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

1 or 100, they still attack the animals within the second after spawning =P
-= Ho Eyo He Hum =-
Post Reply