Navigation:Home arrow Discoveries arrow The Off by One Bug Friday, 25 July 2008
Logo pic
We're like NASA. With battle axes.

 

 
News
Submit News
Community
Strategy
News
Articles
Calculators
Community
Discoveries
Information
One on One
Strategy
Submit News
News
Community
D1 FAQ
Information
Jarulf's Guide
Mods
One on One
Scene
Strategy
Submit News
Home
About Us
Chat
Contact Us
Donate
FAQ
Forum
History
Legal Info
Link to Us
Search
Site News
 
 


 
 
The Off by One Bug PDF Print E-mail
Written by Jarulf   
Thursday, 27 July 2000

Bolty's Note: Ever wonder why there are so many 9's and 4's in the game, and why items and magical modifiers rarely seem to reach "rounded-off" values?  Jarulf found out why.

I think I have found a bug related to random numbers, or rather, to the use of random numbers. Possibly this could be due to bad communication between people though. Basically, quite a few parts of the code that want to pick a random number, lets say from x to y, will instead pick a random number from x to y-1. Now, how is that bad?

Well, as far as I can see, this means that gems with random values in their effect will never have the max value. Any item with a defense rating will never have the max value and so on.

Example: a chipped topaz should, if inserted in a shield, give 10-12% lighting resistance. However, you will never get one that gives 12%, it will always give either 10% or 11%.

Example: a small shield should have a defense of 8 to 10, will only be 8 or 9.

Now, one may argue that indeed a small shield SHOULD only have a defense of 8 to 9, that the data in the armor file lists the minimum value and up to one above the max value. I really don't buy that. If we look at the example of gems, it would mean that 12% is never possible as a flawed topaz gives 13-16% (or really 13-15%). It is clearly meant to list min to max values, not min to max+1 values. I can't see why this would differ from case to case.

So what other things may be affected by this? Well, I have NO idea. This could be all the cases, or this could be the case for any situation where the game picks a random number within a range (not the case though but it could have been). It seems that there aren't similar errors when the game needs a number ranging from 0 up to a specific number (although this is at times hard to know if the game wants a number from 0 to 4; how can we tell it was intended to be from 0 to 5 ). But many cases use percentages and the game thus gets a number from 0 to 99 (for 100 values) and I have not seen any errors with such things.

So if anyone finds more cases where the type of error I mention above can be seen, feel free to tell. It never hurts to know. Unless they fix it, people now can stop looking for those perfect gems and armor as they may already have found it.