Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ ROM
➜ Running the server
➜ Rot based muds
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Serai
(10 posts) Bio
|
Date
| Sat 03 Feb 2007 04:14 AM (UTC) |
Message
| I know there isn't a special area to discuss Rot based muds but since it is derived from RoM I figure I can post it here.
Now, I ran into this problem a few weeks ago and was horribly discouraged because I really do not think this will be an easy problem to fix.
One day I was bored, so I just went around slaughtering all kinds of mobs when I noticed something odd. Some of the mobs in the Fanatics Tower area being able to take upwards of 1million damage before they would die. Im not sure where the problem would be found or how I would go about fixing it. Perhaps someone here knows what to do.
Copy and pasted this:
<31000hp 32302m 31256mv Fanatics' Tower> force mage rep
L.132 Mage says 'I have 21758/21758 hp 21735/21735 mana 100/100 mv 0 xp.'
<31000hp 32302m 31256mv Fanatics' Tower> ba mage
Your backstab does UNSPEAKABLE things to L.132 Mage! -=387061=-
Platinum Claws draws life from L.132 Mage.
Platinum Claws freezes L.132 Mage.
L.132 Mage is struck by lightning from Platinum Claws.
L.132 Mage's fireball scratches you. -=4=-
L.132 Mage's lightning bolt grazes you. -=5=-
L.132 Mage: [**********]
You: [********* ]
so, there's my problem.
Serai | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #1 on Sat 03 Feb 2007 04:56 AM (UTC) |
Message
| I don't really understand the problem. If you don't like that these mobs have so many hitpoints in your game, can't you just go use the building commands (like mset) to give them less hitpoints? |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Serai
(10 posts) Bio
|
Date
| Reply #2 on Sat 03 Feb 2007 04:09 PM (UTC) |
Message
| Its not that the mobs have a lot of hps. If you care to notice, the reporting mob says that it has 21.7k hps and if you look at the amount of damage I am doing which is 387k I'm sure the issue I am having may make itself apparent.
Serai | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #3 on Sat 03 Feb 2007 07:12 PM (UTC) |
Message
| I would look at the way variables are being stored in the code.
If the number of hit points is a "short integer" then you will have problems. The maximum number that can be stored in such a variable is 32767, and adding 1 to that gives -32768. Thus, if the HPs are in the tens of thousands, an overkill might make the mob seem (to the MUD) to have a number of HPs that is not what you expect.
Similarly, if the mob had (say) 10 HP, and you hit it for 40000, then its HP would go so low, they would actually become positive again, and thus it wouldn't die.
This short program will illustrate that:
#include <stdio.h>
int main (void)
{
short test = 10;
test = test - 40000;
printf ("test is %d\n", test);
return 0;
} // end of main
If you run that it prints:
test is 25546
So you can see, hitting my imaginary mob, which is almost dead, for 40,000 HP, actually revives it to have 25,546 HP, so it will be luck for you to kill it. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Serai
(10 posts) Bio
|
Date
| Reply #4 on Sun 04 Feb 2007 05:07 PM (UTC) |
Message
| Sorry, I would've replied sooner but my father took a hissy fit and took the router and cables and locked them away.
So, What you are saying is that I need to find the initial variable where hps are stored and make it a long instead of an int?
If this is what needs to be done, any idea which file I need to start looking at? A search for hp, hitpoints, hitdice brings up a lot of files that when I look at them don't seem to be the ones I need.
Also, this overkill bug, it will never affect players whom are trying to kill something will it?
Serai | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #5 on Sun 04 Feb 2007 06:18 PM (UTC) |
Message
| You need to make it a long int instead of a short int. In C, that just means saying 'int' instead of 'short'.
I don't know how RoT is structured but you will want to look for the character structure (CHAR_DATA, perhaps) and find the data member that stores hit points.
And this bug should not affect players who do reasonable amounts of damage. It will only appear when ludicrous amounts of damage like 380k are dealt. More precisely it will only affect players who deal more than (2^15)-1 damage, causing the mob's HP to drop below -(2^15). 2^15 = 32768. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Serai
(10 posts) Bio
|
Date
| Reply #6 on Sun 04 Feb 2007 06:54 PM (UTC) |
Message
| Thanks, the overkill issue seems to be fixed. And I would just like to add the weapon that was being used was something included in stock rot and not something I made. players should be doing normal amounts of damage.
Thanks for the help,
Serai | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #7 on Sun 04 Feb 2007 06:57 PM (UTC) |
Message
| I imagine that what happened is that since you're an immortal and therefore have a higher level, whatever formula is used to calculate backstab damage doesn't account for people with too high of a level. So the damage got multiplied to that very high amount, which wouldn't happen for players with the player-range of levels. Probably... |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
19,563 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top